ARDUINO Изготовить устройство LDAT

ArbatGames

✩✩✩✩✩✩✩
9 Мар 2024
1
0
Заинтересован в изготовлении одного устройства LDAT для измерения полной задержки ПК в играх

Описание устройства, ПО и схема тут: https://sergentum.blogspot.com/2023/12/ldat.html
Мой контакт для связи https://t.me/ArbatAdmin

Описание устройства
2023-12-26
How to build an LDAT alternative for ~30$

I often play Counter Strike and once I decided to measure the full latency of my computer, just to understand how much it is. One more reason - because I play on the laptop, it might be higher compared to the PC if the laptop isn’t configured properly.

Quick googling gave me a few videos about LDAT, and also about Reflex Analyzer which is basically the same tool built-in to the monitors. Here is the page about original device: Nvidia LDAT

But there is a huge problem with these monitors: there are quite few options available and they cost much more compared to regular monitors even with high refresh rate like 240+ hz. I decided that the task is quite simple and I can build a LDAT-like device on my own, because the algorithm is very simple.




I had a 10 years old Arduino Nano, a Logitech G203 and also I needed some fast light sensor. I chose TPS601A which costs 2 euro for 2 pieces on ali and has a rise time of 2us according to the datasheet.


What was also interesting - to find out how precise this device can be? I knew that PC latency is about 10-30 ms, and I was hoping that it would be fast enough to measure milliseconds. But that's quite simple too, right? We just need to add white LED and put it close to the light sensor, turn it on and check when the sensor will notice the light. I called it DEMO LED.

Basic scheme is:



On the left side I added a pull-down resistor, phototransistor and the switch which is actually an electret switch from the mouse.
On the right side white LED and the switch to turn it off. I called it the DEMO switch, to make it possible to check that the device is working without putting it on the display and to measure latency of the device itself.

I wanted to make click cable to be detacheable, but there is not so much space to built in connector so it doesn't look great, but it works.




When I tested this device I was a bit surprised and happy to see that it can detect latency in just one processor tick which is about ~200 μs which is much less than the latency I’m trying to measure.

Then I had to read the data from the COM port, visualize it and count some metrics like average etc. I wrote I small web-service on the Python that reads selected COM port and draw nice chart with data.


General scheme is pretty obvious, but I add it to be clear:


Second computer is optional of course but it's easier to watch measured data on another screen instead of switching windows or testing game in windowed mode which can affect the latency.

Now it’s time to test couple games:




I'm using Lenovo Legion laptop with i5-11400H and RTX 3060, display is Acer Nitro XV272UKF 300 Hz.

I also use the Nvidia performance overlay and it shows latency 1-2 ms for Half-Life when LDAT shows 7-8 ms. I assume that my setup has some latency which can’t be measured by Nvidia obviously - like input lag and display lag, but this difference between numbers should be the same for all cases. After having this difference measured and calculated I can just watch at performance overlay and add 6-7 ms extra to calculate full latency without attaching LDAT to the monitor again.

As you can see, creating a device like this is relatively easy and costs way less than NVIDIA sells it (actually it doesn’t sell to end users, so you can’t buy it).

Arduino sketch, Python webserver sources, 3D models for a box are all here: github