An input lag investigation

Is there something else to do to get less LAG?

Increase frame delay as high as possible, but i’m not sure those things have enough power.

Thx @Brunnis for the feedback.

Are those fixes to the emulators by you already included in the latest RetroArch releases or do I have to install those fixed emualtors by self?

Edit: Using the standard gl driver and crt-shader ist not realy usable on the pi2.

I think the XMB menu is not compatible with the dispmanx driver, can someone confirm ?

@Tromzy That’s probably correct. I don’t think it supports GL at all, and XMB requires GL.

@xadox The changes are all in the buildbot cores. Which CRT shader are you using? CRT-Pi should be full speed on rpi2, though it may increase latency.

Yes I was using CRT-Pi with default gl driver. For me the framerate was dropping under 55.

You can try overclocking your RPi2:

[QUOTE=xadox;50789]Yes I was using CRT-Pi with default gl driver. For me the framerate was dropping under 55.[/QUOTE] If you’ve changed any of the crt-pi settings from the defaults you will have almost certainly have slowed it down. Make sure you’re overclocking your Pi to the Pi2 setting using raspi-config.

How are you measuring the frame rate? Turning on the frame rate display in retroarch with crt-pi looses a few FPS.

If you’ve tried to minimise latency by disabling threaded video that might hinder frame rate as well. Retropie defaults to threaded video for the reasons explained in this thread.

If you prioritise minimising lag over looks you’re best off using the dispmanx driver and forgoing shaders even if you can get your Pi running at a solid 60 FPS with them.

Used default values only. But the Pi2 is not overclocked.

Yes, frame rate display was enabled.

Yes, threaded video was disabled.

Actually I am using dispmanx again.

Hi! sorry if this has been answered before, but… if it is used a scanline image overlay instead of a scanline shader in Raspberry Pi, should it have a minor input lag effect? thanks!

for “reduce input lag”, this is important option : “disable desktop composition” for windows , it’s extremly important to desactivate windows aero : http://www.humanbenchmark.com/tests/reactiontime before : 240ms with aero , after 180ms disable aero !

And with anti-micro : https://github.com/AntiMicro/antimicro/releases you can reduce inputlag with gamepad poll rate setting at 1ms (anti micro must run in backround) in option/setting

for look the difference, go download keyboardtest : http://www.passmark.com/products/keytest.htm (free 30 day) and connect a game pad turbo . start antimicro and assing a button with keyboard , active turbo button and push the button : look at the “depresstime”, it’s always at _8ms, 16ms, 24ms, ect … now, change setting/option “gamepad poll rate” at 1ms and try again test : now the depresstime is 4ms, 8ms, 12ms, 16ms ect … I let you understand yourself because my English is too bad to explain to you, but i thing you understand what is happening , the gamepad is queried every 4ms instead of 8ms, this proves the action can start earlier !

it’s difficult to change a polling rate in windows 7 but with anti-micro is simple :slight_smile:

P.S : I think the gap between the inputs max 4ms it’s because of turbo joystick can not go faster, but the polling rate must be at 1ms, now mario jump with a turbo in the ass, mamamiiia !

1 Like

disable desktop composition should be ON or OFF? Mine was OFF and I’m sure I never turned that ON before.

disable desktop composition must be ON in retroarch , this is the only way to disable windows aero in windows 8 or windows 10 (for windows 7, change theme for classic theme enough)

I think that if you use exclusive fullscreen, the compositor is “bypassed” anyway (if someone like Hunterk could confirm…).

That’s what “exclusive” means. The program is given exclusive access to the video hardware.

Nope, because “desktop composition” never bypass, it’s integrated in windows (fullscreen exclusive don’t kill aero, check yourself) . The only way is to turn it off

With windows 8 and 10 it’s even worse because it’s literally integrated in dwm.exe and is not called aero , there is no option as windows 7 to turn off . the only way is to do it with retroarch or kill dwm.exe process

However, I think this problem concerns just directX and not opengl or vulkan driver (steam games or emulator) certainly because desktop composition is based on directX In any case, it is safe and certain for steam game or emulator in directX that “desktop composition” has a bad influence to reduce input lag . It’s really visible on mushihimesama steam version

Edit : important, “disable desktop composition” in retroarch 1.3.6 seems broken, it does not disable aero in windows 7 ; this option works perfectly with version 1.0.0.2 but not with the new version . I do not have windows 8 or 10 to do the test, if a person can test to see the behavior it would be good .

Wasabi, thanks a lot for the advice pertaining to Antimicro. Indeed I have been looking for a way to alter the input polling rate for USB controllers on Windows and it’s really difficult to find something that really achieves the desired effect.

Would you be able to verify or measure whether the program actually changes the poll rate for the entire system, so that it does affect Retroarch while running? From the documentation it would seem that the poll rate is modified exclusively for antimicro’s keyboard redirection, but I would be curious to understand if it’s actually making the whole OS read the inputs of that particular controller in a faster way.

As for disabling the desktop composition, it has been broken for quite a while on RA and I don’t think it ever worked on Windows versions higher than 7. Some users over at the Osu message boards have posted some interesting workarounds to temporarily suspend dwm.exe on Windows 10, including batch files that supposedly automate the process. I haven’t tested them yet since with Windows I’m always fearful that things would horribly break afterwards, but I’d be interested in exploring this further and shaving some more ms off.

Even though at this point it might seem like nitpicking and trying to achieve some mythical level of responsiveness, for certain competitive and arcade titles improving this aspect even by a slight extent is crucial…

[QUOTE=wasabi;53363]for “reduce input lag”, this is important option : “disable desktop composition” for windows , it’s extremly important to desactivate windows aero : http://www.humanbenchmark.com/tests/reactiontime before : 240ms with aero , after 180ms disable aero !

And with anti-micro : https://github.com/AntiMicro/antimicro/releases you can reduce inputlag with gamepad poll rate setting at 1ms (anti micro must run in backround) in option/setting…[/QUOTE]

Thanks a lot man! I´ve testet this and it had no to almost no impact on my livingroom emulation machine (win10) but on my vert mame cab (win7) it takes shmup gaming to a new level. antimicro detects the ipac2 (sure the usb version) out of the box! Looks like me an Battle Garegga messing around again…gosh, my nerves.

Thanks also to all involved in this thread who contributed tips & tricks! Sticky!!!

1 Like

Battle Garegga… Now, that’s a game that really tests one’s reflexes! :slight_smile:

Yes it’s possible : assigned a bouton gamepad turbo to keyboardtest, start retroarch in windowed and désactivated “pause when menu activate” in retroarch,You can check that antimicro operate .

It is the gamepad that is modified, You do not even need to emulate the keys for the trick to work, just operate anti-micro in backround with setting 1ms .Normally all usb devices work at 8 ms, moreover you can see that the keyboard is not affected by the tip if you press it. This trick works like mouse gaming software by asking the cpu to control the device more often, there is just a little more power demanded from the cpu . To finish, the effect is clearmemnt visible if you win a frame (but it can have no impact if you are for example at 26ms because 26-8 = 18ms, in this situation you do not win anything) but if you have 20ms originally , You win a frame (frame = 16,66ms)

[QUOTE=Geomancer;53538] As for disabling the desktop composition, it has been broken for quite a while on RA and I don’t think it ever worked on Windows versions higher than 7. Some users over at the Osu message boards have posted some interesting workarounds to temporarily suspend dwm.exe on Windows 10, including batch files that supposedly automate the process. I haven’t tested them yet since with Windows I’m always fearful that things would horribly break afterwards, but I’d be interested in exploring this further and shaving some more ms off. [/QUOTE]

Okay, thanks . So in this situation it’s better to look elsewhere, that’s one of the reasons I did not want to switch to windows 8 or 10 .

[QUOTE=sterbehilfe;53625]Thanks a lot man! I´ve testet this and it had no to almost no impact on my livingroom emulation machine (win10) but on my vert mame cab (win7) it takes shmup gaming to a new level. antimicro detects the ipac2 (sure the usb version) out of the box! Looks like me an Battle Garegga messing around again…gosh, my nerves.

Thanks also to all involved in this thread who contributed tips & tricks! Sticky!!![/QUOTE]

I am delighted to be able to help you (and thanks to the designer of Antimicro). With all these tricks we can now have a solution to have the lowest latency possible. The games have a new flavor :slight_smile:

EDIT : Ok, I have new information; I found a site to understand how it works, It is very well explained : https://ahtn.github.io/scan-rate-estimator/

You can also test your controller on the same principle as “keyboardtest” Also, joytokey can do the same thing as antimicro (I prefer antimicro but the alternatives are good too) Go to : setting/preference/internal/processing speed 16x for activated

Here is what joytokey says about it : By processing the input more frequentely (by the factor of 2-16), latency will be shotened ans very fast automatic repeat will become possible (max 60-500 times per second). However, CPU load will become much heavier, so please use with caution .

After several searches and tests, it is definitely 4ms (for 1000hz) that one can win, against 8ms. (See the link to test the keyboard above for understand), it’s already good and allows to shorten the delay and be able to win a frame. Last thing, I have no improvement with the PS3 controllers, I can not go below 8ms. Surely a technical limitation of PS3 gamepad, there is a no probleme with gamepad PS4 and Xbox360 . I think it’s important to make it clear .

happy new year !