68

I'm trying to use my bluetooth headset (Bluedio, in the screenshot) in Ubuntu-Gnome 16.10, but I keep getting a horrible sound quality in everything.

Important note: I've just tested with a different device, a bluetooth speaker, and it gets the A2DP profile automatically, with a nice sound quality. The problem, then, is only happening with my bluetooth headset.

I've read some posts and the given suggestions don't work in my case (Ubuntu-Gnome 16.10). These suggestions are:

1) Under the Sound settings, change the headset profile to the A2DP (High Fidelity Playback). Not only the sound quality didn't even change, the profile keeps getting turned back to Headset Head Unit (HSP/HFP) profile, in which the sound quality remains horrible. So, even though the A2DP profile shows up there, it doesn't take effect and goes back to the HSP/HFP profile everytime.

2) Changes in the /etc/bluetooth/audio.conf file, like uncommenting the line "AutoConnect=true line". First of all, there isn't such file in Ubuntu-Gnome 16.10. Instead, there is the /etc/bluetooth/main.conf file, which seems pretty similar to the first one in terms of parameters. But, the line is already uncommented in my S.O., just as the suggestion tells me to do. So, it seems that there's nothing to do here with this suggestion.

Here's the screenshot of the Sound Settings' screen. You can see that there's an arrow for the dropdown list, where the A2DP profile shows up (even though it's not appearing in the shot. It's there though), but it gets back to the HSP/HFP profile everytime.

Here's the link for the screenshot:

picture 1

Videonauth
  • 33,355
  • 17
  • 105
  • 120
Fabrik
  • 1,291

9 Answers9

51

I've managed to fix it. Even though I'm not sure if the following steps are in the exactly order to do it, I'm pretty sure it was the combination of them that fixed it. Here they are:

  1. I've installed Blueman: sudo apt install blueman

  2. I've edited the /etc/bluetooth/audio.conf file: sudo -H gedit /etc/bluetooth/audio.conf and added this line in the end of it: Disable=Headset. Users on Ubuntu 17.04 and above may not have audio.conf, but can instead use main.conf.

Note: I've also installed something called pavucontrol from the terminal with the command sudo apt install pavucontrol, but I'm really not sure if it was this or the Blueman that solved it. I suspect it was the Blueman, but if it doesn't help, try the pavucontrol and see if it solves it.

Don't forget to restart the bluetooth service after the change with sudo systemctl start bluetooth

karel
  • 114,770
Fabrik
  • 1,291
  • 9
    Yeah, adding that line Disable=Headset did it for me. :D And pavucontrol is PulseAudio Volume Control, so I don't think installing that was necessary to fix the problem. – Mike Pierce Jul 23 '17 at 15:31
  • 1
    I have just tested the step 1 and 2. Re-connected the bluetooth headset and it worked for me. So no need for pavucontrol. – Murat Gürsu Nov 12 '17 at 15:55
  • Here Here!! Worked for me too. Only needed blueman on Ubuntu 17.04. Then I edited main.conf and restarted bluetooth from the top panel icon. After that I selected high fidelity and now it works. Nice writeup - Thanks! – Ole Dec 13 '17 at 00:24
  • 6
    Disable=Headset worked for me, but I also had to do sudo service bluetooth restart for it to work. And the question remains: Why does it work? – BlueBomber May 30 '18 at 17:49
  • 7
    testing in 18.04-based system: blueman is not needed, no more than pavucontrol; the decisive setting is the Disable=Headset line (in /etc/bluetooth/main.conf). In pavucontrol: only after adding that line, the "High Fidelity Playback" setting becomes available (after restart). Another solution that I haven't yet tested: here. – cipricus Jun 10 '19 at 20:50
  • 2
    To clarify: after doing this, will I still be able to use the headset as, well, a headset? I'm asking because I see three audio profiles in pavucontrol and blueman-applet: headset, high-fidelity sink, high-fidelity source. Selecting high-fidelity sink in pavucontrol (the default in 18.04) results in no audio source from the headset appearing at all. – Raphael Jun 12 '19 at 16:14
  • 1
    Not working for in ubuntu 18.04 – ThanosFisherman Dec 11 '19 at 19:51
  • 1
    It's not working for me with ubuntu 18.04. I edited the /etc/bluetooth/main.conf and added the line at the end of it, restarted the bluetooth service, even restarted my computer but when I select my headset as Output + Input (mic) it automatically switches the profile to HSP/HPF. Moreover, in pavucontrol, If the A2DP profile is selected, I can't see my headset in the input peripherals tab. Any idea? – Quentin Lerebours Jun 29 '20 at 12:00
  • 1
    I seem to have to run sudo service bluetooth restart after any reboots – Jared Beach Oct 27 '20 at 20:46
  • Nothing worked for me on this whole page until I installed pavucontrol -> configuration -> and changed the bluetooth device to A2DP and the codec to SBC – Josh May 04 '23 at 10:59
33
  1. Install Blueman:

    sudo apt-get install blueman
    
  2. Add Disable=headset to /etc/bluetooth/main.conf.

  3. Restart the bluetooth daemon:

    sudo service bluetooth restart
    

If you still have poor sound quality go to pavucontrol and under Configuration set the profile of your device to off and then to A2DP and it should work now.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
donpwner
  • 430
10

I also had the same problem with automatic change back to HSP/HFP.

I solved this by editing /etc/bluetooth/main.conf and uncommenting the line

Name = BlueZ

in the section [General].

Though, it might be not available, when the bluez package is not installed.

Thanks anyway for the tip with the file.

Sebastian
  • 101
8

Get the index of your card:

pacmd list-cards

Set the cards profile to a2dp (example: index 2):

pacmd set-card-profile 2 a2dp_sink

Credit to develmusa of the ArchLinux forums: https://bbs.archlinux.org/viewtopic.php?pid=1720877#p1720877

Arthur
  • 231
  • 3
  • 3
  • 4
    This gives me "Failed to set card profile", which seems to be a common issue: https://askubuntu.com/questions/765233/pulseaudio-fails-to-set-card-profile-to-a2dp-sink-how-can-i-see-the-logs-and – lambshaanxy Sep 12 '19 at 06:43
7

The only thing that works for me is to restart the bluetooth service and reconnect.

sudo service bluetooth restart

Ubuntu 18.04

s.illes79
  • 163
4

I had to do the following for my Bluetooth headset to work, after upgrading from Ubuntu 20.04 to 20.10:

sudo apt-get install pulseaudio-module-bluetooth
sudo killall pulseaudio
pulseaudio --start    
sudo systemctl restart bluetooth

Not sure if it was a transient problem or not. Hope it won't happen again.

I got the following error in the logs when trying to enable the BT connection to the headphones, before doing the fix:

$ tail -f /var/log/syslog 
.
.
Aug 23 15:01:33 my-p1gen2 bluetoothd[226778]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for XX:XX:XX:XX:XX:XX: Protocol not available

After the fix, it worked.

advance512
  • 196
  • 5
2

Solution for Ubuntu 20.10 w/Soundpeats TrueCapsule headphone/headset.

1. Enable MultiProfile support /etc/bluetooth/main.conf

On/near line 58, you'll see #MultiProfile = off. Uncomment (or add a new line) with MultiProfile = multiple.

2. Remove the bluetooth device and re-add it.

This is important. Switching to A2DP did not work for me until I dropped and re-added.

enter image description here

3. Switch to A2DP.

Click Sound Settings (see above screenshot) and select A2DP. You should be able to switch back and forth on the fly (with noticeable sound quality differences).

Note: When I enable the headset microphone, output switches to HSP. I don't know whether this is a necessity of the bluetooth A2DP and HSP codecs, or merely a limitation of the bluetooth implementation. In any case, consider installing GNOME Sound Output Device Chooser, which makes it easy to switch between profiles. enter image description here

Reece
  • 310
  • Is it possible to enable 2-side A2DP? For me it works only as input or output, but not both. 2-side it works only for HSP/HFP – AndreyP Apr 14 '21 at 11:13
  • I don't know the answer to that specifically, but I can tell you that I use my headsets to listen to music and for zoom calls without manually changing the profile. – Reece Apr 17 '21 at 01:14
  • @AndreyP, no. https://android.stackexchange.com/questions/2819/how-do-i-send-bluetooth-audio-from-the-stereo-a2dp-to-headset-hsp-profile

    So either use A2DP without microphone, or HSP/HFP (much worse sound quality) with a mic.

    – Ufos Oct 27 '21 at 13:07
  • I'm trying to connect airdots 3 pro via bluetooth to my Ubuntu 20.04, but it always reconnect them as HSP / HPF, needing me to manually change to A2DP. Is there a way to remember it? – Maxwell s.c Dec 17 '21 at 17:30
1

Thanks for the info, worked great!

On Ubuntu 17.10 I had to change:

Settings > sound > output tab Select Bluetooth output Then set profile to 'high fidelity playback (a2dp sink)

user162459
  • 46
  • 4
0

This one worked for me https://askubuntu.com/a/1186839/834728

sudo apt-get install pulseaudio-module-bluetooth
killall pulseaudio

Try to connect again.