Frameskip issues on Pi4
pamput last edited by pamput
I'm creating this thread to document the exploration of an issue that surfaced in the original post about the release of VVVVV for Pi. It comes up several people are having this exact issue and it doesn't seem to be massively visible.
Not sure if maybe we should add this to the Retropie documentation with other issues related to the Pi4, or even add these fixes to master (I'm not sure the effects on the previous versions though, we would need to have some tests).
The issue at hand
Many of you have certainly experience a strange frame skipping on Pi4 that wasn't present in the previous incarnations. This is usually manifest in the form of "losing every second frame", consistently, similarly to running 60hz signal on a 30hz rendering.
This is caused by the new graphic drivers required to run the Pi4 (new chipset, new drivers). The issue happens because of a bug/lack of support in the new drivers. You can find more info here.
Several emulators and ports are affected:
- Prince of Persia Port
Until the new drivers are fixed, a work around has been found that sorts most of the issues. It usually boils down to add an Env Variable to the lunching script of a certain emulator.
Follow the instructions in the following post, what is described here for VVVVV is outdated.
- Install xorg if it isn't installed. An easy way to go about it is to install Minecraft via RetroPie-Setup (you can probably uninstall it afterwards), as it'll install that dependency.
- Update runcommand from RetroPie-Setup > Core Packages
/opt/retropie/configs/ports/vvvvvv/saves/unlock.vvvmake sure that fullscreen is set to 0.
/opt/retropie/configs/ports/vvvvvv/emulators.cfgadd XINIT:before the command. It should look like:
vvvvvv = "XINIT:/opt/retropie/ports/vvvvvv/VVVVVV" default = "vvvvvv"
drastic = "pushd /opt/retropie/configs/nds/drastic; SDL_RENDER_VSYNC=1 /opt/retropie/emulators/drastic/drastic %ROM%; popd" default = "drastic"
This solves most of the problems. It leaves an annoying issue though with the menu. The rendering of the state of the menu is always one frame behind. This is currently unsolved.
Prince of Persia Port
sdlpop = "pushd /opt/retropie/ports/sdlpop; SDL_RENDER_VSYNC=1 /opt/retropie/ports/sdlpop/prince full; popd" default = "sdlpop"
This seems to completely solve the problem.
Any retroarch emulator
Simply update retroarch to the latest version.
roslof last edited by roslof
NOTE: The information contained here [on the date of its posting] is for a pre-release version of RetroPie and should not be used unless you are well aware of what you are doing. See warning from BuZz in the message below.
Thank you for creating the new thread!
Might want to update the OP post for VVVVVV. The simple method provided by
BuZz[EDIT: psyke83] injecting the SDL_RENDER_VSYNC variable is all that is needed. Just:
vvvvvv = "SDL_RENDER_VSYNC=1 /opt/retropie/ports/vvvvvv/VVVVVV" default = "vvvvvv"
Also, here are the other emulators that I mentioned in the earlier thread:
Jump 'N Bump
jumpnbump = "SDL_RENDER_VSYNC=1 /opt/retropie/ports/jumpnbump/jumpnbump.sh" default = "jumpnbump"
/opt/retropie/configs/oric/emulators.cfgand inject multiple
oricutron-atmos = "pushd /opt/retropie/emulators/oricutron; SDL_RENDER_VSYNC=1 /opt/retropie/emulators/oricutron/oricutron --machine atmos %ROM% --fullscreen; popd" default = "oricutron-atmos" oricutron-oric1 = "pushd /opt/retropie/emulators/oricutron; SDL_RENDER_VSYNC=1 /opt/retropie/emulators/oricutron/oricutron --machine oric1 %ROM% --fullscreen; popd" oricutron-o16k = "pushd /opt/retropie/emulators/oricutron; SDL_RENDER_VSYNC=1 /opt/retropie/emulators/oricutron/oricutron --machine o16k %ROM% --fullscreen; popd" oricutron-telestrat = "pushd /opt/retropie/emulators/oricutron; SDL_RENDER_VSYNC=1 /opt/retropie/emulators/oricutron/oricutron --machine telestrat %ROM% --fullscreen; popd" oricutron-pravetz = "pushd /opt/retropie/emulators/oricutron; SDL_RENDER_VSYNC=1 /opt/retropie/emulators/oricutron/oricutron --machine pravetz %ROM% --fullscreen; popd"
And for anybody who manually installed Sonic Blast Robo 2 Kart:
Sonic Robo Blast 2 Kart
srb2kart = "pushd /opt/retropie/ports/srb2kart; SDL_RENDER_VSYNC=1 ./srb2kart-1.1.0; popd" default = "srb2kart"
All work-arounds for the current, frameskip behavior. This may become obsolete in the future when drivers are updated, but in the meantime -- I'm enjoying my Pi4B to the fullest.
roslof last edited by
ScummVM (not the libretro version) also seems to suffer from the same issue, but I was unable to successfully inject SDL_RENDER_VSYNC=1 in either the emulator config setting nor the script in the roms/scummvm folder to resolve the issue. Might still be a way to do this, but I'm not sure how.
Definitely don't want the variable to be used globally, since it will interfere with other systems.
I don't think I suggested this btw. Maybe another dev. It's not caused by the updated Mesa drivers. It's related to an SDL2 issue.
I have reverted a fix for a non vsync frame rate issue that causes this problem. There's still an issue we need to fix later but this will resolve these cases. You can do a full update or just update RetroPie-Setup script and then run
sudo ~/RetroPie-Setup/retropie_packages.sh sdl2 install_binto get the 2.0.10-+4rpi version with the change.
Also to be clear, the rpi4 code is still in development. You're all welcome to hack away but there's a lot of bug reports appearing for something we haven't released officially yet :-) Advice like this should definitely NOT be added to the wiki btw.
It's worth people being as verbose as possible about this when providing information on editing configs to avoid people breaking their set ups.
roslof last edited by
@BuZz Thank you. I made some edits to my post above to help prevent silliness. You are correct, it was psyke83 who suggested the change.
Your directions above worked perfectly, as expected and I reverted all of the configuration changes. And scummVM also works as expected.
Thank you for the commit, and for letting us play in your house while you and the team tidy-up the inevitable release.