This project is aiming to resolve problems that you can encounter when pairing your headphone.
If this project has helped you, please consider making a donation.
On Ubuntu, remove the headphones from the Bluetooth paired list.
On the headphones, hold the switch in Bluetooth pairing position for 10 seconds to delete all paired devices (You'll get a voice confirmation).
Edit bluetooth configuration file:
sudo nano /etc/bluetooth/main.conf
Replace the following (remove the "#" symbol at beginning of the line if it exist):
ControllerMode = dual
With:
ControllerMode = bredr
Restart bluetooth service:
sudo service bluetooth restart
Note: do this step only if you're using gdm3
Edit or create this file:
sudo nano /var/lib/gdm3/.config/pulse/client.conf
Insert these following lines in this file:
autospawn = no
daemon-binary = /bin/true
Grant access to GDM user:
sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf
Disable pulseaudio startup:
sudo rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket
This step aim to enable your headphone to auto-connect to your computer when you start it. Check if it is already configured with:
cat /etc/pulse/default.pa | grep -B 1 -A 3 'ifexists module-switch-on-connect.so'
If there are no matches for it, start configuring Auto-connect For A2DP editing this file:
sudo nano /etc/pulse/default.pa
Then insert following lines at the end:
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif
After saving these changes, you must reboot now.
Note: I only tested this GUI but feel free to use whatever you want.
via package manager:
sudo apt install blueman
To pair your headphone:
1) Open blueman 2) Right click on your headphone 3) select "headset" 4) hover "Audio profile" and select "A2DP"
If you want to reverse this configuration, you just need to follow steps in reverse order.
Note: Thanks to issue #2, I added to repository
pulseaudio.socket
file which is removed at the end of step 3.