Bluetooth Speaker Plugin

I just want to confirm, that I managed to get it work with a slightly modified variant of the instructions posted by “Fosphatic Duke” :smiley:

I am using Volumio 2.565 on raspi 3…

I had to change the posted installation script in line 21:

[code]#!/bin/bash

echo “Installing Bluetooth Dependencies”
sudo apt-get update
sudo apt-get install -y libasound2-dev dh-autoreconf libortp-dev bluez pi-bluetooth bluez-tools libbluetooth-dev libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev

echo “Cloning Bluez-Alsa repo”
cd /tmp
git clone -b v1.2.0 --single-branch https://github.com/Arkq/bluez-alsa.git

echo “Building Bluez-Alsa”
cd bluez-alsa
autoreconf --install
mkdir build && cd build
…/configure --disable-hcitop --with-alsaplugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib
make

echo “Installing Bluez-Alsa”
sudo make install

sudo cat > /lib/systemd/system/bluezalsa.service <<EOC
[Unit]
Description=BluezAlsa proxy
Requires=bluetooth.service
After=bluetooth.service
[Service]
Type=simple
User=root
Group=audio
ExecStart=/usr/bin/bluealsa --disable-hfp
[Install]
WantedBy=multi-user.target
EOC

sudo systemctl daemon-reload
sudo systemctl enable bluezalsa.service

#requred to end the plugin install
echo “plugininstallend”[/code]

In addition I didn’t have to create a .asoundrc - I modified the mpd.conf.tmpl with the following modified statements:

audio_output { type "alsa" name "Logitech BT Adapter" device "bluealsa:HCI=hci0,DEV=xx:xx:xx:xx:xx:xx,PROFILE=a2dp" mixer_type "software" }

Don’t forget the pair-and-trust-stuff:

bluetoothctl [bluetooth]# power on [bluetooth]# agent on [bluetooth]# default-agent [bluetooth]# scan on [NEW] Device xx:xx [bluetooth]# pair xx:xx [bluetooth]# trust xx:xx [bluetooth]# connect xx:xx [bluetooth]# exit

This solution was inspired by comments on https://geeks-r-us.de/2017/08/18/bluetooth-a2dp-lautsprecher-am-raspberry-pi/

One aspect I struggled with:
To test the playback within Volumio, it is necessary to stop and start the stream after restarting the mpd deamon…
…to test the pure bluetooth connection, use aplay with a wav file:

aplay -D bluealsa:HCI=hci0,DEV=xx:xx:xx:xx:xx:xx,PROFILE=a2dp testfile.wav

Have fun! :smiley: