Bluetooth speaker: preferred mode "High fidelity playback" (A2DP) is not getting saved

44,960

Solution 1

There's an option in /etc/bluetooth/audio.conf called aAutoConnect=truewhich is hashed out.

sudo nano /etc/bluetooth/audio.conf

Delete the "#" at the start of the AutoConnect=true line

I found enabling this option by removing the # and got things connecting properly with my bluetooth headset

Restart the bluetooth service for the change to take effect:

sudo service bluetooth restart

Solution 2

Add the following line to /etc/bluetooth/audio.conf:

[General]
Disable=Headset

and then run this command:

sudo service bluetooth restart

Thread: (Natty) Connect only A2DP profile for bluetooth headset.

Solution 3

For those wondering, I found in Ubuntu 16.04 there is a slight difference to the answer:

sudo gedit /etc/bluetooth/main.conf

And update the following line

#AutoEnable=false

to

AutoEnable=true

Followed by

sudo service bluetooth restart

For me, this defaulted the audio profile to A2DP Sink when connecting a bluetooth audio device.

Solution 4

I'm using Gnome3 and after some time my headset no longer connected at A2DP again. I had to stop Gnome creating a pulseaudio daemon by creating the file /var/lib/gdm3/.config/pulse/client.conf (as root) and adding the following lines to it:

autospawn = no
daemon-binary = /bin/true

Then set the owner to gdm:

sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf

Then log off/on or look for the pulseaudio process running as the gdm user with ps aux | grep pulse

(Trimmed) output looks like:

gdm       2943  10616 ?        S<l  Sep01   0:00 /usr/bin/pulseaudio..

Then kill the process with kill <pid> which for me was 2943

Running bluetoothctl and connecting again, I could then run pacmd list-cards and find my device index: 2 and change to the a2dp_sink with pacmd set-card-profile 2 a2dp_sink.

Finally working again!

Solution 5

In order to auto switch audio into A2DP bluetooth device when connected in Ubuntu 14.04 I followed the instructions from https://sandalov.org/blog/2146/ and it worked perfectly.

Modify /etc/pulse/default.pa to automatically switch pulseaudio sink to Bluez:

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
load-module module-switch-on-connect  # Add this
.endif

Modify /etc/bluetooth/audio.conf to auto select A2DP profile (instead of HSP/HFP):

[General]
Disable=Headset # Add this

Apply changes:

pulseaudio -k # Restarts pulseaudio
sudo service bluetooth restart # Restarts BT

More info at: https://wiki.archlinux.org/index.php/Bluetooth_headset

Share:
44,960

Related videos on Youtube

knb
Author by

knb

I do web development, system- and database administration in a small group at a research institute. Active here on StackExchange.com in my spare time.

Updated on September 18, 2022

