Bug 448496 - latency reduction can negatively affect fullscreen gaming, apparently despite direct scan-out
Summary: latency reduction can negatively affect fullscreen gaming, apparently despite...
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.23.90
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-14 22:46 UTC by tempel.julian
Modified: 2022-01-19 18:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tempel.julian 2022-01-14 22:46:50 UTC
SUMMARY

Setting latency reduction to "force lowest latency" introduces stutter by dropped frames for Counter-Strike 1.6 (native Linux OpenGL XWayland) fullscreen. It doesn't stutter (at least not more than it should due to the unfortunate mailbox vsync) when setting latency reduction to "force smoothest animations".

STEPS TO REPRODUCE
1. On a really slow Gemini Lake system, run Counter-Strike 1.6 via Steam inside Plasma Wayland (Sorry, I don't have access to faster devices that aren't with Nvidia GPU.).
2. Hold down left or right arrow key to continuously pan the camera.
3. Test with "force lowest latency" vs. "force smoothest animations".

OBSERVED RESULT
"force lowest latency" affects smoothness of presentation. According to mangohud, the game's rendering performance is fine (~150fps on 60Hz display), so stutter seems to be happening at presentation level.

EXPECTED RESULT
I think ideally, latency reduction shouldn't affect presentation for fullscreen gaming? The game seems to trigger direct scan-out, as fps are the same as on Xorg with modesetting DDX and compositing suspended. I also updated to latest mesa git-master to make sure dma-buf feedback hopefully is available, but situation didn't change vs. stable Mesa from Arch repo. With Plasma 5.23 Wayland, performance was much lower (~110fps instead of ~160), which should be another indicator for direct scan-out being active with 5.23.90.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 5.16
KDE Plasma Version: 5.23.90 via kde-unstable Arch repo
KDE Frameworks Version: 5.90
Qt Version:  5.15.2
Comment 1 Nate Graham 2022-01-19 15:48:53 UTC
The menu item for this choice says, "(may cause dropped frames)" in it. Sounds like that's what you're experiencing, but you were warned. :) If dropped frames are unacceptable, I would recommend not using this setting.
Comment 2 tempel.julian 2022-01-19 17:29:02 UTC
Question is if latency reduction should actually ever affect fullscreen with direct scan-out. Unlike vs. windowed/desktop usage, where compositing is active.

Btw. also the default "balanced" setting already drops frames with that SoC during regular desktop usage and thus introduces stutter when browing, watching videos in mpv etc.
Comment 3 Nate Graham 2022-01-19 17:30:07 UTC
Can you file another more general bug report for that?
Comment 4 tempel.julian 2022-01-19 17:36:28 UTC
(In reply to Nate Graham from comment #3)
> Can you file another more general bug report for that?

I mentioned it in a ticket for a similar issue with Nvidia:
https://bugs.kde.org/show_bug.cgi?id=443511
Surely a separate report might be justified, though the proposal is the same.
Comment 5 Vlad Zahorodnii 2022-01-19 18:12:34 UTC
DRM doesn't support triple buffering or amending pending atomic commits in general so fullscreen windows are still affected by the latency policy.
Comment 6 tempel.julian 2022-01-19 18:57:38 UTC
That's some vital information, thanks a lot!
I wonder what happens when VRR is active when without VRR, frames would be dropped.

I'll re-test desktop usage with Gemini Lake and then file a ticket if it still stutters with default balanced latency reduction.