After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660482 - dpms interferes with g-s-d screen blanking counter
dpms interferes with g-s-d screen blanking counter
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
: 661006 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-29 14:45 UTC by Pedro Villavicencio
Modified: 2011-12-09 11:45 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
small patch that adds gnome_rr_screen_set_dpms timeout (2.12 KB, patch)
2011-09-29 17:28 UTC, Michael Vogt
none Details | Review
Small patch that disables DPMS timeouts on startup of the gsd power plugin (732 bytes, patch)
2011-09-29 17:29 UTC, Michael Vogt
none Details | Review
updated patch that moves the disable into the right location (when we have a x11 display) (577 bytes, patch)
2011-09-30 07:48 UTC, Michael Vogt
none Details | Review

Description Pedro Villavicencio 2011-09-29 14:45:35 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
Comment 1 Sebastien Bacher 2011-09-29 15:10:02 UTC
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
Comment 2 Michael Vogt 2011-09-29 17:28:27 UTC
Created attachment 197791 [details] [review]
small patch that adds gnome_rr_screen_set_dpms timeout
Comment 3 Michael Vogt 2011-09-29 17:29:22 UTC
Created attachment 197792 [details] [review]
Small patch that disables DPMS timeouts on startup of the gsd power plugin
Comment 4 Michael Vogt 2011-09-30 07:48:44 UTC
Created attachment 197854 [details] [review]
updated patch that moves the disable into the right location (when we have a x11 display)
Comment 5 Roman Yepishev 2011-10-03 15:13:52 UTC
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
  • #0 gnome_rr_screen_set_dpms_timeouts
    at gnome-rr.c line 1248
  • #1 gsd_power_manager_start
    from /usr/lib/gnome-settings-daemon-3.0/libpower.so
  • #2 ??
    from /usr/lib/gnome-settings-daemon-3.0/libpower.so
  • #3 gnome_settings_plugin_info_activate
  • #4 _start

Comment 6 Richard Hughes 2011-10-03 15:35:10 UTC
(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.
Comment 7 Roman Yepishev 2011-10-03 17:56:29 UTC
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).
Comment 8 Roman Yepishev 2011-10-04 08:34:21 UTC
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, &current_mode, error);
     if (current_mode == mode)
         goto out;
...
     ret = DPMSSetTimeouts (screen->priv->xdisplay, 0, 0, 0);
...
out:
     return ret;
Comment 9 Richard Hughes 2011-10-04 08:38:29 UTC
(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.
Comment 10 Roman Yepishev 2011-10-04 12:16:22 UTC
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
Comment 11 Vincent Untz 2011-10-15 06:51:31 UTC
It looks like this got fixed with Richard's commits, so closing.
Comment 12 Bastien Nocera 2011-12-09 11:45:25 UTC
*** Bug 661006 has been marked as a duplicate of this bug. ***