You are not logged in.
I am having trouble with my keyboard and mouse connected to my work laptop and my PC through an USB switch.
The mouse looks like it’s lagging, it stops for a moment then starts moving again while dragging it across the screen.
The keyboard is randomly missing keystrokes, and repeats others multiple times.
I am running Arch on my PC and Windows 11 on my work laptop. The issue only appears under Linux.
My keyboard and mouse are working if I connect them directly to my PC, but I am using an USB switch to be able to use the same devices on my work laptop.
Mouse: Logitech G Pro wireless - issue is present during both wired and wireless operation.
Keyboard: Asus ROG Falchion wireless - issue is present during both wired and wireless operation.
USB Switch: UGREEN USB 3.0 Switch Selector - Link
What I have tried:
For the keyboard:
Xev show the same results, some keystrokes are not registered, or repeated multiple times even after release.
Setting the rate and delay with xset also didn't help. I tried multiple values, and the issue still remains. Setting the delay to 600 seems to have reduced the keystroke repeating issue a bit, but also made it miss more keystrokes than before, which would make sense, since it's the delay between keystrokes.
I am not sure how to check polling rate of the keyboard.
UPDATE: I have tried with a generic Dell keyboard/mouse I found lying around, same results for these too, so It's probably caused by the switch.
As for the mouse:
I checked the mouse refresh rate with evhz-git(AUR) I got an average of 1000Hz, which is the correct refresh rate of this mouse, so that looks good.
If you have any ideas/insights on this, please point me in the right direction.
Thank you!
Last edited by Flashcap20 (2022-10-05 22:51:34)
Offline
My first guess would be to try disabling USB autosuspend. For a global test you can add usbcore.autosuspend=-1 to your kernel parameters
Offline
My first guess would be to try disabling USB autosuspend. For a global test you can add usbcore.autosuspend=-1 to your kernel parameters
Thank you for the quick reply! Unfortunately the issue still remains.
cat /proc/cmdline
BOOT_IMAGE=/vmlinuz[-linux root=UUID=af3d3899-e419-4998-81f8-ff2a9bd5780f rw rootflags=subvol=@ rootfstype=btrfs loglevel=3 quiet usbcore.autosuspend=-1Offline
Any dmesg output during lag?
Have you plugged external power supply to the switch?
Offline
Any dmesg output during lag?
Have you plugged external power supply to the switch?
Sorry for the late reply, when I got back it seemed to be working but after a reboot it was the same again.
The switch doesn't have an external power supply, it's connected to my PC and work laptop through USB 3, getting power from the one it's currently switched to.
dmesg might help with this though. I am getting messages like the ones below constantly, even without typing anything.
[19653.075115] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19654.721637] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19655.045349] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19656.721628] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19657.044753] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19658.734775] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19659.088593] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19660.575569] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19660.938263] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19662.045348] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19662.494920] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19663.445356] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19663.894682] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19664.898065] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19665.344471] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19666.495211] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19666.827997] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19667.915407] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19668.251777] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19668.604879] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19669.285190] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19669.974645] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19670.748657] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19671.404858] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19672.494993] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19673.047676] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19674.098541] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19674.614836] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19675.725104] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19676.088442] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19676.677649] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19677.767954] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19678.144917] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19679.898567] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19681.598740] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcd
[19686.654771] usb 1-9.2: reset full-speed USB device number 28 using xhci_hcd
[19686.974960] usb 1-9.3: reset full-speed USB device number 38 using xhci_hcdThe device 28 and 38 are my keyboard and mouse. The interesting thing is that I also have a USB DAC connected to the same USB switch, but that is not getting reset at all.
Here is the XHCI controller I have (grepped from lspci)
02:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] 500 Series Chipset USB 3.1 XHCI ControllerThe kernel that I am running is 5.19.13-arch1-1
Last edited by Flashcap20 (2022-10-06 18:07:03)
Offline
The switch doesn't have an external power supply
But it has micro-USB socket for it, right? I would try with external power supply first. Just to make sure power is good enough.
The device 28 and 38 are my keyboard and mouse. The interesting thing is that I also have a USB DAC connected to the same USB switch, but that is not getting reset at all.
Does it reset if DAC is unplugged? Does it reset if only one device (keyboard or mouse) is plugged and nothing else? Does it work if switch is connected to PC only?
Offline
Flashcap20 wrote:The switch doesn't have an external power supply
But it has micro-USB socket for it, right? I would try with external power supply first. Just to make sure power is good enough.
Flashcap20 wrote:The device 28 and 38 are my keyboard and mouse. The interesting thing is that I also have a USB DAC connected to the same USB switch, but that is not getting reset at all.
Does it reset if DAC is unplugged? Does it reset if only one device (keyboard or mouse) is plugged and nothing else? Does it work if switch is connected to PC only?
No, the switch has 2 USB ports for output (connecting to the input of the PC and Laptop) and 4 USB ports for input (these are the shared devices between the 2 systems), so I couldn't test it with a random external charger/power supply unfortunately.
It is resetting even if there's only 1 device connected (keyboard or mouse)
It doesn't reset if that one device is the USB DAC however. I also tested with my webcam connected to the switch, it is not resetting that either, so only my keyboard/mouse. Not sure how those are different from other devices under the hood though.
The difference has to be in the type of device, because the resetting happens for other keyboards/mice too, not just these specific ones.
Offline
Not sure how those are different from other devices under the hood though.
Mouse: Logitech G Pro wireless - issue is present during both wired and wireless operation.
Keyboard: Asus ROG Falchion wireless - issue is present during both wired and wireless operation.
I have tried with a generic Dell keyboard/mouse I found lying around, same results for these too
Are the Dell devices strictly wired?
Offline
Not sure how those are different from other devices under the hood though.
Mouse: Logitech G Pro wireless - issue is present during both wired and wireless operation.
Keyboard: Asus ROG Falchion wireless - issue is present during both wired and wireless operation.I have tried with a generic Dell keyboard/mouse I found lying around, same results for these too
Are the Dell devices strictly wired?
Yes, they are.
The mouse and keyboard I normally use are wired or wireless (RF), with both wired and wireless modes having the same issues.
Since neither of them are working, I assume the issue is not with the peripherals connected to the switch, but with the switch itself, or how it's handled by the kernel.
Is there a chance this could be a power issue? The kernel somehow limiting the power delivery of my USB ports perhaps? But then it's weird how it's still an issue even if there's only 1 device connected.
I will look into how to check this.
Last edited by Flashcap20 (2022-10-07 17:02:33)
Offline
Is there a chance this could be a power issue? The kernel somehow limiting the power delivery of my USB ports perhaps? But then it's weird how it's still an issue even if there's only 1 device connected.
Some controllers may monitor current consumption and disable a device if it draws more than requested. But power quality is also important, even if average consumption is ok pulses may cause some devices to glitch.
Offline