Bug 497025 - Wayland - Severe Stuttering When Giving Keyboard or Mouse Input In Certain Apps
Summary: Wayland - Severe Stuttering When Giving Keyboard or Mouse Input In Certain Apps
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: xwayland (show other bugs)
Version: 6.2.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-04 06:42 UTC by Noah Westervelt
Modified: 2025-01-05 01:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
EZ2ON Xprop Output (7.97 KB, text/plain)
2024-12-04 06:42 UTC, Noah Westervelt
Details
Trimmed "journalctl -b 0" Output (220.21 KB, text/plain)
2024-12-04 06:43 UTC, Noah Westervelt
Details
inxi -G output (683 bytes, text/plain)
2024-12-20 03:26 UTC, Noah Westervelt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noah Westervelt 2024-12-04 06:42:44 UTC
Created attachment 176337 [details]
EZ2ON Xprop Output

SUMMARY
When using Wayland, giving mouse / keyboard inputs to certain apps, like this particular game after it's been running for about 1 hour and 15 minutes, causes severe stuttering. The game in question is EZ2ON REBOOT: R, which is running under xwayland and Proton. This is the only application and situation I've seen this happen in, and I've noticed it for close to a month now.

In the journal output, you can see I opened the journal at 23:10:38 to check what was going on. I believe the journal entries seen at 23:03:56 and 23:11:30 are being output whenever the problem occurs. Going further down the journal you can see me opening and closing the journal while reproducing the problem multiple times (I'm alt tabbing in and out of the game in between checking the journal, giving the game mouse and keyboard input when the game's fullscreen window has focus).

I also noticed that my CPU usage dropped slightly whenever I would hold a key down on my keyboard (with the game focused) or rapidly moved my mouse over the game's fullscreen window.

I've attached the xprop output for the game EZ2ON and the output of journalctl (removing output from before I opened the game).

STEPS TO REPRODUCE
1. Open the affected application.
2. Give keyboard / mouse inputs.

OBSERVED RESULT
Application / system experiences severe stuttering.

EXPECTED RESULT
Application / system continues operating like normal.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (kernel 6.12.1-arch1-1 (64-bit))
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Noah Westervelt 2024-12-04 06:43:45 UTC
Created attachment 176338 [details]
Trimmed "journalctl -b 0" Output
Comment 2 John Kizer 2024-12-17 05:07:02 UTC
Hi - thanks for your bug report. Without being able to reproduce in any other applications, this would appear to be a performance issue or bug of some other sort in that particular application.

Is the entire system stuttering when you notice this (ex. when you Alt-Tab out, is your desktop generally responsive)? If so, is the application where you've noticed the problem consuming a high amount of CPU capacity?
Comment 3 Noah Westervelt 2024-12-19 01:52:15 UTC
(In reply to John Kizer from comment #2)
> Hi - thanks for your bug report. Without being able to reproduce in any
> other applications, this would appear to be a performance issue or bug of
> some other sort in that particular application.
> 
> Is the entire system stuttering when you notice this (ex. when you Alt-Tab
> out, is your desktop generally responsive)? If so, is the application where
> you've noticed the problem consuming a high amount of CPU capacity?

My system does not stutter when this is happening, just the game. The game also does not have high CPU usage under normal conditions, but whenever it stutters CPU usage drops during each stutter (which occurs whenever the game receives keyboard or mouse input).

I assumed this to be a problem with Kwin's Wayland implementation because when this game is ran under Kwin with X11 it doesn't seem to have the same problem. I have spent significantly less time with the game under Kwin with X11 though, and I have only intentionally tried to reproduce this bug while using X11 one time. Next time I play the game I will switch to X11 and see if the problem surfaces again.
Comment 4 John Kizer 2024-12-19 05:55:13 UTC
Thanks for the reply - also, what is your system's graphics setup? Something like inxi -G will provide a pretty solid summary of that information - basically what card(s) and drivers are in use.
Comment 5 Noah Westervelt 2024-12-20 03:26:21 UTC
Created attachment 176778 [details]
inxi -G output
Comment 6 Noah Westervelt 2024-12-20 03:34:44 UTC
(In reply to John Kizer from comment #4)
> Thanks for the reply - also, what is your system's graphics setup? Something
> like inxi -G will provide a pretty solid summary of that information -
> basically what card(s) and drivers are in use.

The "inxi -G output" attachment I added has the information you requested.

Display number 1 is the one the game is played on, it runs at 144Hz at 2560x1440 resolution and is connected via a display port cable to my discrete GPU card. Display number 2 is running at 60Hz at 1920x1080 resolution and is connected via a hdmi cable to my discrete GPU card.
Comment 7 Noah Westervelt 2024-12-20 05:38:14 UTC
I reproduced the bug on X11, so it must not have anything to do with Kwin's Wayland implementation. I also opened a video on my second monitor to see if that video stuttered when the game stuttered, and the video ran smoothly. So it's just the game doing it.

The only thing I see in my logs that looks remotely related are lines like this:
"steam[6556]: (wine:7518): GStreamer-Video-CRITICAL **: 22:41:44.894: gst_video_info_from_caps: assertion 'gst_caps_is_fixed (caps)' failed"

So I don't know exactly where the bug lies. It could be in the game itself, in Proton (a technology based on WINE used for running Windows executables on Linux), or maybe in Kwin.

This is a recording of the bug in video form, running on X11.
https://youtu.be/ag0F1g-lggM
Comment 8 Zamundaaa 2025-01-05 01:15:06 UTC
It's almost certainly a bug in the game or in Proton then. I recommend reporting it at https://github.com/ValveSoftware/Proton/issues