zeth
Posts: 27
Joined: Thu Sep 10, 2015 7:37 am

Bluetooth Speaker in Jessie

Sun Nov 01, 2015 8:22 pm

Bluetooth seems to have changed a bit in Jessie so most of the instructions seem to be wrong. The following explains how I made it work, there might be some simpler way.

I have bluetooth dongle from Poundland:

Code: Select all

pi@raspberrypi ~ $ lsusb
Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
And a Bluetooth speaker from Asda called "Polaroid Black Mini Bluetooth Speaker"
speaker.jpeg
Cheap bluetooth speaker from ASDA
speaker.jpeg (22.09 KiB) Viewed 12508 times
I did the following:
  • bluetoothctl
This opened a bluez shell, then I typed:
  • trust device-id
  • pairable on
  • pair device-id
  • connect device-id
Hopefully that is useful to someone. Here are the full commands and output:

Code: Select all

pi@raspberrypi ~ $ bluetoothctl
[NEW] Controller 00:15:83:0C:BF:EB raspberrypi [default]
[NEW] Device 00:11:67:64:54:5B 00-11-67-64-54-5B
[bluetooth]# trust 00:11:67:64:54:5B
Changing 00:11:67:64:54:5B trust succeeded
[bluetooth]# pairable on
Changing pairable on succeeded
[bluetooth]# pair 00:11:67:64:54:5B
Attempting to pair with 00:11:67:64:54:5B
[CHG] Device 00:11:67:64:54:5B Connected: yes
[CHG] Device 00:11:67:64:54:5B Modalias: bluetooth:v0039p13A4d0104
[CHG] Device 00:11:67:64:54:5B 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
	0000112e-0000-1000-8000-00805f9b34fb
	00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 00:11:67:64:54:5B Paired: yes
Pairing successful
[CHG] Device 00:11:67:64:54:5B Connected: no
[bluetooth]# connect 00:11:67:64:54:5B
Attempting to connect to 00:11:67:64:54:5B
[CHG] Device 00:11:67:64:54:5B Connected: yes
Connection successful

User avatar
DougieLawson
Posts: 42142
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Bluetooth Speaker in Jessie

Sun Nov 01, 2015 8:57 pm

Beware of BT dongles from Poundland, they all have the same MAC address because they're Chinese fakes of the CSR4.0 dongle.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
TimG
Posts: 317
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: Bluetooth Speaker in Jessie

Mon Nov 02, 2015 1:01 pm

Unfortunately the BT dongles sold by large reputable component companies also suffer from this problem. If anybody has sources of known-good adapters, with varying MAC addresses, I'd appreciate the info.

zeth
Posts: 27
Joined: Thu Sep 10, 2015 7:37 am

Re: Bluetooth Speaker in Jessie

Sat Nov 07, 2015 2:35 pm

DougieLawson wrote:Beware of BT dongles from Poundland, they all have the same MAC address because they're Chinese fakes of the CSR4.0 dongle.
That is so funny I had to find out if it was true. I got two more and all three have the same MAC address. Hilarious!

For me, it doesn't really matter as nothing else is in bluetooth range of this particular Pi.

User avatar
DougieLawson
Posts: 42142
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Bluetooth Speaker in Jessie

Sat Nov 07, 2015 5:51 pm

zeth wrote: That is so funny I had to find out if it was true. I got two more and all three have the same MAC address. Hilarious!
For me, it doesn't really matter as nothing else is in bluetooth range of this particular Pi.
The annoyance was that I was trying to get RPi1 to connect to RPi2 with BT when I discovered it. It works for getting a WiiMote to connect to one RPi.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

zeth
Posts: 27
Joined: Thu Sep 10, 2015 7:37 am

Re: Bluetooth Speaker in Jessie

Mon Nov 09, 2015 5:31 pm

DougieLawson wrote:The annoyance was that I was trying to get RPi1 to connect to RPi2 with BT when I discovered it. It works for getting a WiiMote to connect to one RPi.
Yeah that is pretty unfortunate. I wonder how deep the chain of Poundland outsourcing goes and if anyone tested them at any stage in the process? Maybe they did then later someone in China decided you can save time by giving them all the same MAC address! Easy to see why RPi likes to make its stuff in the UK.

tpylkko
Posts: 417
Joined: Tue Oct 14, 2014 5:21 pm

Re: Bluetooth Speaker in Jessie

Mon Nov 30, 2015 8:35 pm

A note here (for posteriority): apparently sometimes bluetooth as a service can go bonkers on Raspbian. You will see this when you do

Code: Select all

sudo systemctl status bluetooth
. In that case, you can restart it

Code: Select all

sudo systemctl restart bluetooth
and follow this guide.

device68
Posts: 1
Joined: Sun Dec 27, 2015 5:44 pm

Re: Bluetooth Speaker in Jessie

Sun Dec 27, 2015 5:57 pm

Thanks for the info. This finally worked for me after going though the install process for Bluez although I question if I actually needed to.

I'm using OSMC installed on a Rspberry Pi 2 and very oddly the software has built in Bluetooth support via the My OSMC tab. I origianlly tried the paring and discovery options from here which does pickup and connect the Apple Wireless Keyboard (although only if you don't use the code option) but that's really it. It doesn't work this way, no response from the keyboard anywhere in the interface even though it seems connected.

After trying your solution from the point of being SSH connected to [Bluetooth] I got the device to work. Now I can navigate OSMC with the keyboard and can do away with a wired mouse.

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 2:51 pm

Bluetooth pairing needs be done only once for each device. You're already paired to that device, which is why the pairing fails ("already exists"). Connecting with bluetoothctl is rarely useful. What type of device are you trying to connect with?

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 3:17 pm

I don't know if Kodi/OSMC/OpenElec supports Bluetooth speakers. In Raspbian, you can create an ALSA device. Google 'ALSA Bluetooth' for help. It might be possible through the GUI as well.

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 3:20 pm

If you do try to connect in bluetoothctl, don't use 'to'

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 3:34 pm

Try using Bluetooth Manager (bluetoothctl won't setup an audio connection). You may need to add your user to the 'bluetooth' group.

sam nazarko
Posts: 155
Joined: Wed Apr 25, 2012 5:05 pm

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 4:49 pm

OSMC supports Bluetooth streaming to and from Bluetooth devices. It's currently in testing phase, and we hope to make it part of OSMC by default in a future update.

See https://discourse.osmc.tv/t/testing-blu ... -a2dp/9116

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 5:02 pm

Thank you Sam!

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 6:07 pm

I'm not sure what PA's current resampling method is, probably speex-float-3. In the past, I've had to use a fixed resampling method on the Raspberry Pi, so I've always used 'speex-fixed-3' , without the semicolon.
Last edited by Douglas6 on Sat Jan 16, 2016 6:11 pm, edited 1 time in total.

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 6:13 pm

Two 'e's in 'speex-fixed-3', my bad.

sam nazarko
Posts: 155
Joined: Wed Apr 25, 2012 5:05 pm

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 9:25 pm

We use resample-method = trivial in OSMC by default. Any reason I should look at speex-fixed-3 in particular?

Sam

User avatar
Douglas6
Posts: 5110
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Speaker in Jessie

Sat Jan 16, 2016 9:33 pm

I notice a recognizable improvement in sound quality with 'speex-fixed-3' over 'trivial', without much more (but some) increased CPU load. It seems a good compromise between quality and load.

sam nazarko
Posts: 155
Joined: Wed Apr 25, 2012 5:05 pm

Re: Bluetooth Speaker in Jessie

Sun Jan 17, 2016 6:31 am

Will play with that

Cheers

Return to “Raspberry Pi OS”