As a recent convert to Rune Audio, I was fiddling around to get Bluetooth streaming to work (Pi3B+ -> BT Audio Device). I am currently using: R+ version 20201007 (upgraded from the image I downloaded from the first post in this thread) on a Raspberry Pi 3 Model B Plus Rev 1.3 (BCM2835 • 4 Cortex-A53 @ 1.4GHz • 1GB).
I went ahead and from the settings enabled the Bluetooth hardware and disabled WiFi. Turned on Bluetooth on my phone, but no Pi showed up. So, logged in as root and checked if the modules were loaded. There were some modules loaded related to Bluetooth, but the Bluetooth service wasn't running. Looking at the service file, it tried to start a shell script: /srv/http/bash/system-bluetooth.sh that was not available. So, I created it, based on a script I found elsewhere in this forum (if clause added by me):
- Code: Select all
#!/bin/bash
if [ "`rfkill | grep bluetooth`" != "" ]; then
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
fi
After that, the Bluetooth service started, but bluealsa failed. Another weird thing: bluetoothctl could not find a controller. Wasn't there a recent change in the way Bluetooth was handled on the Pi? So, I added a line to /boot/config.txt
- Code: Select all
include userconfig.txt
A file where I could fiddle around with my settings, without interfering with system stuff. To this file I added
- Code: Select all
### User configuration changes in here
# Enable onboard audio
dtparam=audio=on
# Enable onboard bluetooth
dtparam=krnbt=on
And rebooted. Now the system shows up as a Bluetooth device on my phone and the onboard audio works. As there are no settings in the GUI for Bluetooth - pairing with Bluetooth devices, etc. - I left it at that and use the shell to connect to a Bluetooth speaker for the moment, which works great, until you modify the system/mpd settings.
To connect to a speaker, login as root and issue the following command:
- Code: Select all
bluetoothctl
This should put you in a new shell:
Agent registered
[CHG] Controller XX:XX:XX:XX:XX:XX Pairable: yes
[bluetooth]#
Now enter the following commands (in the bluetootctl shell):
- Code: Select all
scan on
You will see a list with nearby discoverable devices:
[bluetooth]# scan on
Discovery started
[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: yes
[NEW] Device YY:YY:YY:YY:YY:YY SBoom700
Connect to the speaker (after turning off the scan)
- Code: Select all
scan off
pair YY:YY:YY:YY:YY:YY
trust YY:YY:YY:YY:YY:YY
connect YY:YY:YY:YY:YY:YY
The prompt should now change to the name of the device you connected to. As mentioned earlier, opening some settings pages causes the system to disconnect the Bluetooth connection. From the bluetoothctl shell simply enter the following commands to restore it:
- Code: Select all
power off
power on
connect YY:YY:YY:YY:YY:YY
Happy listening