Bug 443254 - Observable frame drop while the MangoHUD shows no frame drop at all in the game
Summary: Observable frame drop while the MangoHUD shows no frame drop at all in the game
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.22.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-03 11:43 UTC by Qu Wenruo
Modified: 2021-10-07 13:29 UTC (History)
0 users

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 Qu Wenruo 2021-10-03 11:43:47 UTC
SUMMARY
In fact it's a long long time problem.

Whenever a game is running, mostly DXVK games using proton, and has MangoHUD running with frametime and 90 FPS limit (display refreshrate 60Hz), no matter how low the game setting I'm using, I can always feel some shuttering here and there.

While MangoHUD reports a flat line for its frametime, and always have 90FPS, no frame drop from the game.

Thus it seems KWin is doing something causing the frame drop/shuttering.

The CPU and GPU (Ryzen 3800X + RX6700XT) is definitely enough for the games I play (for example, outer wilds with medium settings).

I want to try with compositing turned off or Vsync turned off, but unfortunately there is no such option there.

Tried both OpenGL 2.0 and OpenGL3.1 as backend, no difference.

The other thing to mention is, I'm using two monitors, both 1920x1080 60hz, in expanded mode (a large 3840x1080 area across those two displays).
Not sure if such xrandr setup is involved.

STEPS TO REPRODUCE
1. Setup KDE with default compositing using above hardware and xrandr setup
2. Run Steam games with proton, and using MangoHUD to record the frametime
3. Turn down the game settings to make sure the game can maintain whatever high fps
4. Run the game for a while to expose any frame drop

OBSERVED RESULT
Frame drop here and there, which is definitely not acceptable for such hardware.

EXPECTED RESULT
No frame drop observed as long as the machine can keep the FPS over 60 fps.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Comment 1 Qu Wenruo 2021-10-03 11:48:53 UTC
With compositing disabled, can still observe frames drop during gameplay.

And the dropped frame rate seems to be stable at 30FPS, not some random shuttering.

Thus it looks like it's more or less related to the Vsync behavior of Kwin other than compositing.
Comment 2 Vlad Zahorodnii 2021-10-04 12:06:22 UTC
If there are frame rate issues even with compositing disabled, this looks like an issue in xorg or driver rather than kwin.
Comment 3 Qu Wenruo 2021-10-04 12:14:07 UTC
Does that mean, if compositing is disabled, vsync is also disabled?
Comment 4 Vlad Zahorodnii 2021-10-04 12:15:19 UTC
KWin's vsync policy doesn't matter when compositing is disabled as kwin doesn't perform any compositing.
Comment 5 Qu Wenruo 2021-10-04 12:16:49 UTC
OK, thanks a lot.

I'll try to tweak the radaeon drivers to find out what's the cause.
Comment 6 Qu Wenruo 2021-10-07 13:29:50 UTC
After some more tweaking, it seems that gaming with two monitors itself is causing the problem.
If with only one monitor, there is no more obvious lagging.

I'm wondering if there is some extra frame syncing causing the problem.

BTW, with two monitors (extended mode) if running 3D game (DXVK) on the primary monitor, will the fullscreen un-redirect still work?