OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
network medium very-common DISPUTE

Get the microphone working on a Bluetooth headset under PipeWire

omarchyarchendeavouroscachyosmanjarolaptopdesktop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Almost all of this is verified and current, but the WirePlumber drop-in contradicts the default it just quoted and re-enables a role combination upstream deliberately leaves out. Verified correct first: wpctl settings --save bluetooth.autoswitch-to-headset-profile <bool> is real (Arch wiki Bluetooth headset uses that exact command, and the key is in the schema at /usr/share/wireplumber/wireplumber.conf line 873 with default true). The stated upstream default bluez5.roles = [ a2dp_sink a2dp_source bap_sink bap_source hfp_hf hfp_ag ] is exactly what the wiki documents. bluez5.roles, bluez5.enable-msbc, bluez5.enable-sbc-xq and bluez5.hfphsp-backend are all real properties. I found all four in the strings of /usr/lib/spa-0.2/bluez5/libspa-bluez5.so on PipeWire 1.6.8. The profile names are real: bluez5-device.c builds codec profiles as spa_aprintf("%s-%s", name, media_codec->name) over base headset-head-unit with codec names msbc/cvsd, so headset-head-unit-msbc is right, and pactl set-card-profile taking the name while wpctl set-profile takes an index is right. Package names check out: broadcom-bt-firmware is AUR (wiki uses {{AUR|...}}), and linux-firmware-intel / linux-firmware-realtek are real core packages post-split: linux-firmware-intel owns 127 ibt-* Bluetooth blobs and linux-firmware-realtek owns 48 rtl_bt files. Nothing is stale PulseAudio advice. The danger note about /var/lib/bluetooth destroying every link key is correct and matches the dual-boot record. The defect: the drop-in writes bluez5.roles = [ a2dp_sink a2dp_source bap_sink bap_source hsp_hs hsp_ag hfp_hf hfp_ag ] under the heading "restore the roles explicitly", which is not the default it stated two lines earlier. It adds hsp_hs and hsp_ag. Upstream omits hsp_ag on purpose. The Arch wiki records why: "Currently some headsets (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag enabled, so by default we enable only HFP." A user copy-pasting this to fix a mic can break a headset that was working. Corrected fix restores the documented default list and says what to do if the headset only speaks HSP.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Deleting /var/lib/bluetooth to force a clean re-pair (advice that circulates for this problem) removes the link keys for *every* paired device on the machine, including any you have painstakingly synchronised with a Windows dual boot. Back it up first: sudo cp -a /var/lib/bluetooth /var/lib/bluetooth.bak.

Symptom

Bluetooth headphones play audio perfectly but the built-in mic is unusable. Either the headset's microphone never appears as an input at all and the only profile offered is "High Fidelity Playback (A2DP Sink)", or the "Headset Head Unit (HFP/HSP)" profile is listed but greyed out / marked unavailable, or you can select it and then get silence in both directions. Nothing plays and the input meter never moves. In bluetoothctl the transport sits at State: idle on the headset profile where it goes State: active on A2DP.

Cause

Three different failures wear the same face. (1) A2DP is playback-only by design. The microphone only exists under HFP/HSP, which is a separate profile the card has to be switched to. (2) The adapter's firmware is missing, so the SCO link that carries HFP audio never comes up. Broadcom USB dongles are the classic case, logging Bluetooth: hci0: BCM: firmware Patch file not found. (3) The hfp_hf role or mSBC has been disabled in a WirePlumber drop-in, often copied from a "fix my headset" snippet whose whole purpose was to turn HFP off.

Fix

See what the card is actually offering:


pactl list cards | grep -A 40 'bluez_card'
# look for the 'Profiles:' block and whether each is 'available: yes' or 'no'
wpctl status

**Switch to the headset profile by name.** pactl takes the profile name, which is what the listing above prints (wpctl set-profile wants a numeric index, which is easy to get wrong):


pactl set-card-profile bluez_card.XX_XX_XX_XX_XX_XX headset-head-unit-msbc
# if mSBC is not offered by the headset:
pactl set-card-profile bluez_card.XX_XX_XX_XX_XX_XX headset-head-unit

Replace the colons in the MAC with underscores. Then pick the mic as the default source:


wpctl status | grep -A 10 Sources
wpctl set-default <source-id>

**If all Headset Head Unit profiles are available: no, or selecting one gives silence in both directions**, the adapter is missing firmware. Check:


journalctl -kb | grep -i 'bluetooth.*firmware'

BCM: firmware Patch file not found means a Broadcom part, whose blobs are not in the repos:


yay -S broadcom-bt-firmware      # AUR
sudo systemctl restart bluetooth.service

Then unpair and re-pair the headset. For Intel adapters the ibt-* blobs are in linux-firmware-intel, and for Realtek the rtl_bt blobs are in linux-firmware-realtek. Both are pulled in by the linux-firmware meta-package, so on a stock install they are already there.

**Make apps switch to the mic automatically** when a call starts (this is on by default in WirePlumber but is frequently turned off by copy-pasted configs):


wpctl settings --save bluetooth.autoswitch-to-headset-profile true

**Check nothing has disabled the HFP role.** Look for a drop-in that strips hfp_hf:


grep -rn 'bluez5.roles\|autoswitch-to-headset\|enable-msbc' \
  ~/.config/wireplumber/ /etc/wireplumber/ 2>/dev/null

The upstream defaults are bluez5.roles = [ a2dp_sink a2dp_source bap_sink bap_source hfp_hf hfp_ag ], bluez5.enable-msbc = true and bluez5.hfphsp-backend = "native". **Prefer deleting the offending drop-in**, which puts you back on the defaults with no drift. If you would rather be explicit, write the defaults back verbatim and nothing more:


mkdir -p ~/.config/wireplumber/wireplumber.conf.d
tee ~/.config/wireplumber/wireplumber.conf.d/51-bluez-roles.conf >/dev/null <<'EOF'
monitor.bluez.properties = {
  bluez5.roles = [ a2dp_sink a2dp_source bap_sink bap_source hfp_hf hfp_ag ]
  bluez5.enable-msbc = true
  bluez5.enable-sbc-xq = true
  bluez5.hfphsp-backend = "native"
}
EOF

systemctl --user restart wireplumber.service

Do **not** add hsp_hs / hsp_ag on spec. They are omitted from the upstream default deliberately: with both hsp_ag and hfp_ag enabled some headsets stop working entirely (the Sony WH-1000XM3 is the documented case). Only add hsp_hs hsp_ag if the headset is old enough to offer HSP but not HFP, and back it out the moment the profile stops appearing.

Reconnect the headset afterwards. Expect the sound quality to collapse while HFP is active: mSBC is 16 kHz wideband and CVSD is 8 kHz narrowband. That is the protocol, not a bug, and it is why you want autoswitch rather than staying on HFP permanently.

Verify

pactl list cards | grep -A 5 'Active Profile' shows a headset-head-unit* profile. wpctl status lists the headset under Sources. Record and play back a test: pw-record /tmp/t.wav (Ctrl-C after speaking) then pw-play /tmp/t.wav. bluetoothctl info <MAC> and the transport state should read active, not idle, while recording.

Sources

bluetooth-headset-no-microphone-hfp-profile