Setting up Airpods Pro on Ubuntu 20.04
If you have apple airpods or airpods pro, and sometimes want to use it with your Ubuntu machines, follow this guide! If you try to pair airpods without doing any of these steps, most likely the pairing process will never complete.
To enable pairing of airpods, you will need to update the
bredr from the
default value of
dual. This can be done by editing the file
Then restart the Bluetooth service using
sudo /etc/init.d/bluetooth restart command.
You should be able to pair your airpods now and use it as headphones!
In order to have airpods work as microphones, you will need to enable HSP/HFP profile. However,
Pulseaudio by default only supports HSP.
In order to make HSP/HFP work, you have to enable HFP on
pulseaudio which needs
ofono. Here are steps to enable HFP on pulseaudio using ofono on
sudo apt install ofono
Configure pulseaudio to use ofono:
/etc/pulse/default.pa, find the line
load-module module-bluetooth-discoverand change it to
load-module module-bluetooth-discover headset=ofono.
Add the user
bluetoothto grant the permission:
sudo usermod -aG bluetooth pulse
VERY IMPORTANT: To grant the permission, add the following code snippets to
In order to make ofono work, you have to provide a modem to it! You can install a modem emulator called
ofono) to make it work:
phonesimby adding the following lines to
Now you will need to define and enable few services to start the
ofono-phonesim -p 12345 /usr/share/phonesim/default.xmlon startup as a systemd unit, create the file
/etc/systemd/system/ofono-phonesim.service(as root) with the following contents:
After ofono-phonesim runs, you'll need to also enable and put the phonesim modem online.
You will first need to use this githup repo:
Now you can enable and make phonesim modem online by creating another
systemdunit file that depends on the above
systemdunit. Put the following contents in
Then run the following commands to run both daemons:
Check if the service is running with
Now you should be able to switch to HSP/HFP profile for airpods and use it as an input device / microphones.