How to enable Bluetooth headset microphone support in Ubuntu 20.04

This post explains how you can enable bluetooth headset microphone support by installing pipewire in Ubuntu 20.04

Boltt BH1300 Image

Ok, I recently purchased a new BOLTT BH1300 bluetooth headset, which has inbuilt microphone support. The main purpose of the headset was to enable Meetings without having to worry about wires. My Headset instantly connected to the laptop’s bluetooth and to my surprise, the mic was not working. Upon checking the System settings, I found that it was still using the laptop’s internal microphone which was already broken and was not usable. See the screenshot below:

Upon googling and fiddling with my configuration for a few hours, I found that this was a very common problem on the Ubuntu Linux and the pulseaudio  was to blame. So, typically what happens is that for microphone to work, you require HSP (Handset Profile) /HFP(Hands-Free Profile) support in your OS and that is provided by default sound driver pulseaudio in case of Ubuntu linux and pulseaudio does not support HSP out of the box.

It took me some hours to finally make it work using pipewire which is an open source software that aims to greatly improve handling of audio and video under Linux. There were other options too like using oFono library but it was useless to me and too much of configuration. oFono is a mobile telephony software and it was never meant for this particular problem anyway. If you guys are also suffering from the same problem then please follow the rest of the article.

Enable Bluetooth headset microphone

Before installing pipewire, please make sure that your issue is the same as mine.

First, type this command in Terminal

$] bluetoothctl

It should show something like this:

[BOLTT BH1300]#

Where BOLTT BH1300 is my device name. type info and you will see info about your headset:

Device 07:F8:87:8F:B9:ED (public)
	Name: BOLTT BH1300
	Alias: BOLTT BH1300
	Class: 0x00340404
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: yes
	LegacyPairing: no
	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v05D6p000Ad0240

Notice Audio Sink which is necessary to make sure the headset’s microphone is detected. Type quit to exit from bluetoothctl.

Now run pacmd list-cards to show all connected devices.

It should show all the devices. Locate your bluetooth headset and look for the profiles key like below. headset_head_unit available no means that HSP/HFP is not enabled.

profiles:
    a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 40, available: unknown)
    headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: no)
    off: Off (priority 0, available: yes)
active profile: <a2dp_sink>

As pulseaudio does not support HSP/HFP by default, we can override it with the pipewire library.

Installing Pipewire in ubuntu 20.04

To Install pipewire, you need to add a pipewire repository. Type the following command in Terminal:

sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
sudo apt update
sudo apt install pipewire
sudo apt install libspa-0.2-bluetooth
sudo apt install pipewire-audio-client-libraries

Once updated, you will need to reload bluetooth services and mask pulseaudio.

systemctl --user daemon-reload
systemctl --user --now disable pulseaudio.service pulseaudio.socket
systemctl --user mask pulseaudio
systemctl --user --now enable pipewire-media-session.service

If you run into some issues in the last command, which I did too. The best way is to restart pipewire or reboot your system.

systemctl --user restart pipewire
sudo reboot
# make sure eveything is working
pactl info

I don’t know why but for me, it never worked straight and I always had to choose the Headset in Microphone settings manually as shown below.

Please keep in mind that choosing HSP/HFP profile makes your bluetooth in mono mode and you lose stereo sound. I would recommend you to use it only in case of meetings.

You can now enjoy your bluetooth headsets fully in your Ubuntu Linux. Have a great day. Thanks.

Leave a Reply

%d bloggers like this: