Hello,
I know, time has passed and I don't know if this is still an issue in Runeaudio (I am using RuneAudio+R e2), but, I found a very easy solution to get a2dp bluetooth audio from your phone to a Raspberry Pi 3 running RuneAudio+R e2. I'm going to try to describe what I did.
It uses the installed bluez and
bluez-alsa. First, you have to activate Bluetooth in the Runeaudio menu.
After that create the following file as /etc/systemd/system/bluealsa.service
- Code: Select all
[Unit]
Description=BluezAlsa proxy
Requires=bluetooth.service
After=bluetooth.service
[Service]
Type=simple
ExecStart=/usr/bin/bluealsa -p a2dp-sink --a2dp-volume
[Install]
WantedBy=multi-user.target
This is a drop in replacement for the provided system service file. The only difference is that it runs bluealsa with the option
- Code: Select all
-p a2dp-sink
to let the Raspberry Pi act as a high definition audio sink. The option
- Code: Select all
--a2dp-volume
let's you adjust the volume via the volume keys on your phone.
Now, start and enable the bluealsa.service (the first command is only required if you didn't reboot first)
- Code: Select all
systemctl daemon-reload
systemctl start bluealsa.service
systemctl enable bluealsa.service
Then I created a new Service file under /etc/systemd/system/ named a2dp-playback.service with the content
- Code: Select all
[Unit]
Description=A2DP Playback
After=bluealsa.service syslog.service
Requires=bluealsa.service
[Service]
ExecStartPre=/bin/sleep 3
ExecStart=/usr/bin/bluealsa-aplay --profile-a2dp 00:00:00:00:00:00
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=A2DP-Playback
User=root
[Install]
WantedBy=multi-user.target
You then have to start and enable this service (the first command is only required if you didn't reboot first)
- Code: Select all
systemctl daemon-reload
systemctl start a2dp-playback.service
systemctl enable a2dp-playback.service
I suggest that you reboot now that all services are loaded in the right order.
At this point the Raspberry Pi should appear in the list of bluetooth devices on your phone. Now you can pair your smartphone... This is still a bit tricky and still requires ssh access and an open console running bluetoothctl. So, open a terminal and run bluetoothctl on the Pi. Try to pair with the Pi from your phone. Your phone and bluetoothctl should display requests for confirmation of PINs. After that bluetoothctl needs requests authorization to connect your phone to the bluetooth service. After that the Pi should be configured as a bluetooth audio sink and you can start playing audio on your phone. Just make sure that the Pi is not playing via MPD or other sources at the same time: alsa allows only access by one process.
Finally, add your phone to the list of trusted devices in bluetoothctl
- Code: Select all
trust <mac address of your phone>
This avoids the asking for authorization in the future and requires no further user interaction in bluetoothctl when reconnecting your phone later on.
One final remark. I changed the file /srv/http/settings/system-bluetooth.sh to
- Code: Select all
#!/bin/bash
bluetoothctl system-alias "$( cat /srv/http/data/system/hostname )"
bluetoothctl agent NoInputNoOutput
bluetoothctl default-agent
bluetoothctl pairable on
sleep 1
bluetoothctl discoverable on
bluetoothctl discoverable-timeout 0
This enables automatic pairing (without PIN) but still requires to trust the device via bluetoothctl in a terminal. I didn't find a way to give this authorization without user interaction but I don't think that its a good idea from the security perspective anyway. I think, it would be nice to get the autorization request in the Runeaudio interface (with the option to trust the device for future use) as a popup or so or to be able to (pair and) trust devices in the settings menu.
I hope this helps somebody
And,... suggestions and help are appreciated!
Best