Bug 487780 - Fullscreen game stutter when Plasma receives notifications.
Summary: Fullscreen game stutter when Plasma receives notifications.
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: 6.0.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-30 03:58 UTC by Robert
Modified: 2024-06-11 19:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-3246432-0.html (3.11 KB, text/html)
2024-06-06 02:01 UTC, Robert
Details
attachment-4014901-0.html (2.67 KB, text/html)
2024-06-10 16:47 UTC, Robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert 2024-05-30 03:58:12 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
When playing fullscreen games, in particular games using Steam Proton and DXVK (most likely all fullscreen games), there is a momentary drop in frame rate as the desktop notification is received and again as it disappears. It is important to clarify that nothing actually renders over the game, only the momentary stutter that corresponds with the time the notification would appear on the desktop had the game not been running fullscreen. This should not be happening since nothing is actually rendered over the game and nothing should be disturbing the rendering process with direct scanout working consistently. This happens with all notifications and is most noticeable for me with KDE Connect messages from my phone.

STEPS TO REPRODUCE
1. Make sure "Screen Tearing: Allow in fullscreen windows" is enabled in Plasma display configuration.
2. Launch a Vulkan game in fullscreen mode.
3. Set VSync in the game or a constant frame rate so that the game is perfectly smooth (Preferably use a Vulkan hood such as DXVK_HUD with frametimes graph overlay).
4. Trigger a desktop notification such as a text message with KDE Connect via Android.
5. Observe a sudden momentary stutter and corresponding spike in the frametime graph when a notification comes in to the desktop such as KDE Connect and once again when it disappears.

OBSERVED RESULT
A momentary stutter and spike in frametime is observed when Plasma gets a notification in an otherwise perfectly smooth VSync'd game experience.

EXPECTED RESULT
The frame rate should remain perfectly smooth with no stutter during background notification reception and frametimes should be consistent all the time.

SOFTWARE/OS VERSIONS

Operating System: EndeavourOS 
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570 AORUS XTREME
System Version: -CF

ADDITIONAL INFORMATION
Mesa 24.1.0 with RADV drivers.
Comment 1 Zamundaaa 2024-06-05 10:00:05 UTC
Can you test the same scenario after putting
KWIN_DRM_NO_DIRECT_SCANOUT=1
into /etc/environment and rebooting? Do you still see stutter then?
Comment 2 Robert 2024-06-06 02:01:08 UTC
Created attachment 170194 [details]
attachment-3246432-0.html

Yes, I will do that when I get the chance tomorrow and follow up with you. Thanks,

Robert


________________________________
From: Zamundaaa <bugzilla_noreply@kde.org>
Sent: June 5, 2024 6:00 AM
To: robert.bielski@outlook.com <robert.bielski@outlook.com>
Subject: [kwin] [Bug 487780] Fullscreen game stutter when Plasma receives notifications.

https://bugs.kde.org/show_bug.cgi?id=487780

Zamundaaa <xaver.hugl@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REPORTED                    |NEEDSINFO
                 CC|                            |xaver.hugl@gmail.com
         Resolution|---                         |WAITINGFORINFO

--- Comment #1 from Zamundaaa <xaver.hugl@gmail.com> ---
Can you test the same scenario after putting
KWIN_DRM_NO_DIRECT_SCANOUT=1
into /etc/environment and rebooting? Do you still see stutter then?

--
You are receiving this mail because:
You reported the bug.
Comment 3 Robert 2024-06-06 17:59:04 UTC
Just following up, I can confirm that after setting the environment variable KWIN_DRM_NO_DIRECT_SCANOUT=1 and rebooting, there is no stutter present and everything is perfectly smooth in the same gaming scenario when receiving desktop notifications. This likely points to a bug in the direct scanout implementation.
Comment 4 Zamundaaa 2024-06-09 16:42:01 UTC
okay, then direct scanout is definitely getting interrupted, when it shouldn't be.
Do you have any effects that would be acting on notifications?
Comment 5 Robert 2024-06-10 16:47:17 UTC
Created attachment 170350 [details]
attachment-4014901-0.html

Reviewing the Desktop Effects KCM, the only thing that stands out is the effect called "Fading Popups" as they seem to smoothly fade in and out when they show and disappear. I didn't make any changes to this module and use the default effect settings as packaged by Arch/EndeavourOS. Thanks for looking into this minor, but still important issue.

________________________________
From: Zamundaaa <bugzilla_noreply@kde.org>
Sent: June 9, 2024 12:42 PM
To: robert.bielski@outlook.com <robert.bielski@outlook.com>
Subject: [kwin] [Bug 487780] Fullscreen game stutter when Plasma receives notifications.

https://bugs.kde.org/show_bug.cgi?id=487780

Zamundaaa <xaver.hugl@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
         Resolution|WAITINGFORINFO              |---
             Status|NEEDSINFO                   |CONFIRMED

--- Comment #4 from Zamundaaa <xaver.hugl@gmail.com> ---
okay, then direct scanout is definitely getting interrupted, when it shouldn't
be.
Do you have any effects that would be acting on notifications?

--
You are receiving this mail because:
You reported the bug.