Audio device does not switch to bluetooth earbuds/headset upon connection anymore

Hi,

I clearly recall that upon connecting my BT earbuds during my KDE session, the audio device would switch to those automatically.

For some time now, this is no longer the case on my install: audio stays on the speakers, and even if I want to switch manually, the BT-provided devices (output and input - they have a mic) are NOT listed in KDE’s Audio Devices widget.

It doesn’t happen all the time, but frequently enough.

I usually work around this by restarting bluetooth or pipewire, e.g.

systemctl restart bluetooth.service or systemctl --user restart pipewire.service

Are there any investigation steps I can perform? Is this a known issue?

Here are my system info:

Operating System: openSUSE Tumbleweed 20241124
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.8-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon 780M Graphics
Memory: 30.7 GiB of RAM
Graphics Processor: AMD Radeon 780M
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen 7040Series)
System Version: A7

Thanks!

Update: logs bt-no-auto-switch.out.tar.gz - Google Drive

I notice this:

Nov 26 09:32:02 andromeda wireplumber[8071]: spa.bluez5.sink.media: 0x7fed4c076038: error 24
Nov 26 09:32:02 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-77) running -> error (Received error event)
Nov 26 09:32:02 andromeda wireplumber[8071]: spa.bluez5: Failure in Bluetooth audio transport /org/bluez/hci0/dev_70_5A_6F_6B_6D_1D/sep8/fd0
Nov 26 09:32:02 andromeda pipewire[8070]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-77) running -> error (Received error event)

and this (16891 to 16928)

Nov 26 09:31:38 andromeda wireplumber[2158]: wireplumber: stopped by signal: Terminated
Nov 26 09:31:38 andromeda systemd[1914]: Stopping Multimedia Service Session Manager...
Nov 26 09:31:38 andromeda wireplumber[2158]: wireplumber: disconnected from pipewire
Nov 26 09:31:38 andromeda wireplumber[2158]: pw.core: 0x55fe1c3f0f10: leaked proxy 0x55fe1c4ff330 id:3
Nov 26 09:31:38 andromeda wireplumber[2158]: pw.core: 0x55fe1c3f0f10: leaked proxy 0x55fe1c5f6760 id:4
Nov 26 09:31:38 andromeda wireplumber[2158]: pw.core: 0x55fe1c3f0f10: leaked proxy 0x55fe1c447960 id:9
Nov 26 09:31:38 andromeda wireplumber[2158]: pw.core: 0x55fe1c3f0f10: leaked proxy 0x55fe1c6449e0 id:10
Nov 26 09:31:38 andromeda wireplumber[2158]: pw.core: 0x55fe1c3f0f10: leaked proxy 0x55fe1c60e860 id:11
Nov 26 09:31:38 andromeda wireplumber[2158]: pw.core: 0x55fe1c3f0f10: leaked proxy 0x55fe1c5d68d0 id:12
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "alsa_input.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "alsa_input.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "@DEFAULT_SOURCE@"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "alsa_input.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "alsa_input.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "@DEFAULT_SOURCE@"
Nov 26 09:31:39 andromeda plasmashell[2392]: org.kde.pulseaudio: No object for name "alsa_output.pci-0000_c1_00.6.analog-stereo"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "@DEFAULT_SOURCE@"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "@DEFAULT_SOURCE@"
Nov 26 09:31:39 andromeda systemd[1914]: Stopped Multimedia Service Session Manager.
Nov 26 09:31:39 andromeda kwin_wayland[2117]: kwin_screencast: PipeWire remote error:  connection error
Nov 26 09:31:39 andromeda systemd[1914]: Stopping PipeWire Multimedia Service...
Nov 26 09:31:39 andromeda xdg-desktop-por[2084]: Caught PipeWire error: connection error
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: context kaput
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Nov 26 09:31:39 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "@DEFAULT_SOURCE@"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: context kaput
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Nov 26 09:31:39 andromeda kdeconnectd[2717]: 2024-11-26T09:31:39 org.kde.pulseaudio: No object for name "@DEFAULT_SOURCE@"

Please share the output from

inxi -Aa
systemctl --user list-units | egrep -i "wire|pulse"

If you pair the device using bluetoothctl like this…
https://wiki.archlinux.org/title/Bluetooth#Pairing
…does it show up in the wireplumber device list?

wpctl status

Hi, and thank you. Here are the outputs

