{"id":2097,"date":"2022-03-05T13:29:06","date_gmt":"2022-03-05T16:29:06","guid":{"rendered":"https:\/\/maurom.com\/blog\/?p=2097"},"modified":"2024-12-10T10:07:10","modified_gmt":"2024-12-10T13:07:10","slug":"solved-more-hsp-hfp-bluetooth-headset-woes-wh-xb700","status":"publish","type":"post","link":"https:\/\/maurom.com\/blog\/2022\/03\/05\/solved-more-hsp-hfp-bluetooth-headset-woes-wh-xb700\/","title":{"rendered":"More HSP\/HFP bluetooth headset woes (WH-XB700) [SOLVED]"},"content":{"rendered":"<blockquote><p><strong>Updated!<\/strong> In late 2022, <a href=\"https:\/\/www.phoronix.com\/news\/Debian-12-PipeWire\">GNOME, Ubuntu and Debian have switched to Pipewire<\/a> as their default audio server. <strong>PipeWire solves many of the issues with Bluetooth hardware and codecs<\/strong>.<br \/>\nIt has a compatibility layer for PulseAudio (pipewire-pulse), allowing existing applications to seamlessly benefit from PipeWire improvements.<\/p>\n<p>I&#8217;ve been using <a href=\"https:\/\/packages.debian.org\/bookworm-backports\/pipewire-audio\">pipewire<\/a> along with the <a href=\"https:\/\/packages.debian.org\/bookworm-backports\/wireplumber\">wireplumber<\/a> session manager since version 0.3.x, so if you still have problems and haven&#8217;t switched to it, I highly recommend you to do so. There are many guides online, but <a href=\"https:\/\/www.baeldung.com\/linux\/pulseaudio-pipewire-replace\">this one from Baeldung<\/a> is the best one IMHO.<\/p>\n<p>This means that most of the information in this article is now obsolete, but I will keep it just for reference.<\/p><\/blockquote>\n<p>Well, I think you have seen the previous posts (below) where I rambled about connection problems with bluetooth headphones\/headsets on Debian.<\/p>\n<p>If you&#8217;ve already read it, be aware that they don&#8217;t reflect the current situation. I&#8217;ll elaborate&#8230;<\/p>\n<p>After moving back to Debian Bullseye a few months ago, I was given (a delightful gift from a lovely person, I must say) a pair of <a href=\"https:\/\/www.gsmarena.com\/sony_whxb700_extra_bass_wireless_headphones_review-news-36546.php\">Sony WH-XB700 headphones<\/a> which are now working great on that platform, BUT be aware that you may run into some problems while setting them up.<\/p>\n<p>This is my current configuration:<\/p>\n<pre>$ inxi -F\nSystem: Host: hp-laptop Kernel: 5.10.0-11-amd64 x86_64 bits: 64 Desktop: Cinnamon 4.8.6\nDistro: Debian GNU\/Linux 11 (bullseye)\n...\nAudio: Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel\nSound Server: ALSA v: k5.10.0-11-amd64\n...\nBluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb\nReport: ID: hci0 state: up running bt-v: 2.1 address: [REDACTED]\n...\n\n$ apt list --installed bluez blueman pulseaudio pulseaudio-module-bluetooth\nblueman\/stable,now 2.1.4-1+b1 amd64 [installed]\nbluez\/stable,now 5.55-3.1 amd64 [installed,automatic]\npulseaudio-module-bluetooth\/stable,now 14.2-2 amd64 [installed,automatic]\npulseaudio\/stable,now 14.2-2 amd64 [installed]<\/pre>\n<p>After connecting the headphones, sound is great with the <code>a2dp_sink<\/code> [High Fidelity Playback (A2DP Sink)] profile. HOWEVER, while trying to switch to <code>headset_head_unit<\/code> [Headset Head Unit (HSP\/HFP)] profile to use the built-in microphone for calls and meets, pulseaudio kept hanging, crashing and restarting with the following errors (hidden on pulseaudio&#8217;s journal):<\/p>\n<pre>$\u00a0journalctl --user -u pulseaudio\u00a0 \u00a0# run this as normal user\n...\nMar 05 12:28:14 hp-laptop pulseaudio[1290]: q overrun, queuing locally\nMar 05 12:28:15 hp-laptop pulseaudio[1290]: q overrun, queuing locally\nMar 05 12:28:15 hp-laptop pulseaudio[1290]: q overrun, queuing locally\n...\n<\/pre>\n<p>Also, bluetooth logs showed problems while trying to set up the audio AVCTP \/ AVRCP protocols:<\/p>\n<pre># journalctl -u bluetooth\u00a0 \u00a0# run this as root user\n...\nMar 05 12:28:42 hp-laptop bluetoothd[840]: Starting SDP server\nMar 05 12:28:42 hp-laptop bluetoothd[840]: Bluetooth management interface 1.18 initialized\n<strong>Mar 05 12:28:42 hp-laptop bluetoothd[840]: profiles\/audio\/avctp.c:avctp_server_socket() setsockopt(L2CAP_OPTIONS): Invalid argument (22)\nMar 05 12:28:42 hp-laptop bluetoothd[840]: avrcp-controller: Protocol not supported (93)\nMar 05 12:28:42 hp-laptop bluetoothd[840]: profiles\/audio\/avctp.c:avctp_server_socket() setsockopt(L2CAP_OPTIONS): Invalid argument (22)\nMar 05 12:28:42 hp-laptop bluetoothd[840]: audio-avrcp-target: Protocol not supported (93)<\/strong>\nMar 05 12:28:42 hp-laptop bluetoothd[840]: profiles\/sap\/server.c:sap_server_register() Sap driver initialization failed.\nMar 05 12:28:42 hp-laptop bluetoothd[840]: sap-server: Operation not permitted (1)\nMar 05 12:28:45 hp-laptop bluetoothd[840]: Endpoint registered: sender=:1.50 path=\/MediaEndpoint\/A2DPSink\/sbc\nMar 05 12:28:45 hp-laptop bluetoothd[840]: Endpoint registered: sender=:1.50 path=\/MediaEndpoint\/A2DPSource\/sbc\nMar 05 12:29:03 hp-laptop bluetoothd[840]: Endpoint unregistered: sender=:1.50 path=\/MediaEndpoint\/A2DPSink\/sbc\nMar 05 12:29:03 hp-laptop bluetoothd[840]: Endpoint unregistered: sender=:1.50 path=\/MediaEndpoint\/A2DPSource\/sbc\nMar 05 12:29:03 hp-laptop bluetoothd[840]: Endpoint registered: sender=:1.83 path=\/MediaEndpoint\/A2DPSink\/sbc\nMar 05 12:29:03 hp-laptop bluetoothd[840]: Endpoint registered: sender=:1.83 path=\/MediaEndpoint\/A2DPSource\/sbc\n...\n<\/pre>\n<p>Well, after a lot of headaches and dead ends, it turned out that some process (I haven&#8217;t figured out which one, yet) was\u00a0<strong>stealthily switching off<\/strong> the ERTM (<em>Enhanced ReTransmission Mode<\/em>) and ESCO (<em>Enhanced SCO<\/em>) protocols of my Bluetooth stack.<\/p>\n<p>So if you have a similar problem, verify that your stack does not have them disabled by looking at\u00a0<code>\/sys\/module\/bluetooth\/parameters\/<\/code><\/p>\n<pre># grep --color . \/sys\/module\/bluetooth\/parameters\/disable_e*\n\/sys\/module\/bluetooth\/parameters\/disable_ertm:N\n\/sys\/module\/bluetooth\/parameters\/disable_esco:N\n<\/pre>\n<p>If you see a\u00a0<strong>Y<\/strong> there, you might want to try re-enabling ERTM and ESCO by issuing the following commands:<\/p>\n<pre>echo N &gt; \/sys\/module\/bluetooth\/parameters\/disable_ertm\necho N &gt; \/sys\/module\/bluetooth\/parameters\/disable_esco\nsystemctl restart bluetooth\n<\/pre>\n<p>After doing that, switching to\u00a0<code>headset_head_unit<\/code> profile should work fine and the headset can be used without any problem.<\/p>\n<p>I&#8217;ll try to test the same setup with the new pipewire stack in the following days, but in the meantime, <strong>kudos<\/strong> to Juan Pablo Lassala for <a href=\"https:\/\/gitlab.freedesktop.org\/pulseaudio\/pulseaudio\/-\/issues\/1241#note_1035700\">describing the proper solution<\/a> to this tricky problem on pulseaudio issue tracker.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Updated! In late 2022, GNOME, Ubuntu and Debian have switched to Pipewire as their default audio server. PipeWire solves many of the issues with Bluetooth hardware and codecs. It has a compatibility layer for PulseAudio (pipewire-pulse), allowing existing applications to seamlessly benefit from PipeWire improvements. I&#8217;ve been using pipewire along with the wireplumber session manager [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,17,3,23],"_links":{"self":[{"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/posts\/2097"}],"collection":[{"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/comments?post=2097"}],"version-history":[{"count":10,"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/posts\/2097\/revisions"}],"predecessor-version":[{"id":2120,"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/posts\/2097\/revisions\/2120"}],"wp:attachment":[{"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/media?parent=2097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/categories?post=2097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maurom.com\/blog\/wp-json\/wp\/v2\/tags?post=2097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}