[[!meta title="Wireless USB keyboards and delayed keystrokes"]] [[!meta date="2012-04-29 01:09"]] [[!meta author="rohieb"]] [[!meta license="CC-BY-SA 3.0"]] Everytime I was using my wireless USB keyboard with my laptop while the power cable was not connected, the keyboard behaviour was lousy, and keystrokes tend to be delayed by several seconds. The kernel logs said something like [23302.802096] uhci_hcd 0000:00:1a.0: setting latency timer to 64 [23302.842177] uhci_hcd 0000:00:1a.1: PCI INT B -> GSI 21 (level, low) -> IRQ 21 [23302.842190] uhci_hcd 0000:00:1a.1: setting latency timer to 64 [23302.882145] uhci_hcd 0000:00:1a.2: PCI INT C -> GSI 19 (level, low) -> IRQ 19 [23302.882158] uhci_hcd 0000:00:1a.2: setting latency timer to 64 [23302.929065] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19 [23302.929079] uhci_hcd 0000:00:1d.1: setting latency timer to 64 Searching on Google, I found [a forum post][0] which suggested to disable USB auto-suspend in the [laptop-mode][1] configuration files. The relevant file on my Ubuntu 12.04 is `/etc/laptop-mode/conf.d/usb-autosuspend.conf`, which is fairly well documented, and has an option `AUTOSUSPEND_USBID_BLACKLIST` which allowed me to blacklist my USB keyboard, so the device was no longer put in auto-suspend mode. (The USB ID needed for `AUTOSUSPEND_USBID_BLACKLIST` can be found in the output of [lsusb][2]) After editing that file, I had to restart the laptop-mode daemon (`sudo /etc/init.d/laptop-mode restart`), and keystrokes from my wireless keyboard arrived again without any delay. [0]: https://bbs.archlinux.org/viewtopic.php?pid=898114#p898114 [1]: http://packages.ubuntu.com/laptop-mode [2]: http://packages.ubuntu.com/usbutils [[!tag fix Ubuntu auto-suspend battery_power laptop-mode Linux Linux_3.2 powersave timing Ubuntu_Precise USB wireless_keyboard]]