Emulation catching up to real hardware responsiveness


#41

I’ve tried RetroArch 1.7.2 and runahead is quite magical how it removes input latency. I tried with MegaDrive and removed one frame of lag in my test game.

Currently your hardware needs to be powerful enough to run two of your chosen core. On low power hardware only a few less demanding emulators will be usable with this feature.

And you need to manually check how many frames of lag the game you’re playing has. This is easy: pause, hold an action button for the rest of the process, press K to advance a frame at a time until you see the action happen. Each press of K is a frame of lag.

So, now that this is out, the RetroArch team are optimising emulators to squeeze out some extra performance gains, and they plan to improve the runahead system to lower performance requirements.

Bonus is that even if you never use runahead you’ll benefit from the performance gains that are coming to emulators.


#42

Excited about Runahead but it just feels hacky to me (as a concept, not tried it yet). I’m glad lag is getting so much TLC though, hopefully runahead or some other option will help us eliminate lag issues for most games.


#43

This even works on miniSNES, at least in the emulators I’ve tried. Quite amazing!


#44

I’ve been trying out Run-Ahead on both my home PC and a GPD XD and the results have been very nice. As @matt mentioned, they must have worked on bringing down the hardware reqs because it runs well on an Android portable. At least for the most part with NES and GB cores.

Windows 10 PC, Retroarch running Legendary Axe, Mednafen PCE core, Raphnet adapter+Wii Classic Controller Pro:
I’m getting 4 frames of lag (66.6ms). Almost 1 frame of lag (14ms) is from my TV.

WIth Run-Ahead, Hard GPU Sync enabled and set to 0, Full Frame Delay 6 (this may be redundant with Hard GPU Sync on), exclusive full screen… I’m getting 2.5 frames of lag (about 42.4ms)! That’s about 1.7 frames if you subtract what the TV is adding.

Considering Run-Ahead removed a frame of lag that is normally present in the game running on native hardware, there’s a good chance the above setup is running equally or possibly more responsive than console + CRT!

GPD XD, Android Retroarch running SMB3 on FCEumm core.
With Run Ahead alone I was getting a pretty consistent 7 frames of lag. With additional settings enabled, that came down to a consistent 5 frames. I doubt the handheld’s LCD is contributing much – most of it probably comes from known unavoidable lag with Android OS and how it handles controllers. Regardless 5 frames altogether is very playable and not far from real hardware.

Still new to measuring input lag so I’ll need to keep messing around and be more consistent with the games and cores tested.


#45

That’s awesome, love seeing some actual tests and people trying things out.

I’ve been experimenting with Retroarch latency controls on my CRT_emudriver setup myself. I use super resolutions on this setup (example: 2560x240), so using native res may improve performance (something I will investigate as soon as I can). Here are my default settings with i5-2500k @ 4.3GHz and AMD HD6870 GPU.

video_threaded = false
video_hard_sync=true
video_hard_sync_frames=0
video_frame_delay=6 (I increase this to 8 for lower-resource emulators)
video_fullscreen = “true”
video_windowed_fullscreen = “false”
video_scale_integer=false 
Run-Ahead to Reduce Latency:  True
Number of Frames To Run-Ahead: 1-3 (Depening on emulator)
Run-Ahead Use Second Instance: True

I have tested SNES9X, Genesis Plus, or Mednafen SuperGrafix, and those all feel really responsive with 2-3 frames of Run-Ahead and the settings above. I’ve not noticed any issues.

I have not tested N64 with Run-Ahead but Mupen64Plus runs just fine with all the other settings. I will dive into that more soon.

Mednafen PS1 is more demanding. With Run-Ahead enabled, FPS dropped and everything began to stutter horribly. Turning that off was all I needed to bring PS1 back to full speed, with 6 frame delay and Hard GPU sync, which still feels really good.

Mednafen Saturn on the other hand struggles with both Run-Ahead and frame delay for me. As soon as I enable it at any level, even 1 frame, FPS will drop into the 40s or 50s depending on the game and I will begin to get audio stutter. Is Mednafen Saturn that much more intensive than PS1?

Overall things work better than I could have hoped just 6 months ago. It’s amazing this feature was implemented in March and it’s working so well already. 8 and 16-bit cores respond wonderfully to this setting with no issues for my setup, and I’m sure with time (or less demanding cores), PS1 and Saturn will soon work as well.


#46

2-3 frames of run ahead will remove frames of animation with most games on those systems, I recommend setting run ahead to a single frame if you want a safe all in one setting. Personally I’m only comfortable working out each games lag individually and saving that per game setting.

