Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Hmm..Input Lag



  • Is there that much input lag that I am not noticing? I see many people talk about it but to me it is just fine. I do use game mode on my tv and I know the consoles seemingly did have awesome response time, but I do not notice it on Retropie. Even when I first discovered early Nesticle I do not remember there being much lag if any, mostly just game incompatibilities. On my wii homebrew there is lag like a mofo when using any controller plugged in, which drives me insane, but not on here. Maybe I am just getting too old and am going to turn into my dad and uncle where when I play Mario Bros. I'll jerk the controller up over my head like I'm having a seizure every time I press the Jump button( and that was in the early late 80s/early 90s haha). I think we actually lost an NES that way.


  • Global Moderator

    @thedatacereal

    It sounds like you've been using emulators for quite some time. It's possible that you've simply become accustom to it. I've seen several videos and forum posts where people claim to be having a hard time adjusting to the new look-ahead feature in RetroArch because they're now so used to the existence of lag.

    Back in the Nesticle days, I wasn't aware of any input lag either. At that time, it had been a while since I owned an NES and I just assumed I was out of practice when a win didn't come as easily as it once did. Of course it was probably a little of both to be fair.

    Also, keep in mind that while a reduction in lag will certainly give you an advantage, most games can be played just fine with lag existing. There's only a small percentage that become "impossible" with a few frames of lag and I'd argue that they too could possibly be overcome with a fair amount of memorization.

    If you're interested in testing how much lag exists in any one game, I'll paste a reply I wrote in another thread that sketches out the procedure.

    For anyone who doesn't know, you can test how many frames of lag a game has by using the RetroArch pause feature, then hold down a button that will invoke an action in game. Then, use the frame advance feature to move forward one frame at a time until you start to see the action take place in game. However many frames it took to begin the action animation, minus one is how many frames of lag exist and it can vary from game to game.



  • @mediamogul said in Hmm..Input Lag:

    For anyone who doesn't know, you can test how many frames of lag a game has by using the RetroArch pause feature, then hold down a button that will invoke an action in game. Then, use the frame advance feature to move forward one frame at a time until you start to see the action take place in game.

    Pardon my query, since I'm certain it's something beyond obvious, but how do I actually use this? On a PS3 pad, I invoke the hotkey pause, game pauses, then I press (or press and hold) eg "A for punch/shoot/jump", then my hotkey for Frame Forward - the game forwards but the supposed punch/shoot/jump action is not happening at all.


  • Global Moderator

    @youxia said in Hmm..Input Lag:

    I press (or press and hold) eg "A for punch/shoot/jump", then my hotkey for Frame Forward

    The two hotkey combos are likely interfering with each other. Try using the 'k' key from a keyboard to advance forward.



  • @mediamogul Thank you , I did not know about that. One day I just need to sit down and read everything about RetroArch I can. I'm also curious to see how much lag a person can take without noticing. A family member makes me play retro side scrollers but won't turn on their Game Mode on the television and I get so frustrated and how bad it is. They just laugh because they just think I stink at retro games.



  • @thedatacereal ugh I hate it when friends and family have their TV's configured wrong. Seems most people just leave the settings at default and think it's good enough. I usually go behind them and fix everything.



  • @quicksilver I agree. I even have offered to change it for them and compare it so they can see how much better it is but they think I am just making excuses for losing. I guess from now on I'll have to start carrying my own tv when i take my RPi over :O



  • Okay, I've managed to get it going and did some tests on my CRT TV (NTSC via composite). RPi 3B+ @800Mhz with USB PS3 pad and keyboard, Retropie 4.4. The number indicates how many frames occurred before the action commenced. Different games yielded different results hence the range.

    Megadrive: 2-3
    PC Engine: 1-3
    SNES: 1-3 (Super Mario World = 2 if you want to compare with this test
    ZX Spectrum: 2 to14 That 14 is a wildly high number which I don't think represents real value - definitely did not feel like that, perhaps something to do with NTSC vs PAL and/or my setup and emulator config
    Commodore 64: 2
    Mame: 3-4

    What's interesting is that using the "unsupported tweaks" (aka video_threaded / video_max_swapchain_images / video_hard_sync) in the above test made absolutely no difference. Perhaps I did something wrong, though not sure what could that be.



  • @mediamogul said in Hmm..Input Lag:

    The two hotkey combos are likely interfering with each other. Try using the 'k' key from a keyboard to advance forward.

    Finally I managed to test this in SNES emulator. The way I do is

    • Hotkey+p to pause the game
    • click Hotkey button + Joypad B + Keyboard k at same time periodically until jump happens

    In Super Mario World it happens at frame 3. So, at least this part is normal.
    But this is only one half of the story right? This just tests the emulators input lag. But there are other things going on too, the time button press is have to be registered and the video send to monitor and so on. I use USB iBuffalo gamepad, a HDMI to VGA converter on a pc monitor at 480p and have shaders on. It would be a wonder if there is no additional input lag somewhere. In gameplay, I do not recognize any input lag. But I want to be sure here. What would you recommend? It feels instantaneous, so its just for curiosity.

    I feel, I don't hijack this thread as it is on topic.


  • Global Moderator

    @thelostsoul said in Hmm..Input Lag:

    But there are other things going on too, the time button press is have to be registered and the video send to monitor and so on. I use USB iBuffalo gamepad, a HDMI to VGA converter on a pc monitor at 480p and have shaders on.

    Unfortunately , the run-ahead feature won't help with any of those situations, only the inherent latency that exists in the game's programing. For latency caused by LCD monitors, televisions, wireless controllers, streamcasting or even latency resulting from emulation itself, you'd need to employ other tactics, such as the one's listed here.

    What would you recommend? It feels instantaneous, so its just for curiosity.

    For me, the most important factors are always how comfortable the controls feel, how well they represent a game's original control scheme and are they noticeably working against me in any way. If everything feels fine, I say let sleeping dogs lie.



  • @thelostsoul said in Hmm..Input Lag:

    But this is only one half of the story right? This just tests the emulators input lag.

    I'm not so sure. If you press a button, and then see the action happen x frames later, then x is the entire lag. The lag-inducing things you describe have already happened.
    Seeing as you're using a CRT yours is already very low, I wouldn't worry about it.


  • Global Moderator

    As absolutely clever an idea as I think RetroArch's run-ahead is and as much as I love the results, I also believe it's been publicized a little confusingly. It's been stated that it will achieve latency below that of original hardware, and while that is entirely true, it's really only true for those using a CRT display and wired controllers. Any other setup can only leverage it as a means to reduce latency by however many frames a particular game happens to contain inherently. All other sources of latency still apply. A television's 'Game Mode' should still be active and wired controllers are still a good idea.



  • Maybe you are right, I should let the sleeping dog lie. But my curious nature can't do this and now I get involved (just a little bit, like a kid shouting to the dog from a distance).

    While some research, I found an App for the iOS, which should help analyzing the input lag.
    http://isitsnappy.com/
    Unfortunately I only own an Android device, so I can't use this app. But at least its capable of 240fps.

    I only use USB (plus a wireless keyboard) devices for input and so I can't test it with an LED. But... two of the input devices have an built in LED, my Arcade Stick and the wireless keyboard. Pressing a button with turbo mode on the Arcade stick will the LED light up. This should be instant with button pressing, right? And would be the results of the Arcade Stick comparable to the Classic Gamepad?



  • Ok, I did a quick unscientific test, like described above with video recording LED of Arcade Stick. I did test Donkey Kong for Mame2003 and got an input lag of 8 frames. Not 100% sure if this is correct, but sounds quite high to me. With the method pausing the emulation, holding the jump button down (in turbo mode) and counting the frames until jump happens is 4 frames. Does this sound correct to you?

    So, on my end for Donkey Kong on Mame2003, I have this:
    4 frames input lag for games own lag plus emulation with pause
    8 frames input lag for total hdmi to vga converter to monitor with video recording (including everything)

    So now, to find out the actual input lag in milliseconds, do I need to multiply 16.6 with the frame count? 4x16.6=66.4ms and 8x16.6=132,8ms? Is that correct?


  • Global Moderator

    @thelostsoul said in Hmm..Input Lag:

    holding the jump button down (in turbo mode) and counting the frames until jump happens is 4 frames. Does this sound correct to you?

    As long as you're not counting the first frame in which you actually see animation, it would be correct. Otherwise, it would be 3 frames.



  • I don't know what you mean by that. Why shouldn't I count the first frame of animation? Isn't that the start of it?
    Here is an animated GIF for the setup with video capture: https://makeagif.com/gif/input-lag-retropie-44-raspberry-pi-3-donkey-kong-mame2003-emNiU0
    (too big, can't upload it here)
    Is my calculation about the input lag in milliseconds correct?


  • Global Moderator

    @thelostsoul said in Hmm..Input Lag:

    I don't know what you mean by that. Why shouldn't I count the first frame of animation? Isn't that the start of it?

    What you're aiming to remove are only the inactive frames of animation, so that when you press a button, your character will react on the very next frame. If you include that first frame of action animation in your count and add it to the run-ahead frames, you'll effectively be deleting it from existence every time. This would not only create a problem in timing, similar to the latency that you're trying to get rid of, but it would also create visual artifacting.

    Edit:

    Is my calculation about the input lag in milliseconds correct?

    That looks right.



  • @mediamogul Ah ok, thank you for the explanation. I am not 100% if I understand the whole topic, so need to learn more about it. I wasn't trying to remove it, I only was curious about the current state of the normal emulators on my actual setup with the monitor (and adapter between it).
    So, your answer was in reference to the run-ahead feature, right?


  • Global Moderator

    @thelostsoul said in Hmm..Input Lag:

    I am not 100% if I understand the whole topic

    Ha! you know, it's me being the one off topic here. A handful of lag threads popped up in the last week or so and I had originally responded here with info on the run-ahead feature. However, I have since moved it to a more appropriate thread. Sorry for the confusion. Nonetheless, the one point still stands that when determining input lag, you're only looking for inactive frames. Once an action animation has begun, that first frame of activity is the game being aware of and responding to input.



  • @mediamogul Haha, no wonder, its a hot topic everyone talks about it. ;-) Can't blame for this.



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.