FANDOM


How to get bluetooth speakers working on a raspberry pi with alsa.

InstallationEdit

sudo apt-get install bluez blueman xauth alsa-utils bluez-alsa

Then edit /etc/bluetooth/audio.conf and add

AutoConnect=true
Enable=Sink,Source,Media,Socket
SCORouting=PCM

Some people reported that when using bluez > 4.96, the following should be used instead:

AutoConnect=true
Enable=Sink,Source,Socket
Disable=Media
SCORouting=PCM

Restart bluetooth to accept those changes:

sudo service bluetooth restart

Scan for bluetooth devices and note the device address (for example A0:E9:DB:40:12:D3):

hcitool scan

Add this to your /etc/asound.conf file and insert the device address instead of  XX:XX:XX:XX:XX:XX::

#/etc/asound.conf

pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluetooth
           device XX:XX:XX:XX:XX:XX 
           profile "auto"
       }   
   }   
   hint {
       show on
       description "BT Headset"
   }   
}

Test if it has been added to the alsa devices:

aplay -L

sudo hcitool cc A0:E9:DB:40:12:D1

oder

sudo bluez-simple-agent hci0 A0:E9:DB:40:12:D1

Test it with mplayer

mplayer -ao alsa:device=btspeaker best_song_ever.mp3

This command is for pulseaudio found somewhere - ignore it:

pactl load-module module-loopback source=alsa_output.platform-bcm2835_AUD0.0.analog-stereo sink=bluez_source.A0_E9_DB_40_12_D1 rate=44100 adjust_time=0

LinksEdit

http://www.rottenrei.be/posts/2013-07-25-bose-soundlink-on-the-raspberry-pi/

http://zitzlinux.wordpress.com/2011/02/28/connecting-bluetooth-devices-from-command-line/

https://wiki.archlinux.org/index.php/Bluetooth_Headset

https://wiki.debian.org/BluetoothUser

http://debianforum.de/forum/viewtopic.php?f=13&t=128476

https://help.ubuntu.com/community/BluetoothSetup#Using_audio_devices

https://help.ubuntu.com/community/BluetoothAudio

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=26533&p=241248

http://www.wolfteck.com/projects/raspi/iphone/

https://wiki.debian.org/Bluetooth/Alsa

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=26685

http://www.ctheroux.com/2012/08/a-step-by-step-guide-to-setup-a-bluetooth-keyboard-and-mouse-on-the-raspberry-pi/