Frogging-Family / linux-tkg

linux-tkg custom kernels
GNU General Public License v2.0
1.36k stars 169 forks source link

massive performance penalty for 8000hz polling #557

Open laqyx opened 2 years ago

laqyx commented 2 years ago

Sorry if this is the wrong place to ask since this applies to the vanilla kernel and the tkg kernel. This issue isnt isolated to me, my friend has it too on a completely different distro, but I'm using Artix. Hardware wise our PCs are pretty similar, me with an ryzen 5 5600x and his is a 5800x. I dont think its an issue with out CPUs being too weak to handle the polling rate since it works just fine under Windows with a very negligible performance penalty. With massive performance penalty I mean dropping from 400fps to 250fps while moving my mouse, while at 4000hz I basically get no performance penalty at all. I'm by no means an expert and have no knowledge in kernel development, but on the Windows side people worked around this issue (on weaker CPUs) by locking the Mouse/USB Controller to a singular CPU core. While I dont think its an issue of the CPU not being able to handle the polling rate, maybe this issue could be worked around with assigning the USB Controller to a specific CPU Core? I dont know if this is currently possible, but if it is please let me know.

If it helps in any way, heres my /etc/X11/xorg.conf.d/50-mouse-acceleration.conf

Section "InputClass" Identifier "My Mouse" MatchIsPointer "yes"

    Driver "evdev"

    Option "AccelerationProfile" "-1"
    Option "AccelerationScheme" "none"
    Option "AccelSpeed" "-1"

EndSection

Tk-Glitch commented 2 years ago

Are native games also affected? Because that's a known long running issue with Wine since at least 2012. It also used to be and still is to a certain extent an issue with some Windows applications running on Windows (CPU load skyrockets and eats a whole core, usually core 0, leading to horrendous gaming perf). The fastest mice I have are 1000Hz and that's already an issue at that speed with some games running with Wine, on a 5950x (125Hz being the maximum before things are going south in some of them like Neverwinter). CPU load doesn't move in a measurable way btw, the bottleneck is in Wine in that case.

Anyway fixing this is out of my grasp, be it in kernel or Wine. And it doesn't seem to be easy since it might have always been an issue to begin with, just that USB devices used to respect the 125Hz USB port rate at the time.

laqyx commented 2 years ago

I drop a significant amount of fps in native games (csgo) but it's not as massive as in wine games, I made this quick video in 30 mins to demonstrate it https://youtu.be/C5kY06dMre8