
In this article, we will discuss how to permanently remove or disable the HSP/HFP Bluetooth profile in Ubuntu. The HSP/HFP profile is used for audio communication, but there may be instances where you want to disable it, such as when it’s causing connection issues with other devices.
To permanently remove or disable the HSP/HFP Bluetooth profile in Ubuntu, you can edit the PulseAudio configuration, modify the Bluetooth configuration, disable autoswitch and enable manual switching, or remove the UUID from Bluetooth services in Ubuntu 20.04 and 22.04. Try these solutions one by one to find the best option for your needs.
Understanding HSP/HFP Bluetooth Profile
The HSP (Headset Profile) and HFP (Hands-Free Profile) are Bluetooth profiles that allow for audio communication between devices. They are commonly used for telephony applications, such as making calls over Bluetooth. However, in some cases, these profiles can cause issues with audio quality or connectivity. In such cases, it can be beneficial to disable these profiles.
Solution 1: Editing PulseAudio Configuration
PulseAudio is a sound server for POSIX and Win32 systems. It allows you to do advanced operations on your sound data as it passes between your application and your hardware.
To disable the HSP/HFP profile, you can modify the PulseAudio configuration as follows:
- Open the terminal and type the following command to open the PulseAudio configuration file:
sudo nano /etc/pulse/default.pa
- Look for the section that loads the
module-bluetooth-policy.so
module. This module is responsible for managing policy of Bluetooth devices in PulseAudio. - Add
auto_switch=false
to theload-module
line, like this:
load-module module-bluetooth-policy auto_switch=false
This command prevents PulseAudio from automatically switching to the HSP/HFP profile when a Bluetooth device connects.
- Save the file and exit by pressing
Ctrl+X
, thenY
to confirm saving changes, and finallyEnter
to exit. - Restart PulseAudio by killing the running instance with the command:
pulseaudio -k
Then, restart it by using the command:
pulseaudio -D
Solution 2: Modifying Bluetooth Configuration
Another way to disable the HSP/HFP profile is by modifying the Bluetooth configuration.
- Open the terminal and type the following command to open the Bluetooth configuration file:
sudo nano /etc/bluetooth/audio.conf
- Add the following lines under the
[General]
section:
Disable=Headset
This command disables the headset service, which includes the HSP/HFP profile.
- Save the file and exit by pressing
Ctrl+X
, thenY
to confirm saving changes, and finallyEnter
to exit. - Restart the Bluetooth service with the following command:
sudo systemctl restart bluetooth
Solution 3: Disabling Autoswitch and Enabling Bluetooth Device Switching
If you want to disable the automatic switching to the HSP/HFP profile but still allow manual switching, you can modify both the PulseAudio and Bluetooth configurations.
Follow the steps in Solution 1 and Solution 2, but in addition to auto_switch=false
, add load-module module-switch-on-connect
to the module-bluetooth-discover.so
section in the PulseAudio configuration. This module enables manual switching of Bluetooth devices.
Solution 4: Removing UUID from Bluetooth Services (Ubuntu 20.04 & 22.04)
In Ubuntu 20.04 and 22.04, you can disable the HSP/HFP profile by removing its UUID from the Bluetooth services.
- Find the UUID for the specific Bluetooth device’s services using Blueman or other methods.
- Depending on your Ubuntu version, edit the appropriate file:
# For Ubuntu 20.04
sudo nano /var/lib/bluetooth/{{deviceid}}/info
# For Ubuntu 22.04
sudo nano /var/lib/bluetooth/{{controller}}/{{deviceid}}/info
- Remove the UUID from the “Services” section under “General”.
- Save the file and exit.
- Restart the Bluetooth service:
sudo systemctl restart bluetooth.service
Conclusion
Disabling the HSP/HFP Bluetooth profile in Ubuntu can be done in several ways, depending on your specific needs and system configuration. It’s recommended to try these solutions one by one and see which one works best for you. Always remember to back up your configuration files before making any changes, to prevent any potential issues.
Yes, you can disable the HSP/HFP Bluetooth profile temporarily by following the steps mentioned in Solution 1 or Solution 2. Instead of making permanent changes to the configuration files, you can revert the changes or restart the respective services to enable the profile again.
Disabling the HSP/HFP Bluetooth profile will only affect audio communication using these profiles. Other Bluetooth functionalities, such as file transfer or device pairing, will not be affected.