Skip to content

Solving Mic Of Wireless Earbuds Not Working On Ubuntu 20

Ubuntu Wireless Earbuds

TL;DR

My newly purchased set of earbuds had terrible microphone quality in video-conferencing only on my Ubuntu system. The problem was that most earphone/earbuds use A2DP configuration for High Fidelity Playback. This configuration doesn’t support mic as it works unidirectionally (Laptop to Earbuds only). Switching this configuration to HSP/HFP can enable mic support with minor degradation of audio/output quality. This configuration is not available by default in Ubuntu using Pulseaudio drivers. The Pulseaudio drivers that comes pre-loaded with the OS has removed the support for HSP/HFP due to it’s buggy nature. This lead to removed support for mic on most wireless earbuds. To solve the issue of wireless earbuds not working you can jump to ‘Solving The Issue’ section or you can read how I reached to this conclusion below.

Sound panel in Ubuntu
Sound settings panel

The Problem

I recently bought a pair of wireless earbuds that boasted of having 4 microphones for loud and clear call quality. This claim indeed held true on multiple phone calls done using my mobile over the next weekend. The person on other side of the call could definitely hear me better than any of my previous earphones/buds. The problem started when I tried to pair it with my laptop for video conferencing. Surprisingly! the compliments of crystal clear sound from my phone calls suddenly turned into complaints of too much noise on my laptop.

Since everything was working fine on my phone, it didn’t took me long to figure out that the problem was with the Ubuntu system. To dig a bit deeper, I looked into Settings panel under Bluetooth section, nothing much to see there. The only option I got was to disconnect the device or forget connection. No leads so far! Next, I shifted my focus to the Sounds section, to check if there is some problem with my microphone configuration. Voila! there it is, the problem stared right at my face. The output was configured to use my earphones but the input/mic was locked to the laptop’s microphone and the earbud’s mic was not even listed.

The Root Cause

So finally, I got to the problem, half the battle won right? not so fast the problem was not just the missing driver but the missing support. Let’s explore the situation a bit more, the configuration on output was set to A2DP but input is locked to digital microphone. So maybe, if I can somehow add the same configuration for microphone as well, things might work? The answer I got was a huge NO! A2DP only support unidirectional audio transfer and is used to send High Fidelity Playback audio to earbuds. It cannot simply send input from the mic to the laptop.

So this configuration will not work with the on-device microphone. Simply searching ‘Ubuntu mic not working’ brings up only few relevant results, none of them worked completely at the time of writing this. But while searching on our beloved Stack Overflow there are many dead ends for “wireless earbuds not working”. After searching for a while I got another lead or configuration to be precise. HSP (Head Set Profile) or HFP (Head Phone Profile) configuration which supports bi-directional data transfer is required if we want to use the microphone of any Bluetooth device. Support for this configuration was removed in previous versions of Pulseaudio due to the buggy nature of the library. The oFono library that adds support for mobile telephony was used for HSP/HFP configuration in earlier version of Pulseaudio. So I finally reached to the root cause of the problem now time to find the solution.

Solving The Issue

Originally, when I started writing this article, it was going to be about oFono. It added support for HSP/HFP to the existing Pulseaudio drivers instead of replacing them. Though, I had previously heard about another solution named Pipewire. Being an alternative to Pulseaudio, I had to remove the existing drivers and install the Pipewire for it to work. But the idea of replacing the drivers for adding support sounded a bit too extreme at that time. So oFono was my only option left at that time and it did work (for at least a few minutes).

oFono as already mentioned is a bit buggy and that’s why it was removed from Pulseaudio. In my initial testing I was happy with it until it started randomly disconnecting the audio. It was not at all reliable and I had to write system services/configs to get it to work seamlessly. It was just a lot more effort with very little Output. After a 2 days of struggling with this setup, I finally decided to try out Pipewire. After all, being a Software Developer, I cannot leave a problem unsolved, even if it means having to install the drivers again if things go wrong. So far the experience with Pipewire is far better than oFono + Pulseaudio. So, it is the recommended setup from my side to solve the issue of wireless earbuds not working.

Pipewire Installation

Pipewire is an Open Source utility that supports HSP/HFP configuration out of the box. This utility simply replaces the pre-installed Pulseaudio utility without uninstalling it completely. This gives the added advantage of rolling back your changes if things go wrong at any point. Let’s get to the part on how to set it up on your Ubuntu 20 computer.

  1. Open the terminal. You can hit `Ctrl+Alt+T` or look for terminal in global search.
  2. In the terminal run the following command to add the Pipewire package source to your source list:
    sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
  3. Run the update command to refresh the PPA in the system:
    sudo apt update
  4. Install Pipewire by simply running the command:
    sudo apt install pipewire
  5. Install Pipewire with all dependencies using the command:
    sudo apt install libspa-0.2-bluetooth pipewire-audio-client-libraries
    sudo apt install gstreamer1.0-pipewire libpipewire-0.2-1 libpipewire-0.2-dev libpipewire-0.2-doc
  6. Reload the daemon:
    systemctl --user daemon-reload
  7. Next we will disable Pulseaudio from the system (we are not removing it just disabling):
    systemctl --user --now disable pulseaudio.service pulseaudio.socket
    systemctl --user mask pulseaudio
  8. Restart your system before moving to the next step. Since we have disabled the Pulseaudio service that was pre-loaded in OS, it is crucial that we restart the system. This step help in proper configuration of the new service.
  9. Enable the Pipewire media session service:
    systemctl --user --now enable pipewire-media-session.service
  10. Test your install by running the following command:
    pactl info
    If the text that appears say ‘Pulseaudio (on Pipewire)‘ under server name then your installation is successful else you can try the bellow command to restart the Pipewire serve and check again:
    systemctl --user restart pipewire

Do note that in HSP/HFP configuration the earbuds will work in mono mode (Stereo only works with A2DP configuration).

Sound panel after solving the issue of wireless earbuds not working
Sound Panel After Installation

If you want to rollback all the changes we did just now, you can do it by using:
systemctl --user unmask pulseaudio
systemctl --user --now enable pulseaudio.service pulseaudio.socket

Post Installation Steps (Optional)

After installing Pipewire the connectivity was great but the input volume from the mic was very low. I was barely audible to the other participants (again only happening on Ubuntu). If you face similar issue after installing Pipewire, you can simply install PulseEffects. It’s an audio utility that allow you to change (and boost) the input/output of your system audio. And a cherry on top is that it can also remove the low frequency noise using preset filters. Here is how you can install and configure PulseEffects in your system:

  1. Just like we did for Pipewire, we will simply add the PPA for the PulseEffects package to the system:
    sudo add-apt-repository ppa:mikhailnov/pulseeffects -y
  2. Next install the utility with ‘–install-recommends’ flag to also install any required dependencies:
    sudo apt install pulseeffects --install-recommends
  3. Open PulseEffects and change the configurations by adding audio effects. Below is the configuration that worked for me (your values might vary).
    • Limiter: Change Input to 30.0, leave rest of the settings unchanged.
    • Multiband Compressor: Change input to 2.5, leave everything else unchanged.
    • Filter (for additional noise reduction): Select ’12db/oct Bandpass’ from presets, change Resonance to -1.0 dB, leave everything else unchanged.
    • Equalizer: Change input to 2.5, leave everything else unchanged.

You can test out different configurations and check it on any online mic test utility (Google ‘mic test’). These utilities record your voice from your microphone. Once done you can playback the sound to check audio quality. In my case with these settings the voice is loud and clear.

Pulse Effects interface
PulseEffects interface

Drop a Like if you think this was helpful. Share with others if someone else is facing this issue. Leave a comment If something in this article didn’t work. You can also share what worked for you in the comments.

If you happen to host a WordPress website, you can read how to secure your site:

Is your WordPress website redirecting users to a malicious web page?

Signing off till next article, See you there 🙂

