You are not logged in.

#1 2016-04-29 10:05:01

Gianfrix
Member
From: Locorotondo (BA) - Italy
Registered: 2009-10-21
Posts: 41
Website

Problem with USB hub and input devices

Hello everyone, I've got a ridicolous problem with USB hubs in my laptop (a Clevo W230SS).
Basically, if I connect both my USB keyboard and my USB mouse to the hub, the keyboard doesn't work anymore. After pressing some keys, the last one gets stuck. By lots of testing I concluded that it could be a bug because:

  • I tried two different non-powered hubs and even converted one of them into a powered one and I still have the same problem

  • It works flawlessly on Windows and on Linux in another machine

  • It happens on every distro

Could you help me out? Here are some logs:


~ Gianfrix
There's no place like 127.0.0.1

Offline

#2 2016-04-29 17:36:27

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Problem with USB hub and input devices

Does the same thing happen on the USB2 port on the left?

I suppose "stuck" means that the key repeats indefinitely. Did you try simply disconnecting the hub and connecting again? (your dmesg doesn't indicate anything like that)

Offline

#3 2016-04-29 17:47:52

Gianfrix
Member
From: Locorotondo (BA) - Italy
Registered: 2009-10-21
Posts: 41
Website

Re: Problem with USB hub and input devices

mich41 wrote:

Does the same thing happen on the USB2 port on the left?

Yes, I want to use that port for input devices and dedicate the three USB3 ports for drives and stuff like that

mich41 wrote:

I suppose "stuck" means that the key repeats indefinitely. Did you try simply disconnecting the hub and connecting again? (your dmesg doesn't indicate anything like that)

If you type any key on the keyboard (like "d") it gets stuck ("dddddddddddddddddd...") until I press a key on the laptop's keyboard. After that it doesn't work anymore. If I try disconnecting and connecting it again it either doesn't work or the same bug is reproduced. Funny thing is that enabling Num Lock or Caps Lock on the laptop's keyboard lights up the USB keyboard, but not vice versa.
I also forgot to mention that:

  • I tried a USB1 hub (I suppose, as transfer speeds are like 1MB/s) and it works fine, but the other two hubs I tried are USB2 and they all have the same problem

  • Problems start as soon as X is started, on the TTY it all works flawlessly


~ Gianfrix
There's no place like 127.0.0.1

Offline

#4 2016-04-29 18:19:29

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Problem with USB hub and input devices

Gianfrix wrote:

Yes, I want to use that port for input devices and dedicate the three USB3 ports for drives and stuff like that

Makes sense, I asked because lsusb says you used USB3.

So it's same thing on all distros, all USB ports, but only one laptop, only X and only USB2? That's complicated smile

Can you switch to some TTY when it's stuck? Does it work there?

Just to get things straight, the built-in keyboard always works correctly?

Offline

#5 2016-04-29 22:32:12

Gianfrix
Member
From: Locorotondo (BA) - Italy
Registered: 2009-10-21
Posts: 41
Website

Re: Problem with USB hub and input devices

mich41 wrote:

So it's same thing on all distros, all USB ports, but only one laptop, only X and only USB2? That's complicated smile

I know, seems like someone doesn't want me to use peripherals Linux the way I want lol

mich41 wrote:

Can you switch to some TTY when it's stuck? Does it work there?

Just to get things straight, the built-in keyboard always works correctly?

Internal keyboard works correctly. I can switch to a TTY using it, and to use the keyboard again I'd have to plug it off and on again. As soon as I switch to X it shows the same problem again.

EDIT: Waaaait a minute, how come I didn't notice THIS? (Taken from Xorg.0.log)

[    16.738] (**) evdev: Logitech USB Keyboard: Device: "/dev/input/event10"
[    16.738] (--) evdev: Logitech USB Keyboard: Vendor 0x46d Product 0xc31c
[    16.738] (--) evdev: Logitech USB Keyboard: Found absolute axes
[    16.738] (II) evdev: Logitech USB Keyboard: Forcing absolute x/y axes to exist.
[    16.738] (--) evdev: Logitech USB Keyboard: Found keys
[    16.738] (II) evdev: Logitech USB Keyboard: Forcing relative x/y axes to exist.
[    16.738] (II) evdev: Logitech USB Keyboard: Configuring as mouse     // <--- WTF
[    16.738] (II) evdev: Logitech USB Keyboard: Configuring as keyboard

EDIT 2: This actually shows when plugging the keyboard to one of the USB3 ports:
Excerpt from Xorg.0.log:

[   463.974] (II) config/udev: removing device Logitech USB Keyboard
[   463.986] (II) evdev: Logitech USB Keyboard: Close
[   463.986] (II) UnloadModule: "evdev"
[   464.034] (II) config/udev: removing device Logitech USB Keyboard
[   464.050] (II) evdev: Logitech USB Keyboard: Close
[   464.050] (II) UnloadModule: "evdev"
[   466.935] (II) config/udev: Adding input device Logitech USB Keyboard (/dev/input/event10)
[   466.935] (**) Logitech USB Keyboard: Applying InputClass "evdev keyboard catchall"
[   466.935] (**) Logitech USB Keyboard: Applying InputClass "Keyboard Defaults"
[   466.935] (II) Using input driver 'evdev' for 'Logitech USB Keyboard'
[   466.935] (**) Logitech USB Keyboard: always reports core events
[   466.935] (**) evdev: Logitech USB Keyboard: Device: "/dev/input/event10"
[   466.935] (--) evdev: Logitech USB Keyboard: Vendor 0x46d Product 0xc31c
[   466.936] (--) evdev: Logitech USB Keyboard: Found absolute axes
[   466.936] (II) evdev: Logitech USB Keyboard: Forcing absolute x/y axes to exist.
[   466.936] (--) evdev: Logitech USB Keyboard: Found keys
[   466.936] (II) evdev: Logitech USB Keyboard: Forcing relative x/y axes to exist.
[   466.936] (II) evdev: Logitech USB Keyboard: Configuring as mouse
[   466.936] (II) evdev: Logitech USB Keyboard: Configuring as keyboard
[   466.936] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.1/0003:046D:C31C.0008/input/input30/event10"
[   466.936] (II) XINPUT: Adding extended input device "Logitech USB Keyboard" (type: KEYBOARD, id 13)
[   466.936] (**) Option "xkb_rules" "evdev"
[   466.936] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
[   466.936] (II) evdev: Logitech USB Keyboard: initialized for absolute axes.
[   466.936] (**) Logitech USB Keyboard: (accel) keeping acceleration scheme 1
[   466.936] (**) Logitech USB Keyboard: (accel) acceleration profile 0
[   466.936] (**) Logitech USB Keyboard: (accel) acceleration factor: 2.000
[   466.936] (**) Logitech USB Keyboard: (accel) acceleration threshold: 4
[   466.936] (II) config/udev: Adding input device Logitech USB Keyboard (/dev/input/event9)
[   466.936] (**) Logitech USB Keyboard: Applying InputClass "evdev keyboard catchall"
[   466.936] (**) Logitech USB Keyboard: Applying InputClass "Keyboard Defaults"
[   466.936] (II) Using input driver 'evdev' for 'Logitech USB Keyboard'
[   466.936] (**) Logitech USB Keyboard: always reports core events
[   466.936] (**) evdev: Logitech USB Keyboard: Device: "/dev/input/event9"
[   466.936] (--) evdev: Logitech USB Keyboard: Vendor 0x46d Product 0xc31c
[   466.936] (--) evdev: Logitech USB Keyboard: Found keys
[   466.936] (II) evdev: Logitech USB Keyboard: Configuring as keyboard
[   466.936] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/0003:046D:C31C.0007/input/input29/event9"
[   466.936] (II) XINPUT: Adding extended input device "Logitech USB Keyboard" (type: KEYBOARD, id 14)
[   466.936] (**) Option "xkb_rules" "evdev"
[   466.936] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"

Last edited by Gianfrix (2016-04-29 22:40:02)


~ Gianfrix
There's no place like 127.0.0.1

Offline

#6 2016-05-01 13:21:08

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Problem with USB hub and input devices

Weird, maybe the keyboard supports some macros with mouse emulation? Do you have other keyboards to test?

Are you sure it doesn't happen without the mouse? What if you plug it to a different port (USB3/USB3 or USB3/USB2 or USB2/USB3)?

Any messages in dmesg when it gets stuck? During disconnection/reconnection?

Offline

#7 2016-05-01 13:51:08

Gianfrix
Member
From: Locorotondo (BA) - Italy
Registered: 2009-10-21
Posts: 41
Website

Re: Problem with USB hub and input devices

mich41 wrote:

Weird, maybe the keyboard supports some macros with mouse emulation? Do you have other keyboards to test?

Unfortunately no by now, but out of curiosity I plugged in the same hub another mouse. You know what? They all work flawlessly together! O.o
So, recapping: 1 mouse and 1 keyboard (btw, it is a Logitech K120) don't work connected on the same hub. Two mouse and the keyboard work correctly!
Still there are not errors or differences in dmesg or in the log.
EDIT: Actually sometimes it does and sometimes it doesn't, I have to disconnect and reconnect the keyboard first for it to work.
Really, it seems like I'm trolling but I'm not, it is pretty weird what is happening.

mich41 wrote:

Are you sure it doesn't happen without the mouse? What if you plug it to a different port (USB3/USB3 or USB3/USB2 or USB2/USB3)?

As soon as keyboard and mouse are on the same hub they don't work together.

mich41 wrote:

Any messages in dmesg when it gets stuck? During disconnection/reconnection?

Nope, only the standard connection/disconnection messages.

Last edited by Gianfrix (2016-05-01 13:57:13)


~ Gianfrix
There's no place like 127.0.0.1

Offline

#8 2016-05-01 20:19:12

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Problem with USB hub and input devices

Hmm, what if both mice are connected? wink

Maybe run

watch -n1 cat /proc/interrupts

Locate interrupt corresponding to the USB bus used by those devices and see if interrupt count on this line increases by 1 on some CPU every time you press some key and every time you release some key. Use different bus if other devices are spamming this interrupt.

This should tell whether hardware stops working or software gets messed up.

Offline

#9 2016-05-02 23:16:01

Gianfrix
Member
From: Locorotondo (BA) - Italy
Registered: 2009-10-21
Posts: 41
Website

Re: Problem with USB hub and input devices

mich41 wrote:

Hmm, what if both mice are connected? wink

Sometimes the keyboard works, sometimes it doesn't. Don't know why and surely I'd like not to connect an extra mouse as a workaround big_smile

mich41 wrote:

Maybe run

watch -n1 cat /proc/interrupts

Locate interrupt corresponding to the USB bus used by those devices and see if interrupt count on this line increases by 1 on some CPU every time you press some key and every time you release some key. Use different bus if other devices are spamming this interrupt.

This should tell whether hardware stops working or software gets messed up.

When a key is stuck there are no noticeable interrupts. After that, pressing keys on the USB keyboard doesn't generate any interrupt. I should mention that directly plugging the USB keyboard (bypassing the hub) and holding a key doesn't generate repeated interrupts, as it would if I repeatedly press a key.
There are some few other interrupts on the USB bus though, but of course if I remove all devices from the hub and I just leave the keyboard there's no point in debugging (as it works fine). Maybe it's because I'm running from a live USB right now.

Last edited by Gianfrix (2016-05-02 23:16:31)


~ Gianfrix
There's no place like 127.0.0.1

Offline

#10 2016-05-03 08:39:03

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Problem with USB hub and input devices

No repetition is OK, USB keyboards don't do that. They just send a list of all currently pressed keys each time the list changes, that is each time some key is pressed or released. Repetition is done by software.

Gianfrix wrote:

When a key is stuck there are no noticeable interrupts. After that, pressing keys on the USB keyboard doesn't generate any interrupt.

OK, so it looks like the keyboard and USB controller stop communicating for some reason. Maybe some power management silliness? (disregard the bit about XHCI, that's a different story)

Last edited by mich41 (2016-05-03 08:40:27)

Offline

#11 2016-05-09 08:03:43

Gianfrix
Member
From: Locorotondo (BA) - Italy
Registered: 2009-10-21
Posts: 41
Website

Re: Problem with USB hub and input devices

mich41 wrote:
Gianfrix wrote:

When a key is stuck there are no noticeable interrupts. After that, pressing keys on the USB keyboard doesn't generate any interrupt.

OK, so it looks like the keyboard and USB controller stop communicating for some reason. Maybe some power management silliness? (disregard the bit about XHCI, that's a different story)

Nope, I tried before and it didn't work. I tried again now after installing Arch on my HD instead of using a live USB but still doesn't work. Even tried disabling autosuspend for all USB devices using powertop but nothing changes.


~ Gianfrix
There's no place like 127.0.0.1

Offline

Board footer

Powered by FluxBB