Clamp to VRR (FreeSync/Gsync) range?

The good news: The relatively new variable refresh rate runloop works rather well for me!

The bad news: …up until the intended rate exceeds my monitor’s range.

I’m working with a ViewSonic XG2700-4K monitor, which has a FreeSync range of 40–60Hz. This means that when I emulate NTSC NES and SNES with their rates of ~60.1Hz it doesn’t quite work out right. In non-windowed fullscreen, I see horizontal tearing that crawls slowly up the display. In windowed mode, I get smooth sailing for a good few seconds and then a couple obvious frame skips, then repeat.

This is Windows 10, so I’ve tried widening the monitor’s range slightly using CRU, but that hasn’t worked. My current workaround is to set the cores I’m using for those two systems to not use the VRR runloop, but this means that I lose the advantage of automagically enjoying 50Hz smoothness when I slap in a PAL game.

Is there a way to coax RetroArch to check the display’s VRR range, or at least to manually set the range and have RA clamp its framerate to that?

1 Like

Indeed, atm if a core goes above your monitor refresh rate, vsync will be disabled.

You can make a cfg override for that core with vrr_runloop disabled. (just saw you did that already)
That will revert back to the standard RA sync that slightly adjust the game speed along dynamic rate sound control.

Perhaps that could be made into an automatic fallback… I have to think about it.

1 Like

So, I tried to make an option to allow deviation to your monitor refresh rate when a game runs slightly above it.
It’s in settings>frame throttle>“Allow above range deviation for Sync to Exact Content Framerate”
(couldn’t find shorter lol)

On my 1440p gsync screen 120hz, I tried to limit to 60hz in nvidia panel and set the reported refresh in retroarch settings>video (59.995hz).
With g-sync activated it’s a mess: snes9x sound crackles a bit and after a fast forward I end up at a strange 43.5fps speed…

If I disable g-sync, then it works fine and snes9x adapted its speed to 59.995hz with no sound issue.

So… no clue what’s going on, see for yourself if it works for your monitor with that modified RA exe.

(diff here if people not on window want to test)

1 Like

Interestingly enough, it seems to be working just fine for me, as far as I can tell!

I tested both Snes9x and Mesen, and each of those at 2160p in both NTSC and PAL modes. FreeSync is working, audio is fine, fast-forwarding works like a charm, so… thank you!

Did you try to fast forward in an snes9x game?
Is it going back to the right speed when exiting FF?

Do you launch games from the menu or command line/launcher?

I use the XMB menu exclusively, at least for now. I tested fast-forward and rewind in both those cores (and a few others since), and everything went back to the right speed afterwards without any sound crackling. Basically, it’s working perfectly no matter what I do!

Sorry you’re still having trouble there. Would it help for me to pass along some configs or logs?

No thanks, that’s not needed.
As long as you have “exact sync” and “allow deviation” activated in the Frame Throttle menu, alongside your refresh rate in video menu, that’s all good.

I suspect it’s something with a limitation set through the driver (60hz) that isn’t a real one from the screen (that can reach 165hz) causing that here with gsync.
…or that code not working at all with gsync, but I can not know it without more people reporting. :confused:

I may have cursed the thread by its title in referring to VRR by the unfashionable name “FreeSync” and not also “Gsync”. Fixed!

As for the case of having higher available framerates, perhaps I could persuade you to add options to set arbitrary minimum and maximum rates to clamp to, independently of whatever the monitor claims? Those would be useful settings to have for a number of other reasons, too (up to and including trying to pinpoint some odd behaviors in my own monitor.) As always, I’d be glad to help with testing.

Anything I can do to help nudge this code into the official build? I’d love to be able to update my RA install. :grin:

Not enough feedback about it and it’s not working as intended here…