5

I've discovered again that cursing and swearing at inanimate objects doesn't actually improve things, so I'll try posting a question.

A couple of months ago I attempted a fairly ambitious project (Sonos Bluetooth Bridge) with my RPi that didn't work out. It was a fairly complex project IMHO, and as the author of the article didn't respond to help requests, I decided to set it aside, and start with a simpler Bluetooth project.

Connecting to a Bluetooth speaker seemed straightforward enough, but I'm now wondering if there is such a thing as a simple Bluetooth project. My setup is simple:

Just to verify the speaker worked, in about 2 minutes I was able to connected from my phone & play music. Speaker works.

Here's an attempt to show the relevant software on my system:

$ dpkg -l | grep blue
ii  bluez                             5.43-2+rpt2+deb9u2                armhf        Bluetooth tools and daemons
ii  bluez-firmware                    1.2-3+rpt7                        all          Firmware for Bluetooth devices
ii  pi-bluetooth                      0.1.10                            all          Raspberry Pi 3 bluetooth
ii  pulseaudio-module-bluetooth       10.0-1+deb9u1                     armhf        Bluetooth module for PulseAudio sound server

From my RPi, I used bluetoothctl to discover and pair with the speaker as follows (some steps deleted for brevity):

pi@raspberrypi3b:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:67:85:55 raspberrypi3b [default]
[NEW] Device F4:4E:FD:2A:3C:B6 SoundCore mini
[NEW] Device A8:66:7F:4D:1A:B2 SdMiPhone 
[bluetooth]# info F4:4E:FD:2A:3C:B6
Device F4:4E:FD:2A:3C:B6
    Name: SoundCore mini
    Alias: SoundCore mini
    Class: 0x240404
    Icon: audio-card
    Paired: yes
    Trusted: yes
    Blocked: no
    Connected: no
    LegacyPairing: no
    UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
[bluetooth]# connect F4:4E:FD:2A:3C:B6
Attempting to connect to F4:4E:FD:2A:3C:B6
Failed to connect: org.bluez.Error.Failed

Research on the error led to zillions of matches, but the most promising appeared to a couple of answers given here on SE - @udjamaflip answer for Raspberry Pi. This answer refers to another answer on the SE Ubuntu site.. And one other answer on Unix&Linux SE.

I think I've followed the steps correctly. I've edited both files IAW the referenced answer, rebooted, used pactl, but I still get the failure:
Failed to connect: org.bluez.Error.Failed

FWIW, the pactl step succeeds once per reboot, trying to load-module again gets an error, but it can be unload-ed, and then load-ed successfully:

$ pactl load-module module-bluetooth-discover
20
$ pactl load-module module-bluetooth-discover
Failure: Module initialization failed 
$ pactl unload-module module-bluetooth-discover
$ pactl load-module module-bluetooth-discover
22
$ 

The syslog shows the following for each attempt at a connection w/ bluetoothctl:

bluetoothd[491]: a2dp-sink profile connect failed for F4:4E:FD:2A:3C:B6: Protocol not available

Any ideas or suggestions are much appreciated.

1
  • ICYI, a follow-up question was asked in August, 2020, and an answer was found shortly thereafter; see Bluetooth Blues, Redux
    – Seamus
    Commented Sep 18, 2020 at 23:20

1 Answer 1

1

A possible solution is to add users to groups e.g.

sudo gpasswd -a pi pulse
sudo gpasswd -a pi lp
sudo gpasswd -a pulse lp
sudo gpasswd -a pi audio
sudo gpasswd -a pulse audio
5
  • 3
    How on Earth would adding the user to the lp group help with bluetooth audio? Commented Oct 7, 2019 at 10:59
  • 1
    @DmitryGrigoryev I'm no expert and this is just a suggestion to try, but an explanation might be that by default the bluetooth daemon will only give out devices to users that are a member of the lp group.
    – Jim
    Commented Oct 7, 2019 at 12:21
  • 1
    lp stand for "line printer", and I'm yet to find out why the bluetooth daemon would care about that group at all. If you want to give a user every permission there is just in case, just switch to root user. Commented Oct 7, 2019 at 12:37
  • 1
    See note near the beginning of wiki.archlinux.org/index.php/…
    – Jim
    Commented Oct 7, 2019 at 13:57
  • 1
    Also discussion in "Pairing works, but connecting does not" of wiki.archlinux.org/index.php/Bluetooth_headset
    – Jim
    Commented Oct 7, 2019 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.