Unpair your headphone first. (With the DE Bluetooth-Settings or bluetoothctl)
To make your headphone auto connect each time you enable it, you need to enable the switch-on-connect module from Pulseaudio:
sudo nano /etc/pulse/default.pa
Then put these two lines to the end:
# automatically switch to newly-connected devices load-module module-switch-on-connect
Are you using GDM?
Then do this:
Prevent systemd from starting Pulseaudio anyway with socket activation :
These two commands will do the trick:
sudo -ugdm mkdir -p /var/lib/gdm/.config/systemd/user sudo -ugdm ln -s /dev/null /var/lib/gdm/.config/systemd/user/pulseaudio.socket
You can also use the solution to address this problem with this:
pulseaudio-bluetooth-a2dp-gdm-fix [yay -S pulseaudio-bluetooth-a2dp-gdm-fix]
Continue for everyone:
Now it is time to connect and recognize your headphone:
bluetoothctl is the tool we use here from the terminal:
bluetoothctl power on agent on default-agent scan on pair XX:XX:XX:XX:XX:XX < your headphones "ID" trust XX:XX:XX:XX:XX:XX connect XX:XX:XX:XX:XX:XX scan off exit
Check if your headphone is listed under sound devices and is connected via A2DP profile:
If you’re menu only displays Headset Head Unit (HSP/HFP) then this means it also covers the additional microphone that’s built-in with your headphone, for HIFI Headphone choose High Fidelity Playback A2DP.
As far as I can see it will take the last state for each new automatic connection.
And it is done!
To see if it works > reboot system if you do it right and for sure you are lucky to have chosen good hardware, or the right one working together
Now, each time you power on your headphone, just system auto-connecting it with High Definition Audioprofile [A2DP].
It happens after updates or if you use dual-booting with Windows that the headset only connects HSB/HFP.
Sometimes it helps to simple disable and re-enable device.
If that does not help try to remove the disable device and reinitialize it.
And last if all of that do not work try rfkill:
Connect with us:
sudo rfkill block bluetooth
sudo rfkill unblock bluetooth
sudo systemctl restart bluetooth