Measuring 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.
Sparky
Posts: 682
Joined: 15 Jan 2014, 02:29

Re: Measuring keyboard input lag

Post by Sparky » 21 Jan 2015, 22:33

Did some investigating. PS/2 spec is kinda loose, but it sounds like you're just running into the transfer limits of PS2. It should be relatively easy to confirm: If you press a second key without releasing the first key, you should see it earlier. 4 byte keypresses like Keypad Enter and Keypad / should also take longer than 2 byte keypresses (http://www.computer-engineering.org/ps2 ... odes2.html).

stirner
Posts: 74
Joined: 07 Aug 2014, 04:55

Re: Measuring keyboard input lag

Post by stirner » 22 Jan 2015, 14:18

Cannot confirm transfer size dependencies as I'm limited to numpad keys. When I actuate a second key without releasing the first I'm seeing large variance in the results, but in rare cases it does indeed go as low as ~1.5ms.

flood
Posts: 929
Joined: 21 Dec 2013, 01:25

Re: Measuring keyboard input lag

Post by flood » 13 Feb 2015, 04:04

Sparky wrote:
flood wrote:random question
when you have multiple usb hid devices, are the polls synchronized?
The computer needs to be able to handle asynchronous polling, because different devices are allowed to have different polling rates. If you have two USB controllers that happen to run on the same clock, I could see synchronized polling happening by accident. Of course, there are a lot of reasons you might need to give one input priority over the other, like two keyboards simultaneously typing into a text editor, you have to decide somehow which letter to print first. Ultimately it depends on every part of the hardware and software stack allowing it, so probably not.
wait so

what happens if i plug in two 1000hz mice and move them both?

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

Re: Measuring keyboard input lag

Post by Sparky » 13 Feb 2015, 05:10

flood wrote:
Sparky wrote:
flood wrote:random question
when you have multiple usb hid devices, are the polls synchronized?
The computer needs to be able to handle asynchronous polling, because different devices are allowed to have different polling rates. If you have two USB controllers that happen to run on the same clock, I could see synchronized polling happening by accident. Of course, there are a lot of reasons you might need to give one input priority over the other, like two keyboards simultaneously typing into a text editor, you have to decide somehow which letter to print first. Ultimately it depends on every part of the hardware and software stack allowing it, so probably not.
wait so

what happens if i plug in two 1000hz mice and move them both?
Depends on the OS, I remember at least one game that detected both mice and used it for two player control, but that was several years ago, and I don't remember what it was called(I think it was a competitive breakout type game). I think windows just superimposes both inputs on each other.

stirner
Posts: 74
Joined: 07 Aug 2014, 04:55

Re: Measuring keyboard input lag

Post by stirner » 13 Feb 2015, 05:13

The inputs are still treated seperately. I also don't think there's any prioritizing between either of them (at least if they share host controller chips/IRQ) - poll time variance is enough to decide which input gets to a program first either way.

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

Re: Measuring keyboard input lag

Post by Sparky » 11 Apr 2015, 09:43

I have a couple ideas to investigate, based on the stuff in flood's thread.

1: USB uncertainty may be cut in half, by getting a timestamp from the arduino's ISR. Further, the keyboard's response can be confined to a 1ms range by sending several keystrokes in short succession.

2: USB may be eliminated entirely for testing the caps lock, scroll lock, or number lock keys, by using a photosensor on the indicator LEDs. This assumes the USB side of the keyboard works as expected.....Or I could just probe the LED directly. Why didn't I think of that last time?

erazor_de
Posts: 1
Joined: 12 Oct 2015, 12:22

Re: Measuring keyboard input lag

Post by erazor_de » 12 Oct 2015, 23:50

Maybe someone's interested in how I measured usb device input lag using a Raspberry Pi 2 B:
http://roccat.sourceforge.net/technical ... _input_lag

User avatar
lexlazootin
Posts: 1251
Joined: 16 Dec 2014, 02:57

Re: Measuring keyboard input lag

Post by lexlazootin » 13 Oct 2015, 00:41

I'm dying to try and test my equipment myself but i will probably go the more lazy/expensive route and just mount a led to a key and get a cheap 1000fps camera.

Q83Ia7ta
Posts: 761
Joined: 18 Dec 2013, 09:29

Re: Measuring keyboard input lag

Post by Q83Ia7ta » 13 Oct 2015, 02:37

erazor_de wrote:Maybe someone's interested in how I measured usb device input lag using a Raspberry Pi 2 B:
http://roccat.sourceforge.net/technical ... _input_lag
Very nice. Thanks for sharing!

dhaine
Posts: 49
Joined: 22 Nov 2014, 00:25

Re: Measuring keyboard input lag

Post by dhaine » 14 Oct 2015, 01:57

there's a few keyboards claiming input lag superiority at the moment :
logitech g910 / g410 (with romer-g switch a logitech/omron association)
CHERRY RealKey with its cherry mx6 keyboard
a4tech bloody lightstrike with many keyboards but hard to find (b640 b740 b700 b720)
steelseries qs1 with steelseries apex m800

i own logitech cherry and a4tech and did the "bump" test that a4tech bloody is using to test which one is faster; you can find software here : http://bloody.com/usa/Download.php

it's a very rude way to do it ^^

i also tried with orings to see if it could change the winner but from my tests the a4tech was slighty faster than logitech, and the cherry mx6 was actually same as any cherry mx red keyboard : about 10ms slower than a4tech and logitech
I haven't had the chance to test the steelseries...

If you could test these keyboards with your method we would have way better results, unfortunately i suck at anything needing wiring stuff, last time i tried i broke a mouse...

i haven't tried if logitech/a4tech would work on ps2 port with an adaptor but i don't think they do

Post Reply