My bluetooth headphones keep disconnecting and reconnecting after a few minutes

My headset seemingly randomly disconnects and reconnects to the system after a few seconds.

OS: Nobara Linux 40 x86_64
DE: GNOME 46.4 (Wayland)
Kernel: 6.10.7-200.fsync.fc40.x86_64

systemctl output when event happens:

wireplumber[3196]: spa.bluez5.sink.media: 0x56358cf44fa8: error 24
kernel: Bluetooth: hci0: Invalid exception type 04
bluetoothd[1086]: src/profile.c:ext_io_disconnected() Unable to get io data for Hands-Free Voice gateway: getpeername: Transport endpoint is not connected (107)
wireplumber[3196]: spa.bluez5: Failed to release transport /org/bluez/hci0/dev_38_18_4C_FA_2F_65/fd6: Method "Release" with signature "" on interface "org.bluez.MediaTransport1" doesn't exist
gsd-media-keys[3484]: Unable to get default sink
gsd-media-keys[3484]: gvc_mixer_card_get_index: assertion 'GVC_IS_MIXER_CARD (card)' failed
[same error many times]
bluetoothd[1086]: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Host is down
kernel: Bluetooth: hci0: Invalid exception type 03
kernel: Bluetooth: hci0: Invalid exception type 03
kernel: input: WH-1000XM3 (AVRCP) as /devices/virtual/input/input21
systemd-logind[1156]: Watching system buttons on /dev/input/event14 (WH-1000XM3 (AVRCP))
gsd-media-keys[3484]: gvc_mixer_card_get_index: assertion 'GVC_IS_MIXER_CARD (card)' failed
[same error many times]
bluetoothd[1086]: /org/bluez/hci0/dev_38_18_4C_FA_2F_65/fd7: fd(40) ready
gsd-media-keys[3484]: gvc_mixer_card_get_index: assertion 'GVC_IS_MIXER_CARD (card)' failed
[same error many times]
gsd-media-keys[3484]: Couldn't match the portless stream (with card) - 'WH-1000XM3' is it an input ? -> 1, streams card id -> 964
spotify[7275]: App Name is not available when using Portal Notifications

I’m using the Sony WH1000XM3 headset and AX200 Bluetooth/WiFi chip.

So far I’ve uncommented DiscoverableTimeout = 0 in etc/bluetooth/main.conf , will update if that ends up being the fix (doubt).

I’ve already done a lot of googling and a bit of reading, but if a Bluetooth wizard has any troubleshooting steps to try lmk :slight_smile:

While we do support fedora and Nobara is based on fedora, this is not the place to ask for assistance when using Nobara. There are significant changes (including kernel and some drivers) between the stock fedora system and that provided by Nobara so we cannot assist.

Asking us for assistance seems similar to asking on a debian channel for support with Ubuntu or Mint. Many differences are in effect.

Please ask on the Nobara support channels.

1 Like

Added nobara

I’m pretty sure this error happen on Fedora, too, as they both use bluez and PipeWire.

I think I found a workaround. Just in case someone else has this issue, the issue (may have been; still investigating) PipeWire/WirePlumber automatically switching between the HSP/HFP and A2DP profiles.

Philips article on HSP/HFP/A2DP

Basically the solution (assuming you’re using it as earphones and are OK with the mic being unusable) is to disable the automatic switching

https://wiki.archlinux.org/title/PipeWire#Bluetooth_devices 3.1.4.1; quote:

WirePlumber has profile auto-switching enabled by default. It can automatically switch between HSP/HFP and A2DP profiles whenever an input stream is detected. You can disable it with:

/etc/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf (or ~/.config/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf)

wireplumber.settings = {
    bluetooth.autoswitch-to-headset-profile = false
}

And another option I’ll try if it happens again:

https://wiki.archlinux.org/title/Bluetooth_headset#Disable_PipeWire_HSP/HFP_profile 3.4

Unlike PulseAudio, PipeWire does not automatically switch between A2DP and HSP/HFP in response to input events. However, rather than to enable automatically switching to the (lower audio quality) HSP/HFP profile if A2DP fails, you may prefer to disable the former altogether. To do so, create or edit a bluez configuration as shown below.

Note: HSP mode is required for built-in microphones to work [9].
/etc/wireplumber/wireplumber.conf.d/51-mitigate-annoying-profile-switch.conf (or ~/.config/wireplumber/wireplumber.conf.d/51-mitigate-annoying-profile-switch.conf)

## In WirePlumber there's a bug where some applications trigger switching to Headset Profile
## --
## See issue #634, #645, #630, #629, #613
## --
## This config mitigates the issue by completely disabling the switching and support for Headset Profile (HFP)
## Using this would only make sense if you never plan on using the microphone that comes with your headset.

wireplumber.settings = {
  ## Whether to use headset profile in the presence of an input stream.
  ## --
  ## Disable for now, as it causes issues. See note at the top as to why.
  bluetooth.autoswitch-to-headset-profile = false
}

monitor.bluez.properties = {
  ## Enabled roles (default: [ a2dp_sink a2dp_source bap_sink bap_source hfp_hf hfp_ag ])
  ##
  ## Currently some headsets (Sony WH-1000XM3) are not working with
  ## both hsp_ag and hfp_ag enabled, so by default we enable only HFP.
  ##
  ## Supported roles: hsp_hs (HSP Headset),
  ##                  hsp_ag (HSP Audio Gateway),
  ##                  hfp_hf (HFP Hands-Free),
  ##                  hfp_ag (HFP Audio Gateway)
  ##                  a2dp_sink (A2DP Audio Sink)
  ##                  a2dp_source (A2DP Audio Source)
  ##                  bap_sink (LE Audio Basic Audio Profile Sink)
  ##                  bap_source (LE Audio Basic Audio Profile Source)
  ## --
  ## Only enable A2DP here and disable HFP. See note at the top as to why.
  bluez5.roles = [ a2dp_sink a2dp_source ]
}

As suggested in this comment on the Wireplumber issue tracker.

Edit. Nope, still broke. From what I’m seeing I just have to keep troubleshooting. May have something to do with dual-boot Bluetooth - ArchWiki

Edit: still nope. Ended up just buying a new headset :confused: