dosbox-pure icon indicating copy to clipboard operation
dosbox-pure copied to clipboard

Input Lag / Vulkan

Open chinagreenelvis opened this issue 5 months ago • 1 comments
trafficstars

So I'm finally getting back around to setting up DOSBox Pure and RetroArch in general with SwitchRes, and I've got my VGA monitor connected through a DisplayPort adapter, which I don't think is introducing any lag of its own.

I have a custom resolution set up to run content in 640 x 400 @ 70Hz, and everything works fine - except I'm dealing with input lag, depending on the settings, especially from the mouse. It's very noticeable in point-and-click games like SQ4.

What I've found so far is that it's at its worst when using Vulkan, the virtual mouse, and not forcing 60fps.

Forcing 60fps can make it a bit snappier, but it takes away the smoothness of the 70Hz resolution. Using direct input also helps a little, and lastly moving from Vulkan to D3D12 pretty much clinches it. So far, the best balance seems to be running it in D3D12 with direct input and not forcing 60fps.

Any idea why using Vulkan in the RetroArch settings would be introducing this delay? I don't experience it when gaming on console emulators - and in fact, Vulkan is necessary in those cases to be able to play on a CRT TV through a secondary card while using the primary card as a renderer. I don't have to do this with DOSBox because my VGA monitor is connected to the primary card, but it would be preferable to stay on one renderer.

I tried fiddling around with the latency option, but it does too much fighting over CPU power and throttles even DOOM to the point of unplayability.

Any suggestions are welcome, I'm curious to find out how much you may already know.

chinagreenelvis avatar May 26 '25 09:05 chinagreenelvis

I don't think I know much about the issue you're seeing. As a test I modified the core to draw the start menu mouse cursor in the current known position and in the position known in the previously drawn frame. I then tried to move my mouse in circles at a constant speed while taking a screenshot with a tool that also captures the hardware mouse cursor.

This is what I got with RetroArch's glcore video driver: Image

And this is what I got with the RetroArch's vulkan video driver: Image

It looks about the same to me. But I'm just on a regular LCD display with a 60 hz refresh rate. I switched the display to the high refresh mode (144hz) and the results seemed about the same again. This is on Windows 10, running in windowed mode, with many core and RetroArch options on their default.

But if this is specific for you on the vulkan video driver only, then I don't think the core can do much. So if you see a difference between vulkan and D3D12 then that's all on RetroArch, because all the core does is to pass the final image to it every frame. Have you tried tweaking the many video settings? Especially Video > Synchronization.

As an advanced test you could restart RetroArch and go to Load Core > Start Remote RetroPad, go to the Quick Menu, into Core Options and set "Start screen" to "Sensor tester" and "Pointer test" to "Mouse", then go back and select "Restart". This should now show a little point moving with the mouse and show L M R buttons light up when pressing the respective mouse buttons. See if you can feel the input lag there. If you want to go a step further, try using a phone with slow-motion video recording and take a video of the mouse button being pressed with the screen showing behind it and the L, M or R letter lighting up. That way we could actually measure the real time taken between the physical button being pressed and the core being able to react to it.

schellingb avatar May 28 '25 11:05 schellingb