You are not logged in.

#1 2011-02-05 11:20:02

plamkata__
Member
Registered: 2011-02-05
Posts: 6

[SOLVED] USB Keyboard lag when typing

Hi all,

I bought a new USB keyboard - Logitech Deluxe 250. When typing I got some strange lag - I press any key and see how the letter of the key appears after some small amount of time. I have the same problem with other USB keyboard. It is strange that I had no problems few months ago using both USB keyboards on my Debian. One day I updated the Debian to newer version and since then my USB keyboards don't work fine anymore. I switched to Arch and I hoped that it was Debian related problem but here is the same. So I think this is some kernel/driver issue, or maybe some udev related issue because seems on HAL there is no problem. The both keyboards work on other linux PC and also work on Windows on my PC.
This is what I get from dmesg

   usb 2-3: new low speed USB device using ohci_hcd and address 2
   input: LITEON Technology USB Multimedia Keyboard as /devices/pci0000:00/0000:00:13.0/usb2/2-3/2-3:1.0/input/input5
   generic-usb 0003:046D:C312.0001: input,hidraw0: USB HID v1.10 Keyboard [LITEON Technology USB Multimedia Keyboard] on usb-0000:00:13.0-3/input0
   usbcore: registered new interface driver usbhid
   usbhid: USB HID core driver

Any ideas what causes the keyboard lag?

Thanks

Last edited by plamkata__ (2011-03-28 21:27:11)

Offline

#2 2011-02-06 04:18:01

bt
Member
Registered: 2007-04-11
Posts: 198

Re: [SOLVED] USB Keyboard lag when typing

I am having the same problem since the last update. I have asked several times, but no answers so far.

Offline

#3 2011-02-15 20:23:52

plamkata__
Member
Registered: 2011-02-05
Posts: 6

Re: [SOLVED] USB Keyboard lag when typing

I have the feeling it is a kernel related issue - maybe happens on newer kernel versions

Offline

#4 2011-02-16 08:46:39

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: [SOLVED] USB Keyboard lag when typing

How is the rest of the system behaving, i.e. do you also experience lags other than typing?

Offline

#5 2011-02-20 20:36:45

plamkata__
Member
Registered: 2011-02-05
Posts: 6

Re: [SOLVED] USB Keyboard lag when typing

No - the rest of the system seems fine. Only the keyboard is lagging

Offline

#6 2011-02-21 22:41:36

bt
Member
Registered: 2007-04-11
Posts: 198

Re: [SOLVED] USB Keyboard lag when typing

Same as plamkata_  --- Only the keyboard lags (up to 30 secionds)

Offline

#7 2011-03-12 16:30:16

bt
Member
Registered: 2007-04-11
Posts: 198

Re: [SOLVED] USB Keyboard lag when typing

I finally solved the keyboard lag problem by adding a new section to /etc/X11/xorg.conf

Section    "ServerFlags"
     Option     "AutoAddDevices"      "true"
     Option     "AllowEmptyInput"      "no"
EndSection

I have no idea why this works, just following suggestions

Offline

#8 2011-03-14 20:06:50

plamkata__
Member
Registered: 2011-02-05
Posts: 6

Re: [SOLVED] USB Keyboard lag when typing

I tried this but unfortunately there was no effect for me. Besides it really seems weird smile

Offline

#9 2011-03-15 00:42:30

bt
Member
Registered: 2007-04-11
Posts: 198

Re: [SOLVED] USB Keyboard lag when typing

It does sound weird, but I was following idea from the xorg mailing list. The following is a message from March 3, 2011:


On 03/03/2011 08:29 AM, Marty Jack wrote:
> Recently on Server 9 and Server 10, I am finding that once in a while
when I come back to the computer, either the keyboard still works and
the mouse is unresponsive, or the mouse still works and the keyboard is
unresponsive.  If I ssh in and gdb, I find the server in the poll in
WaitForSomething.  Restarting the server fixes it until the next time it
happens.
>
> If someone who has done this before has a suggestion on a line of
attack to troubleshoot, it would be helpful.

This is a result of USB hiccups causing the device to disconnect and
reconnect.  The server now relies on input hotplugging to recover, so if
you are on a roll your own distro, you need to be building with udev
support and AutoAddDevices

Offline

#10 2011-03-20 11:24:01

plamkata__
Member
Registered: 2011-02-05
Posts: 6

Re: [SOLVED] USB Keyboard lag when typing

In my case the keyboard is laggy even if no X server is running - so I assume it is a kernel related issue

Offline

#11 2011-03-20 16:59:59

bt
Member
Registered: 2007-04-11
Posts: 198

Re: [SOLVED] USB Keyboard lag when typing

There appears to be at least three processes interfering with inter-process communication.
1. In my case adding to xorg.conf in my post above resolved most of the serious keyboard delay, and the keyboard no longer froze.
2. But if I called on another program in emacs -- scim for example -- I would still experience a delay. The KDE website shows comments about Dolphin and Konqueror interfering with each other. I removed them both, and most of the balance of the delay disappeared.
3. The last delay is still a puzzle and not fatal. If I log out of X and issue the shutdown -h now command it can take up to 30 seconds for shutdown to begin.

Offline

#12 2011-03-28 21:26:19

plamkata__
Member
Registered: 2011-02-05
Posts: 6

Re: [SOLVED] USB Keyboard lag when typing

Hi,

I have finally fixed the problem smile

Today I experimented with loading/removing usb modules and especially ohci_hcd and ehci_hcd. It appeared that if manually remove ohci_hcd with rmmod and then manually add it with modprobe (I was using different keyboard because after the remove my usb keyboard stops working) the problem is fixed. I drilled deeper in the problem and found that when kernel is starting somehow when ohci_hcd is loading it is unable to take IRQ 19 and so IRQ 19 is disabled (in dmesg there is one kernel call stack trace with some errors when ohci_hcd is loading). Also when my system was booting I was constantly receiving Disable IRQ 19 on ::Waiting for UDev uevents to be processed. In one forum I found that if I adds irqpoll as option to the kernel in grub it may fix the problem with disabling some irq-s, so I tried and now everything is ok - I don't receive anymore "Disable IRQ 19" message on booting and my usb keyboard is working just fine. Also my system is loading faster and KDE is somehow faster loading too.

Offline

#13 2017-08-05 22:30:24

eU9UFAD
Member
Registered: 2017-08-05
Posts: 5

Re: [SOLVED] USB Keyboard lag when typing

For me the problem was not USB at all, but bluetooth.  I had the same problem on Windows, by the way.  Perhaps Logitech is trying to save power in the Bluetooth keyboard.  I have switched to a hardwired USB keyboard and mouse, and no more problems.

Offline

#14 2017-08-05 23:51:05

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,842
Website

Re: [SOLVED] USB Keyboard lag when typing


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB