Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Frameskip issues on Pi4



  • 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:

    • Drastic
    • Prince of Persia Port
    • Oric
    • VVVVV
    • etc.

    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.

    VVVVV

    Follow the instructions in the following post, what is described here for VVVVV is outdated.

    1. 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.
    2. Update runcommand from RetroPie-Setup > Core Packages
    3. On /opt/retropie/configs/ports/vvvvvv/saves/unlock.vvv make sure that fullscreen is set to 0. <fullscreen>0</fullscreen>
    4. On /opt/retropie/configs/ports/vvvvvv/emulators.cfg add XINIT:before the command. It should look like:
    vvvvvv = "XINIT:/opt/retropie/ports/vvvvvv/VVVVVV"
    default = "vvvvvv"
    

    Drastic

    1. Open /opt/retropie/configs/nds/emulators.cfg and add SDL_RENDER_VSYNC=1 as follows
    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

    1. Open /opt/retropie/configs/ports/sdlpop/emulators.cfg and add SDL_RENDER_VSYNC=1 as follows
    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.

    Conclusions

    Thanks to @pjft, @psyke83 and the other guys from the original thread. All the credits go to them.



  • 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

    Open /opt/retropie/configs/ports/vvvvvv/emulators.cfg and add SDL_RENDER_VSYNC=1 as shown:

    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

    Open /opt/retropie/configs/ports/jumpnbump/emulators.cfg and add SDL_RENDER_VSYNC=1 as shown:

    jumpnbump = "SDL_RENDER_VSYNC=1 /opt/retropie/ports/jumpnbump/jumpnbump.sh"
    default = "jumpnbump"
    

    Oric

    Open /opt/retropie/configs/oric/emulators.cfg and inject multiple SDL_RENDER_VSYNC=1 as shown:

    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

    Open /opt/retropie/configs/ports/srb2kart/emulators.cfg and add SDL_RENDER_VSYNC=1 as shown:

    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.



  • 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.


  • administrators

    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_bin to 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.



  • @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.



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.