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
I was helped by the instruction below.
ControllerMode = bredror
ControllerMode = dualby editing
sudo nano /etc/bluetooth/main.confcommand (or another text editor of your choice)
sudo /etc/init.d/bluetooth restart
- Try to pair again.
dualdoes not really make sense as it is the default mode Dec 13, 2019 at 9:09
ControllerMode = bredrworked for me on Ubuntu 18.04, Airpods 1.– samb102Dec 16, 2019 at 8:31
11Thank you. I wasn't able to connect my AirPods Pro in Ubuntu 20.04 LTS. Adding "ControllerMode = bredr" fixed the issue for me. Also echoing that "ControllerMode = dual" was the default. I can't confirm that this answers the original question though, about the AirPods being connected as a headset.– kasJun 2, 2020 at 19:35
15This answer is highly upvoted but it's about connecting airpods, not about the original question which is about connecting them as headset.– Arthur BOct 2, 2020 at 10:23
9I can confirm that this does NOT allow you to use the air pods as headsets on Ubuntu 18.04 on a Thinkpad T440p, tried this with both
ControllerMode = dualas well as
ControllerMode = bredr. As stated before this does NOT answer the original question! Nov 24, 2020 at 12:59
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:
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*'
Optional: install Bluetooth manager, Blueman:
sudo apt-get install blueman
Load USB Bluetooth driver (Bluetooth dongle):
sudo systemctl restart bluetooth
Add controller mode setting to be
/etc/bluetooth/main.confchange this mode to
lein case you have problem with your AirPods:
ControllerMode = dual
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
You might need to choose either
ControllerMode in step 5.
dualis the default, I doubt setting it make any difference. There is another command to manage services which is IMO much easier to remember:
sudo service bluetooth restart,
sudo service bluetooth status. It comes with tap autocomplete so you can type
sudo servicehit TAB and see all available services or type
sudo service blue+ hit TAB which will show all services starting with blue or autocomplete to
bluetoothDec 13, 2019 at 9:24
bredrmade pairing of AirPods Pro finally succeed - but only as headphones, not as headset. The volume was a bit too low so I had to activate Over-Amplification in sound settings to allow volume up beyond 100%. Dec 13, 2019 at 9:38
1@Wlad I have the same partial solution, still no way to use as headset– c-o-dMar 24, 2020 at 22:16
The same result can be achieved in much fewer steps with the other answer.– kasJun 2, 2020 at 19:47
This is what worked for me on Pop_os
Linux pop-os 5.11.0-7620-generic #21~1626191760~21.04~55de9c3-Ubuntu SMP Tue Jul 20 22:18:55 UTC x86_64 x86_64 x86_64 GNU/Linux– sdcAug 29, 2021 at 3:37
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). Two options:
- pipewire (replacement of pulseaudio) (ref https://askubuntu.com/a/1339908/170833 ) (you will get 16k quality on the microphone).
- install ofono (a framework developed by Intel people) alongside your pulseaudio (original SO answer and article explaining similar thing ).
This guide will follow the both options, but don't do both (or both of them halfways). CHOOSE YOUR OWN ADVENTURE NOW.
Install latest Pipewire (and disable pulseaudio)
- 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
- 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
- Disable pulseaudio
sudo systemctl disable --global pulseaudio
- Enable pipewire
sudo systemctl enable --global pipewire-pulse
- 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!
Modify pulseaudio with ofono and ofono-phonesim
First install some dependencies from a PPA:
sudo add-apt-repository ppa:smoser/bluetooth sudo apt install ofono ofono-phonesim
Now, let's start with "the right stuff":
Go ahead and edit
/etc/pulse/default.paand find the line
load-module module-bluetooth-discoverand change it to
load-module module-bluetooth-discover headset=ofono(pro-tip use command
sudoedit /etc/pulse/default.pato edit files of the system)
Edit the file
/etc/dbus-1/system.d/ofono.confand add this xml:
<policy user="pulse"> <allow send_destination="org.ofono"/> </policy>
(not at the end, as that would produce a wrongly formatted XML)
- Edit the file
/etc/ofono/phonesim.confand put at the end of it:
[phonesim] Driver=phonesim Address=127.0.0.1 Port=12345
- Checkout the scripts that help ofono start it's simulated modem:
cd /tmp git clone git://git.kernel.org/pub/scm/network/ofono/ofono.git sudo mv ofono /opt
Reboot your computer and pray to the old and the new gods.
Create a file called
$HOME/prepare_for_meeting.shwith this content:
#!/bin/bash ofono-phonesim -p 12345 /usr/share/phonesim/default.xml & sleep 5 /opt/ofono/test/enable-modem /phonesim /opt/ofono/test/online-modem /phonesim
- TEST STEP. BYPASS IF YOU LIVE ON THE EDGE OF THE UNKNOWN ON EVERY MOMENT. Run this script to test if your are on the right path:
You should see something along this:
[ /phonesim ] Online = 0 Powered = 1 Lockdown = 0 Emergency = 0 Manufacturer = MeeGo Model = Synthetic Device Revision = REV1 Serial = 1234567890 ... continues with much more things ...
Either if you followed the Pipewire or Ofono path, 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.
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).
Has anyone gotten this to work with 21.04? I'm not having any luck. The
list-modemscommand is giving me a lot of 0s and blank entries. Aug 31, 2021 at 19:08
1My settings will allow me to select (HSP/HFP) but it will not remain selected when I close and then reopen the Sound setting window. Aug 31, 2021 at 19:52
Try to change with "blueman" UI the settings. Sometimes is more stable (and also you'll have visual feedback if something went wrong). I have to restart from time to time the services with
sudo systemctl restart ofono && sudo systemctl restart ofono-phonesim && sudo systemctl restart phonesim-enable-modem.service– morhookSep 1, 2021 at 11:54
1Thanks @morhook. Blueman is a little better in that it gives me a vague error message "Failed to change profile to headset_head_unit" when I choose the HSP/HFP profile. Now I need to figure out why it is failing. Sep 4, 2021 at 15:10
1@AlexandreDaubricourt if you installed via pipewire and select codec mSBC you should get a decent quality of microphone. I will erase the ofono-phonesim option so that people stop using it.– morhookAug 29, 2022 at 15:33
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
/etc/pulse/default.pa. I have also tried to install pulseaudio from ppa. These efforts did not take me anywhere, unfortunately.