Here are the instructions, from a fresh Zynhtian install.
apt-get install libbluetooth-dev
apt-get install libsbc-dev
git clone https://github.com/Arkq/bluez-alsa.git
cd blue-alsa
autoreconf --configure
mkdir build
cd build
../configure --enable-systemd
make
make install
sudo systemctl daemon-reload
sudo systemctl enable bluealsa.service
Then check that the bluetooth and bluealsa services are running.
systemctl status bluetooth
systemctl status bluelsa
Pair your phone/computer to the zynthian with bluetoothctl
bluetoothctl
power on
agent on
default-agent
scan on
Note the device address when you see your device name [NEW] Device xx:xx
pair xx:xx
trust xx:xx
connect xx:xx
exit
You should now be able to connect/disconnect to the zynthian.
When you are connected, start playing some music from your phone/computer.
Inject the bluetooth stream into jack with:
alsa_in -d bluealsa -p 8192 > /dev/null &
or with
zita-a2j -d bluealsa -p 8192 > /dev/null &
Then use patchage to route the signals where you want.
Or you can do that on the command line with
jack_connect alsa_in:capture_1 system:playback_1
jack_connect alsa_in:capture_2 system:playback_1
or with
jack_connect zita-a2j:capture_1 system:playback_1
jack_connect zita-a2j:capture_2 system:playback_1
The problem I have now, is that alsa_in
or zita-a2j
break when the bluetooth link disconnects. I need to find a way to start/stop on connection/disconnection events. Seems like bluealsa supports DBus. Also, volume control from the source does not work.