Comments

  • knb
    knb over 1 year

    UPDATE Aug 2017: The solution marked as accepted by me apppears to have worked until Ubuntu 15.10. For 16.04+ choose one of the more recent solutions.

    For 16.04+ the config file is /etc/bluetooth/main.conf NOT /etc/bluetooth/audio.conf .

    I have a bluetooth speaker, Sony SRS-BTX300, which works in linux/ubuntu 13.04, but only after some fiddling. (Update Dec 2013: same problems remain in 13.10)

    I have to set the preferred bandwidth mode to "High fidelity playback" (A2DP) each time after switching on the computer and reconnecting the speaker.

    The mode resets itself to "telephony/duplex" (=low bandwidth) every time. It takes about 20 clicks to reset the speaker, (click through menu, disconnect, reconnects, select mode, test), and these are definitely too many clicks.

    How can I make "A2DP" mode the default mode, an do so in a persistent manner?

    A few screen shots will illustrate.

    After choosing this menu by clicking on the bluetooth icon in the top panel in Unity...

    Bluetooth Icon on panel

    After setting up this...

    A2DP

    ... the preferred mode will be reset to this after restarting/suspending the computer

    Telephony Duplex

    • falconer
      falconer over 10 years
      You may try playing with the settings in the /etc/bluetooth/audio.conf file. E.g. if you don't use any headset, change the MaxConnected=1 setting to 0.
    • black
      black over 8 years
      @falconer This worked on 15.04. Thanks.
  • Sathiya Narayanan
    Sathiya Narayanan almost 10 years
    Unbelievably enough, this worked. Thank you very much!
  • Sathiya Narayanan
    Sathiya Narayanan almost 10 years
    Uh, don't forget to sudo restart bluetooth for the setting to take effect.
  • knb
    knb over 9 years
    Thanks! - in that config file, the comment text above that option was quite verbose, and a bit misleading ("so the default setting of true is usually a good idea." and it's commented out: #AutoConnect=true. --- Removal of the "#" now also seems to work for me, although I haven't rebooted yes (just switched speaker on and off)
  • DmitrySandalov
    DmitrySandalov almost 9 years
    For Ubuntu 14.04 with Upstart: sudo restart --system bluetooth
  • timr
    timr about 8 years
    No such file in Ubuntu 15.10?
  • Nathan J.B.
    Nathan J.B. about 8 years
    Same as @tim and adding the file didn't help.
  • Nathan J.B.
    Nathan J.B. about 8 years
    Not effective in 15.10. :(
  • knocte
    knocte almost 8 years
    no such file in 16.04 either...
  • Ciprian Tomoiagă
    Ciprian Tomoiagă over 7 years
    if I do then the speaker no longer appears in sound settings. how could I debug it ?
  • noe
    noe over 7 years
    Works for ubuntu 16.04, but the file is /etc/bluetooth/main.conf
  • Elijah Lynn
    Elijah Lynn over 7 years
    This worked for my new Bose Quiet Control 30 headphones/neckbuds (QC30). It sounded pretty hissy and was driving me crazy, now it sounds like something I expect from Bose!
  • Elijah Lynn
    Elijah Lynn over 7 years
    This was the other half of the puzzle for getting Bose Quiet Control 30 neckbuds/headphones (QC30) to work for me in Ubuntu 14.04. The other half is the other answer in this question. askubuntu.com/a/563996/11929
  • user584583
    user584583 over 7 years
    Yes! works for ubuntu 16.04 --> /etc/bluetooth/main.conf.
  • Johannes Lemonde
    Johannes Lemonde almost 7 years
    As of Ubuntu 17.04, no such file either. I tried to modify main.conf instead, adding AutoConnect=true someplace in the file, but it didn't solve my problem...
  • jplandrain
    jplandrain over 6 years
    This worked for me on Ubuntu 17.04 I have just added Disable=Headset in the file /etc/bluetooth/main.conf and restarted the bluetooth service with sudo service bluetooth restart
  • wordsforthewise
    wordsforthewise over 6 years
    works, but I also added Disable=Headset and restarted my computer
  • stevenmc
    stevenmc over 6 years
    Not working for 16.04. This answer disables all audio output sources (creates a fault in PulseAudio).
  • Alfred Bez
    Alfred Bez almost 6 years
    I tried this in 18.04 and get this error on service bluetooth status: Unknown key Disable for group General in /etc/bluetooth/main.conf
  • cipricus
    cipricus almost 5 years
    @JohannesLemonde - uncommenting Name = BlueZ in that file and restarting bluetooth solved it for me in Xfce (18.04): askubuntu.com/a/1087118/925128
  • wordsforthewise
    wordsforthewise almost 5 years
    Dunno what you mean @cipricus. I added Disable=Headset to my /etc/bluetooth/main.conf file I think.
  • cipricus
    cipricus almost 5 years
    @wordsforthewise - I wanted to find if both lines are needed or, if only one is enough, whether both work. - Trying to test, I find that in fact I had both. Commenting Disable=Headset & restarting bluetooth, all is fine. Commenting also AutoEnable=true & restarting bluetooth: cannot connect the headset. But after restarting the system I can connect it, and all is fine although both lines are commented now. Odd.
  • Ryan Krage
    Ryan Krage over 4 years
    Worked for me on Ubuntu 19.04, though I had to re-pair my headset (Sony 700N)
  • egelev
    egelev over 4 years
    The configuration in /etc/bluetooth/main.conf didn't work for me. Every time my headphones or laptop go off and on again the automatically reconnected headphones go into 'HSP/HFP' and they can not be set to 'A2DP Sink'. They require to reconnect/repair. So I scripted it into this gist: gist.github.com/egelev/2e6b57d5a8ba62cf6df6fff2878c3fd4
  • Vegard
    Vegard about 4 years
    This worked for me on Ubuntu 19.10 with my Sony Headset WH-1000XM3. (Except that I put the changes for audio.conf in main.conf under [Policy])
  • Vegard
    Vegard about 4 years
    Btw, it did look like it disabled the audio at first, but then it came back after a bit. Restarting could probably help.
  • Bachsau
    Bachsau almost 3 years
    @knb It is commented out, because true is the default, built-in setting.
  • Bachsau
    Bachsau almost 3 years
    Just because this worked for you by coincidence, doesn't mean it is a solution. AutoEnable does nothing else but enable the adapter on boot.