It is, the Saturn is a far more complex piece of hardware than the PS1.

In other news fingers crossed the below can become reality, will be a real game changer for people without freesync / gsync monitors.


#47

Duly noted! I will adjust tonight. I’m sure I’d be fine with 1 frame for all titles unless I fine an absolute slug of a game. I’m not actually that sensitive to lag even though I can tell a big difference with the above settings vs. defaults.

Also, that beam racing V-sync sounds wonderful. Retroarch is really taking off these days.


#48

I’m just floored to check in on this thread and see how much emulation is evolving in recent times. Even back in the late 90s and early 2000s, I thought it was just insane to see 8bit and 16bit console games on my PC running pretty well.

But I never imagined this level of dedication to making the experience as close as possible to the real thing. The dedication of these programmers is extremely impressive.


#49

Exactly what I was thinking. Been out of the game for too long and happy to see how things are developing. Definitely like the last few posts and stuff to read up on.


#50

@Bozo_Cyborg @tomwhite2004

I agree that you need to save individual Run-Ahead settings per game by pausing the emulation and advancing frame by frame, then use Configuration Override save settings per game.

Also test multiple inputs because a delay by design in a character’s attack or jump may throw you off. I accidentally set 4 frames in Air Zonk because of a delay in the equipped weapon, which caused the game to stutter. The weapon charge up was instant and showed I only needed to remove 1 frame. I find that the pause button is another worthwhile method of testing this. I’ll fire a weapon in a game, pause the game, pause the emulation, hold pause to resume the action, and advance frame by frame until the project moves again.


#51

Agreed, per game overide for runahead.


#52

Just tried out Runahead on Mupen64Plus, it was a no-go which is no real surprise. However, with framedelay at 8 things feel great, so I’m not too bothered.

Same for PS1, I was able to push frame delay up to 8 and things feel super snappy.

Otherwise I’ve set all other cores to 1 for now. If I start to see issues I will adjust on a per-game basis. The lagless V-sync sounds much more appealing to me than run-ahead right now, if it shows universal compatibility.

Also, a tip that may help with perceived lag: Adjust deadzones. I noticed while playing PS1 that the analog deadzone makes a big difference with how sluggish movement may seem. If you play with analog controls, I suggest shrinking the deadzone in control settings to see if it helps things feel more responsive.


#53

So say theoretically if I wanted to run a 4K setup for 90s MAME and SNES/Genesis? With this lag reduction method, what type of hardware would I be looking at to have a dedicated machine?

I’m assuming I would want it natively pushing out 4K and not have the tv upscale it. And would it just be cheaper to get an OSSC and have the computer run at 15khz?

I’d like to have as little points of failure as possible, including hardware and cords.


#54

I would go for a G5600 paired with a GTX 1050 and 8gb of ram. Zero point in going through the hassle of getting your build to output at 15khz with all the custom resolutions unless you plan to use a CRT. An OSSC plus a 15khz capable GPU will be much more expensive than a GTX 1050 too.

Run ahead does not work with MAME in Retroarch due to the way save states are managed by the emulator but I think it works with the Final Burn Alpha cores. For MAME you want to use GroovyMAME as its D3D9ex backend is a whole two frames more responsive than anything that the main build has to offer.


#55

Thanks I appreciate the response. Has anyone here tried 4K sprite emulation? I keep hearing the kurozumi crt filter is pretty popular in this setting.


#56

Kurozumi is a custom version of CRT-Royale that aims to look like a PVM with its default settings and is ideally suited to resolutions of 1440p and upwards. With 4k you should see a significant difference in the shadow / slot mask, aperture grill emulation compared to 1080p.

The below thread has quite a few comparison screenshots and general configuration conversation, resetera has an emulator screenshot thread too that I am sure will have screenshots showing it.


#57

How does Kurozumi compare to similar shaders in the Analog Shader Pack? I’ve been playing around with it the past couple of weeks and it has seriously top-notch filters that would fool anyone. The multiple PVM and BVM filters are great, but I’ve taken a liking to the Slotmask Sharp filter.





#58

Couldn’t tell you how it compares tbh. I downloaded that shader pack a while back but not had the time to go through it all.


#59

Dumb question:

I can’t find any download button for the Kurozumi filter on github. It just has the code.

And Retroarch doesnt automatically download it. I see a few variations of CRT Royale but not this particular one.

I’m definitely missing something easy here, but I don’t know what


#60

Create a new notepad (.txt) file and copy everything from the “code” into the txt file, then rename the file to “crt-royale-kurozumi.cgp”. Make sure it changed the extension from txt to cgp.