Running room-assistant on Retropie - interferes with bluetooth controllers
-
Hi all,
I've recently set up my first Retropie system and all is going pretty well! The community on the forums is great and reading up on threads here has helped me overcome a lot of teething issues and noob mistakes I've made along the way.
Now I'm starting to expand the function of my retropie box, making it do a few things for my home automation system (Home Assistant).
A little about my fairly stock-standard setup:
- Raspberry Pi 4 4GB
- Retroflag NESPi 4 case
- Retropie 4.7.1 (installed using Raspberry Pi Imager)
- 2x 8BitDo SN30 Pro+ controllers
- Autostart into Kodi, setup using autostart.sh script configured through Retropie Config
I'm wanting to add my RetroPie box as a node on my room-assistant (RA) network, for ultra-local location tracking using BLE. A normal function of RA is to periodically reset the bluetooth chip when it hasn't detected any BLE devices in a while. What I've noticed is that if it does this mid-game, this disconnects my controller, which usually results in me dying/losing a race/other undesirable outcome. RA's config also says to not run BLE scanning and Bluetooth Classic off the same adapter on a Raspberry Pi due to the everything-on-one-chip nature of its WiFi/BT4.0.
I'm a little stumped as to how to overcome this.
So far I've tried adding a USB BT dongle (hci1) and configuring RA to use that for BLE scanning, but having two BT adapters connected at the same time seems to confuse emulationstation (ES). Forcing ES to use hci0 so RA can use hci1 seemed to be the way to solve this, but I can't see any way to force ES to use a specific adapter.
I'm also tinkering with the idea of having a script stop the RA service when ES launches, and start the RA service again when ES exits (I launch Kodi). But I haven't got very far with this yet. I'm a fairly recent Linux initiate and my scripting skills leave a lot to be desired.
kodi-standalone #auto /home/pi/.scripts/stopra.sh emulationstation #auto
I'm wondering if anyone else runs RA in parallel with ES? If so, how did you solve this issue?
-
EmulationStation does not know (nor care) how the controller is connected, so there's nothing to configure there.
You can however pause the RA software during gameplay and resume it afterwards using the onstart/onend scripts for runcommand - see here.
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.