Input lag with Flycast?

Hi guys - being that run ahead does not work with Flycast I am trying to shave down as much input lag as possible. I am already running a gsync monitor with 5ms of input lag and flycast just does not feel responsive. I tried playing Psyvariar 2 today and it was very difficult. I don’t know if it’s the nature of the Naomi hardware, because Demul is the exact same way.

Do any video backends offer less buffering than gl? I tried cycling through them all but they all kind of felt the same. Does anyone else feel input lag with Flycast?

Did you set hard gpu sync to 0 frames and set frame delay as high as possible without crackling?

1 Like

Make sure you’re using the highest refresh rate your monitor supports. If it’s a 144Hz display, make sure the monitor OSD shows 144Hz when in retroarch. If you don’t do that and run 60Hz, then you will get vsync lag.

And usually the Vulkan driver should have low latency. After switching to Vulkan, set Settings/Latency/Max swapchain images to 1. This will affect perfomance on weaker systems though. But not as much as the Hard GPU Sync setting of the OpenGL driver.

Also make sure RA runs in exclusive fullscreen mode. Make sure Settings/Video/Fullscreen Mode/Windowed Fullscreen Mode is set to OFF. However, I’ve heard of people reporting that on some systems, this doesn’t appear to always work correctly and RA runs in borderless windowed mode regardless. You should be able to verify whether it works correctly or not by enabling gsync only for fullscreen in the nvidia control panel and leave “windowed gsync” disabled. Then enable the gsync status indicator in the nvidia panel’s menu:

When you launch RA, a big, fat green “G-SYNC” logo should appear on the left side. If not, then something is wrong and exclusive fullscreen doesn’t work correctly. You can try enabling windowed gsync in this case, but it’s always going to be somewhat suboptimal (it can have perf and stutter issues.)

1 Like

Yes that’s the default way I always set up any core in RA if run ahead isn’t supported.

So yes my monitor is over clocked at 165hz. Exclusive full screen is on, I am not sure if I’m on 1 for swapchain I won’t be back at my cabinet for a few hours.

So because I use some emulators in windowed mode (Because it’s the only way to use bezels with Rlauncher) I have gsync enabled for both.

What is strange is I’ve always heard that if gsync is running in full screen you’ll get an icon on the screen; I have never seen it Ever but I know it’s working. I have a button I can push on my monitor and it will show what HZ it’s currently running at Via an OSD and in MAME if I’m playing R-Type for example it shows 55hz, same thing for Mortal Kombat then once I’m back at desktop it changes to 60. But strangely that icon has never shown up.

One more thing after researching Naomi input lag on real hardware. Don’t know if there is truth to this but according to a user on the shmups forum who owns a Naomi GDROM. He stated that Naomi input ports have 3 frames of built in lag. That’s like…bad if true.

You need to enable that as I described in my post. I’m not sure if it shows in windowed mode gsync, however.

Then I would say you have your resolution settings wrongly configured and you’re running in 60Hz mode. Choose 144 or 165 in the nvidia panel in the “change resolution” section.

I’m sorry my mistake it does show me back at 165hz at desktop according to my built in monitor OSD when I exit from MAME.

Well, the important thing is that while in RA, the monitor’s current mode OSD shows 165Hz. I don’t mean the “FPS” indicator that some monitors have. I mean the current mode information (this would show something like “2560x1440 @ 165Hz”.) This is to make sure that RA doesn’t for some reason switch you to 60Hz.

With gsync enabled, it’s important to use the highest refresh rate mode the monitor supports. If RA switches to 60Hz, then running 60FPS content (like DC/Naomi) will result in a lot of vsync lag. Also, 165Hz has lower latency than 60Hz, regardless of current FPS because of the higher frame scanout speed. With gsync, if you make sure the mode is 165Hz, then you will get 165Hz frame scanout speeds even with low FPS games (like 30 or 60) which gives you a latency benefit.

2 Likes

Wow…good info here thank you. I’ll check on these things and report back. Might not be until tomorrow. I was always under the impression that in order to run these games at the correct speed AND a high refresh rate such 120hz as an example you would need to enable bfi which I don’t want to do because it darkens the image dramatically. Wasn’t aware it would still do a scan out at that high refresh but content can still run at 60hz.

Also, make sure that vrr_runloop_enable = “true” in retroarch

Ok so I’m using Vulkan now, have frame delay to highest it can go, & I am definitely running at 165hz even during 60hz content. Exclusive full screen checked as well. I also disabled threaded rendering in Flycast core options because I it adds a few frames of input lag. There is apparently a bug that the dev is aware of according to github. But there’s a little issue.

So I thought with gsync there is no reason to enable a program’s vsync. If I enable “sync to exact content rate” and keep vsync Disabled in RA, games look like they are running at half frame rate, even though RA’s frame counter shows 60.2. I have to turn on Vsync in order to get things buttery smooth. I thought the purpose of gsync was to not have to use vsync and get minimal input lag? Why do I have to turn this on then? It should be a matter of turning on the sync to exact content option and done.

Also even with changing gsync to full screen only in NCP I still do not get something that says Gsync in the left of my screen when launching full screen apps. Not sure if this was a feature of older Nvidia drivers when Gsync first came and maybe with new drivers disabled it? Is this message supposed to turn on via my monitor OSD or through Nvidia software via Windows? Again I know it works with MAME like I stayed before.

I do not have that option enabled as far as I know…is that something new? What is it? I didn’t see that Option anywhere in RA?

Oh but you already know about it, it’s the “sync to exact rate” setting. I have it on because it makes things much smoother (no stutters) when running things at 120hz. My monitor is freesync and gsync compatible, but my graphics card isn’t, sadly. Still, it’s very useful!

Oops disregard just saw the end of your post that your card isn’t gsync compatible. I was going to ask if you had vsync enabled but being that you don’t have the card for it you probably have it enabled.

You need vsync ON in RetroArch to make it sync with the monitor swaps regardless of how they happen. It’s unusual in that respect, I think, as most things do want you to turn it off for VRR, but I think it has to do with the fact that the things we’re playing all have their own fixed refresh rates.

1 Like

Ok I guess I’m set up optimally then. It is a lot less laggier now than Demul so thanks to all for the replies. I’m going to dump Demul for good now.

1 Like

RA uses vsync for audio syncing, I think. That’s why you need it. But the point is that if your current display mode has a higher refresh rate than the FPS of the content, then vsync on with gsync has the same lag as vsync off. That’s the whole point :slight_smile:

I don’t understand. I have Gsync compatible monitor and videocard. Regardless of monitor display rate, when I turn “Sync to exact rate” ON, retroarch run games in half of framerate, in 30Hz. Is this a bug?

No, that usually means you’re getting double-sync. That is, something external is forcing vsync and then RetroArch is forcing it again, causing it to sync to the next vblank.

How could this happen? I just went to Nvidia control panel and made sure that it doesn’t force vsync on RA. Also, “Sync to exact rate” is raleted to Gsync, right? So how can it force vsync? And thirdly, This option cuts framerate in half regardless if vsync option in RA turned on or off.

I also tried to disable Gsync entirely in Nvidia control panel and turned “Sync to exact rate” in RA. This brought interesting result: monitor now says that it’s in 60 hz mode, not 30hz. But framerate STILL cuts in half, I test this in NES Tom & Jerry, where Jerry must flicker after taking damage, but with “Sync to exact rate” he’s either solidly visible or disappears completely. Also, disabling Gsync brings screen tearing regardless of vsync option.