Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [Solved] Cursor hide event freezes entire desktop (Read 648 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Solved] Cursor hide event freezes entire desktop

For about a month or so, after having done a full system upgrade, I've had a very annoying issue where any application that hides or unhides the cursor causes some component of my system to freeze. The freeze appears to be longer and happen a lot more frequently if the mouse cursor FPS is lower (happened after I killed picom and started it again).

Affected applications: Any that use cursor hide event (mpv, Firefox, Talos Principle 2,...).

It goes like this: Application causes cursor hide event, display (X11) freezes for 2 or so seconds, cursor hides, display freezes for 2 more seconds. If anything was being written as the cursor hide event happened, the first character is written twice.

In the case of mpv, it freezes, and this is written in STDOUT:
Code: [Select]
Audio device underrun detected.
Audio device underrun detected.
Audio device underrun detected.
Audio device underrun detected.

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

Audio device underrun detected.
Audio device underrun detected.

In the case of Firefox, typing in any text field, such as the Search bar, freezes it as described.

In the case of Talos Principle 2, the game becomes almost unplayable as any opening of the pause menu, tab menu, dialogues, or anything else that uses the hide/unhide events (it happens really frequently) freezes the game.

I ruled out the possibility that it was due to the window manager (Qtile) by trying another (bspwm) and due to the compositor (picom) by temporarily killing it.

I am using a USB mouse/keyboard and AMD graphics card, Mesa drivers.

Can you please help me diagnose and fix this issue? It has been driving me crazy, and left me with an unplayable game on launch solely because I couldn't diagnose this issue myself.

Re: Cursor hide event freezes entire desktop

Reply #1
That sounds quite odd.
Anything errors in dmesg when it occurs ? xorg.log ?

If this was happening to me me I'd boot into one of the weekly iso's and see if it was happening in the 'live' environment.
If it still was I'd try another distro's live iso.

If it still was again I'd have to suspect a hardware fault.

If not then I'm not sure how I'd diagnose it other than what I first mentioned ? Maybe try an older LTS kernel ?
It's not an issue I've ever come across personally And I suspect I'd be a bit stuck myself if I did.
Sorry I can't be more help than that.

Re: Cursor hide event freezes entire desktop

Reply #2

 You should try a different mouse and see if the problem is still there. I'm about 70% sure it's a mouse related issue.


Re: Cursor hide event freezes entire desktop

Reply #3
I was suggested to disable C-state switching in the BIOS, which didn't help (global C-state control).

That sounds quite odd.
Anything errors in dmesg when it occurs ? xorg.log ?

If this was happening to me me I'd boot into one of the weekly iso's and see if it was happening in the 'live' environment.
If it still was I'd try another distro's live iso.

If it still was again I'd have to suspect a hardware fault.

If not then I'm not sure how I'd diagnose it other than what I first mentioned ? Maybe try an older LTS kernel ?
It's not an issue I've ever come across personally And I suspect I'd be a bit stuck myself if I did.
Sorry I can't be more help than that.
There was nothing in `dmesg` or `Xorg.log`, I currently don't have enough time to switch kernel version but it sounds like a good guess.


 You should try a different mouse and see if the problem is still there. I'm about 70% sure it's a mouse related issue.
Good guess. At least as of now, since I unplugged my USB mouse (Steelseries Rival 3, with some customisation using `rivalcfg`) and plugged in a vastly different USB mouse (some really old, dinky SilverCrest mouse), I cannot replicate the issue.

However, since the issue is very inconsistent to replicate, I may need to spend a bit more time with it to safely conclude that something about the mouse is the issue. Again though, considering it only started happening after a system upgrade, it should either be the version of the kernel or X causing the issue, from what I can tell.

Edit: The `rivalcfg` utility offered to update udev rules, which I just did, and hopefully that will make a difference.
Edit 2: That didn't help, but the issue seems to start happening after a certain period of time passes.


Re: Cursor hide event freezes entire desktop

Reply #5
Very strange problem. If you roughly remember on what day you did this update that caused this problem, you could look at your /var/log/pacman.log and try to downgrade possible packages one-by-one. It'd probably be a bit of work but if you can narrow down what specific package upgrade causes this, that would be a big step forward.

Re: Cursor hide event freezes entire desktop

Reply #6
Oh! I was looking in the wrong Xorg.log, now I checked the one in my home directory and found this:
Code: [Select]
[  2059.614] (II) event5  - SteelSeries SteelSeries Rival 3: SYN_DROPPED event - some input events have been lost.
[  2059.655] (EE) event5  - SteelSeries SteelSeries Rival 3: client bug: event processing lagging behind by 35ms, your system is too slow
[  2571.750] (II) event5  - SteelSeries SteelSeries Rival 3: SYN_DROPPED event - some input events have been lost.
[  2571.792] (EE) event5  - SteelSeries SteelSeries Rival 3: client bug: event processing lagging behind by 22ms, your system is too slow
[  2923.382] (EE) event2  - SONiX USB DEVICE: client bug: event processing lagging behind by 2170ms, your system is too slow
[  2923.382] (II) event5  - SteelSeries SteelSeries Rival 3: SYN_DROPPED event - some input events have been lost.
[  4919.198] (II) event5  - SteelSeries SteelSeries Rival 3: SYN_DROPPED event - some input events have been lost.

I am currently trying to see if switching mouse drivers as ####### pointed out helps.

Re: Cursor hide event freezes entire desktop

Reply #7

 Think I got it. Your mouse has high dpi or the way you set it up triggers that. When use such mouse and probably such settings with high demands of resources this freezes can happen. Since a game in general use high resources and you add a resource hungry mouse, inevitable freezes can happen.

You can try lower dpi or some other mouse related settings so maybe you get rid of those freezes.  This could be the case when mouse being ultra performant leaves behind system specs..Or try lower game graphics so your mouse use some resources from there.

Re: Cursor hide event freezes entire desktop

Reply #8

 Think I got it. Your mouse has high dpi or the way you set it up triggers that. When use such mouse and probably such settings with high demands of resources this freezes can happen. Since a game in general use high resources and you add a resource hungry mouse, inevitable freezes can happen.

You can try lower dpi or some other mouse related settings so maybe you get rid of those freezes.  This could be the case when mouse being ultra performant leaves behind system specs..Or try lower game graphics so your mouse use some resources from there.
I don't know about that... I tried to switch to evdev as suggested above and it didn't help:
Code: [Select]
Section "InputClass"
Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

I could try and reduce the DPI, it's only at 800 after all, however the issues occur even on low CPU load.

The polling rate is at 1000 Hz, maybe that's an issue?

Edit: I downgraded xf86-input-libinput and libinput to 1.3.0 and 1.23.0 respectively, hopefully that does it. I will return when I spend enough time testing.

Edit 2: That didn't help either.

 

Re: Cursor hide event freezes entire desktop

Reply #9
Ever since I performed a full upgrade a few days ago, I have not noticed a single instance of this issue happening again. I suspect it's gone now. Hurray!