0

Lag meter [Noob question]
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Lag meter [Noob question]

by mrrmay on Sun Mar 28, 2021 7:07 pm

So I'd like to measure the lag between a button press and a change on my computer display.

I was thinking/hoping to build this:

[OLED display w/Qt] > [light sensor w/QT] > [Qt Py] > [My Computer]

I press a button on the OLED display, QtPy registers the time and sends key stroke to computer, computer displays bright square, light sensor detects bright square on computer monitor, QtPy registers event time and prints lag time on OLED.

Eventually I'd like the QtPy to calculate the mean lag of recent measurements.

Is this feasible?

mrrmay
 
Posts: 8
Joined: Sun Mar 28, 2021 11:51 am

Re: Lag meter [Noob question]

by adafruit_support_mike on Mon Mar 29, 2021 9:18 pm

Yeah, that should work.

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: Lag meter [Noob question]

by mrrmay on Tue Mar 30, 2021 3:10 pm

Thank you!

FWIW, I really appreciated your discussion with @seasidemotors about workflow. I really needed a solid general overview like that.

mrrmay
 
Posts: 8
Joined: Sun Mar 28, 2021 11:51 am

Re: Lag meter [Noob question]

by kevinjwalters on Tue Mar 30, 2021 5:05 pm

You've probably already read about this but a subset of the gaming community is interested in this sort of thing. They seem to often use modified mice which illuminate external LEDs on a button press. High fps video is used to capture the action and then I presume the measurement is normally manual. You can see one example of this in https://forums.blurbusters.com/viewtopic.php?t=172

Dan Luu also has some very thorough testing and analysis on https://danluu.com/, search for latency.

kevinjwalters
 
Posts: 962
Joined: Sun Oct 01, 2017 3:15 pm

Re: Lag meter [Noob question]

by mrrmay on Tue Mar 30, 2021 8:22 pm

Thanks! I hadn't seen those specific pages. The Dan Luu page is fascinating. I'd seen references to the video technique, using the LED's reflection is ingenious.

So, now I've got some digging to do. How often does the QtPy poll inputs? Does the light sensor have it's own poll rate? Do these rates allow for accurate measurements in nanoseconds?

Those are interesting questions indeed.

mrrmay
 
Posts: 8
Joined: Sun Mar 28, 2021 11:51 am

Re: Lag meter [Noob question]

by adafruit_support_mike on Wed Mar 31, 2021 12:07 am

mrrmay wrote:FWIW, I really appreciated your discussion with @seasidemotors about workflow. I really needed a solid general overview like that.

Thank you.

I'm an acute victim of the Einstein/Feynman principle "if you can't explain something to a beginner using everyday language, you don't understand it yourself," and the forums give me a steady supply of beginners who want to know stuff. ;-)

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.