Diagnosing a Bluetooth headset HSP/HFP issue with PipeWire - Ubuntu 20.04

No, this is not another "I have Ubuntu 20.04 and my bluetooth microphone doesn't work" question.

I did some research and found out about Pulseaudio and oFono problems.  I've tried many things, including kernel 5.12.12 installation - nothing has helped.  I gave up for a moment, digging out the old wired headset from the garage. Then I installed Fedora 34 on my second computer and, to my surprise, found there was no problem with my headset there.  It was like the light at the end of the tunnel.  I assumed it was PipeWire, so I installed it on my main machine.  Unfortunately, the situation has not improved here.

After PipeWire has been installed, the system behaves exactly the same as before, that is:

  • I can choose HSP/HFP profile for both input and output;
  • after switching to the HSP/HFP profile, I cannot hear the sound in the headphones (only deaf silence) and my microphone does not pick up any sounds;
  • after switching to the A2DP profile, I can hear the sound in the headphones without any problem.

After switching to the HSP/HFP profile pactl list cards gives me:

Card #37
    Name: bluez_card.38_18_4C_59_F1_6A
    Driver: module-bluez5-device.c
    Owner Module: n/a
    Properties:
        device.api = "bluez5"
        device.bus = "bluetooth"
        media.class = "Audio/Device"
        device.name = "bluez_card.38_18_4C_59_F1_6A"
        device.description = "WH-1000XM3"
        device.alias = "WH-1000XM3"
        device.form_factor = "headset"
        device.string = "38:18:4C:59:F1:6A"
        api.bluez5.icon = "audio-card"
        api.bluez5.path = "/org/bluez/hci0/dev_38_18_4C_59_F1_6A"
        api.bluez5.address = "38:18:4C:59:F1:6A"
        api.bluez5.device = ""
        api.bluez5.class = "0x240404"
        api.bluez5.connection = "connected"
        device.icon_name = "audio-headset-bluetooth"
        bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink ]"
        factory.id = "14"
        client.id = "30"
        object.id = "37"
    Profiles:
        off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        a2dp-sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 0, available: yes)
        headset-head-unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 0, available: yes)
        a2dp-sink-sbc: High Fidelity Playback (A2DP Sink, codec SBC) (sinks: 1, sources: 0, priority: 0, available: yes)
        headset-head-unit-cvsd: Headset Head Unit (HSP/HFP, codec CVSD) (sinks: 1, sources: 1, priority: 0, available: yes)
    Active Profile: headset-head-unit-cvsd
    Ports:
        headset-input: Headset (priority: 0, latency offset: 0 usec, available)
            Properties:
                port.type = "headset"
            Part of profile(s): headset-head-unit, headset-head-unit-cvsd
        headset-output: Headset (priority: 0, latency offset: 0 usec, available)
            Properties:
                port.type = "headset"
            Part of profile(s): a2dp-sink, headset-head-unit, a2dp-sink-sbc, headset-head-unit-cvsd

pactl info gives me:

Server String: /run/user/1001/pulse/native
Library Protocol Version: 33
Server Protocol Version: 35
Is Local: yes
Client Index: 37
Tile Size: 65472
User Name: kamyllus
Host Name: 
Server Name: PulseAudio (on PipeWire 0.3.30)
Server Version: 14.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
Default Source: alsa_input.usb-DisplayLink_Dell_D3100_USB3.0_Dock_1712133780-02.iec958-stereo
Cookie: 0404:22f4

and cat /proc/version gives:

Linux version 5.8.0-55-generic (buildd@lgw01-amd64-050) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021

I need help diagnosing the problem. I am determined to shut up my Windows-colleagues laughing in my face as I struggle.

Please tell me what information I can also provide.  I can compare the setup with Fedora, as well, but I need to know where to look.  I need more data, so I can continue the fight (maybe in another, more precise, forum).


Solution 1:

Since version 0.3.28 conf files are moved to /usr/share/ directory from /etc/. You have to copy them to /etc/ directory manually. From Now /etc/pipewire/ can be used as system wide drop in for User edited conf files. conffile overridden behaviour is $HOME/.config/pipewire > /etc/pipewire > /usr/share/pipewire

To copy conffiles from /usr/share/ to /etc/:

sudo cp -vRa /usr/share/pipewire /etc/

Make sure you have masked PulseAudio and restart Pipewire Service using:

systemctl --user mask pulseaudio
systemctl --user restart pipewire pipewire-pulse

If still doesn't work, I would suggest re-installation using the following link https://pipewire-debian.github.io/pipewire-debian/