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
  • 10

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
  • 10
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.