Bose QC35 and (Arch) Linux

Tobias Wolter
2 min readFeb 20, 2018

--

So, we had a state of things mostly sort of working all the time for some while in our little Linux desktop world.

Then we kind of decided that while things are sort of working, they’re very rigid in the way they’re working. So now things are breaking a lot again as we’re trying to figure out how to deal with it, and some solutions tend to be a bit misguided for some people.

(You know, that’s essentially the systemd debate in a nutshell.)

Which leads us to the fact that you might have run into the problem of the GNOME Display Manager blocking you from using your Bluetooth headphones correctly.

The reason is a pretty simple one: for some reason or another, gdm actually spawns a pulseaudio instance.

I’m assuming it’s some conflagration of current GNOME/gdm shenanigans with Wayland and the way it works; the gdm user starts a more or less complete XDG session which includes some PulseAudio by the way of /etc/xdg/autostart/pulseaudio.desktop.

This isn’t that much of an issue usually, as your local devices readily cohabitate with multiple PulseAudio instances. But the sessions for the HFP and A2DP Bluetooth profiles are single-instance things; thus, GDM will happily gobble up your A2DP Bluetooth connection because you might want to log in with the accessibility service reading the screen for you.

The common “fuck this” solution to this problem is the pragmatic approach:

setfactl -m u:gdm:r /usr/bin/pulseaudio

You know… it works, as usual. It’s just not nice.

So some people are just dropping in user configuration files for PulseAudio and shimming away Bluetooth:

$ cat /var/lib/gdm/.config/pulse/default.pa
#!/usr/bin/pulseaudio -nF
# load system wide configuration
.include /etc/pulse/default.pa
### unload driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
unload-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
unload-module module-bluetooth-discover
.endif

In Arch, you can just grab pulseaudio-bluetooth-a2dp-gdm-fix from the AUR.

There is some old stuff for dropping autospawn = no in a client configuration (/var/lib/gdm/.pulse/client.conf) for the GDM user, but that doesn’t gel with the current way it’s called ATM. For that, you could probably disable the systemd user service pulseaudio for the user gdm, but I haven’t tested that. (Try accessing another users’ systemd ‘user’ instance, good luck.)

Sadly, the GNOME Autostart documentation shows no option to selectively disable this for service users; the XDG Autostart specification is likewise pretty unhelpful in that regard.

So what one would like to see at some point: GDM, recognizing it doesn’t need any kind of audio because the user isn’t even looking at it, drops usage of “locking” input, so it can easily jump onto non-locking input or smurf the Bluetooth connection as soon as it’s foregrounded.

Problem with this rough sketch, of course, is that if the user is already using A2DP, the GDM can’t grab it peacefully. On the other hand, having to switch users on a machine while using Bluetooth A2DP audio with headphones shared by both users is a pretty fringe case. (Here’s looking at me with seperate private and work users.)

Long story short: wat.

--

--