5

So I got me a Pi 3B and I'm using the Bluetooth build into it. after some tinkering around I made some progress towards this goal but I've hit a roadblock and don't know how to continue from here.

Using bluetoothctl I was able to pair my Bluetooth headset:

[bluetooth]# info 00:25:DB:43:24:1B
Device 00:25:DB:43:24:1B
Name: Altec In-ear BT
Alias: Altec In-ear BT
Class: 0x240404
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
UUID: Headset   (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink(0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control(0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information   (00001200-0000-1000-8000-00805f9b34fb)
Modalias: bluetooth:v0039p157Ed0206

made some progress I did a

apt-get purge pulseaudio
apt-get install pulseaudio pulseaudio-module-bluetooth pulseaudio-module-x11

and now I get

Apr 11 02:29:31 raspberrypi bluetoothd[742]: a2dp-sink profile connect failed for 00:25:DB:43:24:1B: Protocol not available
Apr 11 02:39:12 raspberrypi bluetoothd[742]: Endpoint registered: sender=:1.36 path=/MediaEndpoint/A2DPSource
Apr 11 02:39:12 raspberrypi bluetoothd[742]: Endpoint registered: sender=:1.36 path=/MediaEndpoint/A2DPSink
Apr 11 02:40:01 raspberrypi bluetoothd[742]: /org/bluez/hci0/dev_00_25_DB_43_24_1B/fd0: fd(22) ready

which seems like it's ready to go but it's still outputting to the analog jack not the headset so I think I'm still missing something.

after doing some more poking around I found pactl and with that I was able to get it to show me what sources it had, and it had an option to upload a sample and play to a specified source. but the sound clip has to be really small to load. after digging around for one small enough, I was able to get it to actually play the sample though the headset! But when I try to use any media player they either flat out refuse to start, or I get no sound.

so I think I'm at the point now where the pi know how to send sound to the headset but it doesn't know it's supposed to output the sound there instead of the jack. I tried the "set-default-source" option and while I got no error it seem to affect anything either.

2

After much digging around and beating my head against the wall I finally got it working.

I had to change /etc/pulse/default.pa where it mentioned Bluetooth to

load-module module-bluetooth-policy
load-module module-bluetooth-discover
load-module module-switch-on-connect

Then I had to plug in a monitor and keyboard and make sure it connected on the desktop, then it finally worked. For some reason I had to go in full regular mode to get the headset to work. as tried several times to do this from an ssh or xrdp session and I'd get various errors when I tell it to connect.

But apparently there is something that happens differently when your plugged in directly as opposed to remoted in, it only needs to happen once but it does need to happen. the moment it booted up in to a direct session (monitor mouse/keyboard in the pi) everything just worked I didn't have to mess with anything, it automatically connected with out error and I could play music from any app to the bt speakers. And now when I reboot it in headless mode it still works. I'm still curios why the heck that made all the difference, but that did seem to be the missing piece of the puzzle for me.

1

This worked for me - totally in remote SSH session:

Mini Bluetooth Speaker  

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install pi-bluetooth ( "already the newest version" )

sudo apt-get install blueman pulseaudio pavucontrol pulseaudio-module-bluetooth

sudo reboot

hcitool dev  (look for bluetooth address of the built-in adapter)
             (if don't see it:   sudo hciconfig

bluetoothctl

# devices

# power on

# pairable on

# discoverable on

# scan on

# devices  
Device 30:22:12:01:0C:52 Y88

# paired-devices

# agent on

# default-agent

# trust 30:22:12:01:0C:52

# pair 30:22:12:01:0C:52
Attempting to pair with 30:22:12:01:0C:52
[CHG] Device 30:22:12:01:0C:52 Connected: yes
[CHG] Device 30:22:12:01:0C:52 Modalias: usb:v05ACp022Cd0100
[CHG] Device 30:22:12:01:0C:52 UUIDs:
    00001108-0000-1000-8000-00805f9b34fb
    0000110b-0000-1000-8000-00805f9b34fb
    0000110c-0000-1000-8000-00805f9b34fb
    0000110e-0000-1000-8000-00805f9b34fb
    0000111e-0000-1000-8000-00805f9b34fb
    00001124-0000-1000-8000-00805f9b34fb
    00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 30:22:12:01:0C:52 Paired: yes
Pairing successful

# paired-devices
Device 30:22:12:01:0C:52 Y88

# connect 30:22:12:01:0C:52
Attempting to connect to 30:22:12:01:0C:52
[CHG] Device 30:22:12:01:0C:52 Connected: yes

# exit


$ alsamixer  (set volume to 85% - normal)

$ sudo apt-get install omxplayer

$ omxplayer YouBetterRun.mp3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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