Auto switch to A2DP bluetooth device when connected in Ubuntu

Add to /etc/pulse/default.pa to automatically switch pulseaudio sink to Bluez:

 .ifexists module-bluetooth-discover.so
 load-module module-bluetooth-discover
 load-module module-switch-on-connect  # Add this
 .endif

Modify /etc/bluetooth/audio.conf to auto select A2DP profile (instead of HSP/HFP):

 [General]
 Disable=Headset # Add this

Apply changes:

sudo pulseaudio -k # Restarts pulseaudio
sudo restart --system bluetooth # Restarts BT
Tagged , , , . Bookmark the permalink.

3 Responses to Auto switch to A2DP bluetooth device when connected in Ubuntu

  1. BlackPlaid says:

    I’ve been having intermittent trouble with auto connecting. Regardless, this works great for auto connecting in A2DP. It’s much easier to just manually connect BT than to have to also open audio settings, switch adapter, switch from hsp to A2DP.

    Is it possible to switch back to built in audio automatically on BT disconnect?

  2. Evren Yurtesen says:

    My headset just doesnt connect anymore without the headset service

  3. Paul says:

    Hello!

    There is a minor mistake. The pulseaudio process is owned by the current user, so `sudo` must be omitted:

    pulseaudio -k # no sudo

Leave a Reply

Your email address will not be published. Required fields are marked *