Connecting a Bluetooth audio device to retropie
-
Hey,
Pi Model or other hardware: Zero W
Power Supply used: 5v. phone charger with micro-usb cable
RetroPie Version Used: 4.7.1
Built From: Raspberry pi imaging tool
USB Devices connected: Wireless keyboard and mouse dongle
Controller used: Keyboard
Guide used: this guide.I'm trying to attach my headphones to my retropie zero, and for that I've been following this guide.
I managed to pass steps 1 and 2 easily but step 3 says:Tell the PulseAudio server to automatically use the newest connected speaker: To do so, add the following line to /etc/pulse/default.pa
The thing is, I don't know to what I should attach this line to and how to reach it (I don't know how to code, so if it's something obvious please excuse me 😅).
Thanks in advance! -
If you disabled the onboard audio, then I don't think you'll need any further configurations, once PulseAudio is installed and the heaphones are paired.
Runspeaker-test
from the command line and see if you get sound. -
@mitu I didn't disable my onboard audio, at least, not intentionally (or did installing pulse audio disabled the onboard one?). I'll try to pair the headphones and see if it works, thanks!
-
@mitu
Update: Sorry it took me a while to respond. It's the beginning of exam season in uni.
Anyway, the bluetooth audio works great, but now every time I move between screens (emulationnation to a game/settings and vis versa) I get the following message:[date] lvl10: VolumeControl :: init() - Failed to find mixer elements!
What can I do to fix it?
EDIT: I don't know if it matters, but the whole code line appears in white, not orange like in this comment -
@hairdyeguy said in Connecting a Bluetooth audio device to retropie:
What can I do to fix it?
This means the AudioDevice configuration in EmulationStation is not correct - change it to one of the other options (Master/PCM/etc.) and see if this message disappears.
-
@mitu
I tried doing so: First it was changed when I plugged it to a tv (to HDMI) and when it still didn't solve the issue I changed it to master.
The interesting bit is that the first time after the change it shows the error message multiple times but then returns to one line per transition between games/systems. -
@mitu
Update: I tried to check it through the retropie audio settings and found an option called "enable Pulse Audio" once I did that the message disappeared. I've yet to test it with bluetooth but I think (and hope) that solved the issue.
Thanks for your help! -
Hi all,
Could someone post (and maybe pin) a summary here which would describe how to properly connect a bluetooth speaker to Retropie on Raspberry Pi (3B+ in my case)?
AFAIU, this guide is old and some of its steps are not needed or are harmful in Retropie 4.8, right?I'm trying to connect my JBL Flip 4, I know its MAC but Retropie won't show it when I scan for bluetooth devices using the Retropie -> bluetooth menu.
bluetoothctl does not show it in scan results as well but if I try to pair using the known MAC, then trust and connect - it connects but there's still no audio, even after a reboot.
Should enabling pulseaudio play some role here?
I'd be grateful for a guide of just elaboration.Thanks!
-
Replying to my own post.
I've got my JBL Flip 4 working on RPi 3b+ with RetroPie 4.8 using this guide, subsequently changing/etc/asound.conf
to look like this:# Bluetooth speaker pcm.btspeaker { type plug slave.pcm { type bluealsa device "04:FE:A1:BF:FD:80" profile "a2dp" } hint { show on description "JBL Flip 4" } } ctl.btspeaker { type plug card bluealsa } pcm.!default pcm.btspeaker ctl.!default ctl.btspeaker
No issues playing audio files with omxplayer or aplay (e.g.
aplay /usr/share/sounds/alsa/Front_Center.wav
). The problem is with playing audio from the games - audio is delayed approximately by one second and sometimes stutters adding freezes to the game itself.Do you guys know how the stuttering/delay could be eliminated in bluealsa?
-
Ok, so the stutter goes away if I set baud rate of Bluetooth to 460800:
Runsudo nano /boot/config.txt
and then append the following# Enable autoprobing of Bluetooth driver dtparam=krnbt=on # Increase Bluetooth baud rate dtparam=krnbt_baudrate=460800
The idea was taken from here: https://github.com/Arkq/bluez-alsa/issues/205
Now only the playback delay left.
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.