Monitor instantly wakes up from energy saving in Wayland

Moving the conversation from Monitor instantly wakes up from energy saving in Wayland • KDE Community Forums to here:

This problem developed for me after moving from two older ASUS monitors to two MSI monitors (Optix G271CQR Curved Gaming Monitor - 27 Inch, 1ms Response Time, 1000R, 165Hz, Free-Sync premium). I’m on Wayland, Debian unstable/experimental (libkf 5.104 and kscreen/kwin/powerdevil 4:5.27.5-1)

kscreen-doctor -o
Output: 1 DP-1 enabled connected priority 1 DisplayPort Modes: 0:2560x1440@60! 1:2560x1440@165* 2:2560x1440@144 3:2560x1440@120 4:1920x1200@60 5:1920x1080@120 6:1920x1080@60 7:1920x1080@60 8:1920x1080@60 9:1920x1080@50 10:1600x1200@60 11:1280x1440@60 12:1680x1050@
120 13:1680x1050@60 14:1280x1024@120 15:1280x1024@75 16:1280x1024@60 17:1440x900@120 18:1280x800@60 19:1280x720@60 20:1280x720@60 21:1280x720@50 22:1024x768@75 23:1024x768@70 24:1024x768@60 25:800x600@75 26:800x600@72 27:800x600@60 28:800x600@56 29:720x576@50 30:7
20x480@60 31:720x480@60 32:720x480@60 33:720x480@60 34:640x480@75 35:640x480@73 36:640x480@67 37:640x480@60 38:640x480@60 39:720x400@70 40:1600x1200@60 41:1280x1024@60 42:1024x768@60 43:1920x1200@60 44:1280x800@60 45:2560x1440@60 46:1920x1080@60 47:1600x900@60 48:
1368x768@60 49:1280x720@60 Geometry: 0,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: Automatic RgbRange: unknown
Output: 2 HDMI-A-1 enabled connected priority 2 HDMI Modes: 0:2560x1440@60*! 1:3840x2160@60 2:3840x2160@60 3:3840x2160@30 4:3840x2160@30 5:2560x1440@144 6:2560x1440@120 7:1920x1200@60 8:1920x1080@120 9:1920x1080@120 10:1920x1080@60 11:1920x1080@60 12:1920x1080@60
13:1920x1080@50 14:1600x1200@60 15:1280x1440@60 16:1680x1050@120 17:1680x1050@60 18:1280x1024@120 19:1280x1024@75 20:1280x1024@60 21:1440x900@120 22:1440x900@60 23:1280x800@60 24:1280x720@60 25:1280x720@60 26:1280x720@50 27:1024x768@75 28:1024x768@70 29:1024x768@6
0 30:800x600@75 31:800x600@72 32:800x600@60 33:800x600@56 34:720x480@60 35:720x480@60 36:720x480@60 37:720x480@60 38:640x480@75 39:640x480@73 40:640x480@67 41:640x480@60 42:640x480@60 43:720x400@70 44:1600x1200@60 45:1280x1024@60 46:1024x768@60 47:2560x1600@60 48:
1920x1200@60 49:1280x800@60 50:3840x2160@60 51:3200x1800@60 52:2880x1620@60 53:2560x1440@60 54:1920x1080@60 55:1600x900@60 56:1368x768@60 57:1280x720@60 Geometry: 2560,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown

I was able to resolve this issue by connecting both monitors to the computer using the displayport connectors. This is what (I think) was happening:

  1. The monitors are shut off by DPMS
  2. The HDMI-connected monitor(s) signal that they are disconnecting.
  3. kscreen removes the monitors, and reconfigures the screens
  4. This wakes up the monitors
  5. The HDMI-connected monitor re-attaches (since there is now a live signal from the computer)

It seems that my monitors may be misbehaving, but this still seems like it could be resolved by kscreen somehow not causing the monitors to wake up when another monitor is being detached.

I guess that’s a feature request would resolve this issue.

I’ve been experiencing this starting some time between Fedora 36 and 37. Been using Wayland since 36.
I can still boot the Fedora 36 live ISO and have my monitors sleep as expected. Problem happens at the 37 ISO and beyond.
36 ISO has Plasma 5.24.3, 37 ISO has Plasma 5.26.2.

Main monitor using Displayport, second monitor using HDMI. With both on, they wake up after trying to sleep.
If I turn off the HDMI monitor, the Displayport monitor stays asleep. If I turn off the Displayport monitor, the HDMI monitor still wakes itself up. Disabling kscreen2 doesn’t help.
My HDMI monitor doesn’t have any polling options. But since it worked as is back in at least Plasma 5.24.3, it shouldn’t matter?

Tried the Workstation ISOs of 36 and 38 as well to see what Gnome did. 36 with Gnome 42 experienced the issue in the same way as the KDE 37/38 ISOs. So I doubt it’s a kernel, mesa or firmware issue since the versions of those match with the 36 KDE ISO.

Has anyone been able to resolve this issue? I have 3 monitors, 2 connected via DP and 1 connected HDMI. If I try to sleep all 3 monitors, it won’t work. If i powerdown the HDMI monitor then the DP monitors will sleep.

I finally got around to buying an (active) Displayport to HDMI adapter, and now both of my monitors stay asleep.
Something is definitely funky with HDMI handling.