Bluetooth audio devices/profiles are missing after logging in from GDM
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PulseAudio |
New
|
Unknown
|
|||
gdm |
Fix Released
|
Unknown
|
|||
gdm3 (Debian) |
New
|
Unknown
|
|||
gdm3 (Ubuntu) |
Fix Released
|
High
|
Will Cooke |
Bug Description
This is actually a PulseAudio bug, but the workaround is to disable Bluetooth audio in GDM.
Further discussion (and the source of my understanding about this issue) upstream are here:
https:/
To summarise:
GDM opens the A2DP profile for a11y purposes to allow screenreaders to output over BT audio devices. However Pulse doesn't release those devices when no audio is being played and the upshot is that once in the users session A2DP is not available for any Bluetooth audio devices, this means that you can only use the low quality profile HSP/HFP.
There is a proposed workaround, but this means that a11y tools which need to output audio won't be able to use Bluetooth devices within GDM.
I think that for 17.10 shipping this work-around is acceptable, and we should revisit in the 18.04 cycle to try and get a proper fix in PA. The suggested PA bug is:
https:/
but that hasn't seen movement since 2012.
= The work around =
From the Debian wiki: https:/
Disable the Bluetooth sink in the GDM PA daemon.
Add this to /var/lib/
#!/usr/
#
# load system wide configuration
.include /etc/pulse/
### unload driver modules for Bluetooth hardware
.ifexists module-
unload-module module-
.endif
.ifexists module-
unload-module module-
.endif
I have tested this, and I can confirm that it allows access to A2DP again in the user session.
Related branches
- Jeremy Bícha: Approve
- Daniel van Vugt: Approve
-
Diff: 71 lines (+40/-0)4 files modifieddebian/changelog (+13/-0)
debian/default.pa (+17/-0)
debian/gdm3.install (+3/-0)
debian/gdm3.postinst (+7/-0)
affects: | gdm → pulseaudio |
Changed in gdm3 (Debian): | |
status: | Unknown → New |
Changed in pulseaudio: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in gdm3 (Ubuntu): | |
importance: | Undecided → High |
Changed in gdm: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
summary: |
- Disable Bluetooth sink in GDM to allow A2DP in the user session + Bluetooth audio devices/profiles are missing after logging in from GDM |
Changed in pulseaudio (Ubuntu): | |
importance: | Undecided → High |
status: | Confirmed → Triaged |
Changed in gdm3 (Ubuntu): | |
status: | Confirmed → Triaged |
Changed in gdm3 (Ubuntu): | |
assignee: | nobody → Will Cooke (willcooke) |
status: | Triaged → Fix Committed |
Changed in gdm3 (Ubuntu Xenial): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in gdm3 (Ubuntu Zesty): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in pulseaudio (Ubuntu Xenial): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in pulseaudio (Ubuntu Zesty): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in gdm: | |
status: | Confirmed → Expired |
Changed in pulseaudio: | |
status: | Confirmed → Unknown |
tags: | added: a2dp |
no longer affects: | gdm3 (Ubuntu Zesty) |
no longer affects: | pulseaudio (Ubuntu Zesty) |
Changed in gdm: | |
importance: | Medium → Unknown |
status: | Expired → Unknown |
Changed in pulseaudio: | |
importance: | Medium → Unknown |
no longer affects: | bluez (Ubuntu Xenial) |
no longer affects: | gdm3 (Ubuntu Xenial) |
no longer affects: | pulseaudio (Ubuntu Xenial) |
Changed in bluez (Ubuntu): | |
status: | New → Confirmed |
Changed in pulseaudio: | |
status: | Unknown → New |
Changed in gdm: | |
status: | Unknown → Fix Released |
In module- bluetooth- device. c in filter_cb() there's this piece of code:
if (acquire) acquire( u, FALSE) >= 0) {
pa_source_ suspend( u->source, FALSE, PA_SUSPEND_ IDLE|PA_ SUSPEND_ USER);
if (bt_transport_
if (u->source)
if (u->sink)
pa_sink_ suspend( u->sink, FALSE, PA_SUSPEND_ IDLE|PA_ SUSPEND_ USER);
}
The acquire variable is set to true if the bluetooth audio state changed to "playing". This can happen without pulseaudio requesting it, so if we want to have strict equivalence "sink/source suspended" == "audio state is 'playing'" (and I think we want that), then it makes sense that module- bluetooth- device unsuspends the sink/source. The problem here is that there's no clean "force unsuspend" mechanism in pulseaudio. pa_sink_ suspend( u->sink, FALSE, PA_SUSPEND_ IDLE|PA_ SUSPEND_ USER) may not actually unsuspend the sink, because there are also other suspend reasons than just IDLE and USER. So, depending on the situation, the sink may or may not get unsuspended.
module- bluetooth- device could list all possible reasons in the pa_sink_suspend() call, but that would be ugly. When adding new suspend reasons, it would be very easy to forget to update the pa_sink_suspend() call in module- bluetooth- device, and besides, if those suspend reasons are originally set by some other code, the original reasons to suspend don't really disappear when module- bluetooth- device unsuspends the sink, the old reasons are just overridden.
I think there should be a function for forcing unsuspending. The semantics would be such that the sink gets unsuspended regardless of any standing suspend reasons, but all standing suspend reasons would be remembered, and once a new suspend request would be made, the forced unsuspend would cease to have effect, the sink would suspend and things would return to normal.
A related thing is that I would like to replace the single suspend reason bitfield in pa_sink with an individual suspend request object for each suspend request. The single suspend reason bitfield is prone to conflicts if multiple places use the same reason (for example, module- bluetooth- device uses the USER reason which is also used for other purposes).