Let's talk about Latency (and Game Mode)

Here are my results for Vulkan with max swapchain = 2.

Vsyncless
8F, 7.5F, 8F, 9F, 7F, 7F = 64ms

Scanline sync
11F, 10.5F, 10F, 11F, 10.5F, 11F = 88ms

Normal vync (off in Radeon Settings, on in Retroarch)
10F, 11F, 10F, 11F, 11F, 10F = 87ms

Normal vsync but with “Radeon Antilag” enbled in Radeon Settings
11F, 10.5F, 10F, 10F, 11F, 10F = 86ms

Looks like Vulkan vsync is the way to go!

I’ll have to retest with the 3060 next week but this is looking pretty promising. 88ms would mean my TV has 55ms of latency in Movie mode after deducting the 2 frames of SMB internal lag, which seems about right for a low end Samsung TV of that era (2013). I know I know, I should use game mode… but I hate it, the colours are just not to my liking. I’d definitely use it for competitive gaming though.

The main takeaway for me personally is that as long as I have a button-to-pixels no more than 100ms, I’m generally satisfied. I can still feel some latency at 100ms, but it feels to me ok for casual play. Adding an extra frame or two top of that is where I start to feel it intruding into the experience even for casual games. If the game doesn’t involve any timing challenges then I might tolerate more if it was the only way to get a smooth framerate.

2 Likes

Yeah, this is the important thing. As long as you get it below your personal threshold, you’re all set.

I’d be curious to see your game mode results. Also, don’t forget about runahead, since it’ll shave off entire frames at a time :wink:

2 Likes

I have done the same test as proposed here: https://www.youtube.com/watch?v=tnD56BI-ZGA

But with RetroArch, instead of a MiSTer. I’ve gotten 3 frames of lag with a desktop PC and regular TV and 3~4 frames with my notebook. I used:

  • Video driver: Vulkan
  • Max Swapchain Images: 3
  • Input Poll Type: Early
  • Game mode: Enabled
  • A wired (not wireless + cable) USB controller

Everything else was default. If I set the max swapchain images to 2, I reduce the input lag by a whole frame on both devices.

3 Likes

That’s not a good test to be done with the slow-motion camera method because that specific “Lag Test” menu has 3 whole frames of internal input lag (assuming it’s the SNES version). You can verify that with the frame-step feature by pressing K to advance frame-by-frame and see how many frames the game takes to react to input.

A better test, which is what I usually use, is the “Horiz/Vert Stripes”, which has 0 frames of internal lag. Of course you can still use the “Lag Test” one, but you need to be careful to always subtract the internal game lag to your measurements.

@pneumatic Speaking of internal lag, I’m sorry, but I believe Super Mario Bros on the NES has only 1 frame of internal lag, and not 2. My bad.

Anyway, good to know that using Vulkan has reduced lag for you!

3 Likes

Just did 2 runs of measurements in Game mode and got the same result as without Game mode. I know that can’t be correct as I recall using Game mode back in 2014 for GTA IV online matches and I could definitely feel the improvement back then. Checked all picture processing was turned off. The only thing is that my GTA IV days may have been before I changed the model number in the service menu to unlock extra colour controls, so maybe doing that has somehow neutered the Game mode. Another possibility is the Xbox 360 may have been outputting a different signal type like 4:4:4 vs 4:2:0 vs RGB. The TV processor downscales internally to 4:2:2 even when signal is 4:4:4, and I can’t use RGB cause colours are bad in that mode too. Anyway I lost motivation to troubleshoot this further.

2 Likes

Finally got around to measuring the 3060 - the results were ok for OpenGL, basically the same as the R9 380, but with Vulkan it has a couple of issues:

1. I couldn’t get it to disable vsync so couldn’t do any testing of RTSS scanline sync
2. The lowest latency with vsync was 20ms higher than on the R9 380

Seems like AMD drivers work better with Vulkan?

Overall I am not that impressed with 3060 as I’m having other issues with it in relation to shader compilation stutters in Dolphin which were not present on the 1070.

