pages tagged laptop-moderohieb.namehttps://rohieb.name/blag/tag/laptop-mode/rohieb.nameikiwiki2013-09-19T05:04:01ZWireless USB keyboards and delayed keystrokeshttps://rohieb.name/blag/post/wireless-usb-keyboards-and-delayed-keystrokes/rohieb
CC-BY-SA 3.0
2013-09-19T05:04:01Z2012-04-28T23:09:00Z
<p>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</p>
<pre><code>[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
</code></pre>
<p>Searching on Google, I found <a href="https://bbs.archlinux.org/viewtopic.php?pid=898114#p898114">a forum post</a> which suggested to
disable USB auto-suspend in the <a href="http://packages.ubuntu.com/laptop-mode">laptop-mode</a> configuration files.
The relevant file on my Ubuntu 12.04 is
<code>/etc/laptop-mode/conf.d/usb-autosuspend.conf</code>, which is fairly well
documented, and has an option <code>AUTOSUSPEND_USBID_BLACKLIST</code> which
allowed me to blacklist my USB keyboard, so the device was no longer put
in auto-suspend mode. (The USB ID needed for
<code>AUTOSUSPEND_USBID_BLACKLIST</code> can be found in the output of <a href="http://packages.ubuntu.com/usbutils">lsusb</a>)</p>
<p>After editing that file, I had to restart the laptop-mode daemon (<code>sudo
/etc/init.d/laptop-mode restart</code>), and keystrokes from my wireless
keyboard arrived again without any delay.</p>