DEV Community

Izanagi
Izanagi

Posted on

USB polling and interrupt handling: optimizing input devices for gaming

Every USB device generates interrupts. Your mouse, keyboard, headset, and controller all compete for interrupt handling time. On a busy system this affects input latency.

USB interrupt moderation

Windows can moderate USB interrupts — batch them to reduce CPU overhead. For high-polling-rate devices (1000hz+ mice), interrupt moderation adds latency.

Disable USB selective suspend (which causes reconnect delays):

Control Panel → Power Options → Change plan settings → Change advanced power settings → USB Settings → USB selective suspend setting → Disabled

USB controller affinity

USB controllers can be assigned to specific CPU cores via interrupt affinity. By default Windows distributes interrupts across cores automatically. For dedicated gaming, pinning USB interrupts to cores that the game doesn't use can reduce contention.

This is advanced — use msconfig or registry affinity settings. Generally not needed unless LatencyMon shows USB as a DPC latency source.

xHCI vs EHCI

Modern USB 3.x uses xHCI controllers. Older EHCI (USB 2.0) controllers have higher interrupt latency. If you're running a high-polling-rate mouse through a USB 2.0 hub, move it to a direct USB 3.0 port.

Multiple devices on same controller

USB ports share controllers. If your mouse and keyboard share a controller with your audio interface, they compete for interrupt handling. Spread devices across physical USB controllers (check Device Manager to see which ports share controllers).

USB power management

Disable power management on USB hubs:
Device Manager → Universal Serial Bus controllers → each USB Root Hub → Properties → Power Management → uncheck "Allow the computer to turn off this device to save power"

IzanagiOP disables USB selective suspend and USB hub power management globally. https://terweb.lt/

Top comments (0)