This tutorial worked for one evening. The following day, Ubuntu upgraded and this system no longer worked.
Edit the ControllerMode to bredr from the default value of dual
sudo emacs /etc/bluetooth/main.conf
Then restart the Bluetooth service using
sudo /etc/init.d/bluetooth restart
You should now be able to pair your airpods and use them as headphones.
-
Install ofono using
sudo apt install ofono -
Configure pulseaudio to use ofono
Go to
/etc/pulse/default.paFind the line `load-module module-bluetooth-discover` Change it to `load-module module-bluetooth-discover headset=ofono`Add the user
pulseto the groupbluetoothto grant the permissionsudo usermod -aG bluetooth pulseAdd the folowing line to
/etc/dbus-1/system.d/ofono.confbefore</busconfig><policy user="pulse"> <allow send_destination="org.ofono"/> </policy> -
Provide a "modem" to ofono by installing ofono-phonesim
sudo add-apt-repository ppa:smoser/bluetooth sudo apt-get update sudo apt-get install ofono-phonesimConfigure phonesim by adding the following lines to
/etc/ofono/phonesim.conf[phonesim] Driver=phonesim Address=127.0.0.1 Port=12345Now, restart the ofono service with
sudo systemctl restart ofono.service -
To run
ofono-phonesim -p 12345 /usr/share/phonesim/default.xmlon startup, create the file/etc/systemd/system/ofono-phonesim.serviceand add the following content.[Unit] Description=Run ofono-phonesim in the background [Service] ExecStart=ofono-phonesim -p 12345 /usr/share/phonesim/default.xml Type=simple RemainAfterExit=yes [Install] WantedBy=multi-user.target -
Now, you need to put the modem online. Do this by cloning the following github repos
cd /tmp git clone git://git.kernel.org/pub/scm/network/ofono/ofono.git git clone https://github.com/bryanperris/ell.gitOnce you have these repos,
cd /tmp/elland run the following commands.autoreconf -fi ./configure sudo make sudo make installNow,
cd /tmp/ofonoand run the following commandsautoreconf -fi ./configure --enable-external-ell sudo make sudo make installIf there are any D-Bus errors, install the following
sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-devNow move the
ofono/andell/directories to the/opt/directory.mv ofono/ ell/ /opt/Now you can put the phonesim online by creating another systemd unit file that depends on the ofono-phonesim. Put the following content in
/etc/systemd/system/phonesim-enable-modem.service[Unit] Description=Enable and online phonesim modem Requires=ofono-phonesim.service [Service] ExecStart=/opt/ofono/test/enable-modem /phonesim ExecStart=/opt/ofono/test/online-modem /phonesim Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.target -
Run both daemons with the following commands
sudo systemctl daemon-reload sudo systemctl enable ofono-phonesim.service sudo systemctl enable phonesim-enable-modem.service sudo service phonesim-enable-modem startYou can check the status of the modem with
sudo service phonesim-enable-modem statusLastly, restart pulseaudio with
pulseaudio -k
For the modem to be online, you must have ofono-phonesim -p 12345 /usr/share/phonesim/default.xml running in a shell.
https://reckoning.dev/blog/airpods-pro-ubuntu/
https://askubuntu.com/questions/1204810/make-no-rule-to-make-target-ell-util-c-needed-by-ell-util-lo
https://askubuntu.com/questions/506116/bluez-installation-configuration-error-for-dbus-1-6