This project is aiming to resolve problems that you can encounter when pairing your headphone.
-
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
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
For Auto-connect A2DP, edit this file:
sudo nano /etc/pulse/default.pa
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.
via package manager:
sudo apt install blueman
To pair your headphone:
- Open blueman
- Right click on your headphone
- select "headset"
- 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 have added to the repository
pulseaudio.socket
file which is removed at the end of step 3.