
In this article, we will be discussing how to change the default audio mode of Bluetooth headphones from HSP/HFP to A2DP Sink in Ubuntu 18.10. This is a common issue faced by many Ubuntu users, especially those using Sony WH-1000XM2 headphones.
To change the Bluetooth headphones audio mode from HSP/HFP to A2DP Sink in Ubuntu 18.10, you can use a script or modify system files. The script automatically switches the audio profile to A2DP Sink when the headphones connect, while modifying system files involves editing /etc/pulse/default.pa
and /etc/bluetooth/main.conf
. Restarting pulseaudio and the Bluetooth service is necessary after making these changes.
Understanding the Problem
By default, when you connect your Bluetooth headphones to your Ubuntu system, they connect in HSP/HFP mode (Headset Profile/Hands-Free Profile). This mode is primarily designed for voice communication and does not provide high-quality audio output for music.
On the other hand, A2DP (Advanced Audio Distribution Profile) Sink is a Bluetooth stereo audio profile that provides high-quality audio suitable for music. Therefore, to enjoy high-quality audio, you need to switch your Bluetooth headphones to A2DP Sink mode.
Solution 1: Using a Script
A simple solution to this problem is to use a script that automatically switches the audio profile to A2DP Sink whenever the headphones are connected. This script can be found in the provided gist.
To use this script, open a terminal and execute the script whenever the headphones connect in HSP/HFP mode. The script will set the profile to A2DP Sink. You may need to adjust the sleep intervals in the script according to your system’s speed and responsiveness.
Solution 2: Modifying System Files
Another solution is to modify certain system files to automatically switch the audio profile to A2DP Sink whenever the headphones are connected. Here’s how to do it:
- Open a terminal and edit the
/etc/pulse/default.pa
file by typing:
sudo nano /etc/pulse/default.pa
- Add the following lines to the file:
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
load-module module-switch-on-connect
.endif
These lines check if the module-bluetooth-discover.so
file exists. If it does, they load the module-bluetooth-discover
and module-switch-on-connect
modules. The module-bluetooth-discover
module enables the discovery of Bluetooth devices, while the module-switch-on-connect
module switches the audio sink to the newly connected device.
- Next, modify the
/etc/bluetooth/main.conf
file. Open it by typing:
sudo nano /etc/bluetooth/main.conf
- Add the following line to the
[General]
section of the file:
Disable=Headset
This line disables the headset profile, forcing the system to use the A2DP Sink profile.
- After making these changes, restart pulseaudio and the Bluetooth service by typing:
pulseaudio -k
sudo systemctl restart bluetooth
The pulseaudio -k
command kills the currently running pulseaudio service, and the sudo systemctl restart bluetooth
command restarts the Bluetooth service.
Conclusion
The solutions mentioned in this article have been reported to work for various Bluetooth headphones, including Sony WH-1000XM2, JBL, and Bose QC 700. However, some users have reported that the solutions did not work for Sony WH1000XM4. It is recommended to try these solutions and adjust them according to your specific headphones if needed.
Please note that if you have installed pipewire
or other conflicting audio packages, you may need to uninstall them or make additional configurations.
Switching the audio mode of your Bluetooth headphones can greatly improve your audio experience on Ubuntu 18.10. We hope this article has helped you achieve that.
Yes, these solutions have been reported to work for various Bluetooth headphones, including Sony WH-1000XM2, JBL, and Bose QC 700. However, it is recommended to try these solutions and adjust them according to your specific headphones if needed.
If the solutions mentioned in the article do not work for your Bluetooth headphones, you can try searching for specific solutions or troubleshooting steps for your headphone model online. Additionally, you can seek help from the Ubuntu community forums or support channels for further assistance.
No, you do not need to restart your system after making the changes mentioned in Solution 2. Restarting the pulseaudio service and the Bluetooth service should be sufficient.