How to set default profile for bluetooth headset?

You can consider this as a workaround, as here The profile will be switched to HSP/HFP once you start an activity that requires a microphone but the profile initially is set to a2dp_sink.

Modify /etc/pulse/default.pa

Add the following lines or modify them

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy auto_switch=2
.endif

The magic here in auto_switch=2 which will make the pulse audio switch the profile based on requirements.

For more information and options you can refer to this reference wiki : https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#module-bluetooth-policy

Edit

These are some of the pre-conditions that may affect the method.

  • The above method tested with Kde Neon (based on ubuntu-20.04)
  • I have installed ofono,ofono-phonesim based on the below links to enable HSP/HFP for my headphone. I don't know if that may affect the procedure or no.
    • https://zambrovski.medium.com/using-bluetooth-headset-on-ubuntu-790ce6eecc2
    • https://freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#supportedcodecs
  • Tested Apps
    • Microsoft teams (you need to start the call)
    • Browser (Webex site)