Linux/Airpods Pro Headset mode not working of Fedora38 - Don't forget about Bluetooth adapter firmware! Also fix helvum breakage.

After getting a pair of Airpods Pro and connecting them to Fedora 38 computer I found that I could use them as "headphones" but not as a "handset". Pairing was easy using the utility bluetoothctl - put the airpods in pairing mode, run bluetoothctl and then issue the "pair" command giving the proper hex string e.g. as in https://meroupatate.github.io/posts/airpods/.

Once this is done, the "headphone" device as well as the "handsfree" device shows up in the Sound section of "Settings" and can be selected but the this doesn't result in the airpods being able to do anything useful in handsfree mode.

In theory, the problem could be in the Linux Software Sound stack (some combination of  Pipewire, Pulse Audio, Alsa),  or with the various codecs installed on the system.  Most of the resources on the internet focus here. Since I'm on Fedora 38 Pipewire is well established. One other wrinkle about this is that somewhere in the Fedora 36, 37 timeframe it seems that pipewire-media-session was replaced by pipewire wireplumber so some of the online guides could lead you down a rabbit hole chasing ghosts related to pipewire-media-session whereas once you're on Fedora 38 there is zero need to focus there.

In any case I tried a lot of things related to pipewire and pipewire-pulseaudio packages as well as various systemctl commands relating to pipewire services. None of this changed a thing.

Finally I found this website https://www.thetestspecimen.com/posts/broadcom-bluetooth-fedora/ which basically described my exact issue. Basically I hadn't even bothered to remember that the bluetooth adapter (or dongle) was part of the complete picture. In my case I have a Techkey bluetooth dongle which is powered by a Broadcom  BCM20702B0 chip. As the above website suggests the dmesg logs show clearly that the firmware doesn't load because of file not found.

For example in my case:

[   26.054642] Bluetooth: hci0: BCM: firmware Patch file not found, tried:

[   26.054648] Bluetooth: hci0: BCM: 'brcm/BCM20702B0-19ff-0239.hcd'

[   26.054651] Bluetooth: hci0: BCM: 'brcm/BCM-19ff-0239.hcd'

As the above website suggests you head over to https://github.com/winterheart/broadcom-bt-firmware, clone that repo, grab the firmware file for your chip (in my case 'BCM20702B0-19ff-0239.hcd') which is placed in /lib/firmware/brcm. You then unplug and reinsert the dongle, check dmesg again, see that this time the firmware has properly loaded and now voila! everything works. 

I think the mistake is to forget that the bluetooth adapter or dongle is part of the equation and to check the dmesg logs which is probably worth doing when faced with any such issue. 

As a bonus tip, I was getting panics from helvum with messages like 

[W][40946.098386] pw.conf      | [          conf.c: 1005 try_load_conf()] can't load config client.conf: No such file or directory

[E][40946.099041] pw.conf      | [          conf.c: 1029 pw_conf_load_conf_for_context()] can't load config client.conf: No such file or directory

thread '<unnamed>' panicked at 'Failed to create context: CreationFailed', src/pipewire_connection.rs:49:43

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' panicked at 'Pipewire thread panicked: Any { .. }', src/main.rs:128:22


This comes about because (in Fedora anyway) the location of the Pipewire config files has moved and helvum isn't aware of this change. The fix is simple - grab a config file from https://github.com/PipeWire/pipewire/blob/master/src/daemon/client.conf.in and place it in ~/.config/pipewire/client.conf. Problem goes away.


Comments

Popular posts from this blog

Hit failing alternator with a hammer to confirm diagnosis of failing alternator due to bad brushes

alternatives --install gets stuck: failed to read link: No such file or directory

Using SSH, SOCKS, tsocks, and proxy settings to create a simultaneous "dual use" work/home computer