16.04 Can't use bluetooth A2DP headphones, pairs but does not connect. Logs inside
It is a known bug. Try rmmod btusb ; modprobe btusb
. I have had to do it up to four times.
I have seen this with my Lenovo P50 with Intel 8260 wifi/bluetooth. Sometimes the bluetooth firmware doesn't load correctly at boot. Other times it just doesn't work.
I've had the same problem with Jaybird X2 and Bluebuds X, although other Bluetooth audio devices worked without problems. With the headphones, I got this error:
Assertion 'pa_channels_valid(channels)' failed at pulse/volume.c:74, function pa_cvolume_set(). Aborting.
and pulseaudio crashed. What solved it was installing pulseaudio from sources:
- Install all required packages:
sudo apt-get build-dep pulseaudio
- Download https://freedesktop.org/software/pulseaudio/releases/pulseaudio-9.0.tar.gz and unpack.
- In the source dir, run:
./bootstrap.sh --prefix=/usr
. If you want, you can change theCFLAGS
variable to enable compiler optimizations, e.g. use-O2
instead of-O0
. - Then,
make
andsudo make install
This will overwrite the default system installation, but it will work until packages get updated. To prevent updates, we can put the pulseaudio packages on hold:
sudo apt-mark hold libpulse-dev libpulse0 libpulse-mainloop-glib0 pulseaudio pulseaudio-module-bluetooth pulseaudio-utils libpulsedsp pulseaudio-module-x11
Note that I installed pulseaudio 9.0, but it is not the version that made it work. I tried using the packaged version of pulseaudio 9.0 from the PPA, but it also crashed with the same error.
I had this issue with my Bluedio T+3 headset and what I think is happening is that there is a connection timeout. You need to uncomment the line ; exit-idle-time = 20
in the file /etc/pulse/daemon.conf
by removing the semicolon (;).
Change the value to -1
to become:
exit-idle-time = -1
After that use bluetoothctl
again to try and connect to the device. See here for instructions:
Arch wiki: bluetooth headset
Ensure the following:
- Jaybird X2 is paired
- it is marked as trusted (either via
bluetoothctl
andtrust XX:XX:XX:XX
(whereXX:XX:XX:XX
is the MAC address of your Jaybird) or viablueman-manager
) - it is turned on
Press the power button of your Jaybird X2 once. This probably triggers an auto-connect to known devices. So you may need to ensure that other devices do not interfere here. From then on the connection was stable and it also connects automatically after a reboot.
Let me know whether this also solved your problem. I did also a lot of other things and was nearly giving up, when I accidently pressed the power button ;-) So it could also be that one of those other things solved the issue. (was already searching and trying things around bluetooth, pulseaudio, bluez, pactl load-module whatever; so I have still a lot of other hints :-D)
UPDATE (after having connection issues again)
After I connected Jaybird X2 to my android phone, I was not able to reconnect to my laptop again, even after I've dropped the connection from my android phone. Don't know yet, what exactly is the problem here, but to get the connection back, I had to do the following:
- disconnect Jaybird X2 from my android phone (or any other device)
- reboot ubuntu
- reconnecting works and the connection is stable (it usually did not work when pairing the first time... I also required a reboot after that)
I also tried some other things and it seems that at least pulseaudio-module-bluetooth
is required. Also the wifi/bluetooth coexistence-configuration is required at least on my machine ( see: https://askubuntu.com/a/645072/558838 ).
And last but not least: a reboot is always required to get the connection back in case I switched to another device.
To summarize: with that reboot-step I am able to reconnect the Jaybird X2 successfully and the connection is stable.
If anyone knows an easier way to omit the reboot-step, please contribute :)
/etc/init.d/bluetooth restart
does not suffice.
(additional steps I've tried):
I looked into my history. I tried also the following where one or the other might have contributed to the solution above:
-
apt-get install pulseaudio-module-bluetooth
(on my system it wasn't installed) - logs mentioned something about missing
ofono
, so I also installed that - did a
sudo chown -R $USER ~/*
- also applied: https://askubuntu.com/a/691299/558838 (However I reverted it as it didn't help. But it might still have been active, when I tried the auto-connect)
- did also purge/install the pulseaudio, blueman, bluetooth packag