12 thoughts on “Solving Mic Of Wireless Earbuds Not Working On Ubuntu 20”

  1. So, I tried everything here, and it seems my bluetooth headphones are connected, which is great. However, I have a couple of issues I’m running into.

    1) I’ve got terrible static-like noise that I’m hearing from the headphones. If I switch them over to A2DP in the sound settings, that goes away. As soon as I toggle it over to HSP/HFP, I get static. Is there a way to get rid of that? If it matters, I’m using Bose QC35 headphones.

    One issue I had–and I’m a noob, so maybe this is the problem–when I ran this line in the terminal [sudo apt install gstreamer1.0-pipewire libpipewire-0.2-1 libpipewire-0.2-dev libpipewire-0.2-doc] I got an error message saying that libpipewire-0.2-dev and libpipewire-0.2-doc don’t exist. What do I do about that?

    2) I did a mic test, and the mic quality is not very great. Sounds tinny, though I know my headphones have great mic sound when I’m connected to another device, like my phone. Any thoughts on where to start with PulseEffects to change that? I don’t know a lot about sound settings.

    1. Eternal Geeker

      @Trish glad you made it work! I will try to help you with the issues you are facing.

      • Static can be due to a lot of variables so it is difficult to exactly say why this is happening. Are you using pulse audio on output (speakers)? If yes, then try turning it out off. If your speaker volume is over amplified it can lead to minor static sound also getting amplified to irritating levels. Also, can you try turning off noise cancellation on the headphones and see if anything changes? As for the libraries you can try and download the deb file (just like .exe for windows) and install it manually from https://pkgs.org/download/libpipewire-0.2-dev and https://pkgs.org/download/libpipewire-0.2-doc
      • In the PulseEffects make sure you are on the microphone menu and not speaker menu (this could be the reason for static). You can switch it by clicking on the top left microphone button. Once in the menu you will see many options like Gate, Limiter, Equalizer, etc. You just need to change the input slider to amplify the microphone sensitivity. See the image I have posted in the article for the options I am using. I am posting the input value I an using for your reference but your values might differ and you might have set it by trial and error.
        Limiter => Input - 30
        Multiband Compressor => Input - 2
        Filter => Input - 4
        Equalizer => Input - 2

      You can also set “Filter” to “6dB/oct Bandpass” with Resonance value of -3.0 dB to reduce noise from your microphone. If that doesn’t make sense here no issues you will know what to do once you open the filter option. Again, these values worked for me and you might have to tweak these according to your case.

      Best of Luck 🙂

  2. Actually, this ended up failing badly. Every time I try to listen to anything now, I get HORRIBLE, garbled sound. Not just static, but even a beep sounds like the way a highly pixelated photo looks, if that makes sense (not sure how else to explain it). The only way to get good sound again was to switch back to A2DP instead of HSP/HFP, which defeats the point.

    I really wish this would get fixed. It’s a known problem affecting enough users that’s a massive hindrance in pandemic times when I need to be making Zoom calls all the time and need the headphones for privacy.

    Though I ended up capitulating and getting a USB bluetooth dongle, and that’s not even working. If I can’t figure this out, I’m going to have to get a Chromebook or something. I’ve been a happy Ubuntu user since 2008, but this has been my nemesis and the one thing I haven’t been able to fix, and it’s crippling my ability to get meetings done. 🙁

    1. Eternal Geeker

      Sorry to hear that it didn’t work. This problem is related to software and I highly doubt the dongle would give you any better results. I found an open issue with BOSE headphones on bug forum. It has been there for quite some time with no clear fix in foreseeable future https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1894097.
      Though I might not be able to help you resolve this further, but I have a few suggestions that are cheaper than buying a new laptop.

      • Install Windows alongside linux (Dualboot) – Only downside is that you will have to shutdown Linux and boot to Windows before every meeting.
      • Install Windows in a virtualbox on existing Ubuntu – I have tested it out with the wired headsets and it works. Since the problem is with the software this should solve the headset issue in theory.
      • Buy another noise cancelling wired headset only for calls.

      And if you need help for either of the first two options. I would be happy to post a guide for you in upcoming days, so you can let me know in the reply.

      For the love of Linux, I hope you find a solution for this problem and don’t have to switch to another OS 🙂

      Best of luck!

  3. Not working for me. First of all, not able to see Configuration under Input section and when I select HSP/HFP, in Output section got no sound. I’ve to switch to A2DP sink to get back sound.
    Using LG Tone-FP9.

    1. I am facing the same issue as Fire. I got everything installed, and if I select the A2DP sound, it works great. But if I switch to the Handsfree audio source, the “Configuration” section of the Settings screen disappears. If I select “Test”, I get the option to test mono, but I don’t hear anything in my headset.

      1. Eternal Geeker

        Sorry to hear that. This post is for older versions of Pulse Audio, so there might be some update that this post does not cover resulting in it not working. Bluetooth audio is always troublesome with Linux platform and I have tried multiple solution only to find them failing after a few days due to a new update. Though if you do get it working by yourself do let me know and I will update this post.

        Best of Luck!

    2. Eternal Geeker

      Sorry to hear that. This post is for older versions of Pulse Audio, so there might be some update that this post does not cover resulting in it not working. Bluetooth audio is always troublesome with Linux platform and I have tried multiple solution only to find them failing after a few days due to a new update. Though if you do get it working by yourself do let me know and I will update this post.

      Best of Luck!

  4. Worked GREAT!!! I’m running Linux Mint 20.3 with Cinnamon desktop on an HP laptop. I just copied and pasted all the necessary steps into my terminal window, including the restart at Step 8.

    Thanks a bunch, E.G. !!!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: