jmb2341
Posts: 7
Joined: Sun Aug 24, 2014 8:26 pm

Bluetooth Speakers

Sun Aug 24, 2014 8:39 pm

Hello,

There is already a good amount of information on using a Raspberry Pi to make your speakers into Bluetooth speakers. I followed this tutorial,
http://www.instructables.com/id/Turn-yo ... /?ALLSTEPS
and ended up with almost what I wanted.

Ive been able to play music over my speakers through my Pi with an iPhone 4 and iPhone 5 but not a computer. All devices are able to pair but music does not transfer through my Macbook Pro running Mavericks.

Is there a different connection protocol with computers compared to phones? I would think that a new computer would be A2DP and AVRCP enabled.

I am using a CSR8510 Bluetooth USB dongle on my Pi.

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

Re: Bluetooth Speakers

Mon Aug 25, 2014 12:31 am

jmb2341 wrote:Is there a different connection protocol with computers compared to phones?
No, but.... I'm a Windows guy, so I can't try this, but it might be that the MacBook is looking for a slightly different Class of Device (CoD). I would try changing the 'class' line in /var/lib/bluetooth/<adapter address>/config, to:

Code: Select all

class 0x64041C
reboot the Pi and just to be sure, re-pair with the MacBook. (This is a handy calculator for translating CoDs to hex and back: http://www.ampedrftech.com/cod.htm)

Failing that, check /var/log/syslog and (following the instructables guide), /var/log/bluetooth_dev for any informative errors.

jmb2341
Posts: 7
Joined: Sun Aug 24, 2014 8:26 pm

Re: Bluetooth Speakers

Sat Aug 30, 2014 4:52 pm

Thank you for the reply. I finally got a chance to test this again. Unfortunately every time I reboot the class seems to reset. I use,

Code: Select all

 sudo nano /var/lib/bluetooth/00:1A:7D:DA:71:13/config 
to edit the file and changes are saved. Then I reboot and check the file but the class reverts to

Code: Select all

 class 0x4e041c 
This doesn't seem to have Audio as a service class which could be the problem.

http://www.ampedrftech.com/cod.htm?result=4e041c

Do you know how I can write the class so it wont reset?

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

Re: Bluetooth Speakers

Sat Aug 30, 2014 5:05 pm

Sorry, I didn't think it was necessary but it sounds like you'll need to make the same change also in /etc/bluetooth/main.conf

jmb2341
Posts: 7
Joined: Sun Aug 24, 2014 8:26 pm

Re: Bluetooth Speakers

Sat Aug 30, 2014 6:42 pm

Unfortunately I already made the change in both. It remains the same in

Code: Select all

/etc/bluetooth/main.conf

but when I reboot the

Code: Select all

/var/lib/bluetooth/00:1A:7D:DA:71:13/config 
reverts back.

Here is my config file,

Code: Select all

pi@raspberrypi ~ $ cat /var/lib/bluetooth/00:1A:7D:DA:71:13/config
name Bose1
pairable yes
class 0x64041c
and here is my conf file

Code: Select all

pi@raspberrypi ~ $ cat /etc/bluetooth/main.conf
[General]

# List of plugins that should not be loaded on bluetoothd startup
#DisablePlugins = network,input

# Default adaper name
# %h - substituted for hostname
# %d - substituted for adapter id
Name = Bose1

# Default device class. Only the major and minor device class bits are
# considered.
# Class = 0x4e041c
Class = 0x64041c

# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
# 0 = disable timer, i.e. stay discoverable forever
DiscoverableTimeout = 0

# How long to stay in pairable mode before going back to non-discoverable
# The value is in seconds. Default is 0.
# 0 = disable timer, i.e. stay pairable forever
PairableTimeout = 0

# Use some other page timeout than the controller default one
# which is 16384 (10 seconds).
PageTimeout = 8192

# Discover scheduler interval used in Adapter.DiscoverDevices
# The value is in seconds. Defaults is 30.
DiscoverSchedulerInterval = 30

# Automatic connection for bonded devices driven by platform/user events.
# If a platform plugin uses this mechanism, automatic connections will be
# enabled during the interval defined below. Initially, this feature
# intends to be used to establish connections to ATT channels.
AutoConnectTimeout = 60

# What value should be assumed for the adapter Powered property when
# SetProperty(Powered, ...) hasn't been called yet. Defaults to true
InitiallyPowered = true

# Remember the previously stored Powered state when initializing adapters
RememberPowered = true

# Use vendor, product and version information for DID profile support.
# The values are separated by ":" and VID, PID and version.
#DeviceID = 1234:5678:abcd

# Do reverse service discovery for previously unknown devices that connect to
# us. This option is really only needed for qualification since the BITE tester
# doesn't like us doing reverse SDP for some test cases (though there could in
# theory be other useful purposes for this too). Defaults to true.
ReverseServiceDiscovery = true

# Enable name resolving after inquiry. Set it to 'false' if you don't need
# remote devices name and want shorter discovery cycle. Defaults to 'true'.
NameResolving = true

# Enable runtime persistency of debug link keys. Default is false which
# makes debug link keys valid only for the duration of the connection
# that they were created for.
DebugKeys = false

# Enable the GATT Attribute Server. Default is false, because it is only
# useful for testing.
AttributeServer = false

Return to “Media centres”