Loading ROM completely while displaying launch image
-
@GeekOB said in Loading ROM completely while displaying launch image:
Thanks for replying @mitu, this is supported in the link you provide but to a degree, the rom doesn't start loading until the actual launching image has disappeared. The purpose of the hack above is to get the image to display the whole time while the rom loads.
Honestly, I don't see the point of using a splash image while the rom loads.
I mean, if loading time/speed is an issue, then just disable the runcommand launch menu and the emulator will start right away. Using an image display program will 'swallow' the input anyway, so the runcommand launch menu wouldn't work reliably - might as well disable it. -
@mitu Maybe we just perceive differently what "right away" is. On my normal clocked Pi 3b, depending on the rom and emulator (mostly mame2003-plus, fbneo and some popular 8 & 16 bit consoles), I usually stare at a blank black screen for 10-15 seconds. That is long enough to make guests ask if the game crashed or something.
Instead, a loading image while the emulator starts would give us something interesting to look at. I'm using flyers and boxart for this, not mere logos or a "loading ..." image, so there's plenty to look at or read until the game actually starts.
Besides our differences about neccessity, do you happen to know why starting the image viewer as a background task leads to the strange effects @GeekOB and experienced, and how they could be addressed?
Thanks in advance for any enlightenment in this matter.
-
@Clyde said in Loading ROM completely while displaying launch image:
. On my normal clocked Pi 3b, depending on the rom and emulator (mostly mame2003-plus, fbneo and some popular 8 & 16 bit consoles), I usually stare at a blank black screen for 10-15 seconds.
That's abnormally long. Does this happen with the runcommand launch menu disabled ?
[..]
Besides our differences about neccessity, do you happen to know why starting the image viewer as a background task leads to the strange effects @GeekOB and experienced, and how they could be addressed?
My guess is that the STDIN (standard input) is 'stolen' by
fbi
, so any inputs (keyboard mainly) are not interpreted by the program which you expect (emulator or runcommand). Try running the command vianohup
and feed-it/dev/null
as STDIN/STDOUT. -
Thanks very much for the recommendation @mitu. @Clyde explains it much better than me. My wait time is definitely less than 10-15 seconds, more like 5-10, but that will vary with the emulator. Maybe you have a lot of emulator/system override customization @Clyde? this would slow the startup for sure.
Maybe this is not the case with a 3b+ and even less with the Pi4 but adding an image with useful information to read/look at helps with "masking" the wait time. -
Sorry for the long delay, my Retropie related activities were severely limited in the last months, and this issue wasn't among the urgent ones. That said, it is still nagging at me, so I'd like to give it another try.
@mitu said in Loading ROM completely while displaying launch image:
That's abnormally long. Does this happen with the runcommand launch menu disabled ?
It does, depending on the emulator. While most libretro console cores load in 7-9 seconds, lr-mame2003-plus and lr-fbneo take 10-13 seconds. I just tested it again to be sure, with the runcommand menu disabled, but artwork enabled to measure the time after the artwork disappears.
My guess is that the STDIN (standard input) is 'stolen' by
fbi
, so any inputs (keyboard mainly) are not interpreted by the program which you expect (emulator or runcommand). Try running the command vianohup
and feed-it/dev/null
as STDIN/STDOUT.Using
nohup
resulted in the image not being displayed, see my posts above:@Clyde said in Loading ROM completely while displaying launch image:
(For the records, I tried
nohup
at the beginning of the line before, but the image wasn't visible then.)@Clyde said in Loading ROM completely while displaying launch image:
If anyone can explain why putting
fbi
in the background leads to problems with the Enter key in at least RetroArch's MAME cores, or why usingnohup
doesn't display the image at all, and even with fbi's options-T
and-d
to choose a particular terminal or framebuffer, please share your wisdom with me and anyone else interested here.Although I'm planning to upgrade my cab to a Pi 4 in the near future, which hopefully should shorten the loading times, I am still interested to solve this irritant conundrum.
-
I'll preface this by saying that I am not a scripter/coder and I am sure there is a much better/cleaner way of doing it. I merely pieced things together that I found here and there. What's nice is that there is no modifications to any files that could be lost due to an update (i.e.
runcommand.sh
) and I am still convinced that this can all be made to work in a single script (runcommand-onstart.sh
)...right now I rely on a 2nd script to do the heavy lifting.I'd love for this to be a collaboration and maybe we can make this thing rock. :)
If you guys are still interested in this, I am going to post a how-to for how I am doing it. This is part of an overall solution that I am working on that will...
- Display the launch image until the game starts (not wait for the launch image to close before starting the game)
- Start the game...
a. Paused (via bash script). This can be skipped if you want the game to completely load past the initialization screens like arcade ROMS have.
b. Muted (via global Retroarch setting). I do this because I am unable to pause some games fast enough and they make noise in the background (i.e. Defender) - Display a bezel overlay that shows controls on first start
- Allow the user to continue by pressing a key/button after they have reviewed the controls
a. This button/key is mapped topause
(global) andoverlay_next
(overlay cfg file)
a. At that point, the game is unpaused, unmuted and the bezel overlay switches to a transparent one - The user can press the
pause/overlay_next
button/key at any point again to...
a. Pause the game
b. See the the controls (the bezel overlay is switched back to the controls one)
With any luck I'll have this ready for public consumption in the next day or two.
John
-
-
I know its not very welcome to answer to such an old thread but for anyone who has this "enter problem" because of the ampersand.
just after the fbi command use either
stty sane
or
reset
This clears up the ttyp egain
-
@freakzero Thanks! Alas, something seems to have changed in (my?) RetroPie since I developed the hack above. If I put those two lines in `runcommand-onstart.sh' now, the hack works like intended, but the emulator (e.g. lr-mame2003-plus) exits automatically after a couple of seconds – with or without your addition.
Since my Pi 4 loads noticeable faster than the Pi 3b I used back then, I have not much motivation to look into it more deeply. But maybe your help will benefit someone else. (@GeekOB perhaps?)
Thanks again for your contribution! 👍
edit: I also addressed the blank screen while the emulator is loading with a big "LOADING" in ascii art. 🤓
-
@clyde i have a custom solution for this since im running on ODROID with SDL2 and so if im not quitting the process soon enough im getting graphical glitches with on screen borders or other weird problems:
This is my solution by now - its not perfect since it can make problems when a rom cant load (then i have to restart the system) otherwise it works flawlessly on my ODROID with retropie:
Basically i have 2 scripts
runcommand-onstart.sh (mine did not exist since i installed retropie from the distro directly)pkill fbi pkill tail # the image i want to load loader="/etc/emulationstation/splashes/$1/launching.png" if [-f "$loader"]; then # if image is found - start fbi with the image and no timelimit, also start the check script in same directory fbi -1 -t 0 -noverbose -a "$loader" </dev/tty &>/dev/null & (/opt/retropie/configs/all/check.sh) & fi
and the check.sh script:
# you have to enable retroarch logs - always log everything input=/opt/retropie/configs/all/retroarch/logs/retroarch.log timeout 15 tail -f $input | while read LOGLINE # if any of this lines are seen - kill everything related to launchimages - in this case fbi and tail # "Found display server" is the first command in the log before the emulator kicks in do if [[ $LOGLINE == *"Found display server"* ]]; then pkill tail pkill fbi fi if [[ $LOGLINE == *"Failed to load content"* ]]; then pkill tail pkill fbi fi if [[ $LOGLINE == *"Bus error"* ]]; then pkill tail pkill fbi fi done
So what this is doing:
it starts FBI forever and the check script checks the logs for "exit tokens" - if a exit token is hit every process related to the imageloading gets killed.If the rom cant load before 15 seconds (timeout 15 - set this to the possible highest value) the process should get automatically killed.
works btw with the newest (current master in repo) mame-plus and mame emulators at my side. If you have "Enter Problems" - do what i said before - just add the clean commands for the tty additional to the pkill commands
maybe that idea/solution gives some ideas to you :)
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.