1

I manage to use a bluetooth earpiece from Plantronics by fiddling the sound settings as follows, and am looking for ways to hard-wire this UI laden workflow to happen by default as the headset connects.

The workflow I currently go through every time is the following:

  1. Once the headset is powered on and connected through bluetooth, then the system automatically establishes the following configuration whereby the output-only A2DP mode is selected and only output to the headset can take place:

    enter image description here


  1. I then switch it to HSP/HFP and voila as seen below, the system seems to automatically select the headset as an input source on the bottom pane of the window, and thus the headset's microphone becomes enabled:

    enter image description here

    I guess that the settings GUI simply polls PulseAudio, and that the automatic selection of the headset for both output and then input that I get in the settings GUI is due to one or both of the followings lines in /etc/pulse/deafult.pa:

    load-module module-switch-on-port-available

    load-module module-switch-on-connect

    So I guess no mystery about why the settings change once the headset is connected. However I'd like to set this as the default for this bluetooth headset as well as my other (same model) headset or even whenever I re-pair them to the computer.


  1. Finally, I go and switch back to my computer speakers for output, as I'm only interested in using the headset for microphone input: enter image description here

My question is, how do I get that final status automatically applied whenever a bluetooth headset connects? namely, that upon bluetooth connection, the microphone of the bluetooth device will be set as the input source but the device will not be simultaneously selected for sound output.


version information:

$ pacmd --version
pacmd 13.99.1
Compiled with libpulse 13.99.0
Linked with libpulse 13.99.0

Thanks!!

matanox
  • 1,861

2 Answers2

1

There is a chance of detecting the connection event via dbus.

This is an answer on another topic that also performs checking dbus to detect events.

There is no need to reproduce here the contents, as they are in SE or ubuntu.com

1

Sharing what worked for me.I spent many hours googling. Hope this helps someone else. I am using Ubuntu 22.04

This was the link that saved me: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/975

I added the following line:

load-module module-card-restore restore_bluetooth_profile=true

to file = /etc/pulse/default.pa

Rebooted.

Now it remembers the Audio profile set on the bluetooth device.

This really should be an out of the box setting....