Introducing the piLagTesterPRO - a complete input lag testing kit for your Raspberry Pi

The piLagTesterPRO measures input lag (the delay between signal being sent to your display and being able to see it) using a high-temporal resolution brightness sensor. In contrast to my previous input lag device that used a pi zero + a high speed camera, this is a complete package you plug into to your Raspberry Pi.

UPDATE: order the piLagTesterPRO here. 

Because it runs on the Pi, it's possible to display what's being sampled in real time, which at the very least is interesting to look at, but can also help diagnose what's going on as you change display settings or if you get unexpected variance in the lag reported. Here's a live photo of it in use:



The sideways graph in the center is the brightness recorded with the sensor, time locked to when the white probe rectangles were displayed on the right side of the screen (the top one is cut off by the sensor itself). The sawtooth shape throughout is caused by the display back-light being pulsed, and yes it complicates measuring lag. What we are interested in is the peaks of that sawtooth over time. 

If your color sensitivity is excellent you might be able to see that the graph is color coded:
  • the white region at the top is what happened after the probe signal was sent over the video cable, but before the display responded.
  • the start of the red region is where the piLagTesterPRO detected that the display has started to respond to the new input. I call this the "1st response". This is what is typically reported as input lag.
  • the end of the red region and the start of the final, yellow region is when the display has finished responding to the probe. I call this the "full response". This is typically reported as response time - note here it is black to white response time, which is not the same as gray-2-gray which manufacturers report, but the idea is similar.
Determining the 1st response and full response is a somewhat tricky affair if your monitor's brightness drifts over time (many/all do). To this end the program can average over as many trials as you wish. 

The other nice thing about running on a Pi is it's possible to save all the data collected for later analysis. Here's an example of the pretty plots one can make using octave:  


The horizontal lines show the maximum brightness before the probe is shown, and after. The x and the o are the automatically extracted 1st and full responses. These are set when the measured brightness has gone 5% and 80% of the way to the maximum brightness post-probe. You'll notice that it takes a really long time to reach 100% - over 150ms in this example. This is why I use the 80% point instead. The human visual system tends to respond to the log of brightness anyway, so the difference between 80% and 100% is not that salient. 

In the octave code I've written you can click where you think the 1st response should be and compare that average to the automatically extracted one if you wish. 

At the moment there's no photo of the device - because it's a pile of wires on my workbench. I'm not really sure where to go from here in that regard - building a nice box is really beyond my means and interest. I think I could put together a kit of parts already connected/soldered so that all you would have to do is plug it in to the GPIO header on your Pi, but it would still have a DIY ethos and appearance. 

I'd be curious to hear how interested people would be in owning one of these kits to add to their raspberry pi, and how important it be that it look like a professional project.

Update: here's some input lag data collected with the piInputLagPRO. Some interesting results already, like an TV that scans-out at faster than the display refresh rate.

Publicly available hardware is available now for $40, so if you are interested in getting one use the email option below to contact me. 

Comments

LevelRage said…
I've got some commercial grade TVs from Samsung (400ux-2 & 400ux-3) which I'd like some accurate lag testing done on. I've tried the Time Sleuth but the protective coating or anti-glare coat on the TVs prevents the Time Sleuth from taking an accurate reading. (It reads at <6ms but a slow motion test using 240p testsuite show closer to 20-40ms.)

Do you think the sensor you are using on the piLagTesterPRO may be able to take a good reading on these displays?

