Keyboard input lag

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.
MegaWatt
Posts: 21
Joined: 20 Apr 2020, 09:35

Keyboard input lag

Post by MegaWatt » 20 Apr 2020, 10:15

Hi,

Ok this drives me kinda insane and I'd really like to see some evidence / testing relating to all the claims of the big gaming keyboard manufacturers. Namely Steelseries, Razer, Wooting, Corsair, Logitech, Fnatic, perhaps a few others.

I've just ordered a Fnatic board, which claims a 1000Hz polling rate but of course they don't mention key debounce time, none of the manufacturers do.

None of them mention anything regarding key press time to USB packet time, are they all the same give or take a few ms ? according to Steelseries their apex pro boards are 5ms faster than your typical gaming keyboard due to their hall effect switches. I assume the electronics are different / not a matrix keyboard layout ? does that even matter if lets say a Fnatic board has a 10 times faster CPU, again the gaming keyboard manufacturers don't typically mention what CPU is being used. Does all the RGB effects have an effect on keyboard latency ? if being run from the same CPU that's scanning the keyboard then I'd expect it would, again not mentioned / totally unknown.

Nothing is mentioned about when the debounce time is applied, it could be applied on releasing the button perhaps ? i.e. first sign of the button press you register it, then wait 10ms before checking 3 times for the button being open. So here you'd get the fastest possible key registration, there'd be no 5ms delay as per what Steelseries claim.

Key travel and actuation point is always mentioned but what about how fast for the button to spring back up, low actuation force surely means also a weaker spring meaning a longer amount of time for the button to bounce back up over the actuation point if you bottom the button out.

No idea exactly how you'd test this, I was thinking something like a Dremel drill with some sort of cam that will hit a button every time it rotates to the actuation point then record with a high frame rate camera looking for a notepad character to popup. Then compare between all the manufacturers.

Or you could do the ruler test where you compare two boards side by side to see which is faster by hitting a button on each board exactly at the same time, you'd need some sort of mechanism to ensure the ruler / plunger is dead level and adjustable so that it hits the actuation point exactly at the same time. If I remember there was some freeware about to test this, I can remember trying some years ago.

I'd do it myself if I had access to all the boards and a high speed camera :)

MegaWatt
Posts: 21
Joined: 20 Apr 2020, 09:35

Re: Keyboard input lag

Post by MegaWatt » 20 Apr 2020, 12:38

Answering my own question a little, from the below link without trying that hard I can get 3ms and a scan rate of 333Hz using my new Fnatic board, using my older Hyper-X board I could only get 10ms / 100Hz That's without installing the Fnatic software, so I'm reasonably pleased as it would seem like an upgrade. Obviously I'm tapping my keys really fast to get that, it would be interesting to know what other boards would do on this test.

https://blog.seethis.link/scan-rate-estimator/

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

Re: Keyboard input lag

Post by Chief Blur Buster » 20 Apr 2020, 13:20

MegaWatt wrote:
20 Apr 2020, 10:15
No idea exactly how you'd test this, I was thinking something like a Dremel drill with some sort of cam that will hit a button every time it rotates to the actuation point then record with a high frame rate camera looking for a notepad character to popup. Then compare between all the manufacturers.
Windows compositor (dwm.exe) only runs at fps=Hz VSYNC ON, so there's VSYNC ON lag and refresh-cycle-granularity lag.

I'd suggest a game chat app running at 1000fps VSYNC OFF instead changing the WHOLE screen color all at once. From black to white. The first VSYNC OFF frameslice that changes color will be 1ms-accurate in Present()-to-Photons time with a CRT or a known-low-lag LCD with linear latency gradient (cable scanout = cable scanout latency) such as a BenQ panel running at max Hz in Instant Mode.

Remember, not all pixels have the same input lag, www.blurbusters.com/scanout so I recommend a keyboard benchmark app that changes the WHOLE screen color, so you can monitor for ANY *first* VSYNC OFF frameslice that changes color.

Windows compositor.

Image

VSYNC OFF at frame rates 3x refresh rate

Image

VSYNC OFF at 1000 frames per second

Image

At 120Hz, there will be about 8 tearlines per refresh cycle for 1000fps, and at 240Hz, there iwll be about 4 tearlines per refresh cycle for 1000fps. Doesn't matter the Hz, as long as fps=Hz, VSYNC OFF, with a synchronous panel (horizontal scanrate of panel TCON/scaler matching scanrate of cable).

Most Accurate Present()-to-Photons
Most low-lag gaming LCDs at max Hz will usually be synchronous at max Hz, and be keyboard-latency-trustworthy during 1000fps+ VSYNC OFF: Just watch for the first color-changed frameslice in high speed camera footage. Always use Full Screen Exclusive mode (not borderless windowed mode).

If anyone builds a keyboard latency test rig, please bypass Windows compositor and sync technology overheads by using 1000fps+ VSYNC OFF FSE. It is possible to beamraces (raster) the tearlines at microsecond accuracies (that's how RTSS Scanline Sync works, as well as my Tearline Jedi experiment)

Present()-to-Photons is only 1ms on CRTs that way for GPUs that have native analog output, but you can use any ultralow-lag esports LCDs as long as latency gradient is symmetric to cable scanout, it'll be as low as ~2ms-3ms(ish) on the fastest LCDs such as XL2546 (DyAC OFF) or ViewSonic XG270 (at 240Hz only, no lower Hz). Don't use 60Hz mode on a 240Hz esports LCD without knowing its latency gradients/asymmetries -- a distorted latency gradient occurs with TCON/scaler that has go into scan-converting mode -- different horizontal scanrates at panel level and the cable level -- such as a monitor motherboard buffering a slow-scan 60Hz signal for a fast-scan-only 240Hz panel. That is usually not a problem with the best fastest LCDs at max Hz though.

Choose a monitor that has ~3-4ms lag from RTINGS.COM, then when doing keyboard lag tests, subtract the RTINGS.COM measured latency from the measured keyboard latency, and voila, your result is approximately 1ms accurate with my formula.

Try to use the latest Samsung Galaxy S20 which can record high speed video at 960fps for almost a full second. That's a very tight window, but usable for keyboard lag tests. Or use one of the older low-rez 1000fps cameras that can keep recording 1000fps ad infinitum - like older casio cameras even though it's only 64 pixel tall recordings, it's useful as long as you shine a bright light and capture vertically to see whole monitor height to watch for all frame slices. Or buy a higher end high speed camera like a Phantom Flex. Triggering a short-recording high-speed camera and the keyboard lag rig simultaneously will be challenging with Samsung Galaxy but if you have to do that, choose the longest-recording 960fps or 1000fps mode you can find for your budget.
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!

MegaWatt
Posts: 21
Joined: 20 Apr 2020, 09:35

Re: Keyboard input lag

Post by MegaWatt » 20 Apr 2020, 13:57

hhmm thanks for that, it does show using the screen for an output device for measuring keyboard lag to 1ms granularity has problems.

I guess the way to go is to use something like a Raspberry Pi with an LED output that's based off the USB packet from the keyboard, I'd guess a Pi would be fast enough for a sub 1000Hz software loop.

Rather than pulling a keyboard apart and soldering wires to switches you could put something on the top or side of the button being tested such as an accelerometer.

In fact with an accelerometer, Raspberry Pi and an LED that may be all you'd need, you could display a ms latency on screen i.e. difference between the accelerometer showing movement and the USB packet from the keyboard.

I'm certainly interested in whether there's a variation in gaming keyboards i.e. how consistent are they in terms of latency, as mentioned for example when all the RGB effects are enabled.

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

Re: Keyboard input lag

Post by Chief Blur Buster » 20 Apr 2020, 17:51

MegaWatt wrote:
20 Apr 2020, 13:57
hhmm thanks for that, it does show using the screen for an output device for measuring keyboard lag to 1ms granularity has problems.
Yes, requires requires custom programming, 1000fps+ combined with VSYNC OFF in FSE via full screen flash + subtract subsystem lag + carefully selected display

For keyboard lag testing, can be easier to just send a GPIO signal to a raspberry pi pin, unless you are familiar with creating a simple Direct3D app and already have a low-lag monitor.
MegaWatt wrote:
20 Apr 2020, 13:57
I guess the way to go is to use something like a Raspberry Pi with an LED output that's based off the USB packet from the keyboard, I'd guess a Pi would be fast enough for a sub 1000Hz software loop.
That's a possibility, if there is no GPIO latency to the LEDs. And easier for some programmers to implement than ultrahigh-framerate VSYNC OFF as the method.
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!

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

Re: Keyboard input lag

Post by Sparky » 20 Apr 2020, 23:35

The best way to check your keyboard's scan rate is to measure the scan rate with an oscillocope, frequency counter, logic analyzer, some multimeters, etc. That site you linked to is worthless. It listed a keyboard with a 1.5ms matrix scan interval at 20ms.

latency is harder to test, you can only compare it to some other device of a known latency, or make your own latency tester to measure it directly. a keyboard with a 1.5ms scan interval might still have 10 to 20ms of debouncing, and 1 to 10ms of usb polling latency.

You can measure overall latency with a high speed camera, but it's pretty tedious and includes more than just the keyboard. You need many samples, and you can only really compare two keyboards, you can't find the absolute latency of a single keyboard with that method.

MegaWatt
Posts: 21
Joined: 20 Apr 2020, 09:35

Re: Keyboard input lag

Post by MegaWatt » 21 Apr 2020, 07:07

I should be able to code this being a full time developer, I just need the hardware and the time :)

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

Re: Keyboard input lag

Post by Sparky » 21 Apr 2020, 11:19

MegaWatt wrote:
21 Apr 2020, 07:07
I should be able to code this being a full time developer, I just need the hardware and the time :)
Here's a related project, should save you some time: https://github.com/PDA-UR/LagBox

MegaWatt
Posts: 21
Joined: 20 Apr 2020, 09:35

Re: Keyboard input lag

Post by MegaWatt » 21 Apr 2020, 12:20

Just had a flick over the code and it appears to be trying to test exactly what I'm interested in, did anyone get to use this code ? was any measurements made ?

Thinking more about this I'd also be interested in mouse button latency, I'm currently using a Razer Deathadder V2 with optical mouse switches. They don't feel anymore responsive, so it would be interesting to see if it's just a marketing gimmick or has a measurable latency improvement. Again your typical gaming mouse is all about the sensor being at a 1000Hz polling rate, absolutely no mention of the button response times. Surprising really when your typical PC gamer will be trying to reduce latency why these facts and figures aren't easily found, kind of like buying an audio amplifier without any mention of the output wattage.

MegaWatt
Posts: 21
Joined: 20 Apr 2020, 09:35

Re: Keyboard input lag

Post by MegaWatt » 21 Apr 2020, 12:59

I reckon maybe sticking one of these

https://www.ebay.co.uk/itm/Touch-Sensor ... 4129851735

on top of a key cap might be worth trying, although this won't be as accurate as attaching wires to the button in terms of measuring the latency from the keyboard electronics / firmware it might give a more realistic / real world latency that takes button travel / actuation point into account.

I was thinking about using one of the below to sense a button push, might be fiddly to setup i.e. sticking something on the key cap to break the IR beam at the button actuation point.

https://www.ebay.co.uk/itm/1-2-5Pcs-slo ... 2583676072

Post Reply