-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply Input Lag reduction settings to appropriate cores #3134
Comments
An explanation for how the 2nd instance works (taken from https://i.reddit.com/r/emulation/comments/886ucq/):
|
Marvelous is one of the most demanding snes games so I'll test that. The camp site after the intro. Pi4, stock speeds. You must have some overhead for people that want to use a shader so I'm using the crt-pi shader at 1080p for these tests. lr-snes9x. Stock emulator settings. video_threaded=off, video_max_swapchain_images = 1. 30fps I don't really notice the input lag so I'm not sure which setting gives better results. |
Just a quick heads-up: a max swapchain images setting of 2 requires the performance CPU governor to perform well. Otherwise, the governor seems to be fooled into periodically downclocking the CPU. The performance impact is pretty big. I'll see if I can comment a bit more later today. |
runahead will cause unpleasant animation skipping if you raise it above the inherent input lag in the game/console/core, but my understanding is that |
removing |
Yes, it appears to be fixed on 5.4 + full KMS. Could be fine with 5.4 + fake KMS as well, but I haven’t tested yet. Will let you know when I have. |
To be honest, I'm leaning towards just using Just using the KMS video driver (fake or full) and disabling threaded video should provide ~2 frames lower input lag than the pre-Buster RetroPie builds anyway. That's a pretty nice and noticeable improvement. |
we would have to be careful with (if anyone cares to benchmark to see if threaded = false affects this combo please do! i may try to later) |
On my Pi4 4GB I’ve been using the 5.4 kernel (64-bit) with vsync off, video thread off, run ahead off, and swap chain 2 and the few 2d fighting roms I play have performed very well. Input lag seems to much more reduced than the settings I had before. However, Killer Instinct 1/2 (mame2003plus) need to have the video thread on, otherwise it plays at 30 fps. Killer Instinct 2 needs work still, playable but not enjoyable yet. Raiden Fighters 1/2 and Jet play very well on mame2016. Enabling shaders for me is a performance hit on the FPS. Some games don’t seem to be affected as much but there is a noticeable hit. I left it off for now, but I’ll be testing some more in the coming days. I’ve also been playing around with the KMS audio driver (vc4hdmi) and I was able to reduce the audio latency setting to 20 with alsathread. I need to go back and validate that again with the above settings. The audio driver is developmental, so there is no software mixing so no ES BGM audio apps should be enabled. This thread has been helpful with being able to tweak my settings. |
@dankcushions second instance is basically a workaround for bad savestate code, supposedly it has some minor performance impact and i heard it also causes some additional disk I/O by duping the core, so it's probably better to avoid it whenever you can. |
The Pi4 now has enough overhead to apply some of the more aggressive input lag tweaks, some of which we previously warned against here. I would like to investigate these settings with a view to perhaps defaulting them where appropriate, or to provide a function to easily enable them for suitable cores. Said settings could also be applied to x86 defaults (no idea about Odroid, etc).
Known input lag reduction settings:
turning off threaded video seems to reduce input lag by ~1 frame, at the cost of performance. source: https://forums.libretro.com/t/an-input-lag-investigation/4407 (this huge thread has lots of great stuff on input lag)
enables run-ahead and sets the frames to 1. run-ahead explained here. saves 1 frame of input lag. costs memory/cpu. 1 frame is an accepted safe amount of frames for ALL games on ALL cores (?). some games can suit larger amounts of frames, but that is not enough to work with.
creates a secondary instance of the emulator.
i have no idea if this setting is necessary, but i have always had it on. does anyone know why you would turn it off?UPDATE: shouldn't be necessary unless you encounter issues, so keep it off - thanks @barbudreadmon !
there's a great explanation of this somewhere here but i have since lost it! saves 1 frame, at the cost of performance (?). @Brunnis mentioned this can cause tearing here, but i have not noticed this. it requires cpu to be set to 'performance' rather than the 'default' governor to avoid issues (see here)Causes intermittent tearing on fkms, even with governer = perf.
Any more settings?
SNES
Tested in lr-snes9x (so presumably same settings could be applied to all older lr-snes9x-YYYY versions). 40-50% CPU in the random games i tested. Does anyone have any savestates for the later levels of Yoshi's island? they're supposed to be some of the most intense stuff on SNES.
(please help testing on more systems!)
tagging @Brunnis
The text was updated successfully, but these errors were encountered: