Volumio + Bluez-Alsa (a2dp bluetooth support)

For those that used the github.com/BaReinhard/Super-Sim … Pi-Install and had it working with or without modification, would you mind creating an issue on that repo either with the errors or solution that got it working. Be sure to list what Raspbian you are using (Jessie/Stretch, Lite/Desktop) I would love to create a working branch that you can easily install without having to manually configure things afterwards.

Thanks,
BaReinhard

Update:

Wanted to add that I have issued a fix for Volumio users as there were issues with the current install for bluetooth. You can find the new changes in the README and how to benefit from them.

I Wanted to provide an update on bluetooth support for Volumio. A few things to note, it is not using bluez-alsa, it is unofficial as well as not completely integrated with Volumio, meaning that you may need to configure what pulseaudio input sink goes to what output sink. This will likely need to be done via a CLI or terminal (Unless there is a volumio plugin to control PA sinks) If you have any issues with that feel free to open an issue on my github repo:
github.com/bareinhard/super-sim … er-install

Install Process

[code]# enable ssh through volumio.local/dev

ssh to volumio

git clone https://github.com/bareinhard/super-simple-raspberry-pi-audio-receiver-install
cd super-simple-raspberry-pi-audio-receiver-install
git checkout volumio-fix
sudo ./install.sh

Choose Bluetooth Option, #4

Wait for it to complete, and enjoy[/code]

Just a note so I easily can follow this thread :slight_smile:

Followed the steps described by Bareinhard yesterday. Installation went fine, I can connect my phone to the Pi afterwards, but I get no sound from my phone to the Pi.

Can someone explain how to do this?

Cheers!

What A2DP audio codecs are available with this method ?

This method would be to connect my cell (with spotify) to the volume for example? the spotify plugin has some flaw…

Is there another way to install?
I’m newbie in linux.
I installed everything until the bluez-Alsa.
I had problem in making folders (even done, after restarting only the bluez-Alsa folder appears. Volumio running normally.

sory for my poor english

Just a note so I easily can follow this thread :slight_smile:

Thanks to bareinhard I got the streaming itself working by editing /usr/local/bin/bluez-udev . On the second line change audio_sink=0 to audio_sink=1 . this will do the trick. (see github.com/BaReinhard/Super-Sim … issues/103 for details).

So streaming works now, unfortunately, playback is stuttering heavily, so still some tweaking to be done. But getting this to work properly would upgrade the Pi and Volumio together with decent DAC/Amp to a really fantastic stand alone music centre.

OK. I have a pi zero w, justboom amp zero, volumio + spotify connect plugin working fine with wifi.
As a newbie, is there now a complete list of the tasks I need to perform to get spotify to work with bluetooth ?

If you have Spotify running on the Pi already, what do you need Bluetooth for?

The steps described above turn the Pi into a BT receiver, NOT a transmitter.

For streaming spotify from a mobile phone to the pi+amplifier without connecting to a wifi network

Ah, ok. It’s actually not that hard to get it going. But since you are using a Zero W, you would have to use an external WiFi dongle to avoid choppy playback (see last posts under github.com/BaReinhard/Super-Sim … issues/103)

First, write latest Volumio version to your SD card. After booting, login either directly on the Pi or via SSH and follow the steps that bareinhard described:

[code]# enable ssh through volumio.local/dev

ssh to volumio

git clone https://github.com/bareinhard/super-simple-raspberry-pi-audio-receiver-install
cd super-simple-raspberry-pi-audio-receiver-install
git checkout volumio-fix
sudo ./install.sh

Choose Bluetooth Option, #4

Wait for it to complete, and enjoy[/code]

After reboot, you should see a new BT device with the name that you have chosen during setup. Try to connect your phone to it and start music playback on the phone. If you don’t get sound on the RPi, you might have to change /usr/local/bin/bluez-udev . On the second line change audio_sink=0 to audio_sink=1 . this will do the trick. (see github.com/BaReinhard/Super-Sim … issues/103 for details).

Hi, I’ve tried to follow your guide to install bluetooth function but after it finished the installation and reboot the raspberry, I can’t find the bluetooth access point. What can I do ?

git clone github.com/bareinhard/super-sim … er-install

I tried this script on volumio and doesn’t seems to work. I think it only works on Raspbian.

The method of the original post works on my Pi3 and Pi Zero W (i.e. other pis should work too).
There seems to be a problem with the udev rules being too broad.

KERNEL=="input[0-9]*", RUN+="/home/volumio/a2dp-autoconnect"

It also picks up my usb input device and created a link. In my case, my WaveShare touch screen USB input.

volumio@volumiopanel2:~$ systemctl | grep blue
  sys-subsystem-bluetooth-devices-hci0.device                                                             loaded active plugged   /sys/subsystem/bluetooth/devices/hci0
  sys-subsystem-bluetooth-devices-hci0:11.device                                                          loaded active plugged   /sys/subsystem/bluetooth/devices/hci0:11
  bluealsa-aplay@C0:EE:FB:D9:BA:04.service                                                                loaded active running   BlueAlsa-Aplay C0:EE:FB:D9:BA:04 -dhw:1,0
â bluealsa-aplay@WaveShare.service                                                                        loaded failed failed    BlueAlsa-Aplay WaveShare -dhw:1,0
  bluealsa.service                                                                                        loaded active running   BluezAlsa proxy
  bluetooth.service                                                                                       loaded active running   Bluetooth service
  system-bluealsa\x2daplay.slice                                                                          loaded active active    system-bluealsa\x2daplay.slice
  bluetooth.target                                                                                        loaded active active    Bluetooth

When I got both connected, the bluetooth works but the music is choppy, it seems it is caused by both devices outputting to the same audio hardware.

Any suggestion on narrow it down? I tried SUBSYSTEM==“bluetooth” but it doesn’t work.

Right, I manage to stop other USB input devices being added to the bluealsa-aplay. Here is the modified a2dp-autoconnect script (added a mac address check)

#!/bin/bash
# at each BT connection/disconnection start/stop the service bluealsa-aplay
function log {
        sudo echo "[$(date)]: $*" >> /var/log/a2dp-autoconnect
}
BTMAC=${NAME//\"/}

if [ `echo $BTMAC | egrep "^([0-9A-F]{2}:){5}[0-9A-F]{2}$"` ]
then
        if [ $ACTION = "remove" ]
        then
                log "Stop Played Connection " $BTMAC
                sudo systemctl stop bluealsa-aplay@$BTMAC
        elif [ $ACTION = "add" ]
        then
                log "Start Played Connection " $BTMAC
                sudo systemctl start bluealsa-aplay@$BTMAC
        else
                log "Other action " $ACTION
        fi
fi

Also it seems I need to re-pair the devices each time otherwise the music gets really choppy.

Hello Guys,

i did the tutorial and the installation going without any problems.

I can connected my device and all seems good.
BUT if i make a test if all services running up ($ systemctl | grep blue) i don´t get these lines:

bluealsa-aplay@68:FB:7E:24:25:52.service loaded active running BlueAlsa-Aplay 68:FB:7E:24:25:52 -dhw:1,0
system-bluealsa\x2daplay.slice loaded active active system-bluealsa\x2daplay.slice

What should i do to make these services running?

My Problem is that i dont hear anything. Although my Hardware Device is set correctly.
I use the RP3 with a HifiBerryPro Dac+.

Excuse my bad english.

Thanks for Help.
best regards

Peter K.

Hi everybody,

I created some automation for setting up bluez-alsa on as many volumio servers as you want. I personally have several spread throughout the house and it’s a great time saver in the event that any of them need to be rebuilt from scratch. The automation is done with ansible and is available over at github.com/pgporada/ansible-pla … -bluetooth. Feel free to browse through the code and open issues to ask me questions on github because I don’t frequent these forums much and would miss any private messages.