MISC-49: Seinnheiser HD 450BT Bluetooth audio issues on Linux



Issue Information

Issue Type: Bug
 
Priority: Major
Status: Open

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Miscellaneous (MISC)
Resolution: Unresolved

Created: 2021-08-03 09:42:09
Time Spent Working


Description
I have an issue with my HD 405BT (https://assets.sennheiser.com/global-downloads/file/14814/HD_450BT_Manual_EN.pdf) headpones

I've found that when I'm using the headset as an A2DP sink to listen to music, it periodically drops to HSP/HFP. pavucontrol shows A2DP as Unavailable and I have to disconnect and reconnect the headset to get it back for a bit.

HSP/HFP audio quality is dire - not entirely unexpected as, by design, it's lower quality than A2DP (which is only 1 way - no mic).

It is possible to have better quality HSP/HFP audio (although not to A2DP levels), but it seems that PulseAudio is quite stubbornly behind the curve though - https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/776

I've ordered a USB bluetooth soundcard to avoid having to use pavucontrol to switch the headset profile when I went to go on a call, but in the meantime want to try and get to the bottom of this (if I can fix it, I might just set up an software toggle, or try and get PA's auto-toggle working).

dmesg doesn't show much
[Tue Aug  3 09:29:52 2021] input: HD 450BT (AVRCP) as /devices/virtual/input/input94
[Tue Aug  3 09:29:53 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:29:53 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:29:53 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:29:53 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:29:53 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:30:43 2021] Bluetooth: hci0: SCO packet for unknown connection handle 257
[Tue Aug  3 09:31:48 2021] input: HD 450BT (AVRCP) as /devices/virtual/input/input95


As well as the audio quality issues, I had other issues whilst on a Zoom call yesterday.

At first, my headset wasn't available for use (headset was showing as connected in Bluezman). So, I gave up and plugged in a wired headset. Midway through the call, it suddenly switched an my HD450BT came into use.

A little while later, the headset dropped into A2DP so the mic input moved to my wired headset, leaving me in the ridiculous position of holding a headset up to my face to use the mic.

I would guess that's related though - the result of it disconnecting/reconnecting, with PA then trying to adjust config as a result.


---------------------------------------------------------------------

Installed versions

OS:
root@bumblebee:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute


Software:
root@bumblebee:/home/ben# dpkg --list | egrep -e 'Pulse|blue'
ii  bluedevil                                     4:5.21.4-0ubuntu1                                                    amd64        KDE Bluetooth stack
ii  bluez                                         5.56-0ubuntu4.1                                                      amd64        Bluetooth tools and daemons
ii  bluez-cups                                    5.56-0ubuntu4.1                                                      amd64        Bluetooth printer driver for CUPS
ii  bluez-obexd                                   5.56-0ubuntu4.1                                                      amd64        bluez obex daemon
ii  gstreamer1.0-pulseaudio:amd64                 1.18.4-1ubuntu1                                                      amd64        GStreamer plugin for PulseAudio (transitional package)
ii  libbluetooth3:amd64                           5.56-0ubuntu4.1                                                      amd64        Library to use the BlueZ Linux Bluetooth stack
ii  libcanberra-pulse:amd64                       0.30-7ubuntu2                                                        amd64        PulseAudio backend for libcanberra
ii  libkf5bluezqt-data                            5.80.0-0ubuntu1                                                      all          data files for bluez-qt
ii  libkf5bluezqt6:amd64                          5.80.0-0ubuntu1                                                      amd64        Qt wrapper for bluez
ii  libkf5pulseaudioqt2:amd64                     1.2-2build1                                                          amd64        Pulseaudio bindings library for Qt
ii  libopenconnect5:amd64                         8.10-2build1                                                         amd64        open client for Cisco AnyConnect, Pulse, GlobalProtect VPN - shared library
ii  libpulse-mainloop-glib0:amd64                 1:14.2-1ubuntu1                                                      amd64        PulseAudio client libraries (glib support)
ii  libpulse0:amd64                               1:14.2-1ubuntu1                                                      amd64        PulseAudio client libraries
ii  libpulsedsp:amd64                             1:14.2-1ubuntu1                                                      amd64        PulseAudio OSS pre-load library
ii  pulseaudio                                    1:14.2-1ubuntu1                                                      amd64        PulseAudio sound server
ii  pulseaudio-module-bluetooth                   1:14.2-1ubuntu1                                                      amd64        Bluetooth module for PulseAudio sound server
ii  pulseaudio-module-gsettings                   1:14.2-1ubuntu1                                                      amd64        GSettings module for PulseAudio sound server
ii  pulseaudio-utils                              1:14.2-1ubuntu1                                                      amd64        Command line tools for the PulseAudio sound server
ii  qml-module-org-kde-bluezqt:amd64              5.80.0-0ubuntu1                                                      amd64        QML wrapper for bluez


Hardware
lshw doesn't show much:
                   description: Bluetooth wireless interface
                   vendor: Intel Corp.
                   physical id: a
                   bus info: usb@3:a
                   version: 0.02
                   capabilities: bluetooth usb-2.01
                   configuration: driver=btusb maxpower=100mA speed=12Mbit/s


lspci shows a little more though
00:14.3 Network controller [0280]: Intel Corporation Wi-Fi 6 AX201 [8086:a0f0] (rev 20)
        Subsystem: Intel Corporation Wi-Fi 6 AX201 [8086:0070]
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi


The AX201 is integrated Wi-Fi and Bluetooth (https://ark.intel.com/content/www/us/en/ark/products/130293/intel-wi-fi-6-ax201-gig.html)


Attachments

Toggle State Changes

Activity


I've said this before, so I'll start by saying it again: Fuck PulseAudio. Sideways.

Apparently, it's taken issue with that - as I finished that sentence my headset has again dropped A2DP
[Tue Aug  3 09:43:26 2021] input: HD 450BT (AVRCP) as /devices/virtual/input/input96
[Tue Aug  3 09:43:27 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:43:27 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:43:27 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0
[Tue Aug  3 09:43:27 2021] Bluetooth: hci0: SCO packet for unknown connection handle 0

btasker added 'Screenshot_20210803_094535.png' to Attachments
JournalD shows a bit more activity around that time
Aug 03 09:38:03 bumblebee systemd[1]: Started Hostname Service.
Aug 03 09:38:33 bumblebee systemd[1]: systemd-hostnamed.service: Succeeded.
Aug 03 09:42:10 bumblebee systemd[1]: Starting Daily apt download activities...
Aug 03 09:42:14 bumblebee PackageKit[1978]: get-updates transaction /107_aeaceeea from uid 1000 finished with success after 889ms
Aug 03 09:42:25 bumblebee systemd[1]: apt-daily.service: Succeeded.
Aug 03 09:42:25 bumblebee systemd[1]: Finished Daily apt download activities.
Aug 03 09:43:25 bumblebee dbus-daemon[834]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.206" (uid=1000 pid=27410 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo" label="unconfined") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.2" (uid=0 pid=831 comm="/usr/lib/bluetooth/bluetoothd " label="unconfined")
Aug 03 09:43:25 bumblebee acpid[823]: input device has been disconnected, fd 25
Aug 03 09:43:25 bumblebee bluetoothd[831]: src/profile.c:ext_io_disconnected() Unable to get io data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)
Aug 03 09:43:26 bumblebee bluetoothd[831]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 00:1B:66:C8:C9:CA: Device or resource busy
Aug 03 09:43:26 bumblebee bluetoothd[831]: plugins/policy.c:reconnect_timeout() Reconnecting services failed: Operation already in progress (114)
Aug 03 09:43:27 bumblebee bluetoothd[831]: profiles/audio/a2dp.c:a2dp_select_capabilities() Unable to select SEP
Aug 03 09:43:27 bumblebee kernel: input: HD 450BT (AVRCP) as /devices/virtual/input/input96
Aug 03 09:43:27 bumblebee systemd-logind[859]: Watching system buttons on /dev/input/event30 (HD 450BT (AVRCP))
Aug 03 09:43:28 bumblebee acpid[823]: input device has been disconnected, fd 25
Aug 03 09:43:28 bumblebee rtkit-daemon[1252]: Supervising 19 threads of 6 processes of 1 users.
Aug 03 09:43:28 bumblebee rtkit-daemon[1252]: Successfully made thread 40929 of process 27410 owned by '1000' RT at priority 5.
Aug 03 09:43:28 bumblebee rtkit-daemon[1252]: Supervising 20 threads of 6 processes of 1 users.
Aug 03 09:43:28 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
Aug 03 09:43:28 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
Aug 03 09:43:28 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
Aug 03 09:43:28 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 0
Aug 03 09:44:31 bumblebee sudo[40940]:      ben : TTY=pts/3 ; PWD=/home/ben ; USER=root ; COMMAND=/usr/bin/dmesg -T
Aug 03 09:44:31 bumblebee sudo[40940]: pam_unix(sudo:session): session opened for user root by (uid=1000)
Aug 03 09:44:31 bumblebee sudo[40940]: pam_unix(sudo:session): session closed for user root
Aug 03 09:45:50 bumblebee dbus-daemon[834]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.446' (uid=1000 pid=2010 comm=>
Aug 03 09:45:50 bumblebee systemd[1]: Starting Hostname Service...
Aug 03 09:45:50 bumblebee dbus-daemon[834]: [system] Successfully activated service 'org.freedesktop.hostname1'
Aug 03 09:45:50 bumblebee systemd[1]: Started Hostname Service.
Aug 03 09:46:09 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 257
Aug 03 09:46:09 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 257
Aug 03 09:46:09 bumblebee kernel: Bluetooth: hci0: SCO packet for unknown connection handle 257
Aug 03 09:46:09 bumblebee bluetoothd[831]: src/profile.c:ext_io_disconnected() Unable to get io data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)
Aug 03 09:46:20 bumblebee systemd[1]: systemd-hostnamed.service: Succeeded.
Aug 03 09:46:22 bumblebee bluetoothd[831]: /org/bluez/hci0/dev_00_1B_66_C8_C9_CA/sep1/fd5: fd(41) ready
Aug 03 09:46:22 bumblebee rtkit-daemon[1252]: Supervising 19 threads of 6 processes of 1 users.
Aug 03 09:46:22 bumblebee rtkit-daemon[1252]: Successfully made thread 41017 of process 27410 owned by '1000' RT at priority 5.
Aug 03 09:46:22 bumblebee rtkit-daemon[1252]: Supervising 20 threads of 6 processes of 1 users.
Aug 03 09:46:22 bumblebee kernel: input: HD 450BT (AVRCP) as /devices/virtual/input/input97
Aug 03 09:46:22 bumblebee systemd-logind[859]: Watching system buttons on /dev/input/event30 (HD 450BT (AVRCP))
Aug 03 09:46:24 bumblebee sudo[41023]:      ben : TTY=pts/3 ; PWD=/home/ben ; USER=root ; COMMAND=/bin/bash
Aug 03 09:46:24 bumblebee sudo[41023]: pam_unix(sudo:session): session opened for user root by (uid=1000)


