Yet another web developer blog

How to disable auto switching Bluetooth from A2DP to HSP profile on Skype calls in Linux

If you use Bluetooth headset, you probably have bad quality of voice in VoIP calls via Skype and other apps. This happens on Linux and on Windows too.

This happens because when an application starts a call - it create a recording stream with property media.role=phone (telephony applications should set that property for their streams), and PulseAudio switch profile of your Bluetooth Headset from A2DP (Stereo high-quality one-way channel) to HSP/HFP (Mono low-quality 2-way channel for voice-only).

But if you have some attached USB WebCam with microphone, you can improve voice quality in VoIP calls via disabling using headset mic and use WebCam mic instead.

Below are some tricks for disable auto-switching to low-quality codec, and have always high-quality voice on calls. They are tested on Ubuntu Linux (16.04+), but  should work on other Linux distributives too:

1. Disable HSP/HFP profile globally on all your Bluetooth devices:

In /etc/bluetooth/audio.conf file - add under [General] section this line:

[General]
Disable=Headset

and restart bluetooth daemon via sudo service bluetooth restart

2. Disable auto switching to HSP profile on call events:

If you disable HSP/HFP profile, Skype (and maybe other apps) will continue trying switch your headset to HSP profile, but if it disabled - as result they switch it to "Off" profile and you will hear nothing in calls.

For workaround this problem we will disable auto-switching in PulseAudio in /etc/pulse/default.pa file - find the string:

load-module module-bluetooth-policy

and modify to:

load-module module-bluetooth-policy auto_switch=false

and restart PulseAudio instance for current user via command: pulseaudio -k

If you use system-wide PulseAudio instance, use sudo service pulseaudio restart instead.

3. Try to install native Skype package, instead of snap

Execute snap list and check if skype package is exists in list. If yes, it was installed as Snap package, that sometimes can't see bluetooth output devices from pulseaudio.

Solution is remove snap package and install native package:

snap remove skype
wget -O /tmp/skype.deb https://repo.skype.com/latest/skypeforlinux-64.deb
sudo dpkg -i /tmp/skype.deb

 

Tags