[Solved] Bluetooth speaker connecting but not working

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post please read how to get help
Post Reply
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

[Solved] Bluetooth speaker connecting but not working

Post by H.Remedy »

Hi all. I recently bought an awesome little Sony speaker (SRS-XB2) that has bluetooth connectivity. This is the first time I've tried to use bluetooth in a Linux distro, and I'm having trouble getting the darned thing to work on my laptop. It is pairing (it shows up in the list of connected devices on my computer) but audio is still coming out of my laptop speakers rather than the bluetooth speaker. I have set it up as an "audio sink".

Somewhere online I saw a recommendation to try the Blueman manager, which I've downloaded but it hasn't solved my problem.

I can confirm the speaker's Bluetooth adapter works because I've used it successfully with an Android and an iPhone.

Here is inxi -Fxz with my system details:

Code: Select all

System:    Host: Inspiron7000 Kernel: 4.4.0-59-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Xfce 4.12.3 (Gtk 2.24.28) Distro: Linux Mint 18 Sarah
Machine:   System: Dell (portable) product: Inspiron 13-7359
           Mobo: Dell model: 0WJF7F v: A00 Bios: Dell v: 01.06.00 date: 02/25/2016
CPU:       Dual core Intel Core i7-6500U (-HT-MCP-) cache: 4096 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 10367
           clock speeds: max: 3100 MHz 1: 604 MHz 2: 888 MHz 3: 886 MHz 4: 624 MHz
Graphics:  Card: Intel Sky Lake Integrated Graphics bus-ID: 00:02.0
           Display Server: X.Org 1.18.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.00hz
           GLX Renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2)
           GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
Audio:     Card Intel Sunrise Point-LP HD Audio driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.4.0-59-generic
Network:   Card: Intel Wireless 3165 driver: iwlwifi bus-ID: 01:00.0
           IF: wlp1s0 state: up mac: <filter>
Drives:    HDD Total Size: 256.1GB (28.1% used) ID-1: /dev/sda model: SanDisk_Z400s_2. size: 256.1GB
Partition: ID-1: / size: 226G used: 60G (28%) fs: ext4 dev: /dev/dm-1
           ID-2: /boot size: 473M used: 165M (37%) fs: ext2 dev: /dev/sda2
           ID-3: swap-1 size: 8.43GB used: 0.00GB (0%) fs: swap dev: /dev/dm-2
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 32.0C mobo: 25.0C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 223 Uptime: 18 min Memory: 855.8/7837.7MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.421) inxi: 2.2.35 
Hope someone can guide me through this.


EDIT: Previously I had poked around in the pulseaudio settings to set the speaker as an A2DP device. I just opened the settings again and I'm now getting a message "Establishing connection to PulseAudio. Please wait". Nothing happens afterward. I am positive this is not the source of my bluetooth problem, because I could see the settings there before. But now it looks like I've got two problems. Should I be re-installing pulseaudio? :?
Last edited by H.Remedy on Tue Feb 14, 2017 5:55 pm, edited 1 time in total.
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: Bluetooth speaker connecting but not working

Post by JeremyB »

You may want to check pactl list short | grep blue to see if module-bluetooth-discover is listed in the results as that is what reveals it as a sound output in pulseaudio. If module-bluetooth-discover is not in the results try

Code: Select all

pactl load-module module-bluetooth-discover
Then reconnect with the bluetooth speaker
There are other issues that may be solved using a python script from the bug report @ https://bugs.launchpad.net/ubuntu/+sour ... ug/1577197

If your bluetooth speaker doesn't have volume controls or a microphone it should function without the script
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

Oops, looks like I have bigger problems. The ouput from pactl list short | grep blue was:

Code: Select all

shm_open() failed: No such file or directory
Connection failure: Protocol error
I'm also getting the first line of that message when I run the command pavucontrol. I think something has messed up PulseAudio...
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: Bluetooth speaker connecting but not working

Post by JeremyB »

Might need to be reinstalled

Code: Select all

sudo apt-get install --reinstall pulseaudio
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

Thanks - but the errors are still occurring after re-install.

Strike that, I spoke too soon! After a re-start PulseAudio seems to be working fine again. The command you suggested (pactl list short | grep blue) does not return anything, so I'm working through the other suggestions you made. Will keep you updated!
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

Now I'm getting really confused. After a few moments of not using the system, I'm getting the same errors again:

