21

I really don't like that, like Skype changes my bluetooth profile automatically to very low quality HSP profile and then just muted the high quality A2DP profile.

So i want to know, is it possible just to remove or disable HSP/HFP profile (pulse audio, bluez) and if it, how?

Internet is full for tutorials how to get HSP/HFP enable, but for my case, that is the problem.

PS: I don't use bluetooth mic, so it is irrelevant to get that working on A2DP, i know that this is a hard thing to get working, so no need extra work on that one.

5 Answers5

21

Check out this answer: https://askubuntu.com/a/1119934/1025239

Copying the most important part, that just disables this "feature" the way like pulseaudio developers intended.

Open (sudo) /etc/pulse/default.pa and add auto_switch=false like this:

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

Restart pulseaudio by just killing the running instance: pulseaudio -k. After this you can restart it by using pulseaudio -D. Done. You still can switch to the HFP profile, but there is no automatic switching any more.

Nallath
  • 103
8

I've been researching this for quite some time now. It turns out the idea is that most bluetooth mics don't support A2DP, so Pulse Audio is configured to switch from A2DP to HSP whenever an app that would use the microphone (such as Skype) is connected. In the end, what worked for me is the tutorial from this link: https://sandalov.org/blog/2146/

  1. Modify /etc/bluetooth/audio.conf, adding the following:
[General]
Disable=Headset
  1. Kill pulseaudio (it autorestarts) and restart the bluetooth service:
pulseaudio -k
sudo systemctl restart bluetooth

This will disconnect the audio device you are connected to via bluetooth, you'll have to reconnect to it.

Hope this helps :)

David Taub
  • 133
  • 6
1

For me the following was the solution:

# /etc/pulseaudio/default.pa
ifexists module-bluetooth-policy.so
  load-module module-bluetooth-policy auto_switch=false  <-- add auto switch
.endif

.ifexists module-bluetooth-discover.so load-module module-bluetooth-discover load-module module-switch-on-connect <-- add this .endif

/etc/bluetooth/main.conf

[General] Disable=Headset <-- add this

This will disable autoswitch to hsp from pulseaudio and explicitly tell bluez to disable hsp. in addition pulseaudio will switch to the bluetooth device upon connection.

Atleast this is my understanding of the above.

1

To disable a specific device only (Ubuntu 20.04 & 22.04), find the UUID for the device's services. You can do this in Blueman:

blueman uuid

It can also be obtained by running bluetoothctl info and other methods as well.

Next, edit the following to remove the UUID from "Services" under "General".

# For Ubuntu 20.04
sudo vim /var/lib/bluetooth/{{deviceid}}/info

For Ubuntu 22.04

sudo vim /var/lib/bluetooth/{{controller}}/{{deviceid}}/info

Then restart bluetooth

sudo systemctl restart bluetooth.service
NotTheDr01ds
  • 22,082
olabri
  • 11
0

I tried all the solutions I could find on this topic and none of them worked for me. Check out my answer here. It uses a DBus event to detect when a BT device is connected, then sets it to A2DP sink mode. Ugly, but at least it works.

Guavaman
  • 101