What resolutions and video outs will you be supporting?
Alan Robinson said…
The time sleuth uses a fixed threshold which is probably why you can't get a reading; it's probably picking up the backlight flicker (disclaimer: that's just a guess). The piLagTesterPro would not have that problem.

I'm limited to the output resolution of the pi itself. The list is huge for the pi 4 but I haven't tested anything beyond the standard resolutions on my pi zero.

https://www.raspberrypi.org/documentation/configuration/config-txt/video.md
LevelRage said…
I'm certainly very interested in testing it then! Do you have working proto-types? Need a beta tester?

I'm mostly interested in understanding how well these displays will work with retro gaming gear. So 240p 480i 480p etc. Preferably using rgbs or rgbhv.
Fisher said…
Hi Alan, I've got a couple ultrawide (3840x1600) displays I was trying to measure input latency on and was hoping to find a solution using RPi (I have a RPi 4) as the couple commercial testers I've found appear to only support standard TV resolutions (1080p, 4K). Would this solution work for that do you think? What would be the next steps here if that was possible?
Fisher said…
I should rephrase, I'm trying to measure display latency, which is what it appears you measure here correct? The latency introduced by the display itself
Alan Robinson said…
unknown: yes I have a prototype. My plan is to start taking orders very soon. The pi offically supports 240p though I've never tested it myself to see. 480p/i is definitely supported and tested working great currently.

Fisher: have you been able to drive the 3840x1600 at native resolution with the pi? My device/kit depends on the pi to drive the display so that's the limiting factor.
Fisher said…
Yes, I am able to drive the display at 3840x1600 @ 60fps with a RPi4
Alan Robinson said…
Fisher: then it should be no problem. I'm currently waiting for parts to be delivered before I can have the first batch to ship out.
Fisher said…
Great to hear! Can't wait to try it out. I did want to note that I have been unable to run the original PiLagTester software on a RPi4 so far, from what I can tell it has something to do with a change in OpenGL ES and just reports "Failed to add service" when trying to run. Not sure if that will still be an issue in the piLagTesterPro software.
Alan Robinson said…
fisher: the non-pro version will need some tweaks to work with the Pi4. The PRO version has no problems. But it might be a difference cause than the Pi4 - I wouldn't expect that error message that you report. Any chance you could take a video or photo of the actual error you get?
LevelRage said…
I'm pretty stoked to try this out! As I haven't done too much with the Pi in the past can you tell me what would be required? Also I'd like to try and test with analog out if it is possible. RetroRGB has a pretty good write up on different analog solutions. A few of them use the GPIO header so I'm curious if those would get in the way. Also curious if you forsee any issues using an analog output instead of the hdmi.

As for professional packaging, that isn't a priority for me. I'm quite familiar with electronics and the rats nest that a workbench becomes.
Alan Robinson said…
Thanks for your interest. I've only done HDMI output on the pi. There is a non-hat solution which allows composite output using some dedicated pins separate from GPIO, the details of which depend on the pi. That should work just fine with my equipment. The various analog hats for the pi discussed on retroRGB might work but I'd bet not; it would depend entirely on where the hat sits and what GPIO resources it uses.

the best bet would be a hdmi to analog converter, some of which are zero added lag (I believe retroRGB links to at least one).

Perhaps if you could explain what you are trying to do I might be able to give more assistance.
LevelRage said…
Fair enough! I mentioned earlier that I have some Samsung commercial grade LCDs. By some I mean 16. I know they support 240p and have RGBs input so from that perspective they are already some great retro gaming displays. The next thing I'd like to do is demonstrate lag at different resolutions including some of the more esoteric resolutions from arcade machines.

RGBs is done via D-sub in.

Next step: write a post somewhere and try and sell them so they are out of my garage! (They comprise and 4x4 floor standing videowall by the way.)
Alan Robinson said…
Nifty. RGBs isn't the same as VGA, correct? Perhaps you do need a fancy hat. For the lagTesterPro you need pins 1-6 available. Of course the power pins could be doubled up but you'd need access to them.

pins defined here:

https://www.element14.com/community/docs/DOC-92640/l/raspberry-pi-4-model-b-default-gpio-pinout-with-poe-header
LevelRage said…
VGA is typically RGBHV (separate horizontal and vertical sync) where SCART and retro game consoles typically used RGBs (s = sync or more accurately csync = composite sync)

Some devices like these commercial grade tvs will accept combined or separate syncs through the "VGA" (DSUB) port.

Csync is not to be confused with composite video. Composite video is rgbhv all in 1 signal which is why the quality is much further down on the spectrum. Where with csync RGB are still their own dedicated cables while HV sync are combined into one.

Just to round it out Component is just a further hybrid. The green signal is dropped entirely and just derived from the other 3 signals. Its a bit more complicated than that as red and blue aren't pure signals any more... they are just red and blue with respect to the Luma/sync signal. But you can visualize it as red blue and "sync".

I did know about the composite output but I am hoping to use a full RGB signal. How is your time table looking? I may order myself a pi4 in preparation.
Alan Robinson said…
Yeah, composite isn't very good looking in general. But it would be fine for measuring lag, no doubt. Not that I've tried - I don't have the adapter for my pi 4 or the extra header for my pi zero.

I'm hoping to have the supplies within a week to be able to build more than the one I have on my bench currently. But since some of it's coming from china there's a high level of uncertainty.

FYI the raspberry pi zero is also an option if all you want to do is measure lag. Not nearly as fast as the pi 4, but way cheaper.
Alan Robinson said…
FYI I'm ready to start taking (limited) orders. Here's the project status:

https://alantechreview.blogspot.com/2020/07/pilagtesterpro-status-update-pi4-or.html
LevelRage said…
Have you come up with a cost yet also how are you going to take orders PayPal? I don't have the various Pis but i'd be willing to get two to help with an A-B comparison. Pi3B+ and Pi4 for example.
Alan Robinson said…
The cost will be $40 to start with but may go up depending on part availability. I'm currently chancing (hopefully the last) firmware bug that I want to iron out before being ready to ship.
LevelRage said…
Alright just post when you're ready! and let us know how you'll be taking orders!
Alan Robinson said…
FYI the order page is up.

https://alantechreview.blogspot.com/2020/08/pilagtester-pro-order-page.html
Alan Robinson said…
@fisher: FYI there's an alpha version of pi4 support now available. I haven't tested it at the resolutions you want to run but it works fine at lower resolutions and it *should* be fine at higher too.
Alan Robinson said…
final update: 4k support is working and tested.

Email me

Name

Email *

Message *

Popular posts from this blog

Panasonic TH-42PX75U Plasma TV review: input lag and upscaling tested using the piLagTesterPRO

piLagTester PRO order page

A $5 TV Input Lag tester using a Raspberry Pi Zero