[regression] Bluetooth audio no longer supports A2DP (stuck in HSP/HFP mode)

Bug #1438510 reported by Dustin Kirkland  on 2015-03-31
472
This bug affects 97 people
Affects Status Importance Assigned to Milestone
PulseAudio
Confirmed
Medium
bluez (Ubuntu)
High
Unassigned
Vivid
High
Unassigned
pulseaudio (Ubuntu)
High
Unassigned
Vivid
High
Unassigned
Xenial
High
Daniel van Vugt

Bug Description

[Impact]
Bluetooth audio seemingly refuses to support A2DP (stuck in HSP/HFP mode). A2DP is the high quality profile used for Bluetooth speakers and music in general.

[Test Case]
1. Pair a Bluetooth audio device with Ubuntu.
2. Go to Sound settings and check the device's current "Mode".
3. If the current Mode is not yet A2DP then try to set it to A2DP
Expected: The mode is either A2DP by default or can be set to it.

[Regression Potential]
Low. The SRU focuses on Bluetooth logic in pulseaudio, so that is the main area affected. A combination of related A2DP bugs in pulseaudio in xenial means it is difficult to get working at all without this patch. So highly unlikely Bluetooth audio support could get worse. Since pulseaudio itself is being modified there is always a regression potential in support for other audio devices, but several audio devices have been tested and all continue to work well with the patch.

[Other notes]
Related to bug 1283003 and bug 1582213. Possibly others too. The debdiff which fixes this is attached to bug 1582213.

Please note that Bluetooth and Bluetooth audio support in xenial is still not perfect. This SRU only aims to address a few of the most troublesome issues. Please consider the fact that this is an incremental improvement and some people are still likely to experience some bugs related to pulseaudio and Bluetooth, even after this SRU.

The patch was authored by Luke Yelavich with help from Konrad Zapałowicz. And it has received further testing over the past two months by Konrad, Jim Hodapp and Daniel van Vugt. The debdiff proposed here only changes the changelog wording from Luke's original PPA.

[Original Description]
Just installed 15.04 fresh from the latest ISO (beta2).

I'm bummed to see my bluetooth headset (Bose Soundlink overear) seems to have regressed in functionality.

In 14.10, I was able to set the output profile either to a2dp or hsp/hfp (telephony duplex).

In 15.04, it only works in telephony duplex mode. I can't get high fidelity sound playback to work at all.

This thread seems to be related, though the workaround within did not solve the problem for me:
https://bbs.archlinux.org/viewtopic.php?id=194006

The bug is still present in 16.04 LTS and 16.10.

Changed in bluez (Ubuntu):
importance: Undecided → High
Changed in bluez (Ubuntu Vivid):
milestone: none → ubuntu-15.04
Changed in pulseaudio (Ubuntu Vivid):
importance: Undecided → High
milestone: none → ubuntu-15.04
tags: added: regression-proposed
Steve Langasek (vorlon) on 2015-03-31
tags: removed: regression-proposed
Martin Pitt (pitti) on 2015-04-20
Changed in pulseaudio (Ubuntu Vivid):
milestone: ubuntu-15.04 → vivid-updates
Changed in bluez (Ubuntu Vivid):
milestone: ubuntu-15.04 → vivid-updates
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bluez (Ubuntu):
status: New → Confirmed
Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Gareth Trainor (gtredx69) wrote :

I am trying to connect my Beats pill which I can, but the sound is set to telephony. I have spent 4 hours trying to enable a2dp with no luck. In pulse audio, the device appears can select the high quality setting but nothing changes.

James C. Davis (jamescdavis) wrote :

I was able to get a2dp working in 15.04 by editing /etc/bluetooth/audio.conf and uncommenting AutoConnect=true under [General] then restarting the bluetooth service with: systemctl restart bluetooth.service
After doing this, my bluetooth headset connected using the a2dp profile automatically.

RobertFM (robert123m) wrote :

I had the same problem and for several months I have tried all possible solutions I could find to no avail,... until today!

I found the solution in post #17 in the following https://bbs.archlinux.org/viewtopic.php?pid=1526534#p1526534 (tnx SimFox3)

What I did:

# First copy the files I edited

    sudo cp /etc/bluetooth/audio.conf /etc/bluetooth/audio.conf_tmp
    sudo cp /etc/pulse/default.pa /etc/pulse/default.pa_tmp
    sudo cp /usr/bin/start-pulseaudio-x11 /usr/bin/start-pulseaudio-x11_tmp

#Edit /etc/bluetooth/audio.conf

    sudo nano /etc/bluetooth/audio.conf

This is in my audio.conf

    # Configuration file for the audio service
    # This section contains options which are not specific to any
    # particular interface
    [General]
    Enable=Gateway,Source

    # Switch to master role for incoming connections (defaults to true)
    Master=true

    # If we want to disable support for specific services
    # Defaults to supporting all implemented services
    #Disable=Gateway,Source,Socket
    Disable=Socket

    # SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
    # Defaults to HCI
    #SCORouting=HCI

    # Automatically connect both A2DP and HFP/HSP profiles for incoming
    # connections. Some headsets that support both profiles will only connect the
    # other one automatically so the default setting of true is usually a good
    # idea.
    AutoConnect=true

    # Headset interface specific options (i.e. options which affect how the audio
    # service interacts with remote headset devices)
    [Headset]

    # Set to true to support HFP, false means only HSP is supported
    # Defaults to true
    HFP=true

    # Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
    MaxConnected=2

    # Set to true to enable use of fast connectable mode (faster page scanning)
    # for HFP when incoming call starts. Default settings are restored after
    # call is answered or rejected. Page scan interval is much shorter and page
    # scan type changed to interlaced. Such allows faster connection initiated
    # by a headset.
    FastConnectable=true

    # Just an example of potential config options for the other interfaces
    #[A2DP]
    #SBCSources=1
    #MPEG12Sources=0

#Edit /etc/pulse/default.pa

    sudo nano /etc/pulse/default.pa

comment out (with an # at the beginning of the line) the following line

    #load-module module-bluetooth-discover

#now edit /usr/bin/start-pulseaudio-x11

    sudo nano /usr/bin/start-pulseaudio-x11

and after the lines

    if [ x”$SESSION_MANAGER” != x ] ; then
            /usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null
    fi

add the following

    /usr/bin/pactl load-module module-bluetooth-discover

#Restarted and I was finally able tot switch to A2DP

Hope it works for you too.

Yura (ykuchinskiy) wrote :

confirm fix from post #17, ubuntu 15.04

Yura (ykuchinskiy) wrote :

sorry for the typo, confirm fix from post #5, ubuntu 15.04

felipunk (fenieves) wrote :

I will also like to confirm the solution from RobertFM on Post #5, Worked flawlessly.

Changed in bluez (Ubuntu):
milestone: vivid-updates → none
Changed in pulseaudio (Ubuntu):
milestone: vivid-updates → none
Luigi Maselli (grigio) wrote :

I see the profile AD2P sink but the audio is still mono, the instructions in 5 are outdated, some filenams are changed

Horacio Arroyo (deblike) wrote :

Confirm fix from post #5 is still working.

Horacio Arroyo (deblike) wrote :

Just applied to a fresh 16.04 beta 2 install, despite having to create /etc/bluetooth/audio.conf manually, it worked again for me.

I have the exact same bug on up to date 16.04 beta (cannot connect to a2dp sink but hsp working), but i didn't have the bug before with 15.10...

If it can help, here is the message showing in syslog when autoconnecting to the bluetooth speaker:
Apr 2 10:44:39 vaio pulseaudio[1890]: [pulseaudio] bluez5-util.c: Transport Acquire() failed for transport /org/bluez/hci0/dev_A0_E9_DB_00_E2_4D/fd1 (Operation Not Authorized)

I can confirm that is it, at least for me, related to https://bugs.freedesktop.org/show_bug.cgi?id=92102 , and that manually connecting to the speaker with "connect A0:E9:DB:00:E2:4D" with bluetoothctl make the a2dp sink available, while just connecting the speaker with the bluetooth applet didn't. No file modification required.

Note that sometimes it fails to connect even with bluetoothctl, but trying once again the connect command connects successfully.

Regards,

I have the same problem in Ubuntu 16.04 beta 2...I have JBL bluetooth speaker and can't change quality of sound from HSP to A2DP....

kylea (kylea) wrote :

confirm fix from post #5, ubuntu 16.04 beta 2 Ubuntu Gnome.

Thanks

Ryan Frank (ryandlf) wrote :

I'd also like to confirm fix from post #5. Ubuntu 14.04

Karl Grzeszczak (karlgrz) wrote :

I can confirm that ubuntu 16.04 LTS is exhibiting this behavior with three separate bluetooth headsets (JABRA REVO 2.0, Sony MDRXB950BT, and Sennheiser Urbanite XL WIreless).

14.04, 14.10, 15.04, and 15.10 all worked quite well with no additional configuration necessary. By "worked quite well" I mean I could pair all three headsets, they would remain paired through reboots, and I could get A2DP output from each.

On 16.04, in both gnome and unity, it is a hit or miss affair of pairing any of these headsets. I have a Dell XPS 15 and had zero problems prior to installing 16.04.

I used the procedure in post #5, but that does not persist after reboots. I have to unpair the headset completely and then repair in order to get sound. Even then it's hit or miss, sometimes it doesn't work.

I'd be happy to give more details to help resolve this.

Changed in bluez (Ubuntu):
status: Confirmed → Invalid
status: Invalid → Confirmed
Karl Grzeszczak (karlgrz) wrote :

Update to this, which might help in diagnosing, might not.

I can ensure that the bluetooth A2DP connection will successfully deliver audio to my headset consistently if I switch back to "Headset Head Unit (HSP/HFP)" mode in Sound settings prior to disconnecting the headset.

Then, next time I connect the headset, it will be in "Headset Head Unit (HSP/HFP)" mode, but when I switch to "High Fidelity Playback (A2DP Sink)" every single time it successfully plays back audio.

Linux Lurker (mark-edcc) wrote :

@karlgrz

I saw the issues you were having and had recently just figured out the same work-around. Just as I was going to post it for you, I see that you too have narrowed it down to this repeatable behavior.

For me however, I do not switch back to HSP, rather I turn the profile OFF in pavucontrol "configuration" tab. Then I disconnect the bluetooth using the its graphic interface.
The next time I connect the bluetooth device, it connects just fine. Then I simply go to the config tab in pavucontrol to switch the device to A2DP sink. It works every time this way.

In the past, switching the profile to OFF in pavucontrol prior to disconnecting the bluetooth device was unnecessary.
I am currently running Kubuntu 16.04 LTS, but have had 16.04 installed since beta. This regression was not present for me in any previous versions.

Karl Grzeszczak (karlgrz) wrote :

Another update. I had accidentally installed gnome-tweak-tool on my unity install instead of unity-tweak-tool, which pulled in a bunch of gnome-core stuff. After uninstalling the gnome stuff and reverting my configs to default (i.e. removing everything I did in post #5) my bluetooth headphones seem to be connecting properly again.

Karl Grzeszczak (karlgrz) wrote :

@mark-edcc thanks for the update. I'll try that in the future if necessary, but I really feel like the gnome nonsense caused all this. When I tried the 16.04 beta, it was the gnome flavor, and I experienced the same nonsense on arch linux with gnome. Never had this problem with unity. Weird.

Thanks again.

Karl Grzeszczak (karlgrz) wrote :

Hah, removing the gnome packages and reverting the configs did not resolve the issue. Still have to remove the bluetooth device and repair upon any reboot or resuming from sleep / hibernate. What a pain in the ass.

Max Bowsher (maxb) wrote :

I'm not sure if this helps, but I see pulseaudio logging an "Operation Not Authorized" message when things do not work:

Apr 26 01:46:52 zenbook pulseaudio[3346]: [pulseaudio] module-bluez5-device.c: Acquiring transport /org/bluez/hci0/dev_20_74_CF_02_DB_F2/fd0
Apr 26 01:46:52 zenbook pulseaudio[3346]: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_20_74_CF_02_DB_F2/fd0 (Operation Not Authorized)

Whereas after doing the switch-to-HSP, disconnect, reconnect, switch-to-A2DP dance to make it work, the equivalent logging is:

Apr 26 01:52:40 zenbook pulseaudio[3346]: [pulseaudio] module-bluez5-device.c: Acquiring transport /org/bluez/hci0/dev_20_74_CF_02_DB_F2/fd2
Apr 26 01:52:40 zenbook bluetoothd[808]: /org/bluez/hci0/dev_20_74_CF_02_DB_F2/fd2: fd(23) ready
Apr 26 01:52:40 zenbook pulseaudio[3346]: [pulseaudio] module-bluez5-device.c: Transport /org/bluez/hci0/dev_20_74_CF_02_DB_F2/fd2 acquired: fd 46

Karl Grzeszczak (karlgrz) wrote :

@marc-edcc: your method works the most consistently. I've rebooted multiple times, connecting and disconnecting the headset with my phone and other devices, and turning it on and off, and also connecting and disconnecting from the 16.04 laptop, and I haven't had a single problem getting audio to work as expected.

I have to do this dance on each reboot, sleep, hibernate, or even any time I want to just disconnect my headset. For me, this isn't a huge deal, but I would classify this as a blocker bug regarding bluetooth audio.

@maxb: the next time I get into a bad state I will take a look at the logs.

Karl Grzeszczak (karlgrz) wrote :

@marc-edcc: ok, that apparently does not work when sleeping the laptop and resuming ;-(

@maxb: here's how my logs looked when it was failing to connect:

Apr 26 09:37:07 deathstar bluetoothd[1043]: Unable to get io data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)
Apr 26 09:37:07 deathstar bluetoothd[1043]: connect error: Connection timed out (110)
Apr 26 09:37:07 deathstar bluetoothd[1043]: 00:16:94:14:C4:15: error updating services: Input/output error (5)
Apr 26 09:37:57 deathstar bluetoothd[1043]: connect error: Connection timed out (110)
Apr 26 09:37:57 deathstar bluetoothd[1043]: 00:16:94:14:C4:15: error updating services: Input/output error (5)
Apr 26 09:37:57 deathstar bluetoothd[1043]: Unable to get io data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)

Karl Grzeszczak (karlgrz) wrote :

@maxb: also see this a bit later:

Apr 26 09:40:37 deathstar bluetoothd[1043]: Unable to get Headset Voice gateway SDP record: Host is down

Karl Grzeszczak (karlgrz) wrote :

If I run:

sudo systemctl restart bluetooth

the Bluetooth icon in the system taskbar goes blank, and if I try to re-enable it nothing ever happens. Here's the logs from that state:

Apr 26 09:41:38 deathstar systemd[1]: Stopping Bluetooth service...
Apr 26 09:41:38 deathstar bluetoothd[1043]: Terminating
Apr 26 09:41:38 deathstar bluetoothd[1043]: Endpoint unregistered: sender=:1.81 path=/MediaEndpoint/A2DPSource
Apr 26 09:41:38 deathstar bluetoothd[1043]: Endpoint unregistered: sender=:1.81 path=/MediaEndpoint/A2DPSink
Apr 26 09:41:38 deathstar bluetoothd[1043]: Stopping SDP server
Apr 26 09:41:38 deathstar bluetoothd[1043]: Exit
Apr 26 09:41:38 deathstar systemd[1]: Stopped Bluetooth service.
Apr 26 09:41:38 deathstar systemd[1]: Starting Bluetooth service...
Apr 26 09:41:38 deathstar bluetoothd[14513]: Bluetooth daemon 5.37
Apr 26 09:41:38 deathstar bluetoothd[14513]: Starting SDP server
Apr 26 09:41:38 deathstar systemd[1]: Started Bluetooth service.
Apr 26 09:41:38 deathstar dbus[1055]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Apr 26 09:41:38 deathstar bluetoothd[14513]: Bluetooth management interface 1.10 initialized
Apr 26 09:41:38 deathstar bluetoothd[14513]: Failed to obtain handles for "Service Changed" characteristic
Apr 26 09:41:38 deathstar bluetoothd[14513]: Not enough free handles to register service
Apr 26 09:41:38 deathstar bluetoothd[14513]: Error adding Link Loss service
Apr 26 09:41:38 deathstar bluetoothd[14513]: Not enough free handles to register service
Apr 26 09:41:38 deathstar bluetoothd[14513]: message repeated 2 times: [ Not enough free handles to register service]
Apr 26 09:41:38 deathstar bluetoothd[14513]: Current Time Service could not be registered
Apr 26 09:41:38 deathstar bluetoothd[14513]: gatt-time-server: Input/output error (5)
Apr 26 09:41:38 deathstar bluetoothd[14513]: Not enough free handles to register service
Apr 26 09:41:38 deathstar bluetoothd[14513]: Not enough free handles to register service
Apr 26 09:41:38 deathstar bluetoothd[14513]: Sap driver initialization failed.
Apr 26 09:41:38 deathstar bluetoothd[14513]: sap-server: Operation not permitted (1)
Apr 26 09:41:38 deathstar systemd[1]: Starting Hostname Service...
Apr 26 09:41:38 deathstar pulseaudio[2246]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Apr 26 09:41:38 deathstar bluetoothd[14513]: Endpoint registered: sender=:1.81 path=/MediaEndpoint/A2DPSource
Apr 26 09:41:38 deathstar bluetoothd[14513]: Endpoint registered: sender=:1.81 path=/MediaEndpoint/A2DPSink
Apr 26 09:41:38 deathstar dbus[1055]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 26 09:41:38 deathstar systemd[1]: Started Hostname Service.

It's good to note that I reverted all of the configuration changes I made as suggested by @robert123m in post #5.

Karl Grzeszczak (karlgrz) wrote :

Tried again just now with the Sennheiser Urbanite XL Wireless and see this in the syslog:

May 10 08:00:02 deathstar wpa_supplicant[1472]: wlp6s0: Failed to initiate sched scan
May 10 08:00:09 deathstar rtkit-daemon[2045]: Supervising 4 threads of 1 processes of 1 users.
May 10 08:00:09 deathstar rtkit-daemon[2045]: Successfully made thread 19868 of process 2461 (n/a) owned by '1000' RT at priority 5.
May 10 08:00:09 deathstar rtkit-daemon[2045]: Supervising 5 threads of 1 processes of 1 users.
May 10 08:00:09 deathstar kernel: [ 505.747613] Bluetooth: hci0 SCO packet for unknown connection handle 0
May 10 08:00:09 deathstar kernel: [ 505.747616] Bluetooth: hci0 SCO packet for unknown connection handle 0
May 10 08:00:09 deathstar kernel: [ 505.747617] Bluetooth: hci0 SCO packet for unknown connection handle 0
May 10 08:00:14 deathstar pulseaudio[2461]: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected
May 10 08:00:14 deathstar bluetoothd[1176]: Unable to get io data for Headset Voice gateway: getpeername: Transport endpo int is not connected (107)
May 10 08:00:14 deathstar kernel: [ 510.979305] Bluetooth: hci0 SCO packet for unknown connection handle 258
May 10 08:00:21 deathstar bluetoothd[1176]: connect error: Host is down (112)
May 10 08:00:21 deathstar bluetoothd[1176]: GLib: Source ID 197 was not found when attempting to remove it

Karl Grzeszczak (karlgrz) wrote :

Also see this in dmesg:

[ 505.747613] Bluetooth: hci0 SCO packet for unknown connection handle 0
[ 505.747616] Bluetooth: hci0 SCO packet for unknown connection handle 0
[ 505.747617] Bluetooth: hci0 SCO packet for unknown connection handle 0
[ 510.979305] Bluetooth: hci0 SCO packet for unknown connection handle 258

Karl Grzeszczak (karlgrz) wrote :

    4 May 10 08:13:07 deathstar systemd[1]: Stopping User Manager for UID 108...
    5 May 10 08:13:07 deathstar systemd[1880]: Stopped target Default.
    6 May 10 08:13:07 deathstar systemd[1880]: Reached target Shutdown.
    7 May 10 08:13:07 deathstar systemd[1880]: Stopped target Basic System.
    8 May 10 08:13:07 deathstar systemd[1880]: Stopped target Timers.
    9 May 10 08:13:07 deathstar systemd[1880]: Stopped target Sockets.
   10 May 10 08:13:07 deathstar systemd[1880]: Stopped target Paths.
   11 May 10 08:13:07 deathstar systemd[1880]: Starting Exit the Session...
   12 May 10 08:13:07 deathstar systemd[1880]: Received SIGRTMIN+24 from PID 3313 (kill).
   13 May 10 08:13:07 deathstar systemd[1]: Stopped User Manager for UID 108.
   14 May 10 08:13:07 deathstar systemd[1]: Removed slice User Slice of lightdm.
   15 May 10 08:13:42 deathstar rtkit-daemon[1995]: Supervising 4 threads of 1 processes of 1 users.
   16 May 10 08:13:42 deathstar rtkit-daemon[1995]: Successfully made thread 3335 of process 2415 (n/a) owned by '1000' RT at priority 5.
   17 May 10 08:13:42 deathstar rtkit-daemon[1995]: Supervising 5 threads of 1 processes of 1 users.
   18 May 10 08:13:42 deathstar kernel: [ 166.886756] Bluetooth: hci0 SCO packet for unknown connection handle 0
   19 May 10 08:13:42 deathstar kernel: [ 166.886762] Bluetooth: hci0 SCO packet for unknown connection handle 0
   20 May 10 08:13:45 deathstar wpa_supplicant[1568]: wlp6s0: Failed to initiate sched scan
   21 May 10 08:13:51 deathstar bluetoothd[1084]: Start: Connection timed out (110)
   22 May 10 08:13:51 deathstar pulseaudio[2415]: [pulseaudio] bluez5-util.c: Transport Acquire() failed for transport /org/bl uez/hci0/dev_00_16_94_14_C4_15/fd1 (Input/output error)
   23 May 10 08:13:53 deathstar bluetoothd[1084]: Abort: Connection timed out (110)
   24 May 10 08:13:57 deathstar pulseaudio[2415]: [pulseaudio] backend-native.c: connect(): Device or resource busy
   25 May 10 08:14:03 deathstar bluetoothd[1084]: Unable to get io data for Headset Voice gateway: getpeername: Transport endp oint is not connected (107)
   26 May 10 08:14:03 deathstar bluetoothd[1084]: 00:16:94:14:C4:15: error updating services: Input/output error (5)
   27 May 10 08:14:03 deathstar kernel: [ 188.733312] Bluetooth: hci0 SCO packet for unknown connection handle 257
   28 May 10 08:14:03 deathstar kernel: [ 188.733315] Bluetooth: hci0 SCO packet for unknown connection handle 257
   29 May 10 08:14:03 deathstar kernel: [ 188.733316] Bluetooth: hci0 SCO packet for unknown connection handle 257
   30 May 10 08:14:23 deathstar bluetoothd[1084]: /org/bluez/hci0/dev_00_16_94_14_C4_15/fd2: fd(21) ready

Karl Grzeszczak (karlgrz) wrote :

Happy update. Resolved my issues with at least the Sennheiser Urbanite XL Wireless by disconnecting from my android phone before trying to connect to Ubuntu 16.04. I'll take it.

jordan rubin (delorean1) wrote :

Confirming this issue also with the Phillips Bluetooth speaker model BT2500B/37. Cannot set to higher quality sound in pulseaudio. Using gnome-ubuntu 16.04

Updated to 16.04, have the same problem. The fix in comment#5 fixes it!
Thanks!

Alexander Menk (alex-menk) wrote :

Same problem here. The workaround partially fixes it, but still I have sometimes problems to connect. Is it dependent on the bluetooth adapter, headset or both? Are there know-to-work adapters?

Louis Bouchard (louis) wrote :

Testing with a JBL SB400 BT on a Lenovo Thinkpad T450S with the intel ibt driver on F/W version 37081001103110e23 works correctly.

Doing a parallel test on my laptop (HP evo 850) that has :

[12383.666088] Bluetooth: hci0: read Intel version: 370710018002030d00
[12383.666095] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq

Fails according to the bug report.

So it may be firmware related

Changed in bluez (Ubuntu Vivid):
status: Confirmed → Won't Fix
Changed in pulseaudio (Ubuntu Vivid):
status: Confirmed → Won't Fix
Changed in bluez (Ubuntu Vivid):
milestone: vivid-updates → none
Changed in pulseaudio (Ubuntu Vivid):
milestone: vivid-updates → none
tags: added: regression-release
tags: added: xenial
Cyril Humbert (cyril-h5t) wrote :

Same issue with the folowing BT headphones:

 * Plantronic BackBeat FIT.

 * Plantronic BackBeat PRO.

 * B&O Beoplay H8.

The computer has a BT USB dongle:

  Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
  CSR8510 A10
  USB ID = 0a12:0001

The following procedure solved the problem for us:

 1. Purge Ubuntu pulseaudio packages and conf files. Backup and purge
    pulseaudio user conf files too.

 2. Install the corresponding packages from Debian testing (June 2016).
    See attached script (get-pulseaudio8-debian-amd64.sh).

 3. Restart.

 4. A2DP profile should now work as expected with the default
    bluez/pulseaudio configuration (Use pavucontrol to select A2DP
    if needed).

Since Debian Testing (June 2016) and Ubuntu 16.04 are based on the
same pulseaudio upstream version (8.0) this suggests that this
regression is maybe due to a difference in Debian and Ubuntu
packaging: either the compilation options, the default conf or the
specific patches (e.g. Ubuntu packages include more specific patches).

Cyril Humbert (cyril-h5t) wrote :

Updated procedure for comment #35, allowing to install more easily
Debian Testinf pulseaudio package on Ubunutu 16.04.

 1. Stop pulseaudio. Then, backup and purge pulseudio user conf files.

 2. Install pulseaudio Debian Testing (June 2016) packages over Ubuntu
    pulseaudio packages. This will appear as a kind of downgrade. See
    get-pulseaudio8-debian-amd64.sh script. If you use
    pulseaudio-module-x11 too, use the corresponding Debian Testing
    version too to satisfy dependencies.

 3. Restart.

 4. A2DP profile should now work as expected with the default
    BlueZ, pulseaudio configuration. Use pavucontrol to select
    A2DP profile if needed.

Potato110 (aardappel110) wrote :

Same here with a Teufel Airy bluetooth headset. #18 even doesn't work for me.

Max Bowsher (maxb) wrote :

Acting on Cyril's suggestion above, I downloaded the Debian 8.0-2 source package, rebuilt it locally, and installed it. It seems to have fixed the problem for me. So perhaps the problem really is in the Ubuntu delta?

radiantptz (radiantptz) wrote :

Confirmed fixed on @robert123m post #5 above on ubuntu 16.04.1 LTS. Can't thank you enough. Here is my env for reference:

$ dpkg -l | grep 'pulse\|bluetooth'
ii blueman 2.0.4-1ubuntu2
ii gir1.2-gnomebluetooth-1.0:amd64 3.18.2-1ubuntu2
ii gnome-bluetooth 3.18.2-1ubuntu2
ii gstreamer1.0-pulseaudio:amd64 1.8.2-1ubuntu0.1
ii libbluetooth3:amd64 5.37-0ubuntu5
ii libcanberra-pulse:amd64 0.30-2.1ubuntu1
ii libgnome-bluetooth13:amd64 3.18.2-1ubuntu2
ii libpulse-mainloop-glib0:amd64 1:8.0-0ubuntu3
ii libpulse0:amd64 1:8.0-0ubuntu3
ii libpulse0:i386 1:8.0-0ubuntu3
ii libpulsedsp:amd64 1:8.0-0ubuntu3
ii pulseaudio 1:8.0-0ubuntu3
ii pulseaudio-module-bluetooth 1:8.0-0ubuntu3
ii pulseaudio-module-x11 1:8.0-0ubuntu3
ii pulseaudio-utils 1:8.0-0ubuntu3

Ayberk Özgür (equilibriumtr) wrote :

I also confirm that #5 fixes audio output (was able to connect before but no audio output) with Sony MDRXB950BT on Kubuntu 16.04.

Jason Robinson (jaywink) wrote :

Confirmed on Ubuntu 16.04 (4.4.0-34-generic). Recently bought a bluetooth dongle to my desktop. Cannot switch to A2DP making headset useless for listening to music.

bluez 5.37-0ubuntu5
pulseaudio 1:8.0-0ubuntu3

Tried comment #5 editing, rebooted - no effect. This same log message keeps coming to /var/syslog:

> [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected

Ayberk Özgür (equilibriumtr) wrote :

I retract my confirmation on #40; after one disconnect/connect it is back to no audio.

Rahul (rahul-kale-1) wrote :

Confirmed Fix on #5,works permanently on Ubuntu 16.04

Come on guys, this bug was reported almost 6 months ago and there is still no fix for that. Could you focus on it or at least provide a temporary solution. #5 doesn't work for me as well. I have here a Sony MDR-ZX750BN with Ubuntu 16.04 xenial presenting the same problem, it connects but no audio is played. If I use blueman-manager and try to change to A2DP mode, it provides an error message saying that it is not possible to make the switch and keeps the headphone turned off.

After some connect/disconnecting trials using the blueman-manager, this script finally made the things work.

https://gist.github.com/pylover/d68be364adac5f946887b85e6ed6e7ae#file-a2dp-py

Thanks Vahid Mardani for writing this script.

Just wanted to add that the fix in #5 fixed the a2dp issue for me as well. I'm using a pair of [url https://www.amazon.com/gp/product/B00J0BXPD4/ref=od_aui_detailpages00?ie=UTF8&psc=1]Avantree headphones[/url].

Cyril Humbert (cyril-h5t) wrote :

The present bug is probably related to https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1574324 .

The comment given https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1574324/comments/15
seems to confirm #35 and #38: the regression is caused by some patch applied for the Ubuntu
Pulseaudio package.

A new error mode is that now the BT device is not connected at all, even after doing the #5 thing, with the error:

bluetoothd[984]: Unable to get Headset Voice gateway SDP record: Host is down

I need to reboot the system, unpair and pair again the device, and then doing the dance of connecting with low quality, change to the internal audio, disconnecting the BT device, reconnecting again, switch to A2DP --- which now works. After 20 minutes.

I think something happened in the last kernel update.

Will start looking in Google for rain dances for the next time... ;-)

summary: - [REGRESSION] bluetooth headset no longer supports a2dp
+ [REGRESSION] bluetooth headset no longer supports a2dp in 16.04 xenial
description: updated

I applied both solution of #5 and #45. After running the python script my headset started working correctly. I don't know if it is solution of #45 or the combination of #5 and #45, but it works now. Thanks!

Tamir (sugip) wrote :

For yak actuality

tags: added: yakkety
description: updated
summary: [REGRESSION] bluetooth headset no longer supports a2dp in 16.04 xenial
+ and 16.10 yakkety

I am able to use my bluetooth headset after running these two commands

killall pulseaudio; rm -r ~/.config/pulse/* ;
pulseaudio -k

Ryan Lee Sipes (ryanleesipes) wrote :

This affects me as well. Seemingly with each type of bluetooth device I've connected. Sony SRS-X11 bluetooth speaker, my JBL Bluetooth speaker (not sure on the model), and my SkullCandy Hesh 2 Wireless Headphones.

Restarting the devices multiple times appears to randomly fix it. Then I just make sure to keep the device connected on my desk all day to ensure it does not get disconnected.

Will try the workaround.

This affects me on both 16.04 and 16.10 (tested on multiple machines here at System76).

Klavs Klavsen (kl-vsen) wrote :

I have the same issue since updating to 16.04 :(

I have found a consistent way to get A2DP profile working - but it has to be done on every reconnect :(

I switch to HSP/HFP - and sound works. Then I stop ALL sound.. and disconnect bluetoothe device, reconnects bluetoothe device, and then switch profile to a2dp(sink) - and ONLY then, can I start the music again.

tags: added: papercuts2017
Henrik Langli (8-henrik) wrote :

#51 doesn't work on 16.10:

# killall pulseaudio; rm -r ~/.config/pulse/* ; pulseaudio -k
E: [pulseaudio] main.c: Failed to kill daemon: No such process
#

But at least I got rid of my pulseaudio config :-)

This bug will soon have its 2 year anniversary - are anybody preparing celebrations?

Marcel Krause (mk.pmb) wrote :

Upgraded my netbook to xenial today, paired my Sennheiser PX210BT,
shows up in "bt-device --list", connects and headphones play their
internal "playback device added" sound. pavucontrol sees them as
well and offers "High Fidelity Playback (A2DP Sink)" as one of the
modes, so I select it, but still its "output devices" tab has just
the "dummy output". :-(

Also I want the bt-audio command back.

Martin (fidyyuan) wrote :

Is there a way to write a script that can switch to HSP/HFP, attempt to switch to a2dp, disconnect bluetooth and reconnect the bluetooth and then connect to a2dp? That would be a decent work around so we could save ourselves time when we do this every day.

As I commented in http://askubuntu.com/a/775524/16395, some people reported success with the python script at https://gist.github.com/pylover/d68be364adac5f946887b85e6ed6e7ae --- be warned, there is a bit of NSFW language there.

Martin (fidyyuan) wrote :

#57 Thank you SO MUCH! That script worked perfectly for me!

Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Confirmed
Hui Wang (hui.wang) wrote :

I found a very import commit was reverted in the canonical's pulseaudio, if we restore that commit, this problem will be fixed.

commit de1e78a47cd13496c38f627d56944045a629053e
Author: David Henningsson <email address hidden>
Date: Fri Dec 19 10:24:47 2014 +0100

    bluez5: Do not suspend on no -> unknown profile transitions

    In case a transport is currently disconnected and transitions to
    idle, that should not count as a "remote hang up" event.

    Signed-off-by: David Henningsson <email address hidden>

Hui Wang (hui.wang) wrote :

I have tested #59 on several laptops which have different bluetooth modules (intel, atheros and realtek), and all of them are installed ubuntu 16.04, after restoring the commit of #59 in the pulseaudio, the problem disappears.

Hey, to everyone interested we are currently testing and reviewing an improvement to PA that fixes problems with selecting A2DP mode for BT headsets.

Right now it is being tested internally with good results for Sony headsets, QC35 from Bose and BT speakers. Once it is in a silo/ppa I will share this information for much wider testing. Then it will be submitted as a SRU and will land in xenial.

Hui, do you know which patch in the pulseaudio package is responsible for this revert? A quick glance and I cannot find it.

Luke

@Luke,

0502-bluetooth-bluez5-bring-back-SCO-over-PCM-support.patch

Hello,

Le 03/04/2017 à 12:02, Konrad Zapałowicz a écrit :
> Hey, to everyone interested we are currently testing and reviewing an
> improvement to PA that fixes problems with selecting A2DP mode for BT
> headsets.
>
> Right now it is being tested internally with good results for Sony
> headsets, QC35 from Bose and BT speakers. Once it is in a silo/ppa I
> will share this information for much wider testing. Then it will be
> submitted as a SRU and will land in xenial.
>

I've been subscribed to this bug for ages & I'm still seeing this issue with my
BT headset so I'd be more than happy to help you tests.

Kind regards,

...Louis

--
Louis Bouchard
Software engineer, Cloud & Sustaining eng.
Canonical Ltd
Ubuntu developer Debian Maintainer
GPG : 429D 7A3B DD05 B6F8 AF63 B9C4 8B3D 867C 823E 7A61

yeah, we are more than happy to test the fixes. Can't wait for the PPA, hope it will land in Zesty as well ..

Kind Regards,
ejat @ fenris

The ppa is: ppa:ubuntu-audio-dev/pulse-testing Feel free to add it to your system, update pulseaudio and test with your headsets.

thanks @kzapalowicz

however in Zesty ver. 1:10.0-1ubuntu2. Please advise.

pasimako (pasimako) wrote :

I've been using the script from #57 in 16.04 & 16.10, but in 17.04 I switched to GNOME and now the script fails since it cannot find an a2dp sink. After some research, it seems that the problem is with GDM starting its own pulseaudio process (https://bbs.archlinux.org/viewtopic.php?pid=1526658#p1526658). If you think you might have the same issue, first check your pulseaudio instances:

$ ps aux | grep pulseaudio
gdm 2578 4.3 0.1 2350536 12896 ? S<l 15:40 2:10 /usr/bin/pulseaudio --start --log-target=syslog
user 1533 4.3 0.1 2350536 12896 ? S<l 15:48 2:18 /usr/bin/pulseaudio --start --log-target=syslog

If you see a process owned by gdm, you can try to disable pulseaudio spawning by gdm during startup:

$ sudo nano /var/lib/gdm3/.config/pulse/client.conf
autospawn = no
daemon-binary = /bin/true

$ sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf

Restart and #57 should now work.

Lev Popov (nabam) wrote :

I've installed 1:8.0-0ubuntu3.3~xenial1 from testing PPA and it partly fixed the issue.

My headphones are Plantronics BackBeat PRO.

A2DP works perfectly fine when connection is initiated by linux machine, but when it's initiated by headphones, when they turn on, there is no sound. In syslog:

Apr 19 02:14:07 xps pulseaudio[11005]: [pulseaudio] module-bluez5-device.c: Default profile not connected, selecting off profile
Apr 19 02:14:10 xps bluetoothd[12649]: /org/bluez/hci0/dev_0C_E0_E4_45_40_F2/fd7: fd(25) ready
Apr 19 02:14:10 xps pulseaudio[11005]: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_0C_E0_E4_45_40_F2/fd7 (Operation Not Authorized)
Apr 19 02:14:20 xps pulseaudio[11005]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.
Apr 19 02:14:20 xps pulseaudio[11005]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.
Apr 19 02:14:20 xps pulseaudio[11005]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.
Apr 19 02:14:21 xps pulseaudio[11005]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.
Apr 19 02:14:21 xps pulseaudio[11005]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.
Apr 19 02:14:21 xps pulseaudio[11005]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.

Lev Popov (nabam) wrote :

The behavior I've described seems transient, I can't reproduce it anymore.

Daniel van Vugt (vanvugt) wrote :

Lev: The problem you describe in comment #69 sounds like it might be fixed by this (which is missing from xenial AFAIK):

https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/src/service.c?id=2e2edc36a91d6a8f2c65d793273df28a166d6bed

summary: - [REGRESSION] bluetooth headset no longer supports a2dp in 16.04 xenial
- and 16.10 yakkety
+ [regression] Bluetooth audio no longer supports A2DP (stuck in HSP/HFP
+ mode)
tags: added: a2dp
Changed in pulseaudio (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: Confirmed → In Progress
Changed in bluez (Ubuntu):
status: Confirmed → Invalid
description: updated
Daniel van Vugt (vanvugt) wrote :

Attached debdiff for updating xenial to pulseaudio 1:8.0-0ubuntu3.3, in order to address a few problems with Bluetooth audio (A2DP).

description: updated
description: updated
Daniel van Vugt (vanvugt) wrote :

I have moved the debdiff into bug 1582213, which seems to be a more sure-fire-definitely-fixed bug when compared to this more vague ongoing issue.

description: updated
Jeremy Bicha (jbicha) on 2017-05-28
Changed in pulseaudio (Ubuntu Xenial):
importance: Undecided → High
Jeremy Bicha (jbicha) on 2017-05-28
no longer affects: bluez (Ubuntu Xenial)
Changed in pulseaudio (Ubuntu):
status: In Progress → Fix Released
Changed in pulseaudio (Ubuntu Xenial):
status: New → Triaged
Changed in pulseaudio (Ubuntu Xenial):
status: Triaged → In Progress
Changed in pulseaudio (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
Changed in pulseaudio (Ubuntu Xenial):
assignee: nobody → Daniel van Vugt (vanvugt)
granjerox (granjerox) wrote :

Hello,

I've just upgraded pluseaudio with ppa from #66 and now my Q12 Bluetooth headset always connect fine as with A2DP Sink. I'm on Ubuntu 16.04 by the way.

Before the upgrade, I had to ensure to change profile back to HSP/HFP before disconnecting, otherwise I had to do it, disconnect, connect again and then set A2DP... really annoying.

Thanks for the fix, whatever it was.

Hello Dustin, or anyone else affected,

Accepted pulseaudio into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:8.0-0ubuntu3.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in pulseaudio (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Daniel van Vugt (vanvugt) wrote :

Verified. Using the proposed packages bluetooth audio no longer randomly refuses to use A2DP mode.

tags: added: verification-done
removed: verification-needed
Daniel van Vugt (vanvugt) wrote :

Although after some reboots and reconnects I found I could encounter similar bugs, the proposed packages are still much better than what's in xenial at present. It took a lot more effort to confuse and break the bluetooth audio mode than it usually does :)

tags: added: verification-done-xenial
removed: verification-done
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:8.0-0ubuntu3.3

---------------
pulseaudio (1:8.0-0ubuntu3.3) xenial; urgency=medium

  [Luke Yelavich, Konrad Zapałowicz]
  * Fixed multiple interrelated problems with using Bluetooth audio (A2DP),
    where users would experience some combination of:
    - Bluetooth headset/speakers listed but not selectable in Sound settings
      (LP: #1283003)
    - [regression] Bluetooth audio no longer supports A2DP (stuck in HSP/HFP
      mode) (LP: #1438510)
    - [xenial] Bluetooth device doesn't play any sound in A2DP mode unless set
      to HSP/HFP first (LP: #1582213)
  * Specific patches from upstream used to address the above problems:
    - 0103-bluetooth-Add-support-for-automatic-switch-between-h.patch
    - 0104-bluetooth-Add-support-for-automatic-switch-bluez5.patch
    - 0106-bluetooth-Add-optional-heuristic-for-switching-betwe.patch
      . Backport from upstream to fix a bug in Xenial where an incorrect
        audio profile is applied for a headset connected over Bluetooth
        making using it impossible.
    - 0105-bluetooth-policy-do-A2DP-profile-restoring-a-bit-lat.patch
      . Fix a crash that happens if the BT headset is the only non-monitor
        source in the system and the last "phone" stream dies.
    - 0700-pulsecore-add-new-card-profile-hook.patch
      . Backport from upstream (commit 7b6260140149) to allow for correct
        profile selection.
    - 0701-bluetooth-bluez5-wait-for-all-profiles-to-connect.patch
      . Backport from upstream waiting for all profiles to connect before
        creating a card.

 -- Daniel van Vugt <email address hidden> Tue, 23 May 2017 16:24:14 +0800

Changed in pulseaudio (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for pulseaudio has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.