Measuring Input Latency

Status: ongoing

Runtime: 2017 -

Participants: Raphael Wimmer, Florian Bockes, Andreas Schmid

Keywords: WIP, Latency, Prototype

Goals

  • Get a better understanding of latency and latency jitter
  • Development of a tool for exact measurement in order to make different devices comparable for further research

Status

Currently we improve our testing prototype (third iteration) and gather more data from different devices. This iteration uses a non-invasive approach by physically pressing a button on the input device in a controlled manner. Apart from the obvious advantage of not being required to disassemble input devices in order to be able to test their latency, this method also allows to test the latency of touchscreens.

News

PDA Group at CHI '2018 (2018-04-21)

We will present a poster and a workshop paper at CHI 2018. (more...)


Prototype

Video for our CHI Late Breaking Work paper. In the measurements shown in this video, measuring interval and USB polling interval are synchronized (which is actually not good), so the tool effectively measured USB polling rate.



Hardware

The LagBox is based on a Raspberry Pi 2. A optocoupler, which can be switched by the RPi's GPIO interface, is connected to a button of the input device (Fig. 1) and can trigger a button press.
For this method of testing input latency, it is necessary to modify the input devices by connecting the transistor-side of an optocoupler to the button which should be tested (Fig. 2). Furthermore, this method is not suited to test the latency of input devices that offer a non-physical type of interaction, like touch displays.
An advantage of this method over non-invasive approaches is the fact, that external influences are reduced to a minimum due to the direct electric connection between the testing device and the input device. This method also allows it to trigger a large number of button presses in a very short period of time. Thus, it becomes easy to conduct stress tests on the hardware or to collect big amounts of data.

Figure 1: LagBox circuit
Figure 2: Hacked Gamepad


Software

On startup, the software of the LagBox requires the user to select the “hacked” button of the input device via command line parameters to determine which input event to listen to. Afterwards, the actual testing process begins. The RPi closes the optocoupler by writing to the corresponding GPIO pin, logs the current timestamp and waits for an input event by the input device connected via USB. Once the input event arrives, the optocoupler is opened again, another timestamp is logged and the difference is written to a logfile. Then we wait for a randomly selected time between 0.1ms and 10ms, so the circuit can discharge. The reason for the randomized waiting time is to avoid accidental synchronisation of the event readout with the polling rate. This testing process is repeated several (right now 1000) times to get a big enough sample size of input latencies.
The last latency as well as the overall progress of the test are shown on a minimalist GUI (Fig. 3).

Figure 3: GUI of the LagBox


Results

To validate our prototype, several experiments were conducted during the development process where we tested various USB-connected mice, keyboards, and gamepads. The following devices were tested: three gamepads (Logitech Wing-man and two different no-name gamepads using the same DragonRise controller IC), two keyboards (Logitech G15 and Gembird Mini USB Keyboard), and three mice (Logitech G5, G300, and RX250). For each device, we collected 5000 samples. We observed that great differences exist between devices regarding both latency and consistency. Moreover, plotting the kernel density estimates for the latency distributions reveals further peculiarities of certain devices (Fig. 4). For example, the Logitech G15 keyboard has a bimodal distribution of latencies.

Figure 4: Violinpots of latency distribution




List of tested devices (invasive method, 125Hz polling)
Device Name Device Type Polling Rate Median ± std. dev
Logitech Rx250 Mouse 125Hz 13.3 ± 2.8
Logitech Wingman Gamepad 125Hz 5.6 ± 2.3
DragonRise (2x) Gamepad 125Hz 17.3 ± 4.5
Gembird Mini Keyboard 125Hz 29.0 ± 2.5
Logitech G300 Mouse 1000Hz 3.9 ± 0.7
Logitech G5 Mouse 1000Hz 2.2 ± 0.3
Logitech G15 Keyboard 1000Hz 25.8 ± 4.9

Publications

Florian Bockes, Raphael Wimmer, Andreas Schmid

CHI EA '18 Extended Abstracts of the 2018 CHI Conference on Human Factors in Computing Systems

Development of a tool for measuring latency of different USB devices (Tweet this with link)


Resources

News / Blog

PDA Group at CHI '2018 (2018-04-21)

We will present a poster and a workshop paper at CHI 2018. (more...)