Bug 468280 - Kwin: Fractional scaling + adaptive sync @ automatic -> freezes when playing full screen videos
Summary: Kwin: Fractional scaling + adaptive sync @ automatic -> freezes when playing ...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.27.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-08 11:14 UTC by Simon
Modified: 2024-09-05 13:00 UTC (History)
2 users (show)

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


Attachments
Output of journald after last crash, filtered for kwin messages. (3.18 KB, text/plain)
2023-04-08 11:14 UTC, Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2023-04-08 11:14:57 UTC
Created attachment 157953 [details]
Output of journald after last crash, filtered for kwin messages.

SUMMARY
***
I am on a Lenovo X13 Gen 3 AMD running ArchLinux with open source video drivers only.

When I watch a video on, for example, Youtube in full screen mode, the video begins to stutter quite from the beginning and it gets worse when I exit by double clicking. If I go to full screen again or I simply wait too long for exiting, it is too late and a total freeze happens.

With VLC the situation is better, but typically, after like an 1h or so of watching a video, I end up with a freeze too. Going back and forth to full screen seems to cut down the time till the total freeze happens.
***


STEPS TO REPRODUCE
1. Use a browser (tried both Chrome and Firefox)
2. Go to Youtube and start any video
3. Go back and forth to full screen

OBSERVED RESULT
After at most a few seconds the screen will freeze

EXPECTED RESULT
The video should play without any stuttering or screen freezing

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

The problem persists at least since version 5.27.0, but maybe even since 5.26.0

ADDITIONAL INFORMATION
1) Under Gnome everything works as expected, so I would exclude hardware problems
2) When I use additional external screens, the problem does *not* exist
3) I normally use 150% scaling throughout all my screens. Going back to 100% did not change the situation (I logged out and logged in again to make sure everything is consistent).
4) I found today this report: https://bugs.kde.org/show_bug.cgi?id=466238
where a similar freeze is describe, however, it occurs in this case only if multiple screens are used.
Nonetheless, as suggested in this report, putting KWIN_DRM_NO_DIRECT_SCANOUT=1 into  /etc/environment fixes also my problem.
Comment 1 Simon 2023-04-08 13:10:34 UTC
Seems that I was too early to claim “KWIN_DRM_NO_DIRECT_SCANOUT=1” fixes the problem.

Indeed, the stuttering is gone, but after 1-2 minutes into the video, I got a freeze.
Comment 2 Simon 2023-05-06 12:12:47 UTC
Addendum: Also KWin in X11 is doing fine. So there is some issue with KWin + Wayland
Comment 3 Simon 2023-05-14 08:03:36 UTC
Another update:

1) I wrote that the problem also persists with 100 % scaling. This is, at least now, no longer true. The problem does not exist with normal scaling, but only with fractional scaling.
2) It seems to be related to adaptive sync. I had used "automatic" as option, which allowed normal desktop usage, but made the problems with full screen videos. If I select "Always", my desktop basically freezes (at least, when there are some applications open). Deactivating "adaptive sync" seems to fix my problem. I need to do some more long term tests.
Comment 4 Zamundaaa 2023-05-14 17:27:00 UTC
Please enable drm debug logging (https://invent.kde.org/plasma/kwin/-/wikis/Debugging-DRM-issues), reproduce the freeze and upload the log here
Comment 5 Bug Janitor Service 2023-05-29 03:45:12 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2023-06-13 03:45:24 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 7 bartosz1 2024-08-28 15:46:36 UTC
Hello, the same thing happens to me. In my case, it is even when the scalling is set to 100%, on an external display connected to my laptop. The display just loses the input audio/video signal when the refresh rate tries to change. For me it happens with every app that tries to work in a full-screen mode. Turning adaptive sync off helps to prevent this issue from happening.
Comment 8 Zamundaaa 2024-09-05 13:00:39 UTC
When that happens, it's either a display bug (never seen that before) or a driver bug. Please report that to your driver vendor (https://gitlab.freedesktop.org/drm/i915/kernel/-/issues for Intel, https://gitlab.freedesktop.org/drm/amd/-/issues for AMD or https://forums.developer.nvidia.com/c/gpu-graphics/linux for NVidia)