Bluetooth Handsfree Head Unit (HFP) profile with Pipewire

I’m following up on Bluetooth mic doesn't work, headphones do, in Google Meet , as I now have more information on making the Bluetooth headset work with Manjaro KDE Pipewire on a Thinkpad T15g.

For many months, the workaround that I have been using has been to …
(i) Bluetooth > Connect the headset; and
(ii) Start Skype > Settings > Audio & Video > Microphone “Monitor of OpenComm by Aftershokz” > Make a free test call … and after that, the headset would work.

I really didn’t know why.

I got a hint to install pavucontrol-qt (since I’m on KDE), and now have a better sense what was happening.

(1) Starting the computer from a cold boot would have Bluetooth unconnected.

(2) Invoking Bluetooth > Connect adds a configuration of OpenComm by AfterShokz, and sets the profle to High Fidelity Playback (A2DP Sink). This would mean the sound could be heard, but the mic wasn’t working.

(3) Starting Skype > Settings > Audio & Video > would then given an option to switch Microphone from “Built-in Audio Analog Stereo” to “Monitor of OpenComm by Aftershokz” . Selecting the Make a free test call would lead to a click and then the mic would work

(4) Having taken the hint to watch pavucontrol, I can now see that making the switch of the Skype microphone forces the OpenComm by AfterShokz profile to Handsfree Head Unit (HFP).

This is the workaround that I’ve been using for months.

The pavucontrol has now led to an alternative approach.

(5) From a cold start, then Bluetooth > Connect the headset; there’s a choice about whether to select the default “High Fidelity Plackback (A2DP Sink)” or the dropdown of “Handsfree Head Unit (HFP)” . The HFP option can be selected without first starting Skype.

(6) Then starting Skype shows a different Microphone of “OpenComm by Aftershockz” rather than the forced “Monitor of OpenComm by Aftershokz”.

So, this now look like a solution for someone who doesn’t want to first start up Skype, and just use the microphone and sound in the headset (e.g. for Google Meet).

(7) Just for completeness, here’s what the pavucontrol Input Devices looks like:

(8) And here’s the pavacontrol Output Devices.

in addition to the Thinkpad T15g, I have a Thinkpad X230T. I’m looking into making the headset work there, too.

1 Like

While I have success on the Thinkpad T15g, the Thinkpad X230T isn’t so accommodating. I recently had a problem with KDE, that led to my reinstalling Manjaro. Thus, the OS is relatively fresh.

From the steps described above, I repeated:

(1) Starting the computer from a cold boot would have Bluetooth unconnected.

(2) Invoking Bluetooth > Connect adds a configuration of OpenComm by AfterShokz, and sets the profle to High Fidelity Playback (A2DP Sink) . This would mean the sound could be heard, but the mic wasn’t working.

(3) Starting Skype > Settings > Audio & Video > would then given an option to switch Microphone from “Built-in Audio Analog Stereo” to “Monitor of OpenComm by Aftershokz ” .

Selecting the Make a free test call doesn’t have the Skype recording show up in the headset.

(3a) On pavucontrol, I switch the Profile back from “Handsfree Head Unit (HFP)” to "High Fidelity Playback (A2DP Sink).

(3b) On Skype > Audio & Video > Microphone, the option of “Monitor of OpenComm by Aftershokz” is available, but I switched back to “Built-in Audio Analog Stereo”.

Selecting Make a free test call, I can hear the Skype recording in the headset. However, the recording now sounds noisy and distorted, as it’s picking up the machine noise from the internal Thinkpad mic.

I would appreciate additional diagnostics or advice! Thanks.

