flood's input lag measurements

Everything about latency. Tips, testing methods, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
Sparky
Posts: 682
Joined: 15 Jan 2014, 02:29

Re: flood's input lag measurements

Post by Sparky » 01 Dec 2016, 17:31

Chief Blur Buster wrote:Hello flood,

Which microcontroller are you using at the moment?

I've been testing several microcontrollers. Older Arduino has an average of 4.1ms USB lag, while some newer microcontrollers have only 0.19ms USB lag, assuming a microcontroller that supports USB buffer flushing. (Directly plugged into a USB3 port). I am trying to find the cheapest microcontroller capable of <0.20ms USB lag for some experiments.
I think you're looking for any microcontroller that supports USB 2.0 high speed. That will let you use 125µs polling with interrupt transfers.

I think flood is still using the teensy 2.0 with the ATMEGA 32u4. It doesn't support high speed(we're stuck with 1ms polling), but we do know when the interrupt happens, so we can start measuring from that.

Edit: you can also get a bridge chip to use with whatever microcontroller you're already using: http://www.digikey.com/product-detail/e ... ND/2614628

flood
Posts: 929
Joined: 21 Dec 2013, 01:25

Re: flood's input lag measurements

Post by flood » 01 Dec 2016, 21:37

yes teensy 2.0 which has an atmega32u4

polling shouldn't matter for this; my measurements start from the time of usb transmission

also if your mobo has a usb3 controller and you use windows8/10, sweetlow's driver allows 8khz polling even for low speed devices

but again it doesn't (or at least shouldn't) matter

flood
Posts: 929
Joined: 21 Dec 2013, 01:25

Re: flood's input lag measurements

Post by flood » 01 Dec 2016, 21:42

spacediver wrote: Perhaps you could expand the circuit to include a component that directly measures the voltage coming off the photodiode, stores that information, and then you can write code that finds the timestamp that peak voltage occurs, and then you can subtract the ~8us from that timestamp to find the actual time that the line started drawing.
measuring voltage requires analog-to-digital conversion and probably i'd need a faster chip to read an adc at >1MHz
it's unnecessarily complicated for minimal improvement
spacediver wrote:
flood wrote:from my camera pictures, it does seem the lines always start from the left (for the gtx460 at least.)
neat
example:
https://i.sli.mg/ennJfS.jpg

spacediver
Posts: 505
Joined: 18 Dec 2013, 23:51

Re: flood's input lag measurements

Post by spacediver » 01 Dec 2016, 21:52

flood wrote: measuring voltage requires analog-to-digital conversion and probably i'd need a faster chip to read an adc at >1MHz
it's unnecessarily complicated for minimal improvement
Fair enough :)

At the very least, you could measure the average time it takes for diode to reach its threshold voltage, by looking at some oscilloscope plots, and then subtract that mean from all your results. I know, it's a handful of microseconds, but it'll make your results that much more accurate :p

Nice, and I'm assuming that the video card behaves similarly (hsync'd) when rendering a full field (which is a series of lines) as does instructing it to only render one line.

flood
Posts: 929
Joined: 21 Dec 2013, 01:25

Re: flood's input lag measurements

Post by flood » 01 Dec 2016, 21:55

well yea, i assume the part where it buffers a line before writing to the ramdac is independent of the actual thing rendered

flood
Posts: 929
Joined: 21 Dec 2013, 01:25

Re: flood's input lag measurements

Post by flood » 01 Dec 2016, 22:13

flood wrote:polling shouldn't matter for this; my measurements start from the time of usb transmission
yellow trace is a pin for debug. i output a pulse whenever the firmware detects that a transmission has finished (by polling TXINI bit of register UEINTX). i start the timer for the lag-measuring firmware the same way.

blue trace is the voltage of the actual usb D+ wire

Image

as you can see, there is about 2us delay between where the usb transmission finishes and when the firmware detects completion of a transmission
spacediver wrote:
At the very least, you could measure the average time it takes for diode to reach its threshold voltage, by looking at some oscilloscope plots, and then subtract that mean from all your results. I know, it's a handful of microseconds, but it'll make your results that much more accurate :p
well those few us cancel out with the 2us above :P

spacediver
Posts: 505
Joined: 18 Dec 2013, 23:51

Re: flood's input lag measurements

Post by spacediver » 01 Dec 2016, 23:02

flood wrote: well those few us cancel out with the 2us above :P
god is on your side :)

User avatar
lexlazootin
Posts: 1251
Joined: 16 Dec 2014, 02:57

Re: flood's input lag measurements

Post by lexlazootin » 02 Dec 2016, 03:50

Sorry to derail what you guys have going.

If i were to buy the components of the Arduino or Teensy setup i would be able to test latency on my setup with a LCD monitor in any game that would go black to white in a click with relative ease? I'm not very happy with my camera setup :\

flood
Posts: 929
Joined: 21 Dec 2013, 01:25

Re: flood's input lag measurements

Post by flood » 02 Dec 2016, 12:38

it wouldn't be as accurate as for a crt, but yes.
i should have some time this weekend to try

btw last time i never got around to using your black/white test map for csgo :P hopefully i'll give it a try this time

Sparky
Posts: 682
Joined: 15 Jan 2014, 02:29

Re: flood's input lag measurements

Post by Sparky » 02 Dec 2016, 13:47

lexlazootin wrote:Sorry to derail what you guys have going.

If i were to buy the components of the Arduino or Teensy setup i would be able to test latency on my setup with a LCD monitor in any game that would go black to white in a click with relative ease? I'm not very happy with my camera setup :\
Yes, though that dark to light transition is generally easier to get with a mouse movement instead of a mouse click. You'll also have a few to many ms of lag caused by the monitor.

Post Reply