MAMEWorld >> EmuChat
Index   Flat Mode Flat  

Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM
Re: Input lag
04/23/13 09:08 AM


OK I realize this doesn't exactly address your situation because we're on such different hardware and have different purposes, but still it might be interesting just to track the data.

I wrote a very small program that tries to detect a keypress and update a window as quickly as possible in response. It can be run:

- In full screen or window
- With double-buffering disabled or enabled
- If double-buffering is enabled, with lock-to-vsync enabled or disabled
- If lock-to-vsync is enabled, with adaptive vsync enabled or disabled

Right now I just have an X11 version (for Linux), I haven't written the OS X version yet and I certainly haven't written the Windows version yet (Windows programming, ewww).

Anyway, whereas before I wrote that SDLmame appeared to have a 7 frame latency on my desktop Linux system, using my simple latency tester program got much better results. I was able to achieve a 1 - 3 frame latency. There are a few specific details:

- I notice that my caps lock LED takes more than 1 frame to fully illuminate (between 1 and 3 frames, typically 2). I start my latency count at the first visible illumination level (i.e. as soon as there is any illumination of the caps lock key, even if it's not completely illuminated yet)

- I notice that my ancient DELL LCD display (it's an old - circa 2008 or so - IPS or PVS or something) seems to take a few frames to fully ramp into a change. My program just alternates clearing the window to full black or full red in response to a key press, and when going from black to red, for example, it takes typically about 3 frames to go from a just barely pink version all the way to the full red version. So I see something like
- Caps lock light starts to illuminate
- Nothing for 1 - 2 frames
- Window goes pink for 1 frame
- Window goes redder for 1 frame
- Window goes fully red

- I also notice that when going from caps lock on to caps lock off, the window updates exactly at the same time as the caps lock LED turns off, and sometimes even before it does. I have no idea what is going on here - is it possible that the keyboard doesn't turn off the caps lock light until the operating system has already serviced the key press and then tells the keyboard to turn the light off? Not sure.

- On this particular Linux system, the crummy OpenGL drivers on this system don't support enabling or disabling swap-on-vsync ("vsync") or adaptive vsync, so I couldn't test those at all. I found that if my settings were double-buffering windowed or full-screen, or single-buffered full-screen, my program was limited to updating the screen at the display refresh rate (60 Hz). Only if my program were single-buffered in a window was it not locked to the screen refresh rate. At no point did I witness tearing.

Anyway, I am not sure how to explain the 1 - 2 frames between caps lock LED illumination and screen update. Is it input latency in the monitor? Latency in the keyboard driver? Latency in the OpenGL implementation? All three? Not sure, but I suspect that it's monitor input latency, not surprising on a pretty old DELL LCD monitor ...







Entire thread
Subject Posted by Posted on
* Input lag DaRayu 04/07/13 11:47 AM
. * Hey, this thread looks like it spawned a decent conversation.... italieAdministrator  04/27/13 08:19 PM
. * Re: Input lag jumpmaniac81  04/07/13 04:12 PM
. * Re: Input lag DaRayu  04/07/13 11:19 PM
. * Re: Input lag DaRayu  04/10/13 11:17 PM
. * Re: Input lag DaRayu  04/11/13 10:57 PM
. * Re: Input lag AWJ  04/11/13 11:44 PM
. * Re: Input lag DaRayu  04/11/13 11:47 PM
. * Re: Input lag B2K24  04/12/13 01:56 AM
. * Re: Input lag DaRayu  04/13/13 02:10 PM
. * Re: Input lag R. Belmont  04/13/13 10:08 PM
. * Re: Input lag DaRayu  04/14/13 05:36 PM
. * Re: Input lag SmitdoggAdministrator  04/14/13 05:50 PM
. * Re: Input lag DaRayu  04/14/13 11:18 PM
. * Re: Input lag Bryan Ischo  04/22/13 06:23 PM
. * Re: Input lag DaRayu  04/22/13 10:51 PM
. * Re: Input lag Bryan Ischo  04/23/13 09:08 AM
. * Re: Input lag Bryan Ischo  04/24/13 10:04 PM
. * Re: Input lag Bryan Ischo  04/23/13 02:01 AM
. * Re: Input lag Anonymous  04/23/13 12:37 AM
. * Re: Input lag R. Belmont  04/15/13 06:27 PM
. * Re: Input lag DaRayu  04/15/13 10:30 PM
. * Microstutter; ATi's dark little secret. Firehawke  04/16/13 05:00 AM
. * Re: Microstutter; ATi's dark little secret. StilettoAdministrator  04/16/13 05:44 AM
. * Flip Queue Size Calamity  04/17/13 01:50 PM
. * Re: Flip Queue Size R. Belmont  04/17/13 02:48 PM
. * Re: Flip Queue Size Calamity  04/17/13 04:01 PM
. * Re: Flip Queue Size R. Belmont  04/17/13 05:41 PM
. * Re: Flip Queue Size DaRayu  04/18/13 12:32 AM
. * Re: Flip Queue Size grog  04/18/13 11:38 AM
. * Re: Flip Queue Size DaRayu  04/18/13 12:52 PM
. * Re: Flip Queue Size grog  04/18/13 01:27 PM
. * Re: Flip Queue Size DaRayu  04/18/13 02:28 PM
. * Re: Flip Queue Size grog  04/18/13 06:21 PM
. * Re: Flip Queue Size R. Belmont  04/19/13 04:21 AM
. * Re: Flip Queue Size DaRayu  04/19/13 08:38 AM
. * Re: Flip Queue Size Calamity  04/19/13 11:07 AM
. * Re: Flip Queue Size DaRayu  04/19/13 11:53 AM
. * Re: Flip Queue Size Calamity  04/19/13 08:04 PM
. * Re: Flip Queue Size DaRayu  04/20/13 01:59 PM
. * Re: Flip Queue Size Calamity  04/20/13 11:24 PM
. * Re: Flip Queue Size DaRayu  04/21/13 11:51 AM
. * Re: Flip Queue Size Calamity  04/21/13 03:45 PM
. * Re: Flip Queue Size DaRayu  04/21/13 06:54 PM
. * Re: Flip Queue Size Calamity  04/24/13 12:06 AM
. * Re: Flip Queue Size DaRayu  04/24/13 04:27 PM
. * Re: Flip Queue Size Bryan Ischo  04/24/13 10:27 PM
. * Re: Flip Queue Size SmitdoggAdministrator  04/25/13 06:35 PM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 06:45 PM
. * Re: Flip Queue Size Sune  04/25/13 12:35 AM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 12:51 AM
. * Re: Flip Queue Size Anonymous  04/25/13 03:28 PM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 06:07 PM
. * Re: Flip Queue Size Vas Crabb  04/26/13 03:35 AM
. * Re: Flip Queue Size Bryan Ischo  04/26/13 06:03 PM
. * Re: Flip Queue Size Vas Crabb  04/27/13 02:02 AM
. * Re: Flip Queue Size DaRayu  04/25/13 11:45 PM
. * Re: Flip Queue Size Anonymous  04/25/13 07:58 PM
. * Re: Flip Queue Size SmitdoggAdministrator  04/25/13 06:39 PM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 06:47 PM
. * Re: Flip Queue Size casm  04/25/13 09:13 PM
. * Re: Flip Queue Size Sune  04/25/13 01:14 AM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 01:35 AM
. * Re: Flip Queue Size DaRayu  04/25/13 12:42 PM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 06:10 PM
. * Re: Flip Queue Size StilettoAdministrator  04/25/13 03:19 AM
. * Re: Flip Queue Size Bryan Ischo  04/25/13 05:31 AM
. * Re: Flip Queue Size StilettoAdministrator  04/25/13 06:12 AM
. * Re: Flip Queue Size Anonymous  04/24/13 08:51 PM
. * Re: Flip Queue Size DaRayu  04/24/13 09:52 PM
. * Re: Flip Queue Size Sune  04/25/13 12:44 AM
. * Re: Flip Queue Size GatKong  04/23/13 08:04 PM
. * Re: Flip Queue Size DaRayu  04/19/13 08:09 PM
. * Re: Flip Queue Size grog  04/19/13 09:24 PM
. * Re: Flip Queue Size DaRayu  04/19/13 10:13 PM
. * Re: Flip Queue Size R. Belmont  04/19/13 04:44 PM
. * Re: Microstutter; ATi's dark little secret. R. Belmont  04/16/13 05:07 PM
. * Re: Microstutter; ATi's dark little secret. Anonymous  04/16/13 10:59 AM
. * Re: Input lag Anonymous  04/15/13 10:54 PM
. * Re: Input lag R. Belmont  04/16/13 05:03 PM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 102 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 9170