debauchee / barrier

Open-source KVM software
Other
27.25k stars 1.5k forks source link

Moving mouse with a polling rate over 1000 makes computer lag #1110

Open Abragus opened 3 years ago

Abragus commented 3 years ago

When using my Logitech G502 with the polling rate set to 1000, certain parts of my computer lags heavily while moving the mouse (not when the mouse is still).

This includes, but is probably not limited to:

I did notice now, that it feels like all movement, except for the cursor maybe, is limited to 60 hz whenever the issue is happening. Not completely sure about this though.

Clicking 'stop' in the barrier client removes the lag completely. Closing down Barrier does NOT solve the issue, however. It does not matter if a client is connected or not. Lowering the polling rate of my mouse to 500 or anything lower also works. Using a cheapo mouse (which I'm sure has a polling rate below 1000), there is no problem either. The problem seems to be the combination of Barrier and a mouse with a high polling rate.

The weird thing is that I think this started when I first plugged in my new headphones (HyperX Cloud II Wireless), but even after I uninstalled absolutely everything that has to do with it (drivers, control programs, etc.) the problem was still there. And even if it did have something to do with my headphones, Barrier (or my mouse, whichever way you see it) is what is causing the problem, so the fix should be related to Barrier rather than anything else, in my mind at least.

I will happily add any information that is needed. I have not found anything unusual in the logs.

Rick-laboratory commented 3 years ago

https://linustechtips.com/topic/1110338-1000hz-mouse-polling-lag-epidemic/ Its usual that 1000Hz Polling rate even 500Hz has a huge impact on the thread, responsible for it. A Mouse Hook reacting on incoming mouse events doesnt make it better. Because a 1000Hz pollingrate will inflate the number of events gathered, blowing up on following procederes invoking callbacks of doom. In other words it eats performance and has no benefit at all, you would ball out your shoulder before you would even come close to the acceleration which has to be archieved to make your 1000Hz Polling rate theoreticly usefull.

xenago commented 3 years ago

This snippet of the above comment is inaccurate:

(1000hz mouse polling rate) has no benefit at all, you would ball out your shoulder before you would even come close to the acceleration which has to be archieved to make your 1000Hz Polling rate theoreticly usefull.

All that is required to see the effect of an increased polling rate is a computer with a 144hz+ display and a 1000hz mouse - just configure the mouse to 125hz in the driver and drag a window around the screen. A video game isn't required to notice the decreased polling rate - judder is visible immediately, it's incredibly distracting.

More information on this and related subjects is available on the Blurbusters site, which is an original source for much related subject matter on the web:

https://forums.blurbusters.com/viewtopic.php?f=10&t=6162#p46293

https://blurbusters.com/faq/mouse-guide/

Another place to go for input lag testing is the Battlenonsense YouTube channel:

Mouse testing - in particular, go to ~10:30 where there are clips of the visual difference: https://www.youtube.com/watch?v=mwf_F2VboFQ

Input lag playlist: https://www.youtube.com/playlist?list=PLfOoCUS0PSkXVGjhB63KMDTOT5sJ0vWy8

Abragus commented 3 years ago

This snippet of the above comment is inaccurate:

(1000hz mouse polling rate) has no benefit at all, you would ball out your shoulder before you would even come close to the acceleration which has to be archieved to make your 1000Hz Polling rate theoreticly usefull.

I agree. I do notice a difference even between 1000hz and 500hz (I have a 144hz monitor). I have resorted to lowering it to 500, since it isn't that noticable, and the lagging is a lot more annoying.

But I would still like this to be fixed. As I said in the original post, the responsibility to fix this should be on Barrier. It should be able to handle the high polling rate without making the computer lag, whether that is skipping every other movement report, or something else.

Yairama commented 1 year ago

Hello!

I got that problem with a G502 Logitech Mouse wich causes lag on videogames with a polling rate greater than 1000.

I tried two ways, the first one was disabling the C-State in bios. It worked for me, but I wanted to search other ways.

Then I found in a forum that the problem had origin in the motherboard, so, if the devs had fixed the problem you just needed to update the bios. And, it worked for me again.

Personally I recommend the second way, then, if not work, try disabling the C-State.

Hydraxous commented 5 months ago

I had never had an issue with this until today. I've always had my polling rate at 1000 and no observable effects.

I also have a G502 and I'm on Windows 10.

Today upon trying to use my mouse in any video game, the game stutters so bad it comes to a halt whenever I move my mouse. The only change made to my pc was an automatic windows 10 update, so I had assumed that windows was the culprit.

However, changing the polling rate to 250 or 125 in the logitech app fixed the issue for me entirely.

VormixSv commented 4 months ago

I have the same problem in the game "Sea of ​​Thieves". Every time I move the mouse the FPS drops to 0 and the game literally freezes until I stop moving the mouse. My mouse polling rate is already 125Hz, but I even tried reducing it to 62Hz. It did not help. The game itself works fine as long as I don't move the mouse. Help!!

vitaminmoo commented 2 months ago

https://github.com/debauchee/barrier/issues/490 appears to be a duplicate with this