Probably the only notable thing in the above table is the NVCP OpenGL triple buffering setting actually lowered the latency when using vsync + hard GPU sync. However I know that will affect frame pacing so I’d still slightly prefer scanline sync and leave triple buffering on.

5 Likes

That’s a nice set of measurements! I’m wondering, have you subtracted the game’s internal input lag? If not, what game are you using?

Vulkan should be the go-to for reducing input lag as much as possible. It’s a bit strange that Nvidia gives you such high latency values. Are you sure you set max swapchain images to 2?

Depending on the driver and OS, the max swapchain images setting might not be honored. If you open RetroArch through the command-line you can check the log to see what is the effective number of swapchain images in use. It should be 2 for the minimum lag possible.

1 Like

Both the 1070 and the 3060 will have shader compilation stutters since the ubershaders don’t work with the doplhin core. I suspect you had the 1070 for some time and it had already built those shaders, that’s why it didn’t stutter anymore since shader stuttering only happens when you load a game or area for the first time.

So when you switched to the 3060 it had to make new shaders, thus stuttering. But does it occur when you re-load the same game and areas again?

I have a 1060, which is the same gen as the 1070, and i get shader stutters with new games/areas but they stop after they get built.

2 Likes

Invaluable work there, my friend. Thanks a lot!

2 Likes

Super Mario Bros, Nestopia core, just jumping up and down at the start of world 1-1.

Thanks and the log reports [INFO] [Vulkan]: Got 2 swapchain images.

Nvidia Inspector reveals some settings relating to swapchain so I might have a play with those and see if they have any effect.

I’ve always used standalone Dolphin and before each test run I delete the shadercache files for both Dolphin and Nvidia. It’s the only way otherwise like you said I wouldn’t know if the shaders for that part of the game were already previously compiled.

1 Like

Then you can subtract 16.6 ms to your measurements, which leaves you with pretty awesome values for such an old TV.

As for why RTSS scanline sync gives you lower lag than Vulkan with Max swapchains set to 2, I have no idea. On an AMD card (RX 6800) on KDE (Linux) I can achieve 51~54 ms of latency on Vulkan (with Vsync).

1 Like

Question:

How much the parameter Hard GPU Sync Frames influence latency?

Setting it to 1 does it add a whole frame of input lag?

A whole frame, no. It must be a very minuscule amount.

1 Like

@Hari-82 @GemaH I might be mistaken, but I believe it adds a whole frame of input lag, yes.

Not on my setup though. I still get the same amount of lag frames judging from the pause - frame advance method.

@GemaH That method is only for counting frames of input lag internal to the game engine. I.e. the lag that a game has internally that was observable even on the original console. For example, Super Mario Bros has one frame of input lag even on the NES.

It does not measure any of the input lag from the RetroArch graphical pipeline or graphics drivers.

1 Like

Is that true though? Because some people are getting different results with this method. For instance, i only get 1 frame of lag with Genesis Sonic games but other people have reported 2 frames, using the same core.

Also, another reason i don’t think that’s true is because the Saturn core has a lot of frames of lag in all games, like there’s a 3 frames of lag base for all games at least and you go up from there. I don’t think that’s true for the real console.

I would test, but I can’t right now.

But you can do a simple test by setting Hard GPU Sync Frames to a big value, like 5 frames, and then measure the number of frames of lag in, say, Super Mario Bros. That will give us the answer for sure.

From what I understand the frame advance method (with the game paused) can determine the “internal” delay and is useful to set run-ahead (or preemptive frames) to a proper value but for the other settings is always better to do a button-push to animation test.

My mobile (and my old camera) can only record 60fps, if somwone have the means (and time) would be nice to have a proper test recording @120 or more fps…

or maybe a dev could give us a more technical explanation :nerd_face:

Hard GPU Sync frames only goes up to 3.

I tested all values from 0 to 3 and i’m still getting a single frame of lag in Sonic using GenesisPlusGX.

Whatever these GPU frames do, it must be very subtle.