[TUTORIAL] Bluetooth audio on RetroPie v4.4 and Raspberry Pi 3 Model B+
-
This short tutorial shows how to get RetroPi v4.4 installed on the Raspberry Pi 3 Model B+ to use a bluetooth speaker for audio output with the least amount of effort. To follow the steps you need to access a terminal on the RetroPie (either over ssh or through pressing F4).
-
Install pulseaudio-module-bluetooth
This module enables the PulseAudio sound server to work with audio bluetooth devices. [1]
$ sudo apt-get install pulseaudio-module-bluetooth
-
Add the user pi to the bluetooth group
This is needed so the user pi can access the bluetooth service. [2]
$ sudo adduser pi bluetooth
-
Tell the PulseAudio server to automatically use the newest connected speaker
To do so, add the following line to /etc/pulse/default.pa: [3]
/etc/pulse/default.pa ----------------------------------- load-module module-switch-on-connect
- Tell bluetooth to enable audio service
In my case, bluetooth worked but did not offer an audio sink (a2dp-sink) for PulseAudio. Add the following line to /etc/bluetooth/main.conf under the section [General]: [4, 5]
/etc/bluetooth/main.conf ----------------------------------- [General] Enable=Source,Sink,Media,Socket
For visitors that land on this page when troubleshooting their bluetooth audio problems, try adding the above line when the ouput of
systemctl status bluetooth
is something along the line:Dec 16 13:35:33 retropie bluetoothd[492]: a2dp-sink profile connect failed for 88:C6:26:81:4D:CE: Protocol not available
-
Connect to the speaker through the GUI
RetroPie -> BLUETOOTH -> Register and Connect to Bluetooth Device
Select DisplayYesNo as agent. -
Have RetroPie automatically connect to the speaker
RetroPie -> BLUETOOTH -> Configure bluetooth connect mode
Set connect mode to "background": -
Do a reboot and be set
Sidenote:
Do not install bluealsa! In my case, bluetooth audio did not work anymore as soon as bluealsa was installed and deinstalling did not help either, as some settings were not properly restored.References:
[1]: https://packages.debian.org/jessie/pulseaudio-module-bluetooth
[2]: https://raspberrypi.stackexchange.com/questions/71333/bluetooth-does-not-work-with-raspbian-stretch-and-raspberry-pi-3
[3]: https://wiki.archlinux.org/index.php/PulseAudio#Switch_on_connect
[4]: https://raspberrypi.stackexchange.com/questions/47708/setup-raspberry-pi-3-as-bluetooth-speaker
[5]: https://bbs.archlinux.org/viewtopic.php?id=222083 -
-
Nice... Do you experience any type of audio lag?
-
@X_Splinter Looks like @machile made this one post and hasnt been on the forum since. Not sure you are likely to get a response.
-
Good tutorial, pulseaudio works very good with retropie/kodi.
Just one point to add to the tutorial. The following modification is needed in order to avoid sound crackling and speed issues:- sudo vim /etc/pulse/default.pa
- change "load-module module-udev-detect" to "load-module module-udev-detect tsched=0"
This will switch the audio scheduling from timer-based to the traditional, interrupt-driven approach. Which is the one will is needed at least for the PI 3b+.
Sound quality can even by increase with the option Audio Resampling to highest quality.
-
@machile I have done this on the pi 4. It has broken the hdmi audio completely, stuttering on everything I do. Any idea how I can roll it back? I have removed everything I added to the files, and Uninstaller pulse.
-
Hey, working on the rpi 3 b+ and I can’t seem to find /etc/pulse/default.pa. All that is in the /etc/pulse folder is two config files. Please help me.
-
@DudeLebowski You should copy all the folders that you have installed personally and then reinstall the base software.
-
@DudeLebowski Did you find another way to connect bluetooth audio?
-
can this be done on the pi4? ,as i cant find the default.pa
file
stuck on part 3, access to /etc/pulse/default.pa is permission denied
cant see default.pa or the etc folder via playbox either
so cant put in .pulse -
ok i got root access and made the changes but i cannot get the audio to play on the bluetooth speaker ,tried eveything
here:can this be looked at for pi4 -
@machile Im receiving
Apr 21 16:13:59 retropie-128G bluetoothd[579]: Unknown key Enable for group General in /etc/bluetooth/main.conf
-
@dudelebowski Yeah, I'm encountering the same issue after following this guide, where HDMI audio no longer works right. Have you found a solution to this? I'd rather not reinstall, and I guess there's no way to swap between the two freely. Hopefully someone can chime in with advice.
-
@rafaz182 said in [TUTORIAL] Bluetooth audio on RetroPie v4.4 and Raspberry Pi 3 Model B+:
@machile Im receiving
Apr 21 16:13:59 retropie-128G bluetoothd[579]: Unknown key Enable for group General in /etc/bluetooth/main.conf
Did you solve it as I have the same error message. Also the bluetooth speaker is connected, but can't get any audio there also with the
speaker-test
command -
Hi.
I followed this tutorial's steps and managed to get my BT speaker working.
The problem was that after reboot, the speaker failed to connect.
After searching the web for a while, I ran across this: https://unix.stackexchange.com/questions/334386/how-to-set-up-automatic-connection-of-bluetooth-headset
Please see the proposed solution.
Best regards, Luís -
-
-
-
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.