Score:1

Slow USB ports (losing keyboard keystrokes) sometimes on Ubuntu 22.04

in flag

I recently upgraded to 22.04, and have since experienced extremely laggy USB ports, to the point where I lose keystrokes and much/most of the mouse movement input. I am using a USB switch primarily, as this is a server in a rack around the corner.

The baffling thing is that I occasionally get perfect connectivity after physically unplugging/replugging the switch on some ports, but this is not entirely repeatable (otherwise I would ignore it and move on).

I'm looking for some insight on how I would begin to diagnose this?

I have tried:

  • Switching between Wayland and Xorg
  • Using GNOME vs. Gnome Flashback
  • tail -f xorg.0.log
  • looking for alternate display drivers (on-board Intel, no proprietary drivers)
  • a couple other random things I no longer remember from here & around the internet.

USB feels like a little bit of a black box to me, and I was hoping to find out if there's any good way to peek under the hood? powertop was pointed out in the comments, and I will take a look at that. The dmesg suggestion has been helpful, it gave me some ideas.

Hardware Info:

lscpu snippet:
Model name:           Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz

lspci snippet:
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation IvyBridge GT2 [HD Graphics 4000] (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)

An example of dmesg info:

[240530.609005] usb 3-4: USB disconnect, device number 34
[240530.609114] usb 3-4: clear tt 4 (8000) error -71
[240530.609186] usb 3-4-port4: cannot reset (err = -71)
[240530.609516] usb 3-4-port4: attempt power cycle
[240530.609524] usb 3-4-port4: failed to disable port power
[240530.612236] usb 3-4.1: USB disconnect, device number 35
[240530.884271] usb 3-4.2: USB disconnect, device number 36
[240531.791908] usb 3-4: new high-speed USB device number 41 using xhci_hcd
[240531.955365] usb 3-4: New USB device found, idVendor=0bda, idProduct=5411, bcdDevice= 1.44
[240531.955375] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[240531.955378] usb 3-4: Product: 4-Port USB 2.0 Hub
[240531.955380] usb 3-4: Manufacturer: Generic
[240531.956844] hub 3-4:1.0: USB hub found
[240531.957869] hub 3-4:1.0: 4 ports detected
[240532.247872] usb 3-4.1: new low-speed USB device number 42 using xhci_hcd
[240532.354792] usb 3-4.1: New USB device found, idVendor=045e, idProduct=07f8, bcdDevice= 3.00
[240532.354803] usb 3-4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[240532.354806] usb 3-4.1: Product: Wired Keyboard 600
[240532.354808] usb 3-4.1: Manufacturer: Microsoft
[240532.363793] input: Microsoft Wired Keyboard 600 as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.1/3-4.1:1.0/0003:045E:07F8.004C/input/input83
[240532.420569] hid-generic 0003:045E:07F8.004C: input,hidraw0: USB HID v1.11 Keyboard [Microsoft Wired Keyboard 600] on usb-0000:00:14.0-4.1/input0
[240532.423247] input: Microsoft Wired Keyboard 600 Consumer Control as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.1/3-4.1:1.1/0003:045E:07F8.004D/input/input84
[240532.480188] input: Microsoft Wired Keyboard 600 System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.1/3-4.1:1.1/0003:045E:07F8.004D/input/input85
[240532.480508] hid-generic 0003:045E:07F8.004D: input,hidraw1: USB HID v1.11 Device [Microsoft Wired Keyboard 600] on usb-0000:00:14.0-4.1/input1
[240532.559907] usb 3-4.2: new full-speed USB device number 43 using xhci_hcd
[240532.663141] usb 3-4.2: New USB device found, idVendor=046d, idProduct=c52b, bcdDevice=12.11
[240532.663146] usb 3-4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[240532.663148] usb 3-4.2: Product: USB Receiver
[240532.663149] usb 3-4.2: Manufacturer: Logitech
[240532.675394] logitech-djreceiver 0003:046D:C52B.0050: hiddev0,hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-4.2/input2
[240532.879902] usb 3-4.4: new full-speed USB device number 44 using xhci_hcd
[240532.920833] logitech-hidpp-device 0003:046D:4082.0051: HID++ 4.5 device connected.
[240532.960802] logitech-hidpp-device 0003:046D:4082.0051: HID++ 4.5 device connected.
[240533.182857] logitech-hidpp-device 0003:046D:4082.0051: hidpp20_batterylevel_get_battery_info: received protocol error 0x06
[240533.484976] input: Logitech MX Master 3 as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.2/0003:046D:C52B.0050/0003:046D:4082.0051/input/input86
[240533.487451] logitech-hidpp-device 0003:046D:4082.0051: input,hidraw3: USB HID v1.11 Keyboard [Logitech MX Master 3] on usb-0000:00:14.0-4.2/input2:1
[240533.504048] input: Logitech MX Ergo as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.2/0003:046D:C52B.0050/0003:046D:406F.0052/input/input87
[240533.516867] logitech-hidpp-device 0003:046D:406F.0052: input,hidraw4: USB HID v1.11 Keyboard [Logitech MX Ergo] on usb-0000:00:14.0-4.2/input2:2
[240533.530934] input: Logitech ERGO K860 as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.2/0003:046D:C52B.0050/0003:046D:4088.0053/input/input88
[240533.533914] logitech-hidpp-device 0003:046D:4088.0053: input,hidraw5: USB HID v1.11 Keyboard [Logitech ERGO K860] on usb-0000:00:14.0-4.2/input2:3
[240537.854516] usb 3-4: USB disconnect, device number 41
[240537.855133] usb 3-4-port4: attempt power cycle
[240537.855140] usb 3-4-port4: failed to disable port power
[240537.855422] usb 3-4.1: USB disconnect, device number 42
[240538.117213] usb 3-4.2: USB disconnect, device number 43
Matias N Goldberg avatar
vg flag
Check with `sudo powertop` that your USB devices and hubs in the tunables section are not set to power saving. If you have TLP installed, turn it off (if that's the problem, then turn it on and start going device by device in tlp config). Also check dmesg for potential USB errors or warnings. Also post your HW. You said 0 info about your HW config.
jhaagsma avatar
in flag
Ah, that is fair, tough to remember all the things when one is frustrated. I will update above, & I will take a look at powertop, I have never used that.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.