Bluetooth headset not working properly

If I connect my headset via bluetooth, it’s not working all the time. It often helps to switch around audio devices in the KDE setting in the taskbar, and disconnecting/connecting bluetooth, but it’s not working all the time. Sometimes it’s not working at all, sometimes I get weird stuttering if I stop the audio (the last sound is repeaded until I resume audio. Switching audio devices solves this again.). Here is my log of journalctl, I hope I got the relevant part:

Mai 10 10:45:08 elendil-pc kded5[1591]: ktp-kded-module: "auto-away" presence change request: "away" ""
Mai 10 10:45:08 elendil-pc kded5[1591]: ktp-kded-module: plugin queue activation: "away" ""
Mai 10 10:49:09 elendil-pc kded5[1591]: ktp-kded-module: "auto-away" state change: TelepathyKDEDModulePlugin::Enabled
Mai 10 10:49:09 elendil-pc kded5[1591]: ktp-kded-module: plugin queue activation: "unset" ""
Mai 10 10:49:11 elendil-pc kwin_x11[1595]: qml: No rectangle firefox 71303431
Mai 10 10:49:11 elendil-pc kwin_x11[1595]: qml: No rectangle firefox 71303507
Mai 10 10:49:24 elendil-pc ktimetracker[2107]: m_sessionStartTime= ""
Mai 10 10:49:42 elendil-pc kwin_x11[1595]: qml: No rectangle firefox 71303431
Mai 10 10:49:42 elendil-pc kwin_x11[1595]: qml: No rectangle firefox 71303507
Mai 10 10:49:42 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:49:42 elendil-pc kwin_x11[1595]: qml: No rectangle firefox 71303431
Mai 10 10:49:42 elendil-pc kwin_x11[1595]: qml: No rectangle firefox 71303507
Mai 10 10:49:57 elendil-pc kernel: input: WH-1000XM4 (AVRCP) as /devices/virtual/input/input28
Mai 10 10:49:57 elendil-pc systemd-logind[578]: Watching system buttons on /dev/input/event26 (WH-1000XM4 (AVRCP))
Mai 10 10:50:03 elendil-pc pipewire-media-session[1936]: can't reconnect node 133 to 34
Mai 10 10:50:03 elendil-pc pipewire-media-session[1936]: can't reconnect node 125 to 34
Mai 10 10:50:03 elendil-pc pipewire-media-session[1936]: can't reconnect node 105 to 34
Mai 10 10:50:03 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:03 elendil-pc pipewire-media-session[1936]: can't reconnect node 108 to 34
Mai 10 10:50:03 elendil-pc pipewire-media-session[1936]: can't reconnect node 119 to 34
Mai 10 10:50:03 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:03 elendil-pc bluetoothd[1337]: /org/bluez/hci0/dev_14_3F_A6_10_8D_99/sep3/fd1: fd(40) ready
Mai 10 10:50:04 elendil-pc pipewire-media-session[1936]: 'CHECK_PORT(this, direction, port_id)' failed at ../pipewire/spa/plugins/audiomixer/mixer-dsp.c:625 impl_node_port_set_io()
Mai 10 10:50:04 elendil-pc pipewire-media-session[1936]: 'CHECK_PORT(this, direction, port_id)' failed at ../pipewire/spa/plugins/audiomixer/mixer-dsp.c:625 impl_node_port_set_io()
Mai 10 10:50:04 elendil-pc pipewire-media-session[1936]: port 0x55c27cacbf10: set_io: Das Argument ist ungültig
Mai 10 10:50:04 elendil-pc pipewire-media-session[1936]: port 0x55c27cacbf98: set_io: Das Argument ist ungültig
Mai 10 10:50:04 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -22 for resource 13: port_set_io failed: Das Argument ist ungültig
Mai 10 10:50:04 elendil-pc pipewire[1935]: client-node 0x55e808fdf5f0: error seq:2569 -22 (port_set_io failed: Das Argument ist ungültig)
Mai 10 10:50:04 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -22 for resource 13: port_set_io failed: Das Argument ist ungültig
Mai 10 10:50:04 elendil-pc pipewire[1935]: client-node 0x55e808fdf5f0: error seq:2570 -22 (port_set_io failed: Das Argument ist ungültig)
Mai 10 10:50:04 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:10 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:13 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -5 for resource 3: node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler
Mai 10 10:50:13 elendil-pc pipewire[1935]: client-node 0x55e809f73890: error seq:67 -5 (node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler)
Mai 10 10:50:14 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -5 for resource 3: node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler
Mai 10 10:50:14 elendil-pc pipewire[1935]: client-node 0x55e809f73890: error seq:95 -5 (node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler)
Mai 10 10:50:15 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -5 for resource 3: node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler
Mai 10 10:50:15 elendil-pc pipewire[1935]: client-node 0x55e809f73890: error seq:123 -5 (node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler)
Mai 10 10:50:16 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:21 elendil-pc dbus-daemon[572]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.77" (uid=1000 pid=1936 comm="/usr/bin/pipewire-media-session ") interface="(unset)" member="(unset)" e>
Mai 10 10:50:21 elendil-pc plasmashell[1673]: org.kde.plasma.pulseaudio: No object for name "bluez_output.14_3F_A6_10_8D_99.a2dp-sink"
Mai 10 10:50:21 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -5 for resource 3: node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler
Mai 10 10:50:21 elendil-pc pipewire[1935]: client-node 0x55e809f73890: error seq:151 -5 (node_set_param(Spa:Enum:ParamId:PortConfig) failed: Eingabe-/Ausgabefehler)
Mai 10 10:50:21 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:21 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:21 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:26 elendil-pc pipewire-media-session[1936]: 'CHECK_PORT(this, direction, port_id)' failed at ../pipewire/spa/plugins/audiomixer/mixer-dsp.c:625 impl_node_port_set_io()
Mai 10 10:50:26 elendil-pc pipewire-media-session[1936]: 'CHECK_PORT(this, direction, port_id)' failed at ../pipewire/spa/plugins/audiomixer/mixer-dsp.c:625 impl_node_port_set_io()
Mai 10 10:50:26 elendil-pc pipewire-media-session[1936]: port 0x55c27cacbcf0: set_io: Das Argument ist ungültig
Mai 10 10:50:26 elendil-pc pipewire-media-session[1936]: port 0x55c27cacbd78: set_io: Das Argument ist ungültig
Mai 10 10:50:26 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -22 for resource 13: port_set_io failed: Das Argument ist ungültig
Mai 10 10:50:26 elendil-pc pipewire[1935]: client-node 0x55e808fcc9b0: error seq:4158 -22 (port_set_io failed: Das Argument ist ungültig)
Mai 10 10:50:26 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -22 for resource 13: port_set_io failed: Das Argument ist ungültig
Mai 10 10:50:26 elendil-pc pipewire[1935]: client-node 0x55e808fcc9b0: error seq:4159 -22 (port_set_io failed: Das Argument ist ungültig)
Mai 10 10:50:26 elendil-pc kernel: input: WH-1000XM4 (AVRCP) as /devices/virtual/input/input29
Mai 10 10:50:26 elendil-pc systemd-logind[578]: Watching system buttons on /dev/input/event26 (WH-1000XM4 (AVRCP))
Mai 10 10:50:26 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:26 elendil-pc bluetoothd[1337]: /org/bluez/hci0/dev_14_3F_A6_10_8D_99/sep3/fd2: fd(41) ready
Mai 10 10:50:27 elendil-pc pipewire-media-session[1936]: can't reconnect node 121 to 34
Mai 10 10:50:27 elendil-pc pipewire-media-session[1936]: can't reconnect node 120 to 34
Mai 10 10:50:27 elendil-pc pipewire-media-session[1936]: can't reconnect node 111 to 34
Mai 10 10:50:27 elendil-pc pipewire-media-session[1936]: can't reconnect node 132 to 34
Mai 10 10:50:27 elendil-pc pipewire-media-session[1936]: can't reconnect node 116 to 34
Mai 10 10:50:29 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:32 elendil-pc pipewire[1935]: (pulseeffects_sie-142) running -> error (error changing node state: Eingabe-/Ausgabefehler)
Mai 10 10:50:32 elendil-pc pipewire-media-session[1936]: error id:138 seq:7531 res:-5 (Eingabe-/Ausgabefehler): error changing node state: Eingabe-/Ausgabefehler
Mai 10 10:50:32 elendil-pc kwin_x11[1595]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 10840, resource id: 48234503, major code: 15 (QueryTree), minor code: 0
Mai 10 10:50:32 elendil-pc kded5[1591]: Service  ":1.119" unregistered
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:153: TypeError: Cannot read property 'ports' of undefined
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:153: TypeError: Cannot read property 'ports' of undefined
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:153: TypeError: Cannot read property 'ports' of undefined
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:153: TypeError: Cannot read property 'ports' of undefined
Mai 10 10:50:32 elendil-pc systemd[1480]: app-com.github.wwmm.pulseeffects-b21961a5d95f4aeda1300f4a9e82c765.scope: Deactivated successfully.
Mai 10 10:50:32 elendil-pc systemd[1480]: app-com.github.wwmm.pulseeffects-b21961a5d95f4aeda1300f4a9e82c765.scope: Consumed 3min 49.905s CPU time.
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:32 elendil-pc kwin_x11[1595]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 11025, resource id: 23068700, major code: 18 (ChangeProperty), minor code: 0
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:32 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:33 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:33 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:33 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231:37: Unable to assign [undefined] to QPulseAudio::VolumeObject*
Mai 10 10:50:33 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231:37: Unable to assign [undefined] to QPulseAudio::VolumeObject*
Mai 10 10:50:33 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:33 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:33 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:35 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:38 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:46 elendil-pc pipewire[1935]: alsa-pcm front:1: snd_pcm_status error: Datenübergabe unterbrochen (broken pipe)
Mai 10 10:50:47 elendil-pc dbus-daemon[572]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.77" (uid=1000 pid=1936 comm="/usr/bin/pipewire-media-session ") interface="(unset)" member="(unset)" e>
Mai 10 10:50:47 elendil-pc plasmashell[1673]: org.kde.plasma.pulseaudio: No object for name "bluez_output.14_3F_A6_10_8D_99.a2dp-sink"
Mai 10 10:50:47 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:47 elendil-pc plasmashell[1673]: qrc:/plasma/plasmoids/org.kde.plasma.volume/contents/ui/ListItemBase.qml:231: TypeError: Cannot read property 'visible' of null
Mai 10 10:50:47 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:52 elendil-pc pipewire-media-session[1936]: 'CHECK_PORT(this, direction, port_id)' failed at ../pipewire/spa/plugins/audiomixer/mixer-dsp.c:625 impl_node_port_set_io()
Mai 10 10:50:52 elendil-pc pipewire-media-session[1936]: 'CHECK_PORT(this, direction, port_id)' failed at ../pipewire/spa/plugins/audiomixer/mixer-dsp.c:625 impl_node_port_set_io()
Mai 10 10:50:52 elendil-pc pipewire-media-session[1936]: port 0x55c27cacbcf0: set_io: Das Argument ist ungültig
Mai 10 10:50:52 elendil-pc pipewire-media-session[1936]: port 0x55c27cacbd78: set_io: Das Argument ist ungültig
Mai 10 10:50:52 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -22 for resource 13: port_set_io failed: Das Argument ist ungültig
Mai 10 10:50:52 elendil-pc pipewire[1935]: client-node 0x55e808fcc9b0: error seq:5377 -22 (port_set_io failed: Das Argument ist ungültig)
Mai 10 10:50:52 elendil-pc pipewire[1935]: impl-core 0x55e808c79690: error -22 for resource 13: port_set_io failed: Das Argument ist ungültig
Mai 10 10:50:52 elendil-pc pipewire[1935]: client-node 0x55e808fcc9b0: error seq:5378 -22 (port_set_io failed: Das Argument ist ungültig)
Mai 10 10:50:52 elendil-pc kwin_x11[1595]: qml: Ignoring client because of blacklist:  plasmashell
Mai 10 10:50:52 elendil-pc kernel: input: WH-1000XM4 (AVRCP) as /devices/virtual/input/input30
Mai 10 10:50:52 elendil-pc bluetoothd[1337]: /org/bluez/hci0/dev_14_3F_A6_10_8D_99/sep3/fd3: fd(41) ready
Mai 10 10:50:52 elendil-pc systemd-logind[578]: Watching system buttons on /dev/input/event26 (WH-1000XM4 (AVRCP))

“Das Argument ist ungültig” is German for “The argument is invalid”.
“Datenübergabe unterbrochen” is “Data transfer interrupted”
“Eingabe-/Ausgabefehler” is “Input/output error”

I already tried reinstalling pipewire with sudo pacman -S pipewire

I do have issues with BT-audio and using pipewire here to, switched back to use only PulseAudio for now.

It often helps to remove the device and for one time using bluetoothctl as root:

What you say about distortion and stuttering, looks also like it connects as “Hands Free” Headset what causes low quality sound and in most cases does not work any good, A2DP is needed as connection profile to got hifi sound.