| Summary: | Stuttering in some games when clicking and releasing mouse. | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | mwyeatts |
| Component: | performance | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | captainskelly0, linx.system.adm, simon.m.kejonen97, william.drumright |
| Priority: | NOR | ||
| Version First Reported In: | 6.5.1 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
mwyeatts
2025-11-07 20:17:32 UTC
I am having the exact same problem in other games that grabs the cursor like FFXIV. I have tested in Guild Wars 2 and World of Warcraft and the same stutters happen in those as well. Also using arch with the latest release of everything. Also using a multi-monitor setup, but with the same refresh-rate on both. Gpu AMD RX 7900XTX Cpu AMD Ryzen 7 5800X3D I think this is related to direct scanout - direct scanout stops working with MAILBOX and FIFO present modes for a moment when mouse cursor appears and soon later it works again, I can see that "compositing" red text appears for a moment - e.g. press ESC in game to open menu which shows cursor [still regression 6.4.5 -> 6.5.0-git] https://bugs.kde.org/show_bug.cgi?id=510967#c8 https://www.youtube.com/watch?v=GY_5oT8MFNY This issue still persists unfortunately. Same situation. In FFXIV if the mouse setting is set to hardware, there will be a massive fps dip for a moment when the cursor comes back after clicking (if you're, perhaps, trying to move the camera). Like OP, I also have a dual monitor setup where my main has 165hz and my second monitor has 60hz. I haven't exactly noticed this issue in any other game (I've been playing games mostly with controller lately) so, FFXIV for now, is the one I know that is having this issue. One solution is to set the mouse setting to "software" which causes a tiny delay in movement with the mouse, but otherwise the game runs normally smooth. Hardware mode gives us that frame dip issue. I'd like to use hardware mouse as there's no delay at all with moving the mouse around. OS: CachyOS x86_64 Kernel: Linux 6.18.0-3-cachyos DE: KDE Plasma 6.5.4 WM: KWin (Wayland) CPU: 12th Gen Intel(R) Core(TM) i5-12600K (16) @ 5.00 GHz GPU: AMD Radeon RX 6800 XT On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime stalls when right-clicking to control the camera. This does not occur on NVIDIA hardware. Environment (affected system) OS: Archy KDE Plasma: 6.5.4 Session: Wayland GPU: AMD RX 7900 XTX Driver: amdgpu + Mesa Monitor: 165 Hz Mouse: 1000 Hz polling Game runtime: Wine / Proton GE (DXVK) Game: World of Warcraft WOTLK (legacy client) Symptoms Right-clicking to rotate camera causes a visible hitch / microstutter MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or released What fixes the issue KWIN_DRM_NO_DIRECT_SCANOUT=1 → Completely resolves the stutter and FPS→0 drops Gamescope → Also resolves it, but causes alt-tab issues and occasional mouse/camera desync Partial workaround Disabling in-game hardware cursor (adds mouse latency) Control test (no issue) Tested on a laptop with NVIDIA GPU using the same game and runtime: CPU: Intel i7 (12th gen) GPU: RTX 3070 Ti OS: Archy Session: KDE Wayland Mouse: 1000 Hz polling Same Wine/Proton GE runner → No stutter, no FPS drops, no Gamescope or env vars needed Likely cause Appears related to KWin Direct Scanout being invalidated by cursor visibility / pointer grab changes, causing a brief present stall. Disabling Direct Scanout globally avoids the issue. KWIN_DRM_NO_DIRECT_SCANOUT=1 workaround doesn't work for me. I still see fps drops to 0 when release mouse button. Did I miss something? Tried adding it to /etc/environment and ~/.config/plasma-workspace/env/ KWin debug console shows "compositing" red text and it not flashing, just static text (In reply to william.drumright from comment #4) > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime > stalls when right-clicking to control the camera. > > This does not occur on NVIDIA hardware. > > Environment (affected system) > OS: Archy > KDE Plasma: 6.5.4 > Session: Wayland > GPU: AMD RX 7900 XTX > Driver: amdgpu + Mesa > Monitor: 165 Hz > Mouse: 1000 Hz polling > Game runtime: Wine / Proton GE (DXVK) > Game: World of Warcraft WOTLK (legacy client) > > Symptoms > Right-clicking to rotate camera causes a visible hitch / microstutter > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or > released > > What fixes the issue > KWIN_DRM_NO_DIRECT_SCANOUT=1 > → Completely resolves the stutter and FPS→0 drops > > Gamescope > → Also resolves it, but causes alt-tab issues and occasional mouse/camera > desync > > Partial workaround > Disabling in-game hardware cursor (adds mouse latency) > > > Control test (no issue) > Tested on a laptop with NVIDIA GPU using the same game and runtime: > CPU: Intel i7 (12th gen) > GPU: RTX 3070 Ti > OS: Archy > Session: KDE Wayland > Mouse: 1000 Hz polling > Same Wine/Proton GE runner > → No stutter, no FPS drops, no Gamescope or env vars needed > > > Likely cause > Appears related to KWin Direct Scanout being invalidated by cursor > visibility / pointer grab changes, causing a brief present stall. Disabling > Direct Scanout globally avoids the issue. Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to? (In reply to captainskelly0 from comment #6) > (In reply to william.drumright from comment #4) > > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the > > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime > > stalls when right-clicking to control the camera. > > > > This does not occur on NVIDIA hardware. > > > > Environment (affected system) > > OS: Archy > > KDE Plasma: 6.5.4 > > Session: Wayland > > GPU: AMD RX 7900 XTX > > Driver: amdgpu + Mesa > > Monitor: 165 Hz > > Mouse: 1000 Hz polling > > Game runtime: Wine / Proton GE (DXVK) > > Game: World of Warcraft WOTLK (legacy client) > > > > Symptoms > > Right-clicking to rotate camera causes a visible hitch / microstutter > > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or > > released > > > > What fixes the issue > > KWIN_DRM_NO_DIRECT_SCANOUT=1 > > → Completely resolves the stutter and FPS→0 drops > > > > Gamescope > > → Also resolves it, but causes alt-tab issues and occasional mouse/camera > > desync > > > > Partial workaround > > Disabling in-game hardware cursor (adds mouse latency) > > > > > > Control test (no issue) > > Tested on a laptop with NVIDIA GPU using the same game and runtime: > > CPU: Intel i7 (12th gen) > > GPU: RTX 3070 Ti > > OS: Archy > > Session: KDE Wayland > > Mouse: 1000 Hz polling > > Same Wine/Proton GE runner > > → No stutter, no FPS drops, no Gamescope or env vars needed > > > > > > Likely cause > > Appears related to KWin Direct Scanout being invalidated by cursor > > visibility / pointer grab changes, causing a brief present stall. Disabling > > Direct Scanout globally avoids the issue. > > Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to? I may have spoken too soon. While enabling the KWIN_DRM did smooth out the FPS stutter, moving to a busy part of the game causes the mouse to have really bad latency. Going back to GameScope may be the best option until this bug gets addressed upstream. If you want to test it yourself: Create an environment directory and file: mkdir -p ~/.config/environment.d nano ~/.config/environment.d/kwin.conf Add this line to the file: KWIN_DRM_NO_DIRECT_SCANOUT=1 Log out and back in (In reply to william.drumright from comment #7) > (In reply to captainskelly0 from comment #6) > > (In reply to william.drumright from comment #4) > > > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the > > > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime > > > stalls when right-clicking to control the camera. > > > > > > This does not occur on NVIDIA hardware. > > > > > > Environment (affected system) > > > OS: Archy > > > KDE Plasma: 6.5.4 > > > Session: Wayland > > > GPU: AMD RX 7900 XTX > > > Driver: amdgpu + Mesa > > > Monitor: 165 Hz > > > Mouse: 1000 Hz polling > > > Game runtime: Wine / Proton GE (DXVK) > > > Game: World of Warcraft WOTLK (legacy client) > > > > > > Symptoms > > > Right-clicking to rotate camera causes a visible hitch / microstutter > > > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or > > > released > > > > > > What fixes the issue > > > KWIN_DRM_NO_DIRECT_SCANOUT=1 > > > → Completely resolves the stutter and FPS→0 drops > > > > > > Gamescope > > > → Also resolves it, but causes alt-tab issues and occasional mouse/camera > > > desync > > > > > > Partial workaround > > > Disabling in-game hardware cursor (adds mouse latency) > > > > > > > > > Control test (no issue) > > > Tested on a laptop with NVIDIA GPU using the same game and runtime: > > > CPU: Intel i7 (12th gen) > > > GPU: RTX 3070 Ti > > > OS: Archy > > > Session: KDE Wayland > > > Mouse: 1000 Hz polling > > > Same Wine/Proton GE runner > > > → No stutter, no FPS drops, no Gamescope or env vars needed > > > > > > > > > Likely cause > > > Appears related to KWin Direct Scanout being invalidated by cursor > > > visibility / pointer grab changes, causing a brief present stall. Disabling > > > Direct Scanout globally avoids the issue. > > > > Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to? > > I may have spoken too soon. While enabling the KWIN_DRM did smooth out the > FPS stutter, moving to a busy part of the game causes the mouse to have > really bad latency. Going back to GameScope may be the best option until > this bug gets addressed upstream. > > If you want to test it yourself: > > Create an environment directory and file: > mkdir -p ~/.config/environment.d > nano ~/.config/environment.d/kwin.conf > > Add this line to the file: > > KWIN_DRM_NO_DIRECT_SCANOUT=1 > > Log out and back in Still didn't work for me. I use KDE Wayland/Proton GE 10.26/RX 6900 XT if it matters. Currenlty the best workaroud I found is to keep Battle.net Launcher running in system tray. It blocks direct scanout because of this https://bugs.kde.org/show_bug.cgi?id=513203 (In reply to william.drumright from comment #7) > (In reply to captainskelly0 from comment #6) > > (In reply to william.drumright from comment #4) > > > On KDE Plasma Wayland (KWin 6.5.4) with AMD GPU, games that grab/release the > > > mouse cursor (e.g. World of Warcraft WOTLK / Classic) show severe frametime > > > stalls when right-clicking to control the camera. > > > > > > This does not occur on NVIDIA hardware. > > > > > > Environment (affected system) > > > OS: Archy > > > KDE Plasma: 6.5.4 > > > Session: Wayland > > > GPU: AMD RX 7900 XTX > > > Driver: amdgpu + Mesa > > > Monitor: 165 Hz > > > Mouse: 1000 Hz polling > > > Game runtime: Wine / Proton GE (DXVK) > > > Game: World of Warcraft WOTLK (legacy client) > > > > > > Symptoms > > > Right-clicking to rotate camera causes a visible hitch / microstutter > > > MangoHud FPS briefly drops to 0 exactly when the mouse button is pressed or > > > released > > > > > > What fixes the issue > > > KWIN_DRM_NO_DIRECT_SCANOUT=1 > > > → Completely resolves the stutter and FPS→0 drops > > > > > > Gamescope > > > → Also resolves it, but causes alt-tab issues and occasional mouse/camera > > > desync > > > > > > Partial workaround > > > Disabling in-game hardware cursor (adds mouse latency) > > > > > > > > > Control test (no issue) > > > Tested on a laptop with NVIDIA GPU using the same game and runtime: > > > CPU: Intel i7 (12th gen) > > > GPU: RTX 3070 Ti > > > OS: Archy > > > Session: KDE Wayland > > > Mouse: 1000 Hz polling > > > Same Wine/Proton GE runner > > > → No stutter, no FPS drops, no Gamescope or env vars needed > > > > > > > > > Likely cause > > > Appears related to KWin Direct Scanout being invalidated by cursor > > > visibility / pointer grab changes, causing a brief present stall. Disabling > > > Direct Scanout globally avoids the issue. > > > > Where are you adding `KWIN_DRM_NO_DIRECT_SCANOUT=1` to? > > I may have spoken too soon. While enabling the KWIN_DRM did smooth out the > FPS stutter, moving to a busy part of the game causes the mouse to have > really bad latency. Going back to GameScope may be the best option until > this bug gets addressed upstream. > > If you want to test it yourself: > > Create an environment directory and file: > mkdir -p ~/.config/environment.d > nano ~/.config/environment.d/kwin.conf > > Add this line to the file: > > KWIN_DRM_NO_DIRECT_SCANOUT=1 > > Log out and back in Yeah I tried it myself and it removed most of the stutter but it’s still kinda there. So it’s helped but not completely. Using software mouse in the meantime till this gets fixed. So annoying! Try this! I'm not sure if its placebo but it seems to me it works better than KWIN_DRM_NO_DIRECT_SCANOUT=1 Open your environment file: sudo nano /etc/environment Add this line: KWIN_DRM_NO_AMS=1 Save and Reboot. This forces KWin to use a legacy DRM API that often handles input interrupts more smoothly. (In reply to william.drumright from comment #10) > Try this! I'm not sure if its placebo but it seems to me it works better > than KWIN_DRM_NO_DIRECT_SCANOUT=1 > > Open your environment file: sudo nano /etc/environment > > Add this line: > KWIN_DRM_NO_AMS=1 > > Save and Reboot. This forces KWin to use a legacy DRM API that often handles > input interrupts more smoothly. KWIN_DRM_NO_AMS=1 causes crash on my system beacause of this: https://bugs.kde.org/show_bug.cgi?id=512968#c6 I hope this issue gets looked into soon, this is just so annoying. Still just using the software mouse but I'd really love this to be fixed :/ |