DebuggingBluetooth

Differences between revisions 6 and 12 (spanning 6 versions)
Revision 6 as of 2015-09-14 14:08:41
Size: 2383
Editor: pD9ED7EF7
Comment:
Revision 12 as of 2015-12-17 18:31:31
Size: 3590
Editor: 209-6-88-107
Comment: added bluez report bug link
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
When reporting a Bluetooth bug we need to include different things to make it easier for the developers to find a solution for the problem. When reporting a Bluetooth bug we need to include different things to make it easier for the developers to find a solution for the problem.  Please use the following link to report bluetooth bugs:

https://bugs.launchpad.net/ubuntu-rtm/+source/bluez/+filebug
Line 19: Line 21:
  * For Touch based devices: /home/phablet/.cache/upstart/application-legacy-ubuntu-system-settings-.log   * For Touch based devices:
    *
/home/phablet/.cache/upstart/application-legacy-ubuntu-system-settings-.log
    * /home/phablet/.cache/upstart/dbus.log
Line 33: Line 37:
 * If you have a system with BlueZ 5.x use bluetoothctl and execute the following commands
{{{
phablet@ubuntu-phablet:~$ bluetoothctl
[bluetooth]# show
[bluetooth]# devices
[bluetooth]# info <mac addr of any device you have problems with>
}}}
Line 45: Line 56:
'''NOTE:''' If ''/etc/init/bluetooth.override'' doesn't exist use the following command instead
{{{
phablet@ubuntu-phablet:~$ sudo sed -i 's/exec \/usr\/sbin\/bluetoothd/exec \/usr\/sbin\/bluetoothd -d/g' /etc/init/bluetooth.conf
}}}
Line 49: Line 64:
 * For HFP or other mobile related Bluetooth profile debugging we also need to enable verbose logging for ofono:
   * Add '-d' to the exec line in /etc/init/ofono.override
Line 50: Line 67:
*NOTE:* This is currently pretty specific to Touch and needs additional information for systemd based variants of Ubuntu. '''NOTE:''' This is currently pretty specific to Touch and needs additional information for systemd based variants of Ubuntu.

== Dumping send packages ==

At times its also interesting to dump the actual packages send from the host to the Bluetooth chip over HCI. This can be done with

{{{
phablet@ubuntu-phablet:~$ sudo btmon -w <file-to-dump-to>.btsnoop
}}

After you reproduced the problem share the file '''privately''' with one of the developers. Don't attach it on launchpad.

Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

WARNING

If you're going to attach the log files mentioned below be warned that those might include private information like phone numbers. If you're asked to share such log files you're free to not do this or share them with the asking person on a more private way than through launchpad/irc/..

Debugging procedure

Reporting a bug

When reporting a Bluetooth bug we need to include different things to make it easier for the developers to find a solution for the problem. Please use the following link to report bluetooth bugs:

https://bugs.launchpad.net/ubuntu-rtm/+source/bluez/+filebug

Please note/include the following things in your bug report:

  • Which devices are involved? Exact model numbers if available are helpful.
  • Which Bluetooth version do all involved devices support?
  • Necessary log files (if possible with debugging information; see below)
    • /var/log/syslog
    • For Touch based devices:
      • /home/phablet/.cache/upstart/application-legacy-ubuntu-system-settings-.log
      • /home/phablet/.cache/upstart/dbus.log

List common information about current Bluetooth setup

  • Adapter info

phablet@ubuntu-phablet:~$ hciconfig -a
  • List of paired devices

phablet@ubuntu-phablet:~$ /usr/bin/bluez-list-devices
  • If you have a system with BlueZ 5.x use bluetoothctl and execute the following commands

phablet@ubuntu-phablet:~$ bluetoothctl
[bluetooth]# show
[bluetooth]# devices
[bluetooth]# info <mac addr of any device you have problems with>

Generating log files with debugging information

As log files are normally just include warnings and errors it is quite helpful to have log files with additional debugging information. In the std. configuration of a Ubuntu system debugging informations are disabled to not pollute the system with a big log files. For Bluetooth we need to perform the following steps to enable verbose debug logging:

  • If you're on a Touch based system you have to temporarily mount your system partition read/write.

phablet@ubuntu-phablet:~$ sudo mount -o remount,rw /
  • As next step we enable verbose logging for the Bluetooth daemon

phablet@ubuntu-phablet:~$ sudo sed -i 's/exec \/usr\/sbin\/bluetoothd \-c \/etc\/bluetooth\/touch.conf/exec \/usr\/sbin\/bluetoothd \-c \/etc\/bluetooth\/touch.conf -d/g' /etc/init/bluetooth.override

NOTE: If /etc/init/bluetooth.override doesn't exist use the following command instead

phablet@ubuntu-phablet:~$ sudo sed -i 's/exec \/usr\/sbin\/bluetoothd/exec \/usr\/sbin\/bluetoothd -d/g' /etc/init/bluetooth.conf
  • For additional logging information we also enable verbose logging of the PulseAudio daemon

phablet@ubuntu-phablet:~$ sudo sed -i 's/--start/--start --log-level=debug/g' /usr/share/upstart/sessions/pulseaudio.conf
  • For HFP or other mobile related Bluetooth profile debugging we also need to enable verbose logging for ofono:
    • Add '-d' to the exec line in /etc/init/ofono.override

NOTE: This is currently pretty specific to Touch and needs additional information for systemd based variants of Ubuntu.

Dumping send packages

At times its also interesting to dump the actual packages send from the host to the Bluetooth chip over HCI. This can be done with

DebuggingBluetooth (last edited 2017-05-08 06:53:59 by kzapalowicz)