raspotify: Cannot Use Bluetooth Speaker for Raspotify

I have my bluetooth speaker working on my Pi using raspotify(Tested with VLC and Music on my USB Drive) but I cannot find my bluetooth speaker on aplay -l or aplay -L. I have tried all the options with --device hw:x,x in /etc/default/raspotify but no luck.

Here is my output for aplay -l : **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 7/8 Subdevice #0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5: subdevice #5 Subdevice #6: subdevice #6 Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 30 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Hi all, I got raspotify running with a bluetooth device. Need to google a lot and found that no one had a real solution. So here it is:

  1. Connect your bluetooth speaker with bluetoothctl, if not done yet. 1.1. bluetoothctl 1.2. agent on 1.3. pairable on 1.4. scan on and find your bluetooth device, copy the MAC 1.5. scan off 1.6. pair XX:XX:XX:XX:XX:XX (insert the MAC) 1.7. trust XX:XX:XX:XX:XX:XX 1.8. connect XX:XX:XX:XX:XX:XX 1.9. exit
  2. restart your pi sudo shutdown -r now
  3. you have to configure your audio output in /etc/asound.conf (~/.asoundrc is not working) with dynamic and static ALSA configuration: defaults.bluealsa { interface "hci0" # host Bluetooth adapter device "XX:XX:XX:XX:XX:XX" # Bluetooth Device MAC profile "a2dp" } pcm.yourdevice { type plug slave.pcm { type bluealsa device "XX:XX:XX:XX:XX:XX" profile "a2dp" } hint { show on description "Your description of the bluetooth device" } }
  4. Configure raspotify for using your bluetooth device (here you can use either ‘bluealsa’ or ‘yourdevice’ as device) in the file /etc/default/raspotify Find the line starting with #OPTIONS and replace it with following line: OPTIONS="--device bluealsa"
  5. Restart raspotify sudo service raspotify restart

Now your raspotify should be able to play your music on the specified bluetooth device!

Hope this helps and have fun with your pi 😃

@Zumzod I made it work writing this in the asound.conf file:

defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "XX:XX:XX:XX:XX"
defaults.bluealsa.profile "a2dp"

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

good luck!

for everybody still struggling, i’ve found this to resolve any issues for me when installed alongside raspotify : https://github.com/bablokb/pi-btaudio (remove pulseaudio if you have it). still using the default alsa backend.

if you are constantly switching between audio devices it would be best to symlink asoundrc to asound.conf rm /etc/asound.conf ln -s /home/pi/.asoundrc /etc/asound.conf

then restart raspotify everytime you change device sudo service raspotify restart

Thanks @HappyLuke for the initial solution and @tinoargentino for pasting the configuration, it worked immediately for me!