93

With Ubuntu 16.04 I've been attempting to pair by Apple airpods as a headset. They come up as headphones. They work fine as headphones, but I would like the microphone to be available

airpods pairing as headphones, not headset

Doug T.
  • 1,210

4 Answers4

90

I was helped by the instruction below.

  1. Set ControllerMode = bredr or ControllerMode = dual by editing /etc/bluetooth/main.conf file using sudo nano /etc/bluetooth/main.conf command (or another text editor of your choice)
  2. sudo /etc/init.d/bluetooth restart
  3. Try to pair again.
damadam
  • 2,873
Alexander
  • 933
24

I was desperately searching on the websites, but I finally found this blog post which was really helpful to get familiar with a complementary Bluetooth stack. Here's the solution which I have changed and added to it according to my experience:

  1. Install bluez Bluetooth stack (like a full set of Bluetooth drivers which allows the Linux OS direct access to Bluetooth):

    sudo apt-get install 'bluez*'

  2. Optional: install Bluetooth manager, Blueman:

    sudo apt-get install blueman

  3. Load USB Bluetooth driver (Bluetooth dongle):

    modprobe btusb

  4. Restart bluetooth service:

    sudo systemctl restart bluetooth

  5. Add controller mode setting to be dual Bluetooth configuration /etc/bluetooth/main.conf change this mode to bredr or le in case you have problem with your AirPods:

    ControllerMode = dual

  6. Now try to pair your AirPods!

The source of the issue is that Ubuntu's Bluetooth driver doesn't cover AirPods' one.

My system specification:

  • Ubuntu 18.04.2 LTS
  • Mini Bluetooth 4.0 USB 2.0 CSR4.0 Dongle Adapter

UPDATE:

You might need to choose either dual or bredr for ControllerMode in step 5.

enter image description here

13

Ubuntu 23.04

On this one it will just work, as it uses pipewire.

Ubuntu 21.04/22.04

First, some words of context of what's might be going on for Ubuntu 21.04. Pulseaudio doesn't have complete/perfect support for HFP/HSP (the bluetooth standards for headset and headphones).let’s install pipewire (replacement of pulseaudio) (https://askubuntu.com/a/1339908/170833 ) and you will get 16k quality on the microphone.

Install latest Pipewire (and disable pulseaudio)

  1. install PPA with this commands (looks like it’s not necessary to install a PPA on Ubuntu 22.04):
sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
sudo apt-get update
  1. Install pipewire!
sudo apt install pipewire pipewire-pulse \
  pipewire-tests pipewire-locales gstreamer1.0-pipewire libspa-0.2-bluetooth \
  libspa-0.2-jack pipewire-audio-client-libraries
  1. Disable pulseaudio
sudo systemctl disable --global pulseaudio
  1. Enable pipewire
sudo systemctl enable --global pipewire-pulse
  1. Check pipewire is integrated checking the output of this command
$ pactl info | grep "Server Name"
Server Name: PulseAudio (on Pipewire 0.3.35)

At this point you should have a working audio system!

LAST STEP

Now you should have an audio system that can use "Headset Head Unit" protocol. Let's click it! (and yes, now is a good moment to pray to "Mary, Undoer of Knots")

Enter Settings -> Sound -> Output, select "Headset Head Unit (HSP/HFP)" and what you will see that on "Input" also changes.

airpods connected in HSP/HFP mode

Hopefully you enjoyed all this scripting and hacking in your machine! If things go sideways, remember to undo stuff so that your computer doesn't become bloated and full of random scripts from people on the internet (specially from me).

morhook
  • 1,671
7

I finally had my microphone working with Ubuntu 18.04 and Airpods Pro. It seems it is not just Airpods, but Galaxy Buds and several other bluetooth variants. We need HSP (low speaker output but mic enabled) and not A2DP.

Please refer to this very nice write-up: https://askubuntu.com/a/1236379/692059