Skip navigation
NintendoAge
Welcome, Guest! Please Login or Join
Loading...

Measuring input response / lag / processing delays

Feb 8, 2014 at 12:28:29 AM
teh lurv (118)
avatar
< King Solomon >
Posts: 4915 - Joined: 07/17/2013
Massachusetts
Profile
Originally posted by: bunnyboy

240p isn't interlaced, or it would be 240i. The screen in the first display is 1080p, so both the HDMI (720p) and composite (240p) need to be upscaled. I would have assumed those would take similar time and the analog->digital conversion would be very fast, but apparently not!
Modern HDTVs no longer accept 240p signals. 240p over composite is incorrectly interpreted by HDTVs as 480i and it applies unnecessary deinterlacing to the image.



-------------------------
My son... gives me Helpful Nintendo Hints that are far too complex for the adult mind to comprehend. Here's a verbatim example: "OK, there's Ganon and miniature Ganon and there's these things like jelly beans and the miniature Ganon is more powerfuller, because when you touch him the flying eagles come down and the octopus shoots red rocks and the swamp takes longer." And the hell of it is, I know he's right. - Dave Barry


Edited: 02/08/2014 at 12:30 AM by teh lurv

Feb 8, 2014 at 12:47:35 AM
bunnyboy (81)
avatar
(Funktastic B) < Master Higgins >
Posts: 7704 - Joined: 02/28/2007
California
Profile
Originally posted by: JosephLeo

I'm assuming you've created a custom NES software to test the inputs easier, is there any chance that your software may also have some lag? I know some games have input lag, although I'm hard pressed for examples right now.
No custom software, just Balloon Fight.  I checked it in an emulator to make sure the response to the pause button happens on the next frame.  The measurements on the CRT show that too, otherwise it would be more like 30mS.

Originally posted by: teh lurv

Modern HDTVs no longer accept 240p signals. 240p over composite is incorrectly interpreted by HDTVs as 480i and it applies unnecessary deinterlacing to the image.
Good new for me then.  In that case I can guarantee my console will be an upgrade for everyone who uses something other than a CRT    Wonder if theres a Wii/PS3 game I could test with the same method...


Feb 8, 2014 at 2:46:19 AM
bunnyboy (81)
avatar
(Funktastic B) < Master Higgins >
Posts: 7704 - Joined: 02/28/2007
California
Profile
My biggest, newest, most expensive TV is also the slowest!  All the results are in the same ballpark, so analog is not slower in this case.  Game mode removes ~90mS of lag which is huge but the 60-70mS time is still slow.  Unfortunately these results don't help with the 240p -> 480i concept.  Looks like its doing about the same amount of processing on all inputs, independent of deinterlacing and upscaling.  At least my console isn't significantly worse than a real NES!

Sharp Aquos lc-60le640u 1080p time behind CRT
NES on CRT 14mS -
NES composite, game mode ON 60mS 2.8 frames
NES composite, game mode OFF 176mS 10 frames
HDMI NES 720p, game mode ON 66mS 3.2 frames
HDMI NES 720p, game mode OFF 150mS 8.5 frames
HDMI NES 720p, PC mode 146mS 8.2 frames
Nestopia HDMI 1080p, game mode ON 76mS 3.9 frames
Nestopia HDMI 1080p, game mode OFF 168mS 9.6 frames
Wii component 480p, game mode ON 70mS 3.5 frames
Wii component 480p, game mode OFF 172mS 9.9 frames




Feb 8, 2014 at 8:57:27 AM
teh lurv (118)
avatar
< King Solomon >
Posts: 4915 - Joined: 07/17/2013
Massachusetts
Profile
Originally posted by: bunnyboy

Originally posted by: teh lurv

Modern HDTVs no longer accept 240p signals. 240p over composite is incorrectly interpreted by HDTVs as 480i and it applies unnecessary deinterlacing to the image.
Good new for me then.  In that case I can guarantee my console will be an upgrade for everyone who uses something other than a CRT    Wonder if theres a Wii/PS3 game I could test with the same method...
 
Virtual Console on the Wii gives you the option IIRC to output in 240p. The PS3 is backward compatible with PS1 games like the PS2. I know on the PS2 running a PS1 game will cause the PS2 to output in 240p, I'm don't know if that's the case for the PS3 but its easy enough to try. In addition, if you have the correct model PS3, Ico is the only PS2 title that outputs in 240p.



-------------------------
My son... gives me Helpful Nintendo Hints that are far too complex for the adult mind to comprehend. Here's a verbatim example: "OK, there's Ganon and miniature Ganon and there's these things like jelly beans and the miniature Ganon is more powerfuller, because when you touch him the flying eagles come down and the octopus shoots red rocks and the swamp takes longer." And the hell of it is, I know he's right. - Dave Barry

Feb 8, 2014 at 9:19:48 AM
teh lurv (118)
avatar
< King Solomon >
Posts: 4915 - Joined: 07/17/2013
Massachusetts
Profile
Bunnyboy, try checking the settings on your Sharp Aquos and see if the 120hz refresh rate is turned on. The processing to create that fake refresh rate is probably what is increasing the input lag.

-------------------------
My son... gives me Helpful Nintendo Hints that are far too complex for the adult mind to comprehend. Here's a verbatim example: "OK, there's Ganon and miniature Ganon and there's these things like jelly beans and the miniature Ganon is more powerfuller, because when you touch him the flying eagles come down and the octopus shoots red rocks and the swamp takes longer." And the hell of it is, I know he's right. - Dave Barry

Feb 8, 2014 at 9:54:39 AM
nitro2k01 (0)

< Cherub >
Posts: 6 - Joined: 11/18/2008
Sweden
Profile
Originally posted by: bunnyboy

That was my original plan, but I couldn't find a light sensor that would work.  Did you ever get to that point?  I wonder how much the brightness matters for sensors like the bodnar.  I am ending the test when I see the first sign of the new graphics which still might be too dark for it to register.  That could mean a 5mS difference between my camera results and an optical sensor.
My plan is more lo-tech. An LDR (light-dependent resistor) in a bridge configuration, connected to a comparator. Then the comparator threshold is set to a suitable level. This would have to be decided manually by looking at the LDR response on an oscilloscope.

As for your camera, here's an idea: flip the camera 90 degrees and see if you're getting a diagonal transition pattern in each frame. Assuming the camera's frame rate is well above the screen's (which would be required for this to be useful at all) and that it has a rolling shutter, this means that for every line that the camera records, the screen will have drawn slightly more of the new frame. If you don't rotate the camera, the screen and camera will just meet at some scanline, and you will simply get a flat tear line per frame. In other words, rotating the camera gives you more information that yo can parse. Again, this assumes a high speed camera and rolling shutter.
Mine is already starting at the poll, but another LED on the button itself was the next step.  I think that is only significant for emulators where the hardware poll does not align with the NES game poll.  It would be awesome to measure a tetris player to see how much time they have between button press and button poll!
 
'cactly. This would mainly be interesting for emulators, where the processes are asynchronous. On a real NES with an ideal CRT everything is synchronous (aligned) and the controller lag (depending on when in a frame you happen to push the button) is predictable to 0-16.7 ms. Likewise, the screen draw takes 16.7 ms, which gives a total worst-case scenario of 33.4 ms (you just barely missed the poll, and you're looking for a change at the bottom of the screen) and a total best-case scenario of nearly 0 ms, (where you exactly hit the poll, and also are looking for an change near the top of the screen.) This is also assuming that the game is processing the input data for the same frame as it was polled.

The less interesting scenario in the case of an emulator or digital TV setup, is where every step is introducing latency, so that the worst case is always worse than a CRT. The more interesting case is a theoretical emulator setup where all parts are specially made as an integrated system, and the screen redraw is approaching 0 ms, (say something like an OLED screen where you can push data extremely quickly to the screen, and also make the pixels react quickly)  and where you have a deadline type emulation which waits to the absolute end of the framebefore processing the input. So, you would still process events at 60 Hz, but all processing would be done in one burst. The input would be read in the last possible moment, then processed (one frame is emulated, and rendered) and then blitted in a time approaching 0 ms. With this theoretical setup, you will actually beat the NES/CRT setup, because the absolute worst-case input-output time is now approaching 16.7 ms. All of this is arguably beyond the human threshold of reaction, but it's an interesting theoretical discussion.
I am already picking a consistent point on screen, so that shouldn't make a difference other than a constant add or subtract from the final number.  The lcd/plasma panel won't be able to draw any sooner simply because the NES/emulator won't have output the video data yet.

I think displaylag.com had more info about how they average top/bottom/middle to account for different drawing routines but I'm not sure that is significant enough to care about. 
Well yeah, this is speculative on my part, and would only affect digital monitors (whether driven by HDMI or composite.) An ideal CRT already offers the lowest possible latency and of course can't draw data before it gets it. But a digital LCD TV could for example do something weird like buffer the stream into a framebuffer and then draw it as fast as the panel can be driven, say 8 ms for the sake of argument. The point here is more one of curiosity and creating a rig that is as generic as possible, so it would be able to detect this property in a monitor. If I would choose just one pointon the screen, it would be near the bottom.
I don't think LPT port is low latency enough, there are just too many layers of software and hardware in the way.   Not sure of anything else that would be faster without some extreme hardware tho.  Are there any USB 3.0 keyboards to use the num lock light?  
I would have to speculatively disagree. There's no reason why a USB 3.0 keyboard would do any better, assuming that the status LEDs are just updated at the time of polling the keyboard. Windows polls the keyboard at a rate of 125 Hz. I'm guessing this value was chosen to guarantee two polls per frame @60 Hz, while keeping power consumption down by allowing the CPU to potentially halt completely for as long periods as possible when idle, assuming nothing else interrupts the CPU. By increasing the poll rate to 1000 Hz, (the maximum possible as per the USB standard, at least USB1 and USB2, haven't read the USB3 spec) you should be able to get the latency of this event down to approaching 1 ms.

But I don't see why LPT port communication would have to slow, if you make a special driver which allows direct IO port access. Yes, the call would have to bubble down to ring 0, but this is done for all hardware calls, and with a proper driver this should be a fast lightweight operation. (Never mind the added hassle of making such a driver, implementing support for it in emulators and bypassing the driver signature enforcement.) The only real issue I might see is if the LPC bus (which the LPT port probably sits on on any modern computer) somehow adds lag. But that could be measured and remains to be seen.

-------------------------
Blog


Edited: 02/08/2014 at 10:03 AM by nitro2k01

Feb 8, 2014 at 11:16:52 AM
cradelit (21)
avatar
(crade lit) < Bowser >
Posts: 5673 - Joined: 08/18/2009
Alberta
Profile
Originally posted by: bunnyboy

Originally posted by: cradelit

My TV is a panasonic CT34WX15N..  It doesn't do full 1080p though only 1080i and 720p, which apparently isn't the right format. but I assume there are others that do 1080p?
Like all HDMI CRTs I have seen, it doesn't do 720p.  Either 1080i or 480p only.  Should be much less lag because it is only doing digital->analog conversion instead of any kind of processing or upscaling.  At most it would have a couple scanline buffer to do the pixel doubling on 480p.
Ya sorry, it's 1080i, 480i or 480p, I got em mixed up, but I know It doesn't do the one you want anyway  I remember it had more options in the menu too, I thought it might have some sort of upscaling option for 720 since I could swear I remembered seeing 720 something in the options but the remotes busted so right now it's 480p only regardless.



-------------------------
GRRR!

Feb 8, 2014 at 11:57:46 AM
KHAN Games (89)
avatar
(Kevin Hanley) < Master Higgins >
Posts: 8126 - Joined: 06/21/2007
Florida
Profile
The purpose of his test is to point out the difference between emulation based hardware and his HDMI NES. As he's said, he can't make "a special ROM" because emulation based hardware, like the Retron, won't play anything "special."

-------------------------

gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin


Feb 8, 2014 at 1:04:00 PM
Tanooki (185)
avatar
(The Wind Waker) < Bonk >
Posts: 17067 - Joined: 08/27/2010
Kentucky
Profile
Originally posted by: teh lurv

Bunnyboy, try checking the settings on your Sharp Aquos and see if the 120hz refresh rate is turned on. The processing to create that fake refresh rate is probably what is increasing the input lag.

It does since it has to take that signal from the system and then reprocess it up to 120hz from 60 which adds delay.  My 46" LED Samsung has the same problem making pre-GC/PS2 era systems lag like hell bad enough they're unplayable.  It's why I brought up my 60hz Panasonic I have my old systems on because the lag is inperceptable on it so you can play great.

Feb 8, 2014 at 2:24:51 PM
bunnyboy (81)
avatar
(Funktastic B) < Master Higgins >
Posts: 7704 - Joined: 02/28/2007
California
Profile
Originally posted by: nitro2k01

As for your camera, here's an idea: flip the camera 90 degrees and see if you're getting a diagonal transition pattern in each frame. Assuming the camera's frame rate is well above the screen's (which would be required for this to be useful at all) and that it has a rolling shutter, this means that for every line that the camera records, the screen will have drawn slightly more of the new frame. If you don't rotate the camera, the screen and camera will just meet at some scanline, and you will simply get a flat tear line per frame. In other words, rotating the camera gives you more information that yo can parse. Again, this assumes a high speed camera and rolling shutter.
The camera is running at 480fps or 1000fps, so I am getting 10-20 NES scanlines per camera frame.  I can see the electron beam wiping down or the backlight flickering    +/- 4mS is easily close enough accuracy for my ideas.

Originally posted by: nitro2k01

With this theoretical setup, you will actually beat the NES/CRT setup, because the absolute worst-case input-output time is now approaching 16.7 ms. All of this is arguably beyond the human threshold of reaction, but it's an interesting theoretical discussion.
I haven't checked things like laptop screen interfaces, but with any common external screen (vga/dvi/hdmi) you will never beat the CRT because you are still waiting for the pixels to be output in crt order.  Would have to wait for the next gen HDMI or DisplayPort which has compression or partial frame updates.

Originally posted by: teh lurv

Virtual Console on the Wii gives you the option IIRC to output in 240p. 
Turned this on, TV still said 480i (which is expected if 240p is not supported) and the time was around the same as 480p.  Might make a difference on another TV but they are physically very far apart.

Originally posted by: teh lurv

Bunnyboy, try checking the settings on your Sharp Aquos and see if the 120hz refresh rate is turned on. The processing to create that fake refresh rate is probably what is increasing the input lag.
"Motion enhancement" is already off in game mode, that is the closest thing I have found.  Could be some other setting but it would be very hidden.  I think the TV just sucks  

Feb 8, 2014 at 3:29:15 PM
renderling (7)
avatar
< Little Mac >
Posts: 98 - Joined: 01/21/2014
New York
Profile
What camera are you using for these tests?

-------------------------
Now Playing: Mega Man X
Twitter | Bitbucket | GitHub

Feb 8, 2014 at 3:36:09 PM
bunnyboy (81)
avatar
(Funktastic B) < Master Higgins >
Posts: 7704 - Joined: 02/28/2007
California
Profile
Casio Exilim ZR100 mostly in 480fps mode.  1000fps would be more accurate but it is harder to get enough light.

Feb 8, 2014 at 4:41:53 PM
nitro2k01 (0)

< Cherub >
Posts: 6 - Joined: 11/18/2008
Sweden
Profile
Originally posted by: bunnyboy

I haven't checked things like laptop screen interfaces, but with any common external screen (vga/dvi/hdmi) you will never beat the CRT because you are still waiting for the pixels to be output in crt order.  Would have to wait for the next gen HDMI or DisplayPort which has compression or partial frame updates.
Yes, absolutely. Just to be clear, what I had in mind was a theoretical device which doesn't exist where the processing unit is tightly coupled with the display, and the display has the ability to receive and draw data very quickly. If you could dream up anything, this could be a 240 Hz or faster CRT, or some form of LED pixel device.

-------------------------
Blog