Code: Select all

shm_open() failed: No such file or directory
Connection failure: Protocol error
It's like some functions of PulseAudio are crashing after a delay.
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: Bluetooth speaker connecting but not working

Post by JeremyB »

See what

Code: Select all

dmesg | grep -i pulse
There might be some errors there that tell us what is happening

Also post results for

Code: Select all

dpkg -l | grep pulse
I know there were some updates done to keep pulse from crashing while connecting
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

dmesg | grep -i pulse does not return anything.

dpkg -l | grep pulse returns this:

Code: Select all

ii  gstreamer0.10-pulseaudio:amd64	0.10.31-3+nmu4ubuntu2.16.04.2	amd64	GStreamer plugin for PulseAudio
ii  gstreamer1.0-pulseaudio:amd64	1.8.2-1ubuntu0.3				amd64	GStreamer plugin for PulseAudio
ii  libpulse-mainloop-glib0:amd64	1:8.0-0ubuntu3.2				amd64	PulseAudio client libraries (glib support)
ii  libpulse-mainloop-glib0:i386		1:8.0-0ubuntu3.2				i386	PulseAudio client libraries (glib support)
ii  libpulse0:amd64				1:8.0-0ubuntu3.2				amd64	PulseAudio client libraries
ii  libpulse0:i386				1:8.0-0ubuntu3.2				i386	PulseAudio client libraries
ii  libpulsedsp:amd64				1:8.0-0ubuntu3.2				amd64	PulseAudio OSS pre-load library
ii  libpulsedsp:i386				1:8.0-0ubuntu3.2				i386	PulseAudio OSS pre-load library
ii  pulseaudio					1:8.0-0ubuntu3.2				amd64	PulseAudio sound server
ii  pulseaudio-utils				1:8.0-0ubuntu3.2				amd64	Command line tools for the PulseAudio sound server
(Sorry for the alignment problem. I tried getting everything straightened out with the tab key but phpBB is fighting me. :lol: )
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: Bluetooth speaker connecting but not working

Post by JeremyB »

It seems you are missing one

Code: Select all

sudo apt-get install pulseaudio-module-bluetooth
Reboot and check

Code: Select all

pactl list short | grep blue
Hopefully module-bluetooth-discover is loaded
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

Ok, progress! I'm now getting these modules appearing as installed:

7 module-bluetooth-policy
8 module-bluetooth-discover
9 module-bluez5-discover

I still cannot get sound from the external speaker, but (like before) there is no problem pairing it to my computer. Here are some screenshots to show what I'm doing:

Bluetooth Manager shows speaker is paired:
https://i.imgur.com/qxyFRBI.png

PulseAudio Settings shows speaker is an output device:
https://i.imgur.com/5viUSPZ.png
Note: In this window, if I select the external speaker as the "fallback device", and I then try to play some music, the playback progress bar in my music app won't even start moving. If instead I select the laptop's internal speakers as the fallback, then music plays normally through them.

PulseAudio Settings shows A2DP is selected as the speaker's profile:
https://i.imgur.com/bFZnFp2.png

There is definitely something weird going on with PulseAudio though, because if I close the settings window and re-open it, I get this:
https://i.imgur.com/HvUhGa2.png
This does not change unless I reboot the computer.

I get some extra information if I try to open the PA settings from the terminal with pavucontrol command. In this case the terminal shows shm_open() failed: No such file or directory repeatedly for about 10 seconds, and then finally gives up with shm_unlink(/pulse-shm-3190467681) failed: No such file or directory.
xytorq
Level 1
Level 1
Posts: 1
Joined: Sat Jan 28, 2017 10:43 am

Re: Bluetooth speaker connecting but not working

Post by xytorq »

Hello to all,
just in case it may help, I was having similar problem with a BT headset on Mint Mate 18.1
what solved it is the following:
1- open control centre
2- open sound
3- open Output tab
4- select your device (speaker/headset)
3- switch to Hardware tab, your device should be appear and be highlighted
4- at bottom, in 'Settings for selected device", select : High Fidelity Playback (A2DP Sink)
voila!
now it works for me. Hope it will for you too
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

Thanks for taking the time to make that suggestion xytorq. But I've already tried the Xfce equivalent to what you're saying. My problem seems related to - but different from - yours.
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: Bluetooth speaker connecting but not working

Post by JeremyB »

Can you create a new user on your machine and then switch to the new one and see if the issue is still there?
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

JeremyB, that proved to be a good suggestion! I am able to get audio playback through the speaker in a new user account!!

There is a big difference between the two accounts in the PulseAudio sound settings. In the new account, there is a tab called Playback that lists all the audio applications currently running. I can then choose my external speaker as an output for the desired application, and it works. But in my old user account, audio applications do not appear in the Playback tab - there is only a "system sounds" item in the list. (Oddly, however, audio applications DO appear in my desktop panel audio plugin. Unfortunately, clicking on those links just opens the applications themselves; it does not open a settings window for those applications.)

Do you think I should just bite the bullet and migrate my settings/files to the new account and stop trying to troubleshoot this problem? :roll: I don't wanna... but if I hafta.....
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: Bluetooth speaker connecting but not working

Post by JeremyB »

There is a chance it will work in the old user if you go into the file manager, click CTRL + h to see hidden folders. Go into .config folder and rename pulse folder to pulse.old

Then reboot and use the old user, pulse might recreate the file or you may have to reinstall pulseaudio
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

After renaming the Pulse folder I can now see audio players appearing in the PulseAudio window under the Playback tab - progress! But the PulseAudio window is still hanging with that "Establishing connection / please wait" message. This never happens the first time I open the window, but it consistently happens on the second time and subsequent attempts. I had tried reinstalling PulseAudio some days ago (see above) and this did not solve the problem.

I think we've reached the point where i should just migrate to the new user account. Plus, I notice this thread topic has slowly shifted from a networking problem to an audio software problem, meaning it's now in the wrong forum category. Oops. :wink: Thanks for your help though, Jeremy. At least I know I can connect bluetooth on this system!
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: Bluetooth speaker connecting but not working

Post by H.Remedy »

I decided to post a detailed final update for anyone reading this at a later date and looking for help.

I ended up not migrating to a new user account, because everything started working more or less properly after some system updates (including a minor kernel update).

The following steps theoretically should get a bluetooth speaker working with Linux Mint.

Please note I installed and used Blueman instead of the default bluetooth manager.

PART 1: Blueman settings:

1. Open Blueman (probably listed as Bluetooth Manager in your app menu)
2. Click on "Search". While the software is searching, long-press the "pair" button on the bluetooth speaker.
3. When pairing is successful, the speaker should be listed in Blueman.
4. Click on "Setup..." and choose the Audio Sink option.

PART 2: Audio application:

1. Launch an audio application (in this example it will be Audacious).
2. You may have to make a playlist or even click "play" before Part 3 Step 4 becomes possible. At least, this is true for Audacious.

PART 3: PulseAudio settings:

1. Open the PulseAudio sound settings window.
2. Under the Output tab, ensure the bluetooth speaker appears.
3. Under the Configuration tab, choose HSP/HFP as the profile for your bluetooth speaker, and then change this setting to A2DP (*see note below).
4. Under the Playback tab, you should see the running audio application (it might be necessary to do Part 2 Step 2 first). Select the bluetooth speaker as the output method for that audio application.

At this point you should be able to get sound from the speakers. Next time your restart the system or turn the speakers on, you'll have to start at Part 2 again.

* Note: Part 3 Step 3 is necessary because of a known bug. JeremyB above has linked a python script that automates Step 3. I haven't used it yet but that's the next step for me!
duchski
Level 1
Level 1
Posts: 3
Joined: Tue Nov 04, 2014 11:41 pm

Re: [Solved] Bluetooth speaker connecting but not working

Post by duchski »

I solved a similar issue following instructions from thie thread incl. reinstalling pulse audio and deleting pulse settings in .config folder
H.Remedy
Level 3
Level 3
Posts: 163
Joined: Sat Feb 08, 2014 6:52 pm

Re: [Solved] Bluetooth speaker connecting but not working

Post by H.Remedy »

Glad you had success, duchski. Since you brought this thread up again, I should add my own update. LM 18.2 is supposed to have greatly improved bluetooth performance via the built-in Blueberry application. I can happily confirm! Since upgrading to LM 18.2 (from 18.0) my bluetooth problems have completely vanished, as long as I use Blueberry. I literally just turn on bluetooth in Blueberry and turn on my external bluetooth device, and pairing occurs smoothly in a couple of seconds. Hope this is the experience for everyone else going forward.
Post Reply

Return to “Networking”