Bug 452553 - Monitor instantly wakes up from energy saving in Wayland
Summary: Monitor instantly wakes up from energy saving in Wayland
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.24.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-12 15:42 UTC by Mircea Kitsune
Modified: 2023-10-11 20:40 UTC (History)
8 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Kitsune 2022-04-12 15:42:17 UTC
SUMMARY
For many years the Plasma Wayland session suffered from issues with monitor standby breaking things, which has been the one explicit reason why I still need to use the X11 session. In the past the problem was the session crashing whenever the screen went into power saving, typically Plasmashell or Kwin or the screen locker. Allegedly this was because Wayland didn't know how to handle being left without any displays: I understand a fake display is now being used which keeps the desktop from freaking out. I tried this again under Plasma 5.24.3, and for the first time the screen powering off did not appear to crash or break anything.

Unfortunately monitor standby still doesn't work: The screen immediately wakes up as it goes to sleep, instead of staying asleep until I move the mouse or press a button on the keyboard. Since all previous discussion about monitor standby not working in Wayland was related to processes crashing, I wanted to open a new report focusing on the screen not staying powered down. Let us know what's documented on this issue so far, and what extra information you'd like me to provide to better understand it.

It's worth noting that problems with monitors not staying asleep exist with X11 as well: I need to disable the KScreen 2 service from System Settings - Workspace - Startup and Shutdown - Background Services, only then the monitor won't wake up immediately... in Wayland the monitor always wakes up instantly after going to sleep, regardless whether KScreen 2 is stopped or running. I remember that at least with the previous monitor, this wasn't always an issue when using a DVI cable, but both HDMI and DisplayPort would introduce such problems, and yes I tried different cables the last of which are high quality and explicitly the latest version of the interface. All of my video cards are AMD and use the amdgpu module. I believe it was suggested that I look for a setting in the monitor's OSD having to do with automatic source detection, I looked everywhere but couldn't find such an option.

STEPS TO REPRODUCE
1. Select Plasma (Wayland) as the session in SDDM and log in.
2. Go to System Settings - Hardware - Power Management - Energy Saving. Enable the checkbox for Screen Energy Saving. Set the Switch off After counter to 1 minute for quick testing.
3. Wait for a minute without using the mouse or keyboard.

OBSERVED RESULT
At first the screen powers off and goes black accordingly, but after a second wakes right back up.