Have you found a way to permanently set the profile to HFP when connecting to the OpenComm? This is where I’m struggling right now. There is a post from @Ataraxy titled “Save bluetooth headset audio profile” (sorry, I’m not permitted to post the link directly to his post) where he’s asking the same question about saving the profile for his Jabra, but it’s applicable to the OpenComm as well and thus far I’m not finding a solution. I’ve tried defining a ‘set-card-profile’ in /etc/pulse/default.pa.d/opencomm.pa, and failed. I’ve tried locking the HFP profile to the card via ‘pactl send-message /card/bluez_card.20_74_CF_77_ED_E4 set-profile-sticky true’ and can see where the lock is enabled in the gui, but upon disconnect/reconnect it reverts back to A2DP. I’m starting to think that the only way I’m going to be able to handle this is via a udev rule.

Well, didn’t mean to hijack your thread, but I did finally work out a solution to the problem on my machine. No amount of fiddling with the pulseaudio configuration yielded success. I get this squared away by creating a udev rules that invokes a script which derives the user name and id of the user who is logged in and uses that info to send a profile change command to pulseaudio. It’s a pretty disgusting hack to workaround something as simple as the inability to explicitly set profile priority for devices in pulseaudio. Annoying as this is, I learned something new so that’s a positive takeaway. Good luck.

In addition to the Aftershokz OpenComm headset, I also have a Jabra Elite 65t bluetooth headset.

Using pavucontrol to set Configuration to Jabra Elite 65t results in no sound from Skype > Settings > Audio & Video > Microphone “Jabra Elite 65t ” > Make a free test call

Changing that Profie to High Fidelity Playback (A2DP Sink) sends sound to the Jabra headset, the sound gets pickedup by the internal Thinkpad mic (really noisy).

Here’s the inxi:

System:
  Host: di-3434cto Kernel: 5.18.5-1-MANJARO arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.24.5 Distro: Manjaro Linux
Machine:
  Type: Laptop System: LENOVO product: 3434CTO v: ThinkPad X230 Tablet
    serial: <superuser required>
  Mobo: LENOVO model: 3434CTO serial: <superuser required>
    UEFI-[Legacy]: LENOVO v: GCETB1WW (2.71 ) date: 06/19/2018
Battery:
  ID-1: BAT0 charge: 46.8 Wh (98.9%) condition: 47.3/57.2 Wh (82.6%)
CPU:
  Info: dual core model: Intel Core i7-3520M bits: 64 type: MT MCP cache:
    L2: 512 KiB
  Speed (MHz): avg: 2442 min/max: 1200/3600 cores: 1: 2422 2: 2207 3: 2437
    4: 2702
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel
  Device-2: Chicony Integrated Camera type: USB driver: uvcvideo
  Display: x11 server: X.Org v: 21.1.3 driver: X: loaded: modesetting
    gpu: i915 resolution: 1: 1366x768~60Hz 2: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel HD Graphics 4000 (IVB GT2)
    v: 4.2 Mesa 22.1.1
Audio:
  Device-1: Intel 7 Series/C216 Family High Definition Audio
    driver: snd_hda_intel
  Sound Server-1: ALSA v: k5.18.5-1-MANJARO running: yes
  Sound Server-2: PulseAudio v: 16.0 running: yes
  Sound Server-3: PipeWire v: 0.3.52 running: yes
Network:
  Device-1: Intel 82579LM Gigabit Network driver: e1000e
  IF: enp0s25 state: down mac: 3c:97:0e:e1:51:78
  Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi
  IF: wlp3s0 state: up mac: e0:9d:31:16:24:e4
Bluetooth:
  Device-1: Broadcom BCM20702 Bluetooth 4.0 [ThinkPad] type: USB
    driver: btusb
  Report: rfkill ID: hci0 state: up address: see --recommends
Drives:
  Local Storage: total: 1.13 TiB used: 846.21 GiB (73.3%)
  ID-1: /dev/sda vendor: Western Digital model: WD10SPCX-22HWST0
    size: 931.51 GiB
  ID-2: /dev/sdb vendor: Crucial model: CT240M500SSD3 size: 223.57 GiB
