6

For several years (~2012-2020) and over multiple computers (AMD/Intel of various vintages, S3/AMD/Intel graphics), I've observed what appears to be a curious, DDX-independent bug in X11.

Occasionally, after several sleep (echo mem > /sys/power/state) and wakeup cycles, X11 will "forget" my display's DPMS settings, and leave the screen on indefinitely.

In this state, xset dpms force suspend (or -standby) works perfectly; I wonder if the bug is in activity detection or timeout management.

Sometimes the issue takes weeks to surface; sometimes it occurs extremely quickly. I happened to need to reboot a couple days ago, and the problem's already cropped up. Prior to that, I think I've experienced the issue on this machine (which I've been using for about a year) only once before.

Hmm, maybe it's actually a race condition. Yayyyy.

As an acid test, I changed all the values I could from the default 600 (10 minutes) to 5 seconds. Right now, xset q is showing me:

Screen Saver:
...
  timeout:  5    cycle:  5
...
DPMS (Energy Star):
  Standby: 5    Suspend: 5    Off: 5
  DPMS is Enabled
  Monitor is On

My screen is neither being blanked by the X screensaver OR put into DPMS standby/suspend.

Where might I start debugging this?

I'm guessing I'm going to need to build my own copy of X, add as many printfs as I can think, and try to remember to always use my X instead of the system X... but before I go there, I was wondering if anyone had any interesting insightful tidbits for me to try first.

Thanks :)

NB. My system is exhibiting the issue right now, and I'll see if I can hold off rebooting for a couple days. This is a bit of a "month with a Z in it" kind of thing after all.

3
  • Have you found a solution? Having the same issue with Debian 11 and KDE Plasma.
    – rustyx
    Commented Jun 18, 2022 at 13:05
  • Ha, this recently flipped to the "oh yay it's happening again" side of the cycle; I find it comes and goes, usually disappearing again whatever I reboot. Unfortunately I think it might actually be a toe-stepping ambiguity problem somewhere between Chrome, the wild west of the Linux desktop mess, and X11/DPMS. A potentially awkward first test (that I'm not particularly motivated to try myself, too many tabs open lol) might be to see if closing Chrome for however many minutes makes the problem promptly go away.
    – i336_
    Commented Jun 19, 2022 at 13:51
  • I learned a little while back how Linux screen savers (totally orthogonal to X11's built in DPMS blanking) have an ad-hoc scheme of activity tracking that can also be "latched" in "do not suspend" mode via D-Bus. I just run openbox myself so I don't think I'm running any of this, but maybe github.com/mato/xscreensaver-systemd/blob/master/… could be of use in providing (hopefully not too opaque) pointers on where to potentially look next.
    – i336_
    Commented Jun 19, 2022 at 13:58

1 Answer 1

4

It's Chromium bug 1339361. If you play any media in Chrome (or any Electron-based software like Slack), the screen saver, including DPMS, will remain disabled until that process is exited.

Disabling the MIT-SCREEN-SAVER extension should help.

$ sudo tee /etc/X11/xorg.conf.d/01-no-mit-screen-saver.conf <<EOM >/dev/null
Section "Extensions"
    Option    "MIT-SCREEN-SAVER" "Disable"
EndSection
EOM
$ reboot

Check to make sure MIT-SCREEN-SAVER is disabled:

$ xdpyinfo -queryExtensions | grep MIT-SCREEN-SAVER

There's a miryad ways of suspending the screen saver in Linux. Disabling MIT-SCREEN-SAVER should have no impact on the screen saver, DPMS or the wake lock in YouTube etc. which should all continue to work normally.

While debugging this I found another bug (in my opinion) that Chromium seems to disable the screen saver even when playing audio. Which is the reason my screen wakes up every time there's a new mail "ding" in Outlook. But that's another story...

And in case you're curious - the DPMS magic happens inside xorg-server itself in DPMSSet, which invokes DPMS and SetScreenSaverTimer, which arms the timer (or not!).


As a failsafe option I can suggest this nuclear workaround which will force DPMS on regardless of any wake lock. Obviously it needs a large timeout or else you won't be able to watch movies uninterrupted.

$ sudo apt install xprintidle
$ cat <<EOM >crontab
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
DISPLAY=:0
 
*/15 * * * *   t=`xprintidle` && [ $t -ge 7200000 -a $t -lt 9000000 ] && xset dpms force off
EOM
$ crontab crontab
$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .