DIY input lag tester.

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.
Piwi
Posts: 5
Joined: 03 May 2020, 13:32

Re: DIY input lag tester.

Post by Piwi » 09 Jan 2021, 16:57

howiec wrote:
24 Dec 2020, 11:45
Those are definitely photoresistors. Interesting that you seem to get response times different than spec. Regardless, I strongly recommend photodiodes instead for various reasons including much lower response times, and less sensitivity to incident light. Then again, I've never used either so YMMV. I just have an electrical engineering background.
So, a little update. I received some photo_something, and did some testing.
ynXiwrb[1].png
ynXiwrb[1].png (170.06 KiB) Viewed 3728 times
So these, contrary to what adafruit said, are not phototransistor, nor photodiodes, they are actually photoresistors. From what I gathered, they are the new version of the old photoresistors, because the old were not compliant with some EU regulation on some material.
So they work just like the old ones I was using, ~30 to 40 µs response time.
cYhzFLS[1].png
cYhzFLS[1].png (174.39 KiB) Viewed 3728 times
These, ordered from aliexpress, are sold as phototransistors with 2 legs.I do believe they are actual phototransistors. Here's the datasheet I could find from their part number https://datasheetspdf.com/datasheet/3DU5C.html

I don't think I found any actual photodiode yet. i've ordered some stuff from aliexpress, but it still hasn't come :D


Now, onto the interesting part, I tested them both for response time, based on lighting an LED. My test setup looked like this
BTNdrJJ[2].png
BTNdrJJ[2].png (545.22 KiB) Viewed 3728 times
And results were as follow :

- Photoresistor : 124-132 µs
- Phototransistor : 4-8 µs


This was with a basic arduino setup. I then used the stuff to get faster analog reads (https://forum.arduino.cc/index.php?topic=6549.0) then ran some more tests, which gave me :

- Photoresistor : 32-36 µs
- Phototransistor : 4-8 µs


And the weird part :
analogRead from an arduino leonardo like mine takes ~110 µs to process. This seems fine, and the results I'm getting with the photoresistor makes sense.
analogRead with the stuff from the arduino forums to make it faster takes ~17 µs. Results from the photoresistor also makes sense.

But then, analogRead from the phototransistor gives 4-8 µs, with and without the things to make it faster. It's still the same analogRead() function. I have no clue how that works honestly.

Anyway, I'm now in the process of designing a shroud for the photodiode, and then I'll test it for input latency on a PC, and see what happens.

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: DIY input lag tester.

Post by Chief Blur Buster » 09 Jan 2021, 17:11

Great stuff — I’ve been doing something similar for years with photodiodes and have in-house devices, though phototransistors and photoresistors also can produce good results too, depending on the speed/sensitivity/ease you’re looking for.

Don’t forget to publish latency disclosure when publishing lag numbers.

Consistent screen location, preferably multiple (top, center, bottom). If choosing only one location, always use screen centre. Not all pixels refresh at same time, www.blurbusters.com/scanout

1. How the stopwatch starts. VSYNC ON lag tests uses VBI-stopwatch-start (return from frame present unblock). and VSYNC OFF lag tests use Present()-stopwatch-start. Starting lag stopwatch before or upon return of Present(), depends on what you are trying to measure, but if isolating more to display, stopwatch start upon return of Present().

2. How the stopwatch ends. (GtG10% and GtG50% are my favourites since those are more ‘fair’ and representative of human vision, though some testers use GtG2% or GtG99% which aberrates far more away from the actual time of human detectability in lag overestimate/underestimate behaviors).
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

howiec
Posts: 183
Joined: 17 Jun 2014, 15:36

Re: DIY input lag tester.

Post by howiec » 09 Jan 2021, 22:51

Piwi wrote:
09 Jan 2021, 16:57
I don't think I found any actual photodiode yet. i've ordered some stuff from aliexpress, but it still hasn't come :D
There are numerous photodiodes here:
https://www.digikey.com/en/products/fil ... diodes/543

This one may be suitable and is cheap:
https://www.digikey.com/en/products/det ... 01/5879087

Also, standard phototransistors will have 2 terminals. Photons are just absorbed in the base.
Piwi wrote:
09 Jan 2021, 16:57
These, ordered from aliexpress, are sold as phototransistors with 2 legs.I do believe they are actual phototransistors. Here's the datasheet I could find from their part number https://datasheetspdf.com/datasheet/3DU5C.html
According to the datasheet, yes, it uses an NPN transistor. Generally, photodiodes have a faster response time than phototransistors.

But alas, as long as you pick any photodetector with suitable parameters that works well in your device, then who cares if it's a diode, transistor, or resistor (assuming it's not a "weak-link").

Rogex47
Posts: 8
Joined: 28 Jan 2021, 11:24

Re: DIY input lag tester.

Post by Rogex47 » 30 Jan 2021, 19:53

Hi Piwi,

I am a complete noob at this but I would really like to give it a try and build such an input lag tester.
You wrote that you will make a guide on how to do it, are you still working on it?

Please make it as noob friendly as possible :D

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

Re: DIY input lag tester.

Post by Sparky » 31 Jan 2021, 02:45

howiec wrote:
09 Jan 2021, 22:51
Piwi wrote:
09 Jan 2021, 16:57
I don't think I found any actual photodiode yet. i've ordered some stuff from aliexpress, but it still hasn't come :D
There are numerous photodiodes here:
https://www.digikey.com/en/products/fil ... diodes/543

This one may be suitable and is cheap:
https://www.digikey.com/en/products/det ... 01/5879087

Also, standard phototransistors will have 2 terminals. Photons are just absorbed in the base.
Piwi wrote:
09 Jan 2021, 16:57
These, ordered from aliexpress, are sold as phototransistors with 2 legs.I do believe they are actual phototransistors. Here's the datasheet I could find from their part number https://datasheetspdf.com/datasheet/3DU5C.html
According to the datasheet, yes, it uses an NPN transistor. Generally, photodiodes have a faster response time than phototransistors.

But alas, as long as you pick any photodetector with suitable parameters that works well in your device, then who cares if it's a diode, transistor, or resistor (assuming it's not a "weak-link").
You can find visible wavelength phototransistors with a rise time around 10us. Not as fast as photodiodes can be, but definitely good enough for 0.1ms resolution measurements, and a bit easier to implement.

For example: https://media.digikey.com/pdf/Data%20Sh ... -075PT.pdf

FPSMaster
Posts: 187
Joined: 04 Jun 2021, 20:39

Re: DIY input lag tester.

Post by FPSMaster » 25 Sep 2021, 19:36

Im looking for someone who has a testing tool and a personal input lag test data base. Im curious about which graphic settings/windows tweaks/bios settings has the most impact on input lag. Did you personally test many different things? If not, do you have a link to a trusted "input lag database"?

lizardpeter
Posts: 208
Joined: 01 Dec 2020, 14:41

Re: DIY input lag tester.

Post by lizardpeter » 26 Sep 2021, 03:44

FPSMaster wrote:
25 Sep 2021, 19:36
Im looking for someone who has a testing tool and a personal input lag test data base. Im curious about which graphic settings/windows tweaks/bios settings has the most impact on input lag. Did you personally test many different things? If not, do you have a link to a trusted "input lag database"?
I too am very interested in this. It is not something I am able to do right now (I am too busy at the moment), but that would be awesome if anyone else has done it. I know of one database that FR33THY has made using a similar device that might interest you.

NEW: https://docs.google.com/spreadsheets/d/ ... 0&range=L1

OLD: https://docs.google.com/spreadsheets/d/ ... 0&range=S1

One very interesting measurement is just how much latency DWM adds. Even on his 360 Hz monitor, he's seeing much higher latency with DWM enabled. I really wish there was a straightforward way to disable it without messing with the whole OS and making many different things stop working. I like low latency always! Not only in exclusive full-screen games.
i9 9900k | RTX 2080 Ti | 32 GB 4x8GB B-Die 3600 MT/s CL16 | XV252QF 390 Hz 1080p | AW2518H 240 Hz 1080p | PG279Q 144 Hz 1440p

Razer Viper 8K | Artisan Zero Mid XL | Apex Pro TKL | 1 gbps FiOS (Fiber)

FPSMaster
Posts: 187
Joined: 04 Jun 2021, 20:39

Re: DIY input lag tester.

Post by FPSMaster » 26 Sep 2021, 10:54

lizardpeter wrote:
26 Sep 2021, 03:44
FPSMaster wrote:
25 Sep 2021, 19:36
Im looking for someone who has a testing tool and a personal input lag test data base. Im curious about which graphic settings/windows tweaks/bios settings has the most impact on input lag. Did you personally test many different things? If not, do you have a link to a trusted "input lag database"?
I too am very interested in this. It is not something I am able to do right now (I am too busy at the moment), but that would be awesome if anyone else has done it. I know of one database that FR33THY has made using a similar device that might interest you.

NEW: https://docs.google.com/spreadsheets/d/ ... 0&range=L1

OLD: https://docs.google.com/spreadsheets/d/ ... 0&range=S1

One very interesting measurement is just how much latency DWM adds. Even on his 360 Hz monitor, he's seeing much higher latency with DWM enabled. I really wish there was a straightforward way to disable it without messing with the whole OS and making many different things stop working. I like low latency always! Not only in exclusive full-screen games.
Oh wow, thank you for that! Thats kinda what Im looking for. Very interesting to look at. I didnt know windows "Game Mode" adds input lag for example. DWM is already disabled for me, because I did a registry tweak to enable exclusive fullscreen mode across every game. When enablind exclusive fullscreen mode, DWM is automatically disabled.
There is a post on reddit how to enable excl. fullscreen for every game: https://www.reddit.com/r/Windows10/comm ... exclusive/
This worked for me the best.

One thing im wondering about...
Will those tweaks decrease the input lag step by step? Lets say my total system latency is 30ms. There are 3 tweaks I can make. OC GPU gives -5ms, Disable DWM gives -2ms and disabling windows game mode gives -1ms. Will those numbers multiply? For example: 30ms system latency -5ms -2ms -1ms : 22ms? Or do many tweaks just make the input lag more "stable" instead of multiply on each tweak. (Sorry for my english, its not my main language) I hope you understand what I mean.

Post Reply