Partition:
  ID-1: / size: 48.11 GiB used: 24.68 GiB (51.3%) fs: ext4 dev: /dev/sdb7
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 75.0 C mobo: N/A
  Fan Speeds (RPM): cpu: 65535 fan-1: 4938 fan-2:
Info:
  Processes: 319 Uptime: 1d 1h 27m Memory: 15.33 GiB used: 9.41 GiB (61.4%)
  Shell: Zsh inxi: 3.3.19

From Headphone Mic doesn't get detected - #3 by pavan , I’m hoping that @Olli might provide more guidance?

This Thinkpad X230T is a multi-boot computer, so I decided to try experiments with Kubuntu 22.04 and Ubuntu 20.04. I’m coming to a conclusion that this is a problem with the HFP profile in general.

Under Kubuntu 22.04, pavucontrol shows similar conditions, with slightly different description as H5P/HFP.
20220620_Kubuntu_pavucontrol

Skype Make a free test call still doesn’t produce a sound under the H5P/HFP, so the alternative is still the A2DP profile for sound, that results in the unusable internal mic.

Here’s the inxi (from an original Kubuntu 20.04 that got upgraded to 22.04).

$ inxi -F              
System:    Host: di-3434cto Kernel: 5.4.0-117-generic x86_64 bits: 64 Desktop: KDE Plasma 5.18.8 
           Distro: Ubuntu 20.04.4 LTS (Focal Fossa) 
Machine:   Type: Laptop System: LENOVO product: 3434CTO v: ThinkPad X230 Tablet serial: <superuser/root required> 
           Mobo: LENOVO model: 3434CTO serial: <superuser/root required> UEFI [Legacy]: LENOVO v: GCETB1WW (2.71 ) 
           date: 06/19/2018 
Battery:   ID-1: BAT0 charge: 46.8 Wh condition: 47.3/57.2 Wh (83%) 
CPU:       Topology: Dual Core model: Intel Core i7-3520M bits: 64 type: MT MCP L2 cache: 4096 KiB 
           Speed: 1203 MHz min/max: 1200/3600 MHz Core speeds (MHz): 1: 1200 2: 1202 3: 1204 4: 1205 
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.13 driver: modesetting unloaded: fbdev,vesa 
           resolution: 1366x768~60Hz, 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 21.2.6 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio driver: snd_hda_intel 
           Sound Server: ALSA v: k5.4.0-117-generic 
Network:   Device-1: Intel 82579LM Gigabit Network driver: e1000e 
           IF: enp0s25 state: down mac: 3c:97:0e:e1:51:78 
           Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi 
           IF: wlp3s0 state: up mac: e0:9d:31:16:24:e4 
Drives:    Local Storage: total: 1.13 TiB used: 873.58 GiB (75.6%) 
           ID-1: /dev/sda vendor: Western Digital model: WD10SPCX-22HWST0 size: 931.51 GiB 
           ID-2: /dev/sdb vendor: Crucial model: CT240M500SSD3 size: 223.57 GiB 
Partition: ID-1: / size: 33.34 GiB used: 19.69 GiB (59.1%) fs: ext4 dev: /dev/sdb1 
           ID-2: /home size: 69.52 GiB used: 51.09 GiB (73.5%) fs: ext4 dev: /dev/sdb5 
           ID-3: swap-1 size: 15.30 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdb6 
Sensors:   System Temperatures: cpu: 72.0 C mobo: 0.0 C 
           Fan Speeds (RPM): cpu: 4437 
Info:      Processes: 263 Uptime: 5m Memory: 15.34 GiB used: 1.72 GiB (11.2%) Shell: bash inxi: 3.0.38

Ubuntu 20.04 seems to produce similar results.

The outstanding mystery is why I can get this test to work on my Thinkpad T15g, and not my Thinkpad X230T.

I notice some suggestions on " Diagnosing a Bluetooth headset HSP/HFP issue with PipeWire - Ubuntu 20.04", but am unsure whether it’s relevant for Manjaro or not.