EXPECTED RESULT
The screen must stay powered off until moving the mouse or pressing a button on the keyboard.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Kernel Version: 5.16.14-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 570 Series
Comment 1 Nate Graham 2022-04-14 15:08:56 UTC
> Graphics Platform: X11
Are you sure you're on Wayland? :) I guess you reported the bug while you were on X11?
Comment 2 Mircea Kitsune 2022-04-14 15:40:25 UTC
(In reply to Nate Graham from comment #1)
> Are you sure you're on Wayland? :) I guess you reported the bug while you were on X11?

Yes: I use X11 due to this issue. I only logged into Wayland temporarily to test how the problem behaves in Plasma 5.24.
Comment 3 suse 2022-04-16 08:20:29 UTC
I can confirm.
For a fast check you can issue this command to turn the monitor off:
$ sleep 0.5 && qdbus org.kde.kglobalaccel /component/org_kde_powerdevil invokeShortcut "Turn Off Screen"

I have two desktop computers to test:
1. AMD Ryzen 5700G; integrated GPU; openSUSE Tumbleweed 20220412; KDE Plasma 5.24.2; Framework 5.93.0
The monitor turn on again a few seconds after turning off.

2. Intel i7-4770; integrated GPU; OpenSUSE Leap 15.3;
The monitor looks like it's polling for a signal or so. Although it's not showing a picture its power LED goes on and off periodically.

=> Slightly different behavior between Intel an AMD, but one common issue: Under wayland it's not possible to really turn off the monitor.

No issue with X11 (to test:  sleep 0.5; xset dpms force off)

Logs aren't helpful:
# journalctl -f
Apr 09 11:18:38 alone klauncher[8730]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone kactivitymanagerd[8882]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_birthdays_resource[9179]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_followupreminder_agent[9182]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_akonotes_resource[9177]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_control[8986]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_maildispatcher_agent[9195]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_migration_agent[9198]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_indexing_agent[9184]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_contacts_resource[9180]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_mailmerge_agent[9197]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_archivemail_agent[9178]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_mailfilter_agent[9196]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_maildir_resource[9185]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_notes_agent[9200]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_ical_resource[9183]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone baloorunner[10060]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone kiod5[10432]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_newmailnotifier_agent[9199]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_sendlater_agent[9201]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone kwrite[10286]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone kwalletd5[9397]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_unifiedmailbox_agent[9210]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone akonadi_davgroupware_resource[9181]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:38 alone dolphin[10137]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Apr 09 11:18:39 alone rtkit-daemon[2175]: Supervising 6 threads of 3 processes of 1 users.
Apr 09 11:18:39 alone rtkit-daemon[2175]: Successfully made thread 10512 of process 8958 owned by 'dom' RT at priority 5.
Apr 09 11:18:39 alone rtkit-daemon[2175]: Supervising 7 threads of 3 processes of 1 users.
Comment 4 Bug Janitor Service 2022-09-13 15:10:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2940
Comment 5 Mircea Kitsune 2022-09-13 17:10:42 UTC
Only addition I can make is confirming the issue is heavily dependent on the monitor model. I just bought a new Samsung Odyssey to replace my Viewsonic monitor over multiple issues: Where the Viewsonic wouldn't normally stay in sleep under either X11 or Wayland, the Samsung does so in both with KScreen2 enabled and on either HDMI or DP cables.

The old monitor was moved to another computer... on it standby actually works now, despite not working on the same cable on my box. And both machines use AMD cards, I forgot if I still enable amdgpu on my mother's PC which may explain why there it's working at least in X11. Hopefully affected monitor models will also be fixed, there seem to be quite a few especially around lower end products.
Comment 6 Enrico 2023-02-02 06:23:14 UTC
I have the same problem on a Intel NUC (NUC12WSHi5) with Intel i5-1240P and the Xe integrated graphic.
I've tested many workarounds found online, but nothing solved the problem.

To be honest, I've also tested this problem on Fedora (GNOME) on Wayland and the monitor can't go in standby mode. Can this be considered a Wayland problem and not a Plasma/Qt issue?
On X11 everything works fine.
Comment 7 Enrico 2023-02-02 19:21:02 UTC
I post  a workaround I found, maybe it can be useful for someone:

I've set the monitor to use only the HDMI source instead of the "Auto" mode which automatically detects the video source. With "HDMI" mode the standby works fine while in "Auto" the screen never goes in standby.
It seems that the monitor sends some kind of signal to the PC and it wakes up...
Comment 8 Zamundaaa 2023-09-26 22:14:35 UTC
Git commit 482a1f0fb5bddb6d376a6b8d39a04bc16786cc97 by Xaver Hugl.
Committed on 27/09/2023 at 00:02.
Pushed by zamundaaa into branch 'master'.

backends/drm: don't wake displays up when outputs get temporarily removed

When some displays go to sleep, that can be wrongly detected as a temporary
hotunplug by the driver. In order to not wrongly wake up the system with
such a display, detect that scenario and set the 'new' output to dpms off
again.
Related: bug 379474

M  +22   -0    src/backends/drm/drm_backend.cpp
M  +1    -1    src/backends/drm/drm_backend.h
M  +3    -0    src/workspace.cpp

https://invent.kde.org/plasma/kwin/-/commit/482a1f0fb5bddb6d376a6b8d39a04bc16786cc97
Comment 9 Enrico 2023-09-27 05:01:23 UTC
Hello,
thank you very much for fixing this annoying issue!

Can you please help me to understand in which version we should have this fixed?
So I can check if it's solved on my configuration.
Comment 10 Enrico 2023-10-11 20:40:51 UTC
On the latest Neon Unstable the monitor goes in stanby as expected.
Many many many many many many thanks! I was stuck on X11 due to this problem <3