Running a Rom from terminal Issues
-
I have created a python script that will start a game's rom from an IoT/MQTT message. When I execute this script from the terminal (emulationstation is not running) the script can start the rom just fine, as in when the correct MQTT message is received it starts the rom without any issues. At the moment, only a single game is hard coded to work, I'll add more robust 'start any game in the library' functionality later.
The script is written to sit idle and run forever, reacting to specific MQTT messages. My issue is when emulation station is running (on screen, usable like normal) and my script is triggered and attempts to start the rom, the screen goes black and stays locked up.
I'm assuming there is a conflict somewhere that is preventing emulation station from giving up the display and audio to the externally started rom? Has anybody tried something similar, at the very least starting a rom externally while ES is running?
Ultimately, what I would like is for ES to "go the background" while the rom is running, and come back to life when the rom is killed (START & SELECT buttons pressed on my gamepad).
Does ES offer some form of API to start a rom externally so other simultaneously running apps can do the same thing as the user navigating the UI?
Any thoughts or help would be appreciated. Thanks!
-
@jason said in Running a Rom from terminal Issues:
Ultimately, what I would like is for ES to "go the background" while the rom is running, and come back to life when the rom is killed (START & SELECT buttons pressed on my gamepad).
Does ES offer some form of API to start a rom externally so other simultaneously running apps can do the same thing as the user navigating the UI?No, there's no API to background ES and start a new game. You haven't offered any info about your setup though - which system/platform are you using (Pi/PC/etc.) ?
-
Apologies, I’m running on an RPi4 with the RetroPie 4.7.1 image downloaded from the RetroPie site.
My goal is to offer external ways of starting a rom on an arcade cabinet of mine. Companion app, website, voice assistant, etc. as possible examples of an “external way”.
-
@jason said in Running a Rom from terminal Issues:
, I’m running on an RPi4 with the RetroPie 4.7.1 image downloaded from the RetroPie site.
Pi 4 is using the KMS/DRM video drivers for ES and emulators and there can't be 2 clients at the same time using the same video output. You'll have to stop ES if you wish to start an emulator.
-
@mitu thanks, I’ll give this a shot.
Out of curiosity, if this is how ES works... Starts a rom, shuts itself down... Rom closes, then starts ES (or something similar) how does ES come back to the same screen so fast instead of going through the same boot up process?
I guess I’m asking how ES handles the switching process so I can mimic it the best I can.
-
@jason ES backgrounds itself during game launch and disables the video output during this time.
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.