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 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.
On this one it will just work, as it uses pipewire.
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)
- 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!
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).
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