Pulseaudio bluez5-util.c: TryAcquire() failed - Operation Not Authorized

Bug #1577197 reported by Aleksandr Panzin on 2016-05-01
470
This bug affects 93 people
Affects Status Importance Assigned to Milestone
bluez (Ubuntu)
High
Unassigned
Nominated for Xenial by Daniel van Vugt
indicator-sound (Ubuntu)
Medium
Unassigned
Nominated for Xenial by Daniel van Vugt
pulseaudio (Ubuntu)
High
Unassigned
Nominated for Xenial by Daniel van Vugt

Bug Description

Pulseaudio outright stops audio via Bluetooth after sleep or prolonged period of time. Only restart fixes the issue. This started early 2016 in 15.10.
Issue is discussed here as well http://askubuntu.com/questions/763539/bluetooth-speaker-no-sound-in-ubuntu-16-04 and mentioned in other unrelated bugs.

Ubuntu Xenial 16.04 LTS

The log below:

May 1 17:18:07 jalexoidmobile pulseaudio[2884]: [pulseaudio] module-bluez5-device.c: Default profile not connected, selecting off profile
May 1 17:18:07 jalexoidmobile bluetoothd[7349]: /org/bluez/hci0/dev_00_02_3C_05_99_F2/fd4: fd(35) ready
May 1 17:18:07 jalexoidmobile rtkit-daemon[1794]: Supervising 3 threads of 1 processes of 1 users.
May 1 17:18:07 jalexoidmobile rtkit-daemon[1794]: Successfully made thread 10967 of process 2884 (n/a) owned by '1000' RT at priority 5.
May 1 17:18:07 jalexoidmobile rtkit-daemon[1794]: Supervising 4 threads of 1 processes of 1 users.
May 1 17:18:07 jalexoidmobile pulseaudio[2884]: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_00_02_3C_05_99_F2/fd4 (Operation Not Authorized)
May 1 17:18:07 jalexoidmobile kernel: [20583.032442] input: 00:02:3C:05:99:F2 as /devices/virtual/input/input24
May 1 17:18:19 jalexoidmobile pulseaudio[2884]: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended.

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 04f2:b2da Chicony Electronics Co., Ltd thinkpad t430s camera
Bus 001 Device 008: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]
Bus 001 Device 004: ID 147e:2020 Upek TouchChip Fingerprint Coprocessor (WBF advanced mode)
Bus 001 Device 003: ID 17ef:1003 Lenovo Integrated Smart Card Reader
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

[20388.983474] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[20389.070114] usb 1-1.4: New USB device found, idVendor=0a5c, idProduct=21e6
[20389.070120] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20389.070122] usb 1-1.4: Product: BCM20702A0
[20389.070124] usb 1-1.4: Manufacturer: Broadcom Corp
[20389.070126] usb 1-1.4: SerialNumber: 446D578686DD
[20389.076232] Bluetooth: hci0: BCM: chip id 63
[20389.092220] Bluetooth: hci0: BCM20702A
[20389.093225] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[20389.551476] wlan0: authenticate with a0:63:91:2f:3f:ed
[20389.554391] wlan0: send auth to a0:63:91:2f:3f:ed (try 1/3)
[20389.557790] wlan0: authenticated
[20389.558339] wlan0: associate with a0:63:91:2f:3f:ed (try 1/3)
[20389.562209] wlan0: RX AssocResp from a0:63:91:2f:3f:ed (capab=0x1411 status=0 aid=2)
[20389.581260] wlan0: associated
[20389.581369] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[20389.830185] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1669
[20389.846186] Bluetooth: hci0: Broadcom Bluetooth Device
[20418.269466] input: 00:02:3C:05:99:F2 as /devices/virtual/input/input23
[20583.032442] input: 00:02:3C:05:99:F2 as /devices/virtual/input/input24

Aleksandr Panzin (jalexoid) wrote :

PS: The connection to the speaker is made without issues, only Pulseaudio is causing the failure.

Xavi Garcia (xavi-garcia-mena) wrote :

This seems like a pulseaudio bug to me, nothing to do with the indicator.
Adding pulseaudio and moving to invalid for indicator-sound...

Changed in indicator-sound (Ubuntu):
status: New → Invalid
Launchpad Janitor (janitor) wrote :

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

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Dave Pifke (dpifke) wrote :
Download full text (4.4 KiB)

I too encountered this problem: Bluetooth audio stopped working after I upgraded to 16.04.

Running pulseaudio -v, I saw my headphones connect, then the TryAcquire() error message from the subject line of this bug:

I: [pulseaudio] module.c: Loaded "module-bluez5-device" (index: #21; argument: "path=/org/bluez/hci0/dev_00_18_09_24_DD_95").
I: [pulseaudio] module-card-restore.c: Card bluez_card.00_18_09_24_DD_95 profile a2dp_sink became available, activating.
I: [pulseaudio] module-bluez5-device.c: Transport /org/bluez/hci0/dev_00_18_09_24_DD_95/fd3 acquired: fd 30
I: [pulseaudio] module-bluez5-device.c: SBC parameters: allocation=0, subbands=1, blocks=3, bitpool=53
I: [pulseaudio] module-device-restore.c: Restoring volume for sink bluez_sink.00_18_09_24_DD_95: front-left: 54407 / 83%, front-right: 54407 / 83%
I: [pulseaudio] module-device-restore.c: Restoring mute state for sink bluez_sink.00_18_09_24_DD_95: unmuted
I: [pulseaudio] sink.c: Created sink 1 "bluez_sink.00_18_09_24_DD_95" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] sink.c: bluetooth.protocol = "a2dp_sink"
I: [pulseaudio] sink.c: device.description = "MDR-AS800BT"
I: [pulseaudio] sink.c: device.string = "00:18:09:24:DD:95"
I: [pulseaudio] sink.c: device.api = "bluez"
I: [pulseaudio] sink.c: device.class = "sound"
I: [pulseaudio] sink.c: device.bus = "bluetooth"
I: [pulseaudio] sink.c: device.form_factor = "headset"
I: [pulseaudio] sink.c: bluez.path = "/org/bluez/hci0/dev_00_18_09_24_DD_95"
I: [pulseaudio] sink.c: bluez.class = "0x240404"
I: [pulseaudio] sink.c: bluez.alias = "MDR-AS800BT"
I: [pulseaudio] sink.c: device.icon_name = "audio-headset-bluetooth"
I: [pulseaudio] sink.c: device.intended_roles = "phone"
I: [pulseaudio] source.c: Created source 1 "bluez_sink.00_18_09_24_DD_95.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] source.c: device.description = "Monitor of MDR-AS800BT"
I: [pulseaudio] source.c: device.class = "monitor"
I: [pulseaudio] source.c: device.string = "00:18:09:24:DD:95"
I: [pulseaudio] source.c: device.api = "bluez"
I: [pulseaudio] source.c: device.bus = "bluetooth"
I: [pulseaudio] source.c: device.form_factor = "headset"
I: [pulseaudio] source.c: bluez.path = "/org/bluez/hci0/dev_00_18_09_24_DD_95"
I: [pulseaudio] source.c: bluez.class = "0x240404"
I: [pulseaudio] source.c: bluez.alias = "MDR-AS800BT"
I: [pulseaudio] source.c: device.icon_name = "audio-headset-bluetooth"
I: [pulseaudio] source.c: device.intended_roles = "phone"
I: [bluetooth] core-util.c: Successfully enabled SCHED_RR scheduling for thread, with priority 5.
I: [bluetooth] module-bluez5-device.c: Transport /org/bluez/hci0/dev_00_18_09_24_DD_95/fd3 resuming
I: [pulseaudio] module-always-sink.c: A new sink has been discovered. Unloading null-sink.
I: [pulseaudio] card.c: Changed profile of card 1 "bluez_card.00_18_09_24_DD_95" to a2dp_sink
I: [pulseaudio] module-card-restore.c: Storing card profile for card bluez_card.00_18_09_24_DD_95.
I: [bluetooth] bluez5-util.c: Transport /org/bluez/hci0/dev_00_1...

Read more...

Con Kolivas (kernel-kolivas) wrote :

I have the same issue since upgrading to (Kubuntu) 16.04 with bluetooth audio not working to the A2DP device. However I found a temporary workaround - after it connects the audio player stops completely in its tracks, but if I change the audio configuration on the bluetooth audio device from A2DP to HSP/HFP audio starts working at low fidelity and if I then switch it back to A2DP the audio now works at high fidelity.

Afforess (afforess) wrote :

I can also confirm this for 16.04. I note a very similar error in the syslog:

May 28 17:34:58 afforess-pc pulseaudio[2004]: [pulseaudio] module-bluez5-device.c: Default profile not connected, selecting off profile
May 28 17:35:00 afforess-pc bluetoothd[1009]: /org/bluez/hci0/dev_20_9B_A5_5D_BB_30/fd2: fd(31) ready
May 28 17:35:00 afforess-pc pulseaudio[2004]: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_20_9B_A5_5D_BB_30/fd2 (Operation Not Authorized)
May 28 17:35:00 afforess-pc kernel: [91164.555960] input: 20:9B:A5:5D:BB:30 as /devices/virtual/input/input27

I did some digging at one point, and the error from bluez5 seems to originate from DBus, and may be a permissions issue with the bluetooth DBus configuration or pulseaudio DBus configuration.

The workaround suggested by Con Kolivas works, but is very annoying.

livelace (k-a2min-2) wrote :

The same problem. +1

Jeff (jdferron) wrote :

I can confirm the same issue is happening with GalliumOS 2.0 (Ubuntu 16.04 LTS base). The workaround however does not work on this distro.

https://github.com/GalliumOS/galliumos-distro/issues/246

tags: added: xenial
Launchpad Janitor (janitor) wrote :

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

affects: bluez → bluez (Ubuntu)
Changed in bluez (Ubuntu):
status: New → Confirmed
Changed in pulseaudio (Ubuntu):
importance: Undecided → Medium
Changed in bluez (Ubuntu):
importance: Undecided → Medium
Changed in indicator-sound (Ubuntu):
importance: Undecided → Medium
Changed in bluez (Ubuntu):
status: New → Confirmed
Jeff (jdferron) wrote :

Could someone on the ubuntu development team update the bluez package to 5.39? The bluez website states there are A2DP fixes in the next release.

http://www.bluez.org/release-of-bluez-5-39/

Vahid Mardani (vahid-mardani) wrote :

+1, The same problem. any update? patch?

zollac (kyle2160k) wrote :

I compiled blueZ 5.42 and the problem is fixed. Maybe someone can update the package in the repo?

Vahid Mardani (vahid-mardani) wrote :

After testing all workarounds, i wrote a python script to change profile, disconnect, reconnect and set profile to a2dp. it's working/

run it after pair/turning-on the device with python3.5.

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

sven-ola (sven-ola) wrote :

My stereo headphones shows this bug. I've tried to add https://git.kernel.org/cgit/bluetooth/bluez.git/commit/src/service.c?id=2e2edc36a91d6a8f2c65d793273df28a166d6bed using dpkg-buildpackage with no success.

sven-ola (sven-ola) wrote :

Upgrading to (self-compiled) 5.41-0ubuntu5 does not help either: still got syslog with:
pulseaudio[4465]: [pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_00_18_09_21_36_F0/fd1 (Operation Not Authorized)

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

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

Thanks Vahid Mardani for writing this script.

Vahid Mardani (vahid-mardani) wrote :

After two years of changing profile, disconnectiong, reconnecting and setting a2dp profile, for my headset manually about 6-7 times per day, i decided to throw the pain out for ever, anyway.

You are welcome, Jônata Tyska Carvalho.

Mark (mark-delta-echo) wrote :

Just upgraded to Ubuntu 16.04 and have the issue.
I can confirm that the workaround of Con Kolivas working Thanks for that!

dpkg -l | grep bluez

I have version: 5.37-0ubuntu5 just like the repository version.
(apt-cache policy bluez)

If this issue is fixed in ver 5.42 in August, when is it expected to appear in the repository?

poet_imp (paul-lemmons) wrote :

The problem persists in 16.10. I was soooooo hoping that this would be resolved by the upgrade. Ubuntu 16.10 is showing version 5.41 as the latest available. Might someone be willing to package 5.42, if that fixes this?

Con Kolivas (kernel-kolivas) wrote :

Confirmed still a problem in 16.10. I still do the ->HSP->A2DP switch every time bluetooth audio connects to get it working.

Confirmed on 16.10 too (bluez 5.41-0ubuntu3) and the script here https://gist.github.com/pylover/d68be364adac5f946887b85e6ed6e7ae#file-a2dp-py does not work anymore for me since the upgrade to 16.10 :(.

Ubuntu 16.10 broke the script because it's parsing some text which changed format.

I've adapted the regexes.

https://gist.github.com/wdullaer/631830bf13e8ecb646567b04acf654f8

This one works for me in 16.10. YMMV

You guys rock, this works for me too :).

Vahid Mardani (vahid-mardani) wrote :

The original gist updated to work with 16.10 also:

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

Jarosław Kilian (jaros1024) wrote :

This script also works for me on Mint 18. Is there any way to run it automatically, after connecting with a bluetooth device?

a2dp.py does not work for me. the bluetooth headset doesn't even show up in the sound control. nothing i do makes it come back. restarting pulseaudio, reloading alsa, reloading module-bluetooth-discover.

the only solution is to reboot.

Sabin Iacob (iacobs) wrote :

in my case I have to do rmmod btusb; modprobe btusb

<rant>
it looks to me like every new release of Ubuntu manages to break Bluetooth audio in some way that is new and creative and ever-increasingly difficult to automate away:
 * 14.10 and before - volume wouldn't be restored, sink wouldn't switch; solved by having a script listen to dbus for a headphone connection event and tell pulseaudio to set the default sink and restore volume
 * 15.04 - no sound unless I disconnected and reconnected again; put that in a script
 * 15.10 - needed to connect manually, but at least the rest worked; solved by having a script look if the phones are connected, do a l2ping to see if they are available and connect; occasionally I'd have to rmmod btusb; modprobe btusb
 * 16.04 - this issue; I only managed to upgrade yesterday, I still haven't found a pattern to this madness
</rant>

Sabin Iacob (iacobs) wrote :

so, in order to get sound I have to:

* start blueman applet (default applet connects to ... something on the headphones, because they say "device connected", but not to some audio thingy, or at least pulseaudio doesn't pick it up unless I use blueman and tell it to connect to the audio sink on the headphones)
* start headphones
* sometimes open sound settings and click on the headphones so the sink shows up - it's listed in sound settings, but doesn't show up in pacmd list-sinks
* run a2dp.py

awesome!

Does anyone have a way to automate this, or at least remotely stab a pulseaudio developer?

Genma (rickard-joh) wrote :

I have this problem with my Jabra halo smart, a2dp.py is a good workaround at the moment. But this need to be fixed.

Uwe Friebe (ufriebe) wrote :

I have this problem with my Plantronics BackBeat. Device is connected, but I can't use it at all.
a2dp.py does not help. It tells me pulseAudio service does not run.

./a2dp.py
Connection MADE
Selecting device:
1. 0C:E0:E4:9E:73:7C PLT_BBTSENSE
2. 98:FD:B4:0D:74:E7 ThinkPad Bluetooth Laser Mouse
Select device[1]:
1
Device MAC: 0C:E0:E4:9E:73:7C
Command: pacmd list-sinks failed with status: 1
stderr: Es läuft kein PulseAudio-Dienst oder nicht als Sessiondienst.

Czikus (czikus-gmail) wrote :

Same problem with Ubuntu 16.04 and Jaybird X3. The workaround in a2dp.py works, but it's an annoying problem. I tried bluez 5.43, and the problem still exists. Are there any ideas on how to fix this problem permanently?

Czikus (czikus-gmail) wrote :

The problem was solved for me by installing pulseaudio 8.0 from sources, without Ubuntu patches. No need to re-connect the headphones or use the workaround script anymore.

lagerimsi (lagerimsi) wrote :

Hi there!

still got this problem with the KDE Neon distribution based upon Ubuntu 16.04.

Solved this problem with a little shell-script based on this thread: http://askubuntu.com/questions/765233/pulseaudio-fails-to-set-card-profile-to-a2dp-sink-how-can-i-see-the-logs-and

The script is attached.

FIRST OF ALL:
Change the devices MAC-address in the variable inside the script! (can be found with "bluetoothctl" --> Device)

- Made a "chmod a-x bluetooth_headphone_reactivation.sh" to make it executable.

For automatic execution _at startup_ (only works if headset is already turned on):

- Added the script to the start/shutdown scripts in KDEs' control panel

For fast manual execution:
- Added an entry to the application-starter (you can also set a keyboad shortcut like "CTRL+ALT+H" and/or pin this starter to the window bar)

DaveQB (david-dward) wrote :

I can add I have this error too now I have upgraded to 16.04.

Thanks Vahid Mardani for the great script!

Emile Heitor (imilnb) wrote :

Same issue in Mint 18.1 (based in Ubuntu 16.04), lagerimsi script works, what also works (more annoying) is to rm -rf ~/.config/pulse, pulseaudio -k, pair the headphones, launch volume control -> Hardware and pick a2dp sync for the headphone.
Lennartware at its best.

UBUNTU user (self.dispose) wrote :

confirm issue on UBUNTU 16.04 with pulseaudio 8.0
Vahid Mardani's script is a valid temporary workaround by running it every time the bug appear

tags: added: a2dp
Changed in bluez (Ubuntu):
importance: Medium → High
Changed in pulseaudio (Ubuntu):
importance: Medium → High
Changed in pulseaudio (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Daniel van Vugt (vanvugt) wrote :

We are working to backport some fixes to Ubuntu 16.04 in this area, and this bug might be related...

On that note, can anyone confirm if Ubuntu 17.04 (pulseaudio 10.0) has fixed this bug?

Changed in bluez (Ubuntu):
status: Confirmed → Incomplete
Changed in pulseaudio (Ubuntu):
status: Confirmed → Incomplete
Pavel Novak (pavel-innuendo) wrote :

I can confirm, after update to 17.04 I don't have this problem.

I still have the issue with 17.04 :(.

Hello Daniel,

I've just updated my Ubuntu to 17.04, and it seems to be fine now. I can
now stop the bluetooth or reboot and have the system automatically
reconnected to my BT speaker in A2DP mode.

-- Brice

Le 29/05/17 à 11:30, Daniel van Vugt a écrit :
> We are working to backport some fixes to Ubuntu 16.04 in this area, and
> this bug might be related...
>
> On that note, can anyone confirm if Ubuntu 17.04 (pulseaudio 10.0) has
> fixed this bug?

Daniel van Vugt (vanvugt) wrote :

Frandeboeuf Nicolas,

Could you please provide a copy of /var/log/syslog from the machine you still have trouble with?

I am sorry, I just checked by launching "tail -f /var/log/syslog" and then switching on my bluetooth headset, here is what appears:

May 30 08:15:21 desktop pulseaudio[1504]: [pulseaudio] module-bluez5-device.c: Default profile not connected, selecting off profile

So I guess I have another issue. I know this is not the place, but if you happen to know where I should start looking for, I have no idea…

Thanks

Daniel van Vugt (vanvugt) wrote :
Elmar Isele (elmar-isele) wrote :

Hello Daniel,

have the same issue after returning from suspend with my bluetooth a2dp compatible headset.

See /var/log/syslog attached, please.

Daniel van Vugt (vanvugt) wrote :

coyote: What Ubuntu release are you using? (run: lsb_release -a)

Elmar Isele (elmar-isele) wrote :

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Elmar Isele (elmar-isele) wrote :

my workaround is to switch from a2dp mode to headset, reconnect the device to get a sink....

GreyBox (grey-box) wrote :

Hi Daniel,

>> On that note, can anyone confirm if Ubuntu 17.04 (pulseaudio 10.0) has fixed this bug?
I can confirm that unfortunately fresh Ubuntu 17.04 has this bug on my laptop.

lsb_release -a
Release: 17.04
(last updates using apt dist-upgrade)

lspci | grep Ath
04:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
06:00.0 Ethernet controller: Qualcomm Atheros Killer E2400 Gigabit Ethernet Controller (rev 10)

headphone:
Jabra Talk

grep blue /var/log/syslog
pulseaudio[1443]: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected

script (temporary) fixes this issue:
https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197/comments/34

Daniel van Vugt (vanvugt) wrote :

GreyBox: Please log a separate bug. You appear to have a different problem...

Changed in pulseaudio (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
Daniel van Vugt (vanvugt) wrote :

OK. This bug is way oversubscribed and is getting confused by too many people reporting problems that are not actually this bug.

It seems generally people using 17.04 either report this bug is fixed, or are reporting different bugs.

So consider this one Fix Released for 17.04. I understand 16.04 is still suffering though, so will nominate xenial for additional future fixes.

Everyone: If you continue to experience problems with the error "TryAcquire() failed - Operation Not Authorized" then you can comment here. We know it still happens in 16.04 but are interested to hear if it can still happen in 17.04. If you experience any problems that are not "TryAcquire() failed - Operation Not Authorized" then please log a separate bug...

Changed in bluez (Ubuntu):
status: Incomplete → Fix Released
Changed in pulseaudio (Ubuntu):
status: Incomplete → Fix Released
Zeppe (giuseppe-passino) wrote :

Im still experiencing this problem on Ubuntu 17.10 (very infrequently). I'm getting:

[pulseaudio] bluez5-util.c: Transport TryAcquire() failed for transport /org/bluez/hci0/dev_00_0C_8A_86_6A_94/fd0 (Operation Not Authorized)

often even in between 2 videos on youtube. This will freeze any video playing btw. I can resolve with `pulseaudio -k` and repairing the bluetooth device.

Changed in bluez (Ubuntu):
status: Fix Released → Confirmed
Changed in pulseaudio (Ubuntu):
status: Fix Released → Confirmed
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.