inxi -Aa

Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Rembrandt Radeon High Definition
    Audio vendor: Framework driver: snd_hda_intel v: kernel pcie: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: c1:00.1 chip-ID: 1002:1640 class-ID: 0403
  Device-2: Advanced Micro Devices [AMD] ACP/ACP3X/ACP6x Audio Coprocessor
    vendor: Framework driver: snd_pci_ps v: kernel alternate: snd_pci_acp3x,
    snd_rn_pci_acp3x, snd_pci_acp5x, snd_pci_acp6x, snd_acp_pci,
    snd_rpl_pci_acp6x, snd_sof_amd_renoir, snd_sof_amd_rembrandt,
    snd_sof_amd_vangogh, snd_sof_amd_acp63 pcie: gen: 4 speed: 16 GT/s
    lanes: 16 bus-ID: c1:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-3: Advanced Micro Devices [AMD] Family 17h/19h HD Audio
    vendor: Framework driver: snd_hda_intel v: kernel pcie: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: c1:00.6 chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.11.8-1-default status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: PipeWire v: 1.2.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl

systemctl --user list-units | egrep -i “wire|pulse”

  sys-devices-pci0000:00-0000:00:02.2-0000:01:00.0-net-wlp1s0.device                                                                 loaded active plugged   MT7922 802.11ax PCI Express Wireless Network Adapter
  sys-subsystem-net-devices-wlp1s0.device                                                                                            loaded active plugged   MT7922 802.11ax PCI Express Wireless Network Adapter
  pipewire-pulse.service                                                                                                             loaded active running   PipeWire PulseAudio
  pipewire.service                                                                                                                   loaded active running   PipeWire Multimedia Service
  wireplumber.service                                                                                                                loaded active running   Multimedia Service Session Manager
  pipewire-pulse.socket                                                                                                              loaded active running   PipeWire PulseAudio
  pipewire.socket                                                                                                                    loaded active running   PipeWire Multimedia System Sockets

This morning it worked, took my earbuds out of their case, KDE connected them and they also show up as audio devices (spearkers + mic).

Hi, and thanks.

Right now they show up (item 78.). I did the pairing via KDE’s settings UI.

Also, this morning the issue I reported didn’t happen, so the earbuds connected successfully AND KDE also shows them as audio input/output devices and sets them as default. The problem here is that it’s a bit hit and miss and I dunno which troubleshooting steps to take when it’s a “miss”.

PipeWire 'pipewire-0' [1.2.7, andrea@andromeda, cookie:2727683381]
 └─ Clients:
        32. kwin_wayland                        [1.2.7, andrea@andromeda, pid:2257]
        33. WirePlumber                         [1.2.7, andrea@andromeda, pid:2296]
        41. WirePlumber [export]                [1.2.7, andrea@andromeda, pid:2296]
        68. pipewire                            [1.2.7, andrea@andromeda, pid:2505]
        69. libcanberra                         [1.2.7, andrea@andromeda, pid:2419]
        70.                                     [1.2.7, andrea@andromeda, pid:2419]
        71. xdg-desktop-portal                  [1.2.7, andrea@andromeda, pid:2209]
        72. libcanberra                         [1.2.7, andrea@andromeda, pid:2536]
        73. plasmashell                         [1.2.7, andrea@andromeda, pid:2536]
        74.                                     [1.2.7, andrea@andromeda, pid:2536]
        75. KDE Connect Daemon                  [1.2.7, andrea@andromeda, pid:2822]
        76. Chromium input                      [1.2.7, andrea@andromeda, pid:203]
        77. Firefox                             [1.2.7, andrea@andromeda, pid:4305]
        81. WirePlumber                         [1.2.7, andrea@andromeda, pid:2296]
       104. wpctl                               [1.2.7, andrea@andromeda, pid:6491]

Audio
 ├─ Devices:
 │      42. Rembrandt Radeon High Definition Audio Controller [alsa]
 │      43. Family 17h/19h HD Audio Controller  [alsa]
 │      78. EarFun 4 di Andrea                  [bluez5]
 │  
 ├─ Sinks:
 │      47. Rembrandt Radeon High Definition Audio Controller Digital Stereo (HDMI) [vol: 0.40 MUTED]
 │      48. Family 17h/19h HD Audio Controller Analog Stereo [vol: 0.80]
 │  *   **93. EarFun 4 di Andrea                  [vol: 0.32]**
 │  
 ├─ Sources:
 │  *   49. Family 17h/19h HD Audio Controller Analog Stereo [vol: 0.15]
 │  
 ├─ Filters:
 │    - loopback-2296-18                                            
 │      91. bluez_input.70:5A:6F:6B:6D:1D                                [Audio/Source]
 │      92. bluez_capture_internal.70:5A:6F:6B:6D:1D                     [Stream/Input/Audio/Internal]
 │  
 └─ Streams:

Video
 ├─ Devices:
 │      50. Laptop Camera                       [v4l2]
 │      51. Laptop Camera                       [v4l2]
 │      55. Laptop Camera: Laptop Camera        [libcamera]
 │  
 ├─ Sinks:
 │  
 ├─ Sources:
 │  *   56. Laptop Camera (V4L2)               
 │  
 ├─ Filters:
 │  
 └─ Streams:
        83. kwin_wayland                                                
             84. output_1        > plasmashell:input_1  [init]
        85. plasmashell                                                 
             86. input_1         < kwin_wayland:output_1        [init]

Settings
 └─ Default Configured Devices:
         0. Audio/Sink    bluez_output.70_5A_6F_6B_6D_1D.1
         1. Audio/Source  alsa_input.pci-0000_c1_00.6.analog-stereo

It could be a BT pairing/connectivity issue at play, and a bug report may be required.

You could watch the journal logging in a terminal for bluetooth-related messages…
sudo journalctl -f | grep -i blue
That might yield further helpful clues. I don’t own any BT hardware currently, but hopefully others can chime in with further advice here.

Hi, I had collected a dump of journalctl when this happened last time (see message: Audio device does not switch to bluetooth earbuds/headset upon connection anymore - #2 by andrea.ippo)

Grepping on it as you suggest shows this:

Nov 26 09:17:50 andromeda kded6[2272]: org.kde.kameleon: invalid color index "red green blue yellow white amber" read from /multi_index for device "chromeos:multicolor:charging"
Nov 26 09:17:50 andromeda systemd[1914]: Starting Bluetooth OBEX service...
Nov 26 09:17:50 andromeda systemd[1914]: Started Bluetooth OBEX service.
Nov 26 09:31:07 andromeda plasmashell[2392]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/FullRepresentation.qml:75:13: QML Toolbar: Binding loop detected for property "leftInset":
Nov 26 09:31:15 andromeda systemd[1914]: Reached target Bluetooth.
Nov 26 09:31:17 andromeda plasmashell[2392]: file:///usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/FullRepresentation.qml:75:13: QML Toolbar: Binding loop detected for property "leftInset":
Nov 26 09:31:39 andromeda wireplumber[8071]: spa.bluez5.native: RFCOMM receive command but modem not available: AT+NREC=0
Nov 26 09:31:39 andromeda wireplumber[8071]: spa.bluez5.native: RFCOMM receive command but modem not available: AT+BTRH?
Nov 26 09:31:54 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-77) graph xrun not-triggered (0 suppressed)
Nov 26 09:31:57 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-77) graph xrun not-triggered (0 suppressed)
Nov 26 09:32:02 andromeda wireplumber[8071]: spa.bluez5.sink.media: 0x7fed4c076038: error 24
Nov 26 09:32:02 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-77) running -> error (Received error event)
Nov 26 09:32:02 andromeda wireplumber[8071]: spa.bluez5: Failure in Bluetooth audio transport /org/bluez/hci0/dev_70_5A_6F_6B_6D_1D/sep8/fd0
Nov 26 09:32:02 andromeda pipewire[8070]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-77) running -> error (Received error event)
Nov 26 09:32:02 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "bluez_output.70_5A_6F_6B_6D_1D.1"
Nov 26 09:32:02 andromeda kdeconnectd[2717]: 2024-11-26T09:32:02 org.kde.pulseaudio: No object for name "bluez_output.70_5A_6F_6B_6D_1D.1"
Nov 26 09:32:02 andromeda plasmashell[2392]: org.kde.pulseaudio: No object for name "bluez_output.70_5A_6F_6B_6D_1D.1"
Nov 26 09:32:12 andromeda wireplumber[8071]: spa.bluez5.native: RFCOMM receive command but modem not available: AT+NREC=0
Nov 26 09:32:12 andromeda wireplumber[8071]: spa.bluez5.native: RFCOMM receive command but modem not available: AT+BTRH?
Nov 26 09:32:25 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-130) graph xrun not-triggered (0 suppressed)
Nov 26 09:36:44 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-130) graph xrun not-triggered (0 suppressed)
Nov 26 09:36:54 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-130) graph xrun not-triggered (0 suppressed)
Nov 26 09:38:19 andromeda wireplumber[8071]: spa.bluez5.sink.media: 0x562215956768: error 24
Nov 26 09:38:20 andromeda wireplumber[8071]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-130) running -> error (Received error event)
Nov 26 09:38:20 andromeda wireplumber[8071]: spa.bluez5: Failure in Bluetooth audio transport /org/bluez/hci0/dev_70_5A_6F_6B_6D_1D/fd1
Nov 26 09:38:20 andromeda pipewire[8070]: pw.node: (bluez_output.70_5A_6F_6B_6D_1D.1-130) running -> error (Received error event)
Nov 26 09:38:20 andromeda kdeconnectd[2717]: 2024-11-26T09:38:20 org.kde.pulseaudio: No object for name "bluez_output.70_5A_6F_6B_6D_1D.1"
Nov 26 09:38:20 andromeda kded6[2272]: org.kde.pulseaudio: No object for name "bluez_output.70_5A_6F_6B_6D_1D.1"

Hmm found another match for that error 24 at Nov 26 09:38:19:

https://www.reddit.com/r/archlinux/comments/sh6eqs/bluetooth_headset_disconnecting_intermittently/

I wonder if it’s a driver issue in my case as well

Note to self: might be relevant as well: