Page 1 of 1
Input Lag
Posted: Mon Dec 31, 2007 8:01 pm
by LordGaz
Anyone else noticing some extra keyboard input lag in the more recent versions of MAME?
Not all games but most games are responding to keys 2 or 3 frames too late which makes new high score attempts a bit tricky.
Marble Madness has once again become a bit silly too, the inertia of the trackball simulation seems to have been increased or perhaps it's just a consequence of the input lag.
Cheers all, Gaz.
Posted: Mon Dec 31, 2007 9:01 pm
by Chad
which versions, which controlers? mame122 seems fine to me, i screw up where i always screw up (not due to input lag but due to bad reflexes :)
Posted: Mon Dec 31, 2007 9:21 pm
by LordGaz
It's keyboard lag.
I've noticed it in every MAME since the K6 tourney including 122 and not just on my machine. Could just be that I'm sensitive to it, even 1 frame of lag is noticeable.
Posted: Mon Dec 31, 2007 10:23 pm
by mahlemiut
I can tell you that the input data is readable by the game at the right time. I tested this using the MAME debugger, and testing SSF2T (CPS-2). Opening the memory window and going to 0x804000, which is the input port for most of the standard JAMMA controls, reads 0xFFFF. The ports are active low, so this correct when nothing is pressed. Exiting the debugger, and going to the game's input test, shows there is about a 2 frame lag between the key being pressed, and the relevant input being displayed on-screen as active (use shift-P to advance a frame).
Now, doing the same, but activating the debugger after the first frame advance, and looking at location 0x804000 again, will show that this input change is indeed visible to the game. For example, if you hold 1P button 2, location 0x804000 will read 0xFFDF. Bit 5 is active (ie: 0). This suggests that it is not input lag, but possibly video lag.
Of course, that makes no sense if different drivers produce different lag...
I've tested D3D, DDraw and GDI, and they all produce the same lag for the same game.
Posted: Mon Dec 31, 2007 10:27 pm
by Alessandro.S
I wouldn't be able to tell. Moving from Fedora7 / xwolfmame 104 to Fedora8 / SDLmame 118 and later due to the fact that PulseAudio conflicts with the xwolf104 build (sound begins to play, then it crackles, then it goes off) I basically play with very different MAMEs.
I have though AUDIO lag in Fedora8 - playing frogger is much more difficult since I hear the jump sounds probably close to 1/10 of a second later than the jump itself; to the point that it's better to reboot in Fedora7 and play with xwolf104

That's anyway an issue with my setup.
Though, while I'm still improving my Galaxian scores, at times I don't know if it's me pressing the fire button at the wrong time or if it's the fire button that isn't very responsive. It's probably me - but after reading Lord Gaz's post, hmm...
Posted: Mon Dec 31, 2007 10:39 pm
by mahlemiut
KDE often causes annoying audio lag in a number of applications when it has sound enabled.

Posted: Tue Jan 01, 2008 10:38 am
by BBH
I've been meaning to post about input lag for a while but I keep forgetting...
Basically, pretty much all versions of MAME have some form of input lag. The weird thing is that it depends a lot on the driver, so there are different results from game to game.
But the other thing is that a lot of games ended up having extra frames of lag after 0.100.
For instance, if you run Super Street Fighter II Turbo on wolf99, go into the input test and pause to advance frame-by-frame when you press a button, there's 1 extra frame of input lag before the button lights up. If you try it in 0.100 or any version after, there's 2 frames of lag.
For Psikyo SH2 games like Strikers 1945 II, there's 2 frames of lag in 0.99 already. In newer versions, it's 3 frames.
Most people can't tell when there's 1 or 2 frames of input lag, and it probably doesn't have that major of an effect on things. But, it could make a difference on an intense game where reflexes are key. It's for this reason that in the future I'm sticking with wolf99 for any game that's emulated correctly by it.
I also honestly believe that K7 and any other future tournaments should give players the choice to use wolf99 if they want to use a version with less input lag.
Posted: Mon Jan 07, 2008 6:58 am
by The TJT
1 or 2 frames of input lag shouldn't make much difference. It's only around 1,7-3,3 hundredth of a second.
Posted: Mon Jan 07, 2008 7:20 am
by mahlemiut
It's 16.667ms for 1 frame of a 60Hz game.
Posted: Mon Jan 07, 2008 7:21 am
by The TJT
mahlemiut wrote:It's 16.667ms for 1 frame of a 60Hz game.
Yeah, that's what I said didn't I...

Posted: Mon Jan 07, 2008 7:29 am
by mahlemiut
Just clarifying. Dumb people might get confused with commas used as decimal points.

Re: Input Lag
Posted: Thu Mar 20, 2008 2:19 am
by BBH
As of MAME 0.123u5, extra input lag is gone so any frame delays in games should be comparable to MAME 0.99 and prior. This is a good thing, obviously.