Earlier examples look similar, but there's nothing else logging that's common
Aug 03 09:07:59 bumblebee gpg-agent[39223]: listening on: std=5 extra=6 browser=4 ssh=3
Aug 03 09:10:41 bumblebee kernel: usb 3-5.2.4: reset full-speed USB device number 50 using xhci_hcd
Aug 03 09:12:29 bumblebee dbus-daemon[834]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.206" (uid=1000 pid=27410 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo" l>
Aug 03 09:12:29 bumblebee acpid[823]: input device has been disconnected, fd 25
Aug 03 09:12:29 bumblebee bluetoothd[831]: src/profile.c:ext_io_disconnected() Unable to get io data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)
Aug 03 09:12:32 bumblebee bluetoothd[831]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 00:1B:66:C8:C9:CA: Host is down (112)
Aug 03 09:12:34 bumblebee bluetoothd[831]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 00:1B:66:C8:C9:CA: Device or resource busy
Aug 03 09:12:34 bumblebee bluetoothd[831]: plugins/policy.c:reconnect_timeout() Reconnecting services failed: Operation already in progress (114)
Aug 03 09:12:34 bumblebee bluetoothd[831]: profiles/audio/a2dp.c:a2dp_select_capabilities() Unable to select SEP
Aug 03 09:12:34 bumblebee kernel: input: HD 450BT (AVRCP) as /devices/virtual/input/input92
Aug 03 09:12:34 bumblebee systemd-logind[859]: Watching system buttons on /dev/input/event30 (HD 450BT (AVRCP))
Aug 03 09:12:35 bumblebee acpid[823]: input device has been disconnected, fd 25
Later today I've got one of these: https://www.amazon.co.uk/1mii-Bluetooth-Adapter-Transmitter-Headphone/dp/B086L2WNPG/ref=sr_1_6?dchild=1&keywords=1mii+bluetooth+audio&qid=1627980786&sr=8-6 : arriving.

So, the headset won't be paired with the laptop/touch Bluez at all - Pulseaudio will just see a USB soundcard (the button on the front of it is used to switch between HFP and A2DP).
So, I've just spent an hour listening to a training video without a single drop-out.

The video was just someone talking over slides, so incredibly low bandwidth on the audio side of things. I've another video to watch, but I've put some music (much higher bandwidth) on first to see if I get a dropout.

Not that it should matter too much, but in both cases, the audio source is Firefox (music playing in Jamstash, video playing on the training site).
The music lasted about 40 mins (ish) earlier. It's also just died again.
Sounds a lot like this: https://unix.stackexchange.com/questions/575020/bluetooth-keeps-changing-from-a2dp-to-headset-and-loses-connection-on-debian-bus

Unfortunately:
The problem was solved by using another bluetooth adapter. With the "Priva III" from Avantree the connection has not got lost again. It worked right after plugin.


This BlueZ bug also sounds about right: https://github.com/bluez/bluez/issues/102
With 5.56, my Mpow Cheetah headset connects as expected when powered on. However, after a while (maybe an hour), the connection drops out. A few seconds later it comes back, but is locked into HSP mode with very poor audio quality. I am forced to turn the Mpow Cheetah off and back on again, to reconnect in the proper mode.


The version I'm running is right too
ii  bluez                                         5.56-0ubuntu4.1                                                      amd64  


They also list a logline that's common with mine
mars 09 13:14:47 bespin bluetoothd[377]: profiles/audio/a2dp.c:a2dp_select_capabilities() Unable to select SEP


Fix is here - https://github.com/tedd-an/bluez/commit/fac790455a8a2d1fd7973db1fed2f297d67f5d9f

There is an update in the Ubuntu repos to 5.56-0ubuntu4.2, - that's too low, we need 5.58, but installing that and lets see what happens
I've restarted Pulse and the Bluetooth stack to be sure
pulseaudio -k
sudo systemctl restart bluetooth
Unfortunately, no-dice, did it again.

Log entries look the same too
Actually, it's possible that it wouldn't be fixed even if I had 5.58.

There's a bug here: https://github.com/bluez/bluez/issues/130 where a user waited for Manjaro to get 5.58 only for the issue to persist. Like me, they've got an AX201 chipset.

There's some discussion about linux-firmware causing problems for this chipset here:

- https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1155
- https://bugzilla.redhat.com/show_bug.cgi?id=1929434

I'm running the following:
ben@bumblebee:/tmp$ dpkg-query --list linux-firmware
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  linux-firmware 1.197        all          Firmware for Linux kernel drivers


The Ubuntu Errata for this version notes
linux-firmware (1.197) hirsute; urgency=medium

* Intel AX210 Wi-Fi card does not work since updating to 1.196
(LP: #1922406)
- SAUCE: Revert "iwlwifi: add new FWs from core59-66 release"

-- Seth Forshee <email address hidden> Wed, 07 Apr 2021 08:50:11 -0500


And links to the Ubuntu bug - https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1922406

Means I should have the fix.

But, there has been mention that you need to power off and then boot for firmware changes, so is this the version I installed from new or is it a recent update?
root@bumblebee:~# zgrep linux-firmware /var/log/apt/history.log.1.gz | wc -c
64432


It was installed along side a lot of other packages - it's the original install.
Ahh, reading that Ubuntu bug, it's fixing a different issue with the wifi card - the Wi-Fi wasn't working with the previous version.

OK, so that release was made 7 Apr 2021.

Based on the PA thread though, the release we're interested in (i.e. that fixed it for others) is 20210426 with the commit being made here: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=73144e02dcff54529ab42d951de682740d204180 (so still after the Ubuntu version)

As Ubuntu doesn't have anything newer in the repos, I guess the next step is to go out of band.
root@bumblebee:~# wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-20210716.tar.gz
root@bumblebee:~# tar xf linux-firmware-20210716.tar.gz
root@bumblebee:~# tar -cf firmware_backup /lib/firmware/intel
root@bumblebee:~# cd linux-firmware-20210716/
root@bumblebee:~/linux-firmware-20210716# cp intel/ibt-* /lib/firmware/intel/


Need to power off and boot back up now
Boot done
root@bumblebee:~# dmesg | grep firmwa
[    1.457559] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/tgl_dmc_ver2_08.bin (v2.8)
[    1.850777] psmouse serio1: trackpoint: Elan TrackPoint firmware: 0x92, buttons: 3/3
[    8.080743] iwlwifi 0000:00:14.3: loaded firmware version 59.601f3a66.0 QuZ-a0-hr-b0-59.ucode op_mode iwlmvm
[    8.302125] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[    8.302855] Bluetooth: hci0: Found device firmware: intel/ibt-19-0-4.sfi
[    8.498285] r8152 3-5.3:1.0: skip request firmware
[   10.171892] Bluetooth: hci0: Waiting for firmware download to complete


So now we put some music on and wait....

For avoidance of doubt, the headphones have been re-paired to the laptop (I had unpaired them to play around with the 1mii B10)
At risk of jinxing it, it's been fine so far - by far the longest it's gone.
Still fine so far.

However, I've just had a Zoom call, so have just switched to HSP/HFP (at the beginning of the call) and then switched back to A2DP, so that may yet prompt a failure
Still seems good, so lets go one further and see if we can get auto-switching between profile reliably working
ben@bumblebee:~$ cat /etc/pulse/default.pa  | grep bluet
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
ben@bumblebee:~$ sudo nano /etc/pulse/default.pa
ben@bumblebee:~$ cat /etc/pulse/default.pa  | grep bluet
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy auto_switch=2
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
ben@bumblebee:~$ pulseaudio -k


Triggered a Zoom test call with music still playing, worked a charm.

It switched to HSP/HFP while the Zoom call was active, and then when I left the call, went back to A2DP
Continues to be smooth so far.

At risk of immediately triggering the issue: I think we've solved it.
It seems I've spoken too soon :(

When I got into a Zoom call, Pulse correctly switches to HSP/HFP (if there's music still playing it noticeably degrages in quality). BUT, I can't use the headset's mic - it's listed but I can't switch to it in Zoom or in pavucontrol - it just changes back to a different (FWIW, the mic built into my webcam).
It looks like it's the way Zoom grabs available hardware.

If I kill Zoom, manually switch to HSP/HFP in pavucontrol and launch a zoom test call, the mic works fine.

But, if I let auto-switch take me from A2DP to HSP automatically, it doesn't seem to get any input from the mic.

The problem is, I can't seem to just set Zoom to use Same as System either, because pavucontrol won't let me change Zoom's input to HD450BT it just goes back to whatever it had defaulted to (in this case the webcam). If I try and change input in Zoom, pavucontrol shows "Reconnecting to PulseAudio" briefly, suggesting there's either a crash/restart/reload happening in the background.
> The problem is, I can't seem to just set Zoom to use Same as System either, because pavucontrol won't let me change Zoom's input to HD450BT it just goes back to whatever it had defaulted to (in this case the webcam).

Sounds like I'm hitting this: https://github.com/NixOS/nixpkgs/issues/80042

On the original Ubuntu bug (https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/508522) there's
Note that meet + chrome is unusable with auto_switch=2 and bose QC35 II.

I only managed to make it work once when initially investigating the option. I haven't been able to make a single google meet call with chrome ever since I activated that option, I must regularly start firefox specifically for these calls.


Maybe I didn't imagine that first test then....

Let's set auto-switch back to 2 and reboot just to be sure
Nope, that's still a no-go.

When triggering a test call (https://zoom.us/test) the test screen lists the HD450BT, but in pavucontrol we can see Zoom is still using a different mic, you just can't get it to switch over.

Going into Pavucontrol and switching to HSP/HFP before triggering the test call works fine, we end up using the right mic.

I guess Zoom must be doing some kind of lookup/binding when the call first opens but (presumably) generates the mic list dynamically.