1

I am trying to use a bluetooth speaker as an input and output device. It works fine with my phone, so the speaker and bluetooth is functional. End goal is to use it like a google assistant, since it has a speaker and a microphone on it (testing to see if I can use the microphone).

I use

$: bluetoothctl
$: power on
$: agent on
$: default-agent
$: scan on
#waiting to get mac address
$: pair (macaddress)
Attempting to pair with 1D:34:BE:73:C3:CD
[CHG] Device 1D:34:BE:73:C3:CD Connected: yes
[CHG] Device 1D:34:BE:73:C3:CD UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 1D:34:BE:73:C3:CD UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 1D:34:BE:73:C3:CD UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 1D:34:BE:73:C3:CD UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 1D:34:BE:73:C3:CD ServicesResolved: yes
[CHG] Device 1D:34:BE:73:C3:CD Paired: yes
Pairing successful
#about 5 seconds  later
[CHG] Device 1D:34:BE:73:C3:CD ServicesResolved: no
[CHG] Device 1D:34:BE:73:C3:CD Connected: no

Any attempts to connect to it after this fail. Any attempt to play music over it fails. This is a headless system so I can't really use the GUI, as it is disabled, though I can use anything that can be forwarded via x server.

I am a bit perplexed by this...

jeffpkamp
  • 121
  • 1
  • 9
  • 1
    Welcome to the "Perplexed Club" :) I've got the same issue, and recently posted a similar question here. My question has links to a couple of suggestions I tried that didn't work for me, but others have reported they did work for them. Beyond that, all I can offer is a "Good Luck". If you do find an answer, please post it here; we're not the only ones struggling with this. – Seamus Apr 01 '19 at 14:50
  • @Seamus After spending all day I got it to work.. problem is I have no idea what it was that finally fixed the issue. :( – jeffpkamp Apr 02 '19 at 04:27
  • Not to worry... I think that happens frequently! And then, to add to the confusion, they publish a "tutorial" on their blog because they believe they know what they did to make it work :) I feel it's a murky area sorely in need of some organization and better (clearer, not more) documentation. I'm glad to hear you got it working... and also glad you won't be publishing a blog on your solution :) – Seamus Apr 02 '19 at 13:18

2 Answers2

1

Somethings that seemed to have made it work. I am using pulseaudio. From what I read you shouldn't do this with Raspian stretch, which should instead use Bluez-alsa. however, this isn't in the package repositories for me and installation didn't fix anything so I am saying what kind of got it working.

  1. make sure you have bluetooth modules for pulseaudio installed. sudo apt-get install pulseaudio-module-bluetooth
  2. Reboot bluetooth sudo systemctl stop bluetooth && sudo systemctl start bluetooth
  3. Restart pulseaudio pulseaudio -k && pulseaudio -D
  4. unload and load pulseaudio module pactl unload-module module-bluetooth-policy && pactl load-module module-bluetooth-policy
  5. Use bluetoothctl to pair your device

Your device might pair now. I find I have to do unload and reload the bluetooth-policy module for pulse audio every time I reconnect (Step 4). Super annoying.

jeffpkamp
  • 121
  • 1
  • 9
  • I've just read Youness' "tutorial" on these Bluetooth issues. If his research & conclusions are accurate, the RPi 3B+ Bluetooth hardware is pretty much useless as far as streaming sound (unless you're a masochist, and like low quality playback :) – Seamus Apr 06 '19 at 13:35
  • @seamus I installed the latest version of Raspian and it works great via the user interface with blue-alsa. Streams like a pro. Was also very easy to set up. I just did sup apt-get install blue-alsa, and then connected via the desktop and started streaming to the speaker. However, just can't get sound from the microphone back. – jeffpkamp Apr 06 '19 at 23:52
  • Terrific! Hope to get back and get mine working soon :) – Seamus Apr 11 '19 at 16:26
0

I found these guides particularly useful, and helped me solve playing audio over bluetooth speaker issue.

CONNECT BLUETOOTH HEADPHONES WITH YOUR RASPBERRY PI

If aplay ... PROFILE=sco doesn't work for you, try changing it to a2dp and use bluetoothd with a2dp plugin. (Guide here)

FYI. aplay doesn't support mp3 files, try mpg123 or omxplayer instead.