Can't reconnect to paired Bluetooth devices after toggling BT unless I re-pair

I have a slightly strange issue where paired Bluetooth devices will fail to reconnect once the Bluetooth module is toggled (disable->enable) unless I unpair and re-pair them.

Reproduction steps:

  1. Pair headset with laptop, verify it works
  2. Disconnect and reconnect in the settings panel, verify it works
  3. Turn off Bluetooth, wait a couple of seconds, turn on Bluetooth
  4. Attempt connecting to the previous headset
  5. Observe connection failure

When the connection fails, the spinner in the Bluetooth panel spins for 20~30 seconds and then displays the following:

image

On running journalctl -xeu bluetooth I don’t see anything of note:

// ... truncated ...
Mar 09 11:58:59 wendy bluetoothd[1350]: Endpoint unregistered: sender=:1.32 path=/MediaEndpoint/A2DPSource/faststream
Mar 09 11:58:59 wendy bluetoothd[1350]: Endpoint unregistered: sender=:1.32 path=/MediaEndpoint/A2DPSource/faststream_duplex
Mar 09 11:58:59 wendy bluetoothd[1350]: Endpoint unregistered: sender=:1.32 path=/MediaEndpoint/A2DPSink/opus_05
Mar 09 11:58:59 wendy bluetoothd[1350]: Endpoint unregistered: sender=:1.32 path=/MediaEndpoint/A2DPSource/opus_05
Mar 09 11:58:59 wendy bluetoothd[1350]: Endpoint unregistered: sender=:1.32 path=/MediaEndpoint/A2DPSink/opus_05_duplex
Mar 09 11:58:59 wendy bluetoothd[1350]: Endpoint unregistered: sender=:1.32 path=/MediaEndpoint/A2DPSource/opus_05_duplex
Mar 09 11:58:59 wendy bluetoothd[1350]: Battery Provider Manager destroyed
Mar 09 11:59:01 wendy bluetoothd[1350]: Battery Provider Manager created
Mar 09 11:59:01 wendy bluetoothd[1350]: src/device.c:device_set_wake_support() Unable to set wake_support without RPA resolution
Mar 09 11:59:01 wendy bluetoothd[1350]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSource/ldac
Mar 09 11:59:01 wendy bluetoothd[1350]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSink/aptx_hd
Mar 09 11:59:01 wendy bluetoothd[1350]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSource/aptx_hd
Mar 09 11:59:01 wendy bluetoothd[1350]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSink/aptx
Mar 09 11:59:01 wendy bluetoothd[1350]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSource/aptx
// ... truncated ...

This is what shows up in dmesg:

[11911.994054] Bluetooth: hci0: Waiting for firmware download to complete
[11911.994393] Bluetooth: hci0: Firmware loaded in 1753915 usecs
[11911.994577] Bluetooth: hci0: Waiting for device to boot
[11912.007576] Bluetooth: hci0: Device booted in 12856 usecs
[11912.007651] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-12-16.ddc
[11912.010587] Bluetooth: hci0: Applying Intel DDC parameters completed
[11912.011567] Bluetooth: hci0: Firmware revision 0.1 build 19 week 44 2021
[11912.013575] Bluetooth: hci0: Reading supported features failed (-16)
[11912.013596] Bluetooth: hci0: Error reading debug features
[11912.013623] Bluetooth: hci0: HCI LE Coded PHY feature bit is set, but its usage is not supported.
[11912.066355] Bluetooth: MGMT ver 1.23

If I remove the device and re-pair it, it connects fine, audio plays, etc.
image

This is affecting the two headsets I’ve managed to test with (Buds2 Pro and WH-1000XM5). I’m using a ThinkPad T480 with the “Intel Corporation Wireless 8265 / 8275 (rev 78)” card according to lspci. I’m planning to install Windows and some other distro on a separate partition and verify whether this issue persists, but was wondering if anybody else ran into this issue in the meantime. Any replies would be appreciated!

So this appears to be a Linux issue, not a NixOS-specific issue.

I tested on Windows 11 and BT functioned as I expected it to. I then booted up a copy of Linux Mint and observed the same behavior.

Interestingly the kernel there gave me some more debug and error messages:

[  227.800732] Bluetooth: hci0: Bootloader revision 0.0 build 26 week 38 2015
[  227.801665] Bluetooth: hci0: Device revision is 16
[  227.801672] Bluetooth: hci0: Secure boot is enabled
[  227.801675] Bluetooth: hci0: OTP lock is enabled
[  227.801678] Bluetooth: hci0: API lock is enabled
[  227.801681] Bluetooth: hci0: Debug lock is disabled
[  227.801683] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[  227.811738] Bluetooth: hci0: Found device firmware: intel/ibt-12-16.sfi
[  229.704576] Bluetooth: hci0: Waiting for firmware download to complete
[  229.704718] Bluetooth: hci0: Firmware loaded in 1848598 usecs
[  229.705015] Bluetooth: hci0: Waiting for device to boot
[  229.717720] Bluetooth: hci0: Device booted in 12586 usecs
[  229.717746] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[  229.720080] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-12-16.ddc
[  229.722814] Bluetooth: hci0: Applying Intel DDC parameters completed
[  229.723763] Bluetooth: hci0: Firmware revision 0.1 build 19 week 44 2021
[  229.725805] Bluetooth: hci0: Reading supported features failed (-16)
[  229.725821] Bluetooth: hci0: Error reading debug features
[  229.725831] Bluetooth: hci0: HCI LE Coded PHY feature bit is set, but its usage is not supported.
[  229.778571] Bluetooth: MGMT ver 1.22
[  229.834529] Bluetooth: hci0: Invalid link address type 1 for b0:54:76

The Linux Mint kernel was 6.8.0-51-generic, while I’m running 6.13.5 on NixOS. It appears that the Intel BT driver on Linux is faulty going back to 6.8.0 (and possibly before)…

Do you have fast boot enabled in windows? That can mess with hardware like wifi and bt cards.

I only installed Windows on a separate boot partition to confirm that it wasn’t a problem on Windows. This has been going on without Windows ever since I installed NixOS.

1 Like