Input Lag Compensation to compensate for game's internal lag?

I don’t think it works with MAME currently, but it should work mostly okay with FBA.

As for comparing with GroovyMAME, AFAIK their options are all about getting the input polling and the image rendering/display as close as possible (including the new beam-racing/raster-slicing method). Most of our latency options take this same approach. Runahead, though, is completely different and is more akin to how online games try to hide latency.

Unfortunately when I tested FBA it had some odd bugs with Runahead turned on, regardless of whether Secondary Core was activated and irrespective of the number of frames.

Some games in particular (like Battle Garegga and Gunbird) had some strange audio issues, with the music or sound effects being noticeably sped up.

Enable “Runahead Use Second Instance”. Then you get full frames in Snes9x for Smash Tennis in the hires game menu. Of course only if your PC is fast enough for it.

Does this run ahead method use separate core affinity allowing multithreaded cpu to cover performance? Most emulators use just one core.

Thank you for the quick reply, though I’m afraid that’s not the solution since I’ve had the second-instance-option enabled already. The only option that makes the slowdown go away is turning vsync off. Interestingly, when I do that in the Smash Tennis menu, then the RetroArch video statistics report twice the expected framerate (120 fps instead of 60). I also tried one of the bsnes-cores and Arkanoid - Doh It Again, another SNES-game that switches to interlaced in some cases, same slowdown, same double framerate. Then I also tested the mednafen cores with some Saturn and PlayStation games that have interlaced video (Panzer Dragoon Zwei titlescreen, Radian Silvergun titlescreen, Gran Turismo titlescreen) and no slowdown at all, even with vsync on. also when turning vsync off, the reported framerate in the video statistics still remained as expected somewhere around 60hz. Seems like something fishy is going on with interlaced video timing for SNES cores when runahead is enabled.

maybe you have the video option “black frame insertion” turned on, on a 60hz monitor? try disabling that if that is the case.

Yeah, interlaced video is not quite working yet in runahead.

I don’t have it done correctly in Snes9x, and Genesis Plus GX resets the field counter every time state is loaded.

These are issues within the cores themselves.

Despite use of the word “core”, all the RunAhead stuff is strictly single-threaded for now.

While most situations are entirely sequential, there is one situation that could be made parallel. That is when using Secondary core, and input is not dirty. In that case, the two cores could be in two different threads. I have not implemented that, and RetroArch would need changes to accommodate two threads trying to use the callback systems.

1 Like

Ah, Ok. I never use Vsync in Retroarch since i have Freesync capable hardware. So, no problems at all with slowdowns in interlaced SNES games menu, title screens etc. Tried it with bsnes too.

There’s still some core options that are causing problems with runahead 2 instances.
FCEUMM isn’t cropping the picture when using the overscan option, it’s just changing the geometry
(easy to verify with super mario bros 3, the margin on the left side should disappear).

I saw some desync while changing the overclock option during runtime too.

What precise sequence of actions will cause the settings to not be synchronized?

I’m trying out Armadillo, and I’m seeing the overclock feature and overscan options work fine.

I’m starting a game with runahead activated, 2nd instance ON in FCEUmm.
Horizontal and vertical overscan cropping options are disabled.
Exclusive Fullscreen is ON (just realised the issue does not happen if you stay in windowed mode).

If I enable both to crop the picture, it stays the same like this:

If I go to the latency menu and disable runahead or 2nd instance, then it works:

1 Like

Nope, still can’t reproduce the issue at all.

Downloaded RetroArch Nightly, used Core Updater to get official version of FCEUmm.

Run a game in FCEUmm just to get the options menu, have FCEUmm set to no cropping, quit the game, quit RetroArch.

Turn on RunAhead with secondary instance, run the game again.

Turning vertical and horizontal cropping on and off works perfectly.


Second try, from a fresh configuration file…

Doing this sequence of commands:

  • Enable Fullscreen Mode
  • Load a game in FCEUmm
  • In Quick Menu > Options, turn off horizontal and vertical cropping (both on by default)
  • Press ESC to quit
  • Run RetroArch again
  • Turn on RunAhead and Secondary Instance
  • Load the game
  • Turn on cropping in Quick Menu > Options

I still see cropping turn on fine. Just can’t reproduce this issue at all.

It seems to go wrong after you go windowed to fullscreen here.
I start in windowed and then push F to go fullscreen.

1 Like

Found the issue, entering and leaving fullscreen mode destroys the environment hook.

The whole call stack:

CMD_EVENT_FULLSCREEN_TOGGLE > CMD_EVENT_REINIT > video_driver_reinit > CMD_EVENT_RESET_CONTEXT > drivers_init > menu_driver_init > menu_update_libretro_info > CMD_EVENT_LOAD_CORE_PERSIST > libretro_get_system_info > libretro_get_system_info_lib > libretro_get_environment_info

The function libretro_get_environment_info is wiping away all environment hooks I added, so the core never sees any options changes after entering and leaving fullscreen mode.

3 Likes

Thanks, it’s working fine now! :slightly_smiling_face:

New issue… :persevere:

Can’t activate runahead with fb alpha.
I did finish dodonpachi and esp galuda with it before but now impossible on the latest core version.
I get the “Can’t load state.” message, while loading/saving states work.

Somehow managed to get a secondary core desync in Snes9x 2010 while playing Final Fantasy II.

Hello all !!

Can anyone please explain to me why I can’t use the “Run Ahead Input Latency” feature on my PS3? Every ROM I try to run just results in a never ending black screen. If I run the game without enabling the feature and then toggle to Retroarch to enable it, I get crazy audio problems and some games (like Sonic) slow down worse than a slow motion picture!

Forgive me for my ignorance on the subject, I’m merely an end user trying to play some old SNES games, no programming skills whatsoever! I’m also sorry if this isn’t the right place to ask this question but I would really appreciate if someone told me if this is a recurring problem in all PS3s or just mine!

Thanks!

Sorry if it doesn’t work, I don’t have a PS3 and have never tested it on that system. From what you described, I have no clue why it’s failing.

Also make Retroarch and the cores are as new as possible, get nightly builds if you can.

1 Like