Skip to content

Instantly share code, notes, and snippets.

@aidos-dev
Last active December 29, 2024 04:56
Show Gist options
  • Save aidos-dev/b49078c1d8c6bb1621e4ac199d18213b to your computer and use it in GitHub Desktop.
Save aidos-dev/b49078c1d8c6bb1621e4ac199d18213b to your computer and use it in GitHub Desktop.
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf

The terminal will ask you to input your password. Please type it :)

Step 2.

After that a file with configurations will be opened in a terminal window.

Find the next line:

#ControllerMode = dual

Step 3.

Change "dual" to "bredr". The final code must be:

ControllerMode = bredr

Step 4.

To save changes and exit nano editor do the following:

  1. On your keyboard press:
Ctrl + x
  1. On the bottom of nano editor you will see a qustion:

"Save modified buffer?"

  1. Press on your keyboard: y
  2. Press on your keyboard: Enter

After these steps you will come back to regular terminal window on the same directory as before.

Step 5.

Run the next command in a terminal:

sudo /etc/init.d/bluetooth restart

After that you will see the message:

"Restarting bluetooth (via systemctl): bluetooth.service."

Step 6.

Go to your computer settings and enable Bluetooth so it starts to look for bluetooth connections

Step 7.

The next actions should be performed exactly as described:

  1. Put your airpods (both) inside the case

  2. Keep the cover opened

  3. With cover opened and airpods inside the case press and hold the button on the back of the airpods case.

  4. Hold the button until you see the light blinking on the front side of the case, it can also make a sound signaling that it is in pairing mode

Step 8.

Finaly, after all these steps you should find your AirPods on Bluetooth settings section and connect it ;)

@ziimiin14
Copy link

Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

Changing #ControllerMode = dual to ControllerMode = dual works for me.

ControllerMode = bredr does not work for me.

@najandhamed
Copy link

god bless u! ^^

@higorasilverio
Copy link

This was more than helpfull! Thank you so much!

@would1920
Copy link

Amazing! it works for me in ubuntu lts22.04

@utkarsh2102
Copy link

Works on Ubuntu 22.04, thanks a bunch! <3

@JavierOrdonezA
Copy link

It works in Ubuntu 22.05. Thanks, bro <3

@sorbatdev
Copy link

Anybody has random cuts on audio with Airpod Pro's?

@marielauremk
Copy link

Thanks a lot

@MoudiAlameel
Copy link

This worked great after restarting my computer thanks

@jovenwayfarer
Copy link

thank you! works right away!

@F3d0s
Copy link

F3d0s commented Jul 10, 2024

Thank you!

@rkahani
Copy link

rkahani commented Jul 18, 2024

thanks

@rtulke
Copy link

rtulke commented Jul 20, 2024

Works with Debian 12 Gnome

@semeruk
Copy link

semeruk commented Jul 24, 2024

Wonderful it works, thanks !! But now I can't reconnect my mouse MX Master :'(

Unfortunately, after setting ControllerMode = bredr my laptop stopped seeing/connecting to Logitech's keyboard and mouse as well :(

@semeruk
Copy link

semeruk commented Jul 24, 2024

Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy

Changing #ControllerMode = dual to ControllerMode = dual works for me.

ControllerMode = bredr does not work for me.

ControllerMode = dual - works for me with Logitech MX devices and AirPods, but only as output device, its microphone is not available to set as Input :(
I'm on Ubuntu 20.04.6 LTS.

Update:

  • First, I changed #ControllerMode = dual to ControllerMode = bredr and suddenly when I restarted Bluetooth service with sudo /etc/init.d/bluetooth restart I was finally able to pair my AirPods (1st gen)! However all my Logitech MX devices got disconnected.

  • Second, I decided to change ControllerMode = bredr to ControllerMode = dual to be able to connect my Logitech MX devices. And VOILÀ - my AirPods and MX devices are connected via Bluetooth to my laptop.

  • Third, I followed this guide on AskUbuntu to make the AirPods microphone work as my input device. Unfortunately, I need to switch the Input in Settings to AirPods microphone but the Output switches to mSBC codec (HSP/HFP) automatically, so my earphones doesn't give me high quality sound on meetings :(
    Luckily I can switch to A2DP codec (High Fidelity Playback) as the Output and high quality sound gets back but only output! Hence I need to remember whether I am on a call or watching YouTube to switch between this options in Settings.

    • Handsfree: lower quality but both input/output
    • Headset: high quality but only output

Maybe somebody has managed to use both the A2DP (High Fidelity Playback) as the Output and AirPods microphone as the Input?

@dynamiclynk
Copy link

Mint 21 works perfect, thanks!

@fegue
Copy link

fegue commented Jul 31, 2024

I am on Fedora 40 and what works for me to have stable connection with the Airpods AND connect to my MX Keyboard and mouse is to set both controls (note the hash stays)

#ControllerMode = dual
#ControllerMode = bredr

@JohnTortugo
Copy link

Worked fine. Thanks.

@j4st1
Copy link

j4st1 commented Aug 9, 2024

Its does work on Nobara 40. Thanks man, i appreciate it

@shaybensasson
Copy link

Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
Changing #ControllerMode = dual to ControllerMode = dual works for me.
ControllerMode = bredr does not work for me.

Works for me with Logitech MX devices and AirPods but its microphone is not available to set as Input :( I'm on Ubuntu 20.04.6 LTS.

I had a similar problem and switched between the settings, but I until I did a reboot it couldn't recognize my Logitech mouse.
Thanks for the detailed guide.

@TomerHekmati
Copy link

Thanks!
Worked for me, Ubuntu20 with AirPods 3.

@SlicedBreadWasTaken
Copy link

isnt working for me on mint 21 / airpods pro, theyre showing up in the bluetooth devices list but trying to connect them fails and gives a "Connection Failed: br-connection-canceled" error

@nepfaff
Copy link

nepfaff commented Oct 12, 2024

worked on Ubuntu 22.04 🎉

@vtolmach
Copy link

vtolmach commented Oct 16, 2024

Worked on Ubuntu 24.04.1 LTS

@theoctober19th
Copy link

Worked on Ubuntu 23.04

@jsilva74
Copy link

Thanks a lot!

@Bashiri1990
Copy link

worked for me on ubuntu 22.04. thanks

@Loumier
Copy link

Loumier commented Nov 22, 2024

Thanks that has worked for me on Ubuntu 22.04.5 LTS. However, I also had a Mx Master 3 and this mode made the undiscoverable. So I had to revert the configuration, but after pairing the Airpods kept working.

@shlyaiger
Copy link

Thanks it's worked for me on Ubuntu 24.04.1 LTS with AirPods Pro

@jjjllxx
Copy link

jjjllxx commented Nov 28, 2024

This is really clear and useful! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment