Reasons for respecting bInterval?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello list,

I would greatly appreciate your feedback on some assumptions and
findings about the latency of USB-connected input devices.


a) are there any known downsides to always polling USB-connected input
devices at 1000 Hz instead of polling only every bInterval ms?

b) IF there are no known downsides: why isn't polling at 1000 Hz the
default on Linux?

c) While the USB 3.0 standard actually seems to allow specifying polling
intervals of 0.5 ms and 0.25 ms, it seems that the Linux USB stack does
not support polling at these rates. Is this correct?


Background:

For an upcoming research paper on input latency, we have characterized
the latency of 35 USB-connected input devices (mice, gamepads,
keyboards) by electrically triggering device buttons and measuring the
time until an input event arrived in the application. To this end, we
used a Raspberry Pi 2 running Raspbian (iirc).

A major, somewhat unsurprising, finding is that device latency varies a
lot between devices but also depends to a large degree on the USB
polling rate. Both average latency and variance in latency increase with
longer polling intervals.
We also tested each device with a slightly patched kernel that activated
 the equivalent of usbhid.mousepoll=1 for all input devices (when we
started with this project, jspoll and kbpoll params were not yet
supported by the kernel we used).
Polling at 1 ms resulted in significant improvements for all devices
which did not already report a bInterval of 1 (most reported 10).
The average latency dropped by 5-10 ms for every device.
The variance of the latency (max latency - min latency of 1000
measurements) dropped consistently from ~15 ms to ~5 ms.
In our tests, no detrimental effects of 1000 Hz polling could be
observed. In an earlier experiment, a few years ago, a cheapo gamepad
became unresponsive during testing. We do not know whether this was
caused by polling at a too high rate or due to mechanical stress and do
not have it anymore.

Feel free to check out https://hci.ur.de/projects/latency
The page does not yet contain the new results, however. We will update
it in early 2019.

Cheers,
Raphael Wimmer

Attachment: pEpkey.asc
Description: application/pgp-keys


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux