GNOME Bugzilla – Bug 660482
dpms interferes with g-s-d screen blanking counter
Last modified: 2011-12-09 11:45:25 UTC
this report has been filed here: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/851520 "screensaver is acting errantly. I switched the setting to 1 minute. The screen began fading away at the proper time. I then ran a video in totem for a time and the screen cut off at ten minutes (with no fading). I then cut off the video and the screen faded (as it should) after a minute. I cannot reliably determine what it is that the issue is. I have asked someone to repro the issue and they didn't seem to be affected. I've deleted all my settings files and the issue persists." "Typically, I set Turn off after to 30 minutes (screen still cuts off at 10) and "Lock screen after" to "When screen turns off" so that it SHOULD lock at 30 minutes when I tell the system to cut off the screen." "I can fill in the details: When I run the computer, if I leave it idle for ten minutes, the screen will cut off. My settings are all set for the screen to shut off at a half hour at the earliest. Conventionally, when the screen cuts off in the proper fashion (which I can check via setting the screen cut off for 1 minute) the screen fades to black. But when this ten-minute cutoff happens, the screen simply immediately switches off. I cannot attest to HOW it's happening. The previous comments are the best guess at how these things happened. " logs: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/851520/+attachment/2450230/+files/killandrun.log https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/851520/+attachment/2450246/+files/stopprocessandrun.log
seems like a gnome-settings-daemon issue that was just discussed on IRC today, if your issue is about screen being turned off and not screensaver the xorg default dpms value is 600s (10 minutes) but g-s-d doesn't change that, it does its own tracking to turn off the screen or lock it and doesn't update the dpms counter, which means xorg just put the screen in idle after 10 minutes
Created attachment 197791 [details] [review] small patch that adds gnome_rr_screen_set_dpms timeout
Created attachment 197792 [details] [review] Small patch that disables DPMS timeouts on startup of the gsd power plugin
Created attachment 197854 [details] [review] updated patch that moves the disable into the right location (when we have a x11 display)
The patches refer to different functions, one ends with timeout (gnome-desktop3), other in timeouts(g-s-d). However, after the patch is applied correctly g-s-d crashes with segfault: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff77a3b1a in gnome_rr_screen_set_dpms_timeouts (screen=0x6ec650, standby=0, suspend=0, off=0, error=0x1) at gnome-rr.c:1248 1248 g_return_val_if_fail (error == NULL || *error == NULL, FALSE); (gdb) bt
+ Trace 228671
(In reply to comment #2) > Created an attachment (id=197791) [details] [review] > small patch that adds gnome_rr_screen_set_dpms timeout Nahh, we can't add API in the stable release. Really we just want gnome_rr_screen_set_dpms_mode() to disable the timeouts, as we want to basically take control of the dpms stuff from then on. I've merged this into gnome-desktop: commit 1e9027cfacaf4d7571780e05c0b03e4521ae9a9d Author: Richard Hughes <richard@hughsie.com> Date: Mon Oct 3 16:19:23 2011 +0100 When setting the DPMS mode manually, clear the timeouts Based on a patch from Michael Vogt, many thanks. Resolves https://bugzilla.gnome.org/show_bug.cgi?id=660482 and this into g-s-d: commit aaae8e5e9deae04d0d1980f8e70f64db428f6a5f Author: Richard Hughes <richard@hughsie.com> Date: Mon Oct 3 16:31:07 2011 +0100 power: Ensure the DPMS state is 'on' at startup This also has the side-effect of disabling the default DPMS timeouts the session may have set. Resolves https://bugzilla.gnome.org/show_bug.cgi?id=660482 Can you please test git master of g-s-d and gnome-desktop and report if this actually fixes the problem. Thanks.
It does not look like this fixes the problem completely since g-s-d calls this routine only upon some kind of event (as I understand from code), so it starts applying the setting only after lid closing or only after g-s-d runs the handlers for turning the screen off itself (i.e. after 10 minutes the screen will go be turned off anyway).
This happens because when the code first runs on g-s-d startup the mode is already on and it is left unchanged. gnome_rr_screen_set_dpms_mode: /* set, if the new mode is different */ ret = gnome_rr_screen_get_dpms_mode (screen, ¤t_mode, error); if (current_mode == mode) goto out; ... ret = DPMSSetTimeouts (screen->priv->xdisplay, 0, 0, 0); ... out: return ret;
(In reply to comment #8) > This happens because when the code first runs on g-s-d startup the mode is > already on and it is left unchanged. Yup, I fixed that in gnome-desktop yesterday.
Thank you, It looks like there is code duplication though - http://git.gnome.org/browse/gnome-desktop/tree/libgnome-desktop/gnome-rr.c?id=8559c7853d34664128cd2e4388b3c0e5cf9f7d21#n1263
It looks like this got fixed with Richard's commits, so closing.
*** Bug 661006 has been marked as a duplicate of this bug. ***