19

I can successfully connect a Mi BlueTooth speaker to Ubuntu, but I cannot play sound through it, because it is not listed in my sound output list.

Bluetooth module for PulseAudio sound server

Is present on my system, however running sudo pactl load-module module-bluetooth-discover returns:

Failure: Module initialization failed. 

How can I solve this issue? `

2
  • what if you do not use sudo for loading a module?
    – Takkat
    Sep 13, 2016 at 13:42
  • same result @Takkat Sep 13, 2016 at 13:43

10 Answers 10

35

One way to solve the problem is to:

  1. unpair the device
  2. run the following command on terminal: sudo pkill pulseaudio
  3. and then pair again the speaker via bluetooth.

The speaker is now displayed on the output audio list, which needs to selected for obtaining output sound.

Remember to, under Sound Settings, change Mode to High Fidelity Playback (A2DP Sink).

2
  • I did not even have to disconnect the device, let alone unpair. Just killed pulseaudio and reconnected with bluetoothctl. It worked. Weird.
    – Jo Mo
    Mar 24, 2020 at 8:19
  • + 1 My speaker was only visible and working for one logged in user (yes I concurrently log under different users on my computer). Unpairing and killing pulseaudio helped pair it back to the user I needed to output the sound with ATM.
    – Shautieh
    Apr 20, 2020 at 20:15
16

This is what is working for me for Bose QuietComfort 35 on Ubuntu 16.04. pauvcontrol didn't do it for me, and neither did the numerous settings changes and module loadings recommended elsewhere. So give this a try:

  1. Install blueman

    sudo apt install blueman
    
  2. Delete the paired device in the bluetooth settings.

  3. Run these commands in terminal:

    $ sudo pkill pulseaudio
    $ sudo /etc/init.d/bluetooth restart
    
  4. Turn off headphones.

  5. Turn on headphones, and press green/go until headphones notification voice says "Ready to pair."

  6. Launch blueman, and from the upper right menu, right-click the icon to bring up the blueman menu. Select Setup new device.

  7. Pair the device, and when you are given an option, not Headphones, not Handsfree. Use the Audio sink option.

  8. Then when you look into the audio settings panel, the device should be displayed.

5
  • 2
    Thanks, that worked. Kinda sucks that it is required so often. No permanent solution.
    – umpirsky
    Nov 4, 2017 at 9:24
  • This 'kind of' works for me, my QC35 appears in the sound output again. But it connects in HSP/HFP mode (mono). I cannot switch it to A2DP stereo mode.
    – Jesbus
    Dec 16, 2018 at 10:00
  • and.. after getting frustruted and pkilling pulseaudio 1000 times in a bash loop, somehow it started working in A2DP mode again. Bluetooth is an absolute nightmare on ubuntu :/
    – Jesbus
    Dec 16, 2018 at 10:10
  • Thanks, it's worked for my bluetooth speaker. But, my PC's internal speaker has not worked yet. May 4, 2020 at 21:04
  • This worked for me. (At least once) Aug 11, 2020 at 15:28
1

I had to use Lou Gro's blueman solution every time I rebooted. This fixed it for me:

https://wiki.archlinux.org/index.php/Bluetooth_headset#Gnome_with_GDM

Follow the instructions under "Gnome with GDM" (use gdm3 in the paths instead of gdm for Gnome 3)

1

For me the easiest and right solution to that was:

sudo apt install pulseaudio-module-bluetooth 

then i removed the device from the bluetooth known devices, reboot and all worked. I can now see the headphones as sound output in sound settings. Hope it helps!

1

This is old, but I had the same problem on 18.04 and none of the solutions offered worked for me.

What worked for me, at least for Audacious, was to start PulseAudio Volume Control, and after I started Audacious - I selected Mi Bluetooth Computer Speaker from the dropdown.

PulseAudio Volume Control Playback tab

0

I had a lot of trouble getting my No Bounds speaker to connect. Clicking the Bluetooth icon in the taskbar showed 3 devices called 'No Bounds'. The first one would connect, then disconnect in 10 secs. So I decided to delete the device. Then when I turned on the No Bounds, it connected! Now works perfectly (LM19.1)

0

I followed the Debian documentation troubleshooting help for A2DP ("Advanced Audio Distribution Profile") that works for me:

In order to prevent GDM from capturing the A2DP sink on session start, edit /var/lib/gdm3/.config/pulse/client.conf (or create it, if it doesn't exist):

autospawn = no
daemon-binary = /bin/true

After that you have to grant access to this file to Debian-gdm user:

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

You will also need to disable pulseaudio startup:

rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket

In order to auto-connect a2dp for some devices, add this to /etc/pulse/default.pa:

load-module module-switch-on-connect

Reboot.

Now the sound device (bluetooth headset) should be accessible through pavucontrol > and standard audio device manager.

0

I didn't have any luck with /var/lib/gdm3/.config/pulse/client.conf or /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket or /var/lib/gdm3/.config/pulse/default.pa - I kept seeing Debian-gdm's pulseaudio process. What worked for me was the link from https://wiki.debian.org/BluetoothUser/a2dp#Refused_to_switch_profile_to_a2dp_sink:_Not_connected to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845938 and the removal of execute permission from the Debian-gdm user to pulseaudio in the original submission there, which I refined as follows to avoid the reboot:

sudo setfacl -m u:Debian-gdm:r /usr/bin/pulseaudio
sudo killall pulseaudio

...

Well, that's remained working for me across upgrades and reboots - I only see a pulseaudio process in my username - but I still had problems today getting my Amazon Echo to connect as a sink rather than a source. What finally worked (today) was initiating the pairing as a sink from the blueman-manager program from the blueman package.

0

Had this issue on 20.04. This worked for me:

pulseaudio -k && sudo alsa force-reload
0

For me, on Ubuntu 20.04, I had two problems:

  • The UI is not enabled, so the confirm device GUI can't appear. Fixed by this answer

  • After I could confirm the device, it paired, but did not show in the audio device manager. This is because the device was not trusted.

    I installed blueman as mentioned above, sudo apt install blueman, and then my bt speaker was already listed. Instead of all of the process kill, restart and pair steps, I right-clicked the speaker in blueman and chose "Trust" - and now the speaker shows as an audio output in Sound settings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .