Suggestions/requests/ideas for RuneAudio core features and functions

Re: BlueTooth

Postby pstout7 » 03 Oct 2017, 04:30

@crucerio A bit of a necropost here, but I am wondering if you had any success with the github code that you mentioned in your previous post. I have a Raspberry Pi3 with an Allo Piano 2.1 DAC and I would love to use Bluetooth as an input.
Posts: 1
Joined: 03 Oct 2017, 04:26

Re: BlueTooth

Postby kailua » 27 Feb 2020, 20:12


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
Description=BluezAlsa proxy

ExecStart=/usr/bin/bluealsa -p a2dp-sink --a2dp-volume


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
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
    Description=A2DP Playback
    After=bluealsa.service syslog.service

    ExecStartPre=/bin/sleep 3
    ExecStart=/usr/bin/bluealsa-aplay --profile-a2dp 00:00:00:00:00:00


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/ to
Code: Select all

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!

Posts: 1
Joined: 27 Feb 2020, 19:29

Re: BlueTooth

Postby mangocats » 22 Mar 2020, 15:33

So, I realize this is an old thread... I've been using a Pi Zero W with LibreElec to play music playlists, as well as 1080p video, via Bluetooth speakers for some time. I'm looking for a better music player interface, and I hope Rune is it. I'd also like to put a Pi Zero W in my car and feed audio to the in-dash receiver via Bluetooth - not the most ideal audio quality, but far better than FM.

What's the status of Bluetooth audio out support in Rune?
Posts: 1
Joined: 22 Mar 2020, 15:27

support RuneAudio Donate with PayPal


Return to Feature request

Who is online

Users browsing this forum: No registered users and 1 guest