How to enable Bluetooth headset microphone support in Ubuntu

Last updated on March 9th, 2023 at 01:05 pm

This post explains how you can enable Bluetooth headset microphone support by installing pipewire in Ubuntu 20.04. However it should work with any Ubuntu flavour.

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.

You could also support this blog by ‘Buy Me a Coffee‘ icon in bottom right corner. Have a great day. Thanks.

39 thoughts on “How to enable Bluetooth headset microphone support in Ubuntu”

  1. I rejoiced the whole evening when I received a working microphone in bluetooth headphones on the laptop without support of built-in mic (Lenovo Yoga c930)! But on the next day I cannot connect my headphones to my laptop. The Bluetooth manager sees them, but disconnects on connection. I tried to reinstall all the stuff, including a fresh install of Ubuntu, but I still can’t get it to work. 😦

      1. Unfortunately I am started receiving nasty artifacts on display as on old TV with installed pipewire. To top it all off, my headphones began to turn off again. I reverted to pulseaudio without mic 🙁

  2. Working fine on Ubuntu 20.04, thanks!
    Have manually switch profiles between HSP and A2DP for calls through browser, but it works

  3. Thanks for sharing the solution. I can only choose “HSP/HFP, codec CVSD” so that both bluetooth microphone and speaker works. Otherwise, only microphone worked. It’s not a big issue to me. Just a tweak you probably need to do if not both work. BTW, I use my airpod.

  4. Hi, I tried following your steps. All seems to work fine, until I reboot the system. All the system becames slow, I don’t know why. I undo the previous steps to enable again pulseaudio, and the system worked fine again. So I don’t know why I can’t use pipewire 😦 I’m using Ubuntu 20.04

  5. Thanks, that worked!
    The only thing it was necessary for me to replace:
    pulseaudio.socket
    with:
    systemctl –user start pulseaudio.socket

    Now I can use Samsung U-flex with a microphone =)

  6. Hello, thank you for this – great article. I’ve got just one issue (but a major one!) – on HSP/HFP profiles there is loopback (voice from headphone’s mic is played, loopbacked, on the headphones).

    I have tried popular solutions, e.g. looking into alsamixer but there is nothing wrong there.

    Any ideas?

    1. Hi Jakub,

      Unfortunately I can’t replicate the issue If you find some solution, please feel free to post here for others too.

      Glad you liked the post. Thanks

  7. Working good but when i switched to from speaker to bluetooth device, videos are crashing in chrome and other browsers. I need to restart browser to make them work.

    Also, i’m facing connection issue. I need to remove the bluetooth device and pair again to make it work,

  8. Thank you.
    I followed the steps but I can no longer connect my headset. My system sees it but when I toggle the connect button, it reverts back. How can I solve this? And How can I undo the above steps?
    I’m using Zorin OS 16/Bluetooth Ver4/Headset bluetooth 4

  9. Awesome! Thanks a lot for taking the time to document this. It worked like a charm with Galaxy Buds+ (E685) on Ubuntu 20.04.2 LTS (Focal Fossa).

  10. I upgraded my 20.04 to 21.10 on one of my systems, and the pulseaudio on 21.10 sees the microphone. I’m not quite ready to do the update on my main system, and wonder if there is a way to get the newer pulseaudio on 20.04.

  11. Hey thanks for this solution. It certainly worked with my JBL CLUB700BT headphones and mic. As someone already pointed out, I can only use HSP with codec CVSD for both to work consistently, but also my A2DP volume is now very low.

  12. Thanks for this! It singlehandedly saved my online school experience. I wish that there would be a build in option that would allow for stero output. Maybe in a future Ubuntu update.

  13. Thanks a lot for sharing this worked for me now my headset’s mic is detected but It doesn’t work or capture any sound do you have any suggestions?

    There’s only one difference I have from all the steps
    In the output configuration I have HSP/HFP, codec mSBC selected and I don’t have HSP/HFP, codec CVSD as an option
    Also I don’t see any configuration for the input section

    I’m using ubuntu 20.4 and airpods

  14. Thanks a lot for this, just one question,
    If I enable mic from my headset, codec turns to mono audio?
    Any resolve for that?

  15. bro pls tell my how to undo these steps. I followed the same and there is no sound at all in my laptop

  16. Didn’t work out for me. First, not able to see Configuration in the Input section and for Output, choosing HSP/HFP give me no sound and no input either. I’m using LG Tone9

  17. Thanks for sharing this! I finally use my BaseUS Bluetooth Headphone with mic in my Lenovo IdeaPad. Unfourtnally the internal mic stop to work. This is a known issue in Alsa and Realtek ALC Codecs.

Leave a Reply

%d bloggers like this: