You are not logged in.

#1 2023-01-19 22:49:29

Corrupted
Member
Registered: 2021-07-07
Posts: 18

[Solved] Games stuttering when using mouse and keyboard

I've recently run into issues with both native and non-native ( proton/wine ) games stuttering if I try to play them on mouse and keyboard. The first game I experienced this with was Chained Echoes. Disabling picom more or less fixed the issue but resulted in tearing. If I leave picom on and use an xbox controller instead I don't get any stuttering. I've also experienced this with valheim and again, recently, with FFXIV. After 40 minutes of playing I start to get really bad stutter that seems to go away if I plug in and use my xbox controller. Alternatively, restarting the game seems to fix the stuttering issue for a period of time. I've tried disabling picom for FFXIV as well but it didn't make a difference and after 40mins the stuttering started again.

I've checked my gpu and cpu when this starts happening and they both appear to be normal ( GPU: 64c, 39% usage, 44635/112264 mem usage for GPU - 50c 40% usage for CPU ). Enabling performance mode on the cpu doesn't fix the issue and at this point I'm not really sure what the issue could be or why this appears to crop up specifically when I try to use mouse and keyboard. Has anyone else experienced this?

Specs are as follows in case that's important:
ROG Strix X299-E
64gb ram
2080ti
i9-10980xe
Xorg - i3

Edit:
Just now realizing this has been posted in the wrong section. Apologies. I can't seem to relocate the post to the proper section.

Last edited by Corrupted (2023-01-22 10:01:46)

Offline

#2 2023-01-20 18:30:15

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: [Solved] Games stuttering when using mouse and keyboard

Maybe some devices interfere on the same (shared) USB bus. Check with 'lsusb' for devices that reside on the same 'Bus'. Try to "shuffle/spread" them by plugging into different ports.


sys2064

Offline

#3 2023-01-21 00:55:56

Corrupted
Member
Registered: 2021-07-07
Posts: 18

Re: [Solved] Games stuttering when using mouse and keyboard

Maniaxx wrote:

Maybe some devices interfere on the same (shared) USB bus. Check with 'lsusb' for devices that reside on the same 'Bus'. Try to "shuffle/spread" them by plugging into different ports.

Thanks for the suggestion. I took a look at the output of lsusb and it shows that all of my usb devices are going over Bus 01:

Bus 001 Device 042: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 041: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 040: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 039: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 038: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 029: ID 05a7:1020 Bose Corp. Bose USB Audio
Bus 001 Device 037: ID 1532:0226 Razer USA, Ltd Huntsman Elite
Bus 001 Device 011: ID 0b05:1867 ASUSTek Computer, Inc. AURA Custom Human interface
Bus 001 Device 009: ID 0b05:185c ASUSTek Computer, Inc. Bluetooth Radio
Bus 001 Device 036: ID 1532:0086 Razer USA, Ltd Gaming Mouse [Basilisk Ultimate, Wired]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I tried moving the mouse across all of the usb ports on my PC when the stuttering started and none of them seemed to change the bus. It just changed where on the Bus 01 list the mouse was showing up. I have a usb hub hooked up that I tried unplugging to see if maybe that would clear up any 'noise' but it didn't help. Next time the problem starts I'll try unplugging everything except the mouse and see if that makes a difference. Interestingly enough, after unplugging and replugging all of my usb devices the stuttering issue became persistent until I switched the main display at which point it seemed to stop. Started seeing an ibus warning around that time but I don't know that it's related.

Jan 20 16:35:38 por systemd-logind[909]: Watching system buttons on /dev/input/event10 (Razer Basilisk Ultimate)
Jan 20 16:35:44 por dbus-daemon[2254]: [session uid=1000 pid=2254] Activating service name='org.freedesktop.portal.IBus' requested by ':1.94' (uid=1000 pid=16475 comm="XIVLauncher.Core run --parent-xpose-pids --parent-")
Jan 20 16:35:44 por dbus-daemon[2254]: [session uid=1000 pid=2254] Activated service 'org.freedesktop.portal.IBus' failed: Process org.freedesktop.portal.IBus exited with status 1
Jan 20 16:35:44 por org.freedesktop.portal.IBus[16490]: Not connected to the ibus bus
Jan 20 16:35:53 por gamemoded[6762]: ERROR: Wine loader has no accepted cmdline for client 16522 yet, deferring.
Jan 20 16:35:53 por pkexec[16523]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)

Offline

#4 2023-01-21 04:13:05

Corrupted
Member
Registered: 2021-07-07
Posts: 18

Re: [Solved] Games stuttering when using mouse and keyboard

Ran into the issue again. At the time I had journalctl running in 'follow mode'. Nothing new appeared in the journalctl logs other than homed rebalancing around 10mins prior to the issue occurring. I plugged in my controller which of course fixed the stuttering. Checking lsusb it looks like it is also on bus 01 so if the issue were interference or 'noise' on that bus I would expect the controller to display the same issue. Going back to mouse and keyboard caused the stuttering to start again. I tried unplugging everything except the mouse but the issue persisted even after removing potential sources of interference. I'm not sure where to start so far as debugging goes. It does appear to be some sort of I/O issue since the game(s) work fine outside of the mouse and keyboard causing performance issues. I'm going to see if I can use libinput to monitor the keyboard and mouse and see if that turns anything up.

I grabbed a video of the issue. I started recording after the stuttering started but you can see the game running very poorly when moving around/adjusting the camera with m&k and as soon as I switch to the controller everything starts running fine again: https://www.dropbox.com/s/3pac2cfx5qj3v … e.mp4?dl=0

Edit: I did some more looking around and it seems as though someone else has run into a similar issue with wine specifically and it was caused by the polling rate of their peripherals. I'm going to try monitoring/tweaking that and see if that helps at all.

Last edited by Corrupted (2023-01-21 04:28:39)

Offline

#5 2023-01-21 07:42:44

Corrupted
Member
Registered: 2021-07-07
Posts: 18

Re: [Solved] Games stuttering when using mouse and keyboard

Alright, I think what I'm running into is "ghost stuttering" https://www.reddit.com/r/linux_gaming/c … ring_when/

This appears to be an issue with certain game engines and wine in general: https://bugs.winehq.org/show_bug.cgi?id=46976. Both my mouse and my keyboard have high poll rates ( 1ms ) which seems to trigger this 'ghost stuttering'. For games like Chained Echoes this is immediately evident whereas for games like FFXIV it seems to take a while for it to become an issue. Not sure why that is. For some people updating the BIOS fixes this. My BIOS hadn't been updated for a couple years since attempting an internet update caused it to lock. I updated my BIOS to the latest version using USB but this did not fix the issue. Since the high poll rate seems to be the issue I tried modifying the polling interval for both my mouse and keyboard by creating the usbhid.conf modprob file and adding:

options usbhid mousepoll=3
options usbhid kbpoll=3

After running modprob I checked to see if the changes took via:

systool -m usbhid -A mousepoll

and then checked the Ivl for both devices. Neither had changed which seems to mean I've run into another long standing bug: https://bugzilla.kernel.org/show_bug.cgi?id=82571. I may continue poking around at this as time permits but it seems, to me, that there isn't much else that can be done other than replacing peripherals with something slower or disabling USB3.

Offline

#6 2023-01-22 09:59:09

Corrupted
Member
Registered: 2021-07-07
Posts: 18

Re: [Solved] Games stuttering when using mouse and keyboard

I've kind of, sort of found a fix for this issue. The 'ghost stuttering' can be, more or less, fixed by setting the cpu into performance mode. This is something I do for most games anyways but it really helps with game that have mouse and keyboard caused stuttering.

sudo cpupower frequency-set -g performance

Additionally, I had been launching the game using XIVLauncher which apparently patches the game and uses its own custom wine-mono for better/more consistent performance. I uninstalled the XIVLauncher and tried running the game through proton-ge instead using the default launcher. Minus some crashing with the launcher and losing a few frames this seemed to fix the issue. The mouse and keyboard stuttering remains an issue for FFXIV and other games like Chained Echoes but is made far less noticeable by using the above command. It seems to be the case that either some tweaks XIVLauncher was making to the game/wine that was causing FPS issues given enough time in-game or proton-ge is providing some sort of patch to fix this. XIVLauncher had async dxvk enabled by default while proton-ge does not. I may try enabling it to see if it triggers the stuttering issue with proton-ge. Regardless the problem seems to be fixed now so I'm going to mark this solved.

Last edited by Corrupted (2023-01-22 10:05:29)

Offline

Board footer

Powered by FluxBB