Back to Manjaro on the X230T, I’ll provide the settinga as described at Diagnosing a Bluetooth headset HSP/HFP issue with PipeWire - Ubunt

With pavucontrol reading "Handsfree head Unit (HFP), here’s the pactl list cards:

pactl list cards                                                                                 ✔ 
Card #0
        Name: alsa_card.pci-0000_00_1b.0
        Driver: module-alsa-card.c
        Owner Module: 6
        Properties:
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xf2530000 irq 32"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1b.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "1e20"
                device.product.name = "7 Series/C216 Chipset Family High Definition Audio Controller"
                device.form_factor = "internal"
                device.string = "0"
                device.description = "Built-in Audio"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        Profiles:
                input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 32833, available: yes)
                output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 39268, available: yes)
                output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 39333, available: yes)
                output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 33968, available: yes)
                output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 34033, available: yes)
                output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: no)
                output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5965, available: yes)
                output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
                output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 865, available: yes)
                output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
                output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 865, available: yes)
                output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: no)
                output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5765, available: yes)
                output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
                output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
                output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
                output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 665, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: output:analog-stereo+input:analog-stereo
        Ports:
                analog-input-internal-mic: Internal Microphone (type: Mic, priority: 8900, latency offset: 0 usec, availability unknown)
                        Properties:
                                device.icon_name = "audio-input-microphone"
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo
                analog-input-dock-mic: Dock Microphone (type: Mic, priority: 7800, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "audio-input-microphone"
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo
                analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "audio-input-microphone"
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71+input:analog-stereo, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1+input:analog-stereo
                analog-output-speaker: Speakers (type: Speaker, priority: 10000, latency offset: 0 usec, availability unknown)
                        Properties:
                                device.icon_name = "audio-speakers"
                        Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo
                analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "audio-headphones"
                        Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
                hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "video-display"
                        Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo, output:hdmi-surround71, output:hdmi-surround71+input:analog-stereo
                hdmi-output-1: HDMI / DisplayPort 2 (type: HDMI, priority: 5800, latency offset: 0 usec, not available)
                        Properties:
                                device.icon_name = "video-display"
                        Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo, output:hdmi-surround71-extra1, output:hdmi-surround71-extra1+input:analog-stereo

Card #1
        Name: bluez_card.20_74_CF_5B_7E_B2
        Driver: module-bluez5-device.c
        Owner Module: 25
        Properties:
                device.description = "OpenComm by AfterShokz"
                device.string = "20:74:CF:5B:7E:B2"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "headphone"
                bluez.path = "/org/bluez/hci0/dev_20_74_CF_5B_7E_B2"
                bluez.class = "0x240418"
                bluez.alias = "OpenComm by AfterShokz"
                device.icon_name = "audio-headphones-bluetooth"
                bluetooth.battery = "80%"
                bluetooth.codec = "mSBC"
        Profiles:
                a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)
                handsfree_head_unit: Handsfree Head Unit (HFP) (sinks: 1, sources: 1, priority: 30, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: handsfree_head_unit
        Ports:
                headphone-output: Headphone (type: Headphones, priority: 0, latency offset: 0 usec, available)
                        Part of profile(s): a2dp_sink, handsfree_head_unit
                headphone-input: Bluetooth Input (type: Bluetooth, priority: 0, latency offset: 0 usec, available)
                        Part of profile(s): handsfree_head_unit

Here’s the pactl info .

pactl info                                                                                   INT ✘ 
Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 12
Tile Size: 65472
User Name: daviding
Host Name: di-3434cto
Server Name: pulseaudio
Server Version: 16.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: bluez_sink.20_74_CF_5B_7E_B2.handsfree_head_unit
Default Source: bluez_source.20_74_CF_5B_7E_B2.handsfree_head_unit
Cookie: 1922:f020

Now, I’m way out of my depth!