Monitor won't enter sleep when logged in (Ubuntu Budgie 24.04)

Recent convert to Ubuntu Budgie and encountered one weird issue. My bench system is a Beelink Mini 12s Pro (n100 based) and single monitor connected via HDMI. When the system is sitting at the login screen, screen will blank and enter dpms sleep mode as expected. If I’m logged into the system, screen blanks for a several seconds, then empty desktop is displayed and system never sleeps.

I’ve checked all the usual suspects seen in the forums and here on discourse (e.g. is gdm or gnome-shell installed, is hdmi auto-switch disabled, etc.) but have not been able to identify the source of the issue. Any suggestions where to start troubleshooting this? I’d be happy to debug and provide feedback to hopefully resolve this for anyone else experiencing this issue. Thanks!

Just an update, the command ‘xset dpms force off’ (or suspend…standby) blanks the monitor for 2 seconds and returns to the terminal. This shows that something is interrupting dpms when logged in. I tried running with sleep 10, giving me time to disconnect my mouse and keyboard, and display still came back on.

Lastly, system has two HDMI ports, but only one monitor connected. I confirmed X is properly identifying HDMI-1 on, HDMI-2 disconnected.

Hoping someone has suggestions to troubleshoot this further…

Thanks.

Confirmed this is definitely a monitor “hotplug” issue. If I disable udev (sudo udevadm control stop), monitor will sleep properly when screen is locked.

Obviously this is not a viable solution. Is there anyway to add a UDEV rule to block/ignore monitor hotplug events? Here are the events seen when the screen is locked but doesn’t sleep…

KERNEL[2329.698423] change /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)
UDEV [2329.713210] change /devices/pci0000:00/0000:00:02.0/drm/card1 (drm)

Hmm… well found. You are now delving into areas i personally dont have any knowledge of.

I presume you have found topics like this?

Yup, found many similar articles, but all are about scripts that respond to udev events, not rules that force udev to ignore events. It appears this bug maybe a core gnome issue, as I found this AMDGPU bug report which shows the exact same behaviour where a monitor with autoselect will cause the display to never enter DPMS sleep… (reported 5 years ago…still not resolved)

Interestingly, running Debian with XFCE or KDE on this system have no DPMS issues, only Gnome derivatives appear to encounter this bug. So definitely something deep in the code. I’d be happy to dig into this further to assist in resolving it, but don’t even know where to start, not knowing the codebase.

Interesting reading that issue

It is specific to certain monitors and especially affects hdmi connected monitors.

The suggested patch was applied to kwin to resolve. But it appears the fix should be at the graphics driver level.

Would be worth looking more closely at your monitor. Maybe playing with energy saving options may help. If your monitor offers any other output other than hdmi then well worth trying that as well.

Unfortunately, auto-select can’t be disabled on this monitor, and my bench system connected to this monitor is just an N100 with dual hdmi ports, so no love there. That’s why I’m trying to figure out how to block hotplug monitor events to at least work around the issue until the gnome team address the core issue.

On some gnome based distros, they have settings where this can be disabled via gsettings (e.g. gsettings set org.gnome.settings-daemon.plugins.xrandr active false for endevouros). Is there a similar setting available in Budgie?

That gsettings key should also be available for budgie.

Sadly, no such schema exists in Budgie. I did a search of settings and find no reference to xrandr. I’ll keep digging…

ok - it appears GNOME dropped this key quite a while ago - so maybe endevour is patching this manually themselves

Great news! I discovered a solution for this issue (with assistance from an old Stack Exchange post). Creating a manual xorg.conf file using the current configuration (which is fine for my purposes) stops X11 from auto-configuring the monitor when DPMS kicks in, allowing it to properly sleep.

Specifically, I used sudo X :2 -configure to dump the current xorg.conf, then used xrandr and xvidtune to capture the monitor settings. I updated the xorg.conf file in my home directory to include only the current xmodeline in use and moved this file to /etc/X11. Rebooted and poof, DPMS sleep mode works! Who knew???

1 Like