[Gutsy] Display sleep sets wrong DPMS off time

Bug #190537 reported by Ewen McNeill
6
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gnome-power-manager

In Ubuntu Gutsy (7.10) with gnome-power-manager (2.20.0-0ubuntu6), the System->Preferences->Power Management slider for "Put display to sleep when inactive for" shows values that start with the value set in System->Preferences->Screensaver slider for "Regard the computer as idle after", and go upwards from there. Eg, if the Screensaver figure is set to 8 minutes, the minimum that the Power Manager display sleep can be set to is 9 minutes (8+1 minutes).

However the value that is stored in the gnome configuration does not have this offset (eg, with the screensaver figure of 8 minutes, a power management display off figure of "13 minutes", the value stored in the gnome configuration will be 300 seconds (ie, 5 minutes). With a power management display off figure of "14 minutes" the value stored will be 360 seconds (ie, 6 minutes).

The value from the gnome configuration is then applied as an X DPMS "power off" time, eg 300 seconds as the display time off. The result is that the monitor will then turn off after 5 minutes (300 seconds), even though the gnome power management display off time is reported through the user interface as "13 minutes". And thus the monitor turns off even before the screen saver kicks in, and much earlier than it was set to do so. The only combination that might work sanely is to set both timeouts to the same value (0 minutes difference), which would result in a DPMS off time of 0 seconds, which happens to disable the automatic X server DPMS off time (leaving gnome power manager to do its own thing) -- but it doesn't seem possible to do this.

This effect (idle time shown = screen saver time + power manager time; from https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/135813/comments/5) would appear to explain this bug:

https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/59589

too (ie, why the value cannot be set below 11 minutes -- they presumably have a screensaver time of 10 minutes).

Obviously I expect that the time specified in gnome power manager to power off the display will be the time in reality, not some arbitrarily shorter time. (I first noticed this with a screen saver time of 8 minutes, and a display off time of 9 minutes -- which caused the screen to power down after 1 minute of inactivity.) There are various ways this could be fixed to work sanely:
- have gnome-power-manager not set the X server DPMS time and manage everything itself, counting from when the screen saver kicks in

- have gnome-power-manager set the X server DPMS time to the value stored plus the screen saver timeout (so the overall time is consistent with what is shown in the preferences dialog)

- have the preferences dialog store the value shown into the gnome preferences (including the amount that is attributed to the screensaver timeout, eg the full 13 minutes == 780 seconds) so that the value can be set directly into the X server DPMS and will give the correct timeout

- decouple the power manager and screen saver timeouts again, so that the power manager screen off time can be set from 1 minute upwards. This would also allow having the screen powered down before the screen is locked, which can be useful if one is doing something else nearby but wants to save power (eg, a power manager off time of 3 minutes, and a lock time of 5 minutes, would power the display down pretty rapidly but allow waking it with a keypress without having to type in a password). This would just require changing the power manager preferences UI to accurately report the figure it's setting into the gnome preferences.

Ewen

Revision history for this message
Ewen McNeill (ewen) wrote :

Attached screenshot showing:
- Screen Saver preference time of 8 minutes (480 seconds)
- Power Manager display off time of 14 minutes (840 seconds)
- gnome configuration apps->gnome-power-manager->timeout->sleep_display_ac value of 6 minutes (360 seconds; 14 minutes - 8 minutes = 6 minutes)
- X DPMS information showing an off time of 360 seconds (6 minutes)

Computer is on AC power at present. The values are live adjustable, and updating the slider in the power manager UI will result in new values being saved/set with the offset described above.

Ewen

Ewen McNeill (ewen)
description: updated
Ewen McNeill (ewen)
description: updated
description: updated
description: updated
Revision history for this message
unggnu (unggnu) wrote :

I have made some tests. I can't confirm this behavior with Gutsy. The value in DPMS is always zero for me but it still works since Gnome seems to handle it on its own.

xset q | grep -A 1 -i DPMS
DPMS (Energy Star):
  Standby: 0 Suspend: 0 Off: 0
  DPMS is Enabled
  Monitor is On

Maybe your laptop-mode service or something else set the wrong dpms sleep time. Could you please recheck this issue with the Ubuntu Gutsy Gibbon 7.10 Live CD?

Changed in gnome-power-manager:
status: New → Incomplete
Revision history for this message
Ewen McNeill (ewen) wrote :

I've just attempted to reproduce it now, with the same results as you (ie, the DPMS off time isn't being set as it was previously). I wondered whether it had something to do with either s2ram, or adding a monitor on resume (eg, docking with an external monitor) but neither of those seem to be triggering it now.

I'll keep an eye out for it happening again in the next couple of weeks (it's pretty obvious as the monitor starts turning off pretty soon after I stop typing), and if it does happen try to figure out a more precise sequence to get it into that situation. If I don't see it again, perhaps it got resolved by a recent update.

Thanks for trying to reproduce it.

Ewen

Revision history for this message
unggnu (unggnu) wrote :

Closing as per user comment. Feel free to open it again if it still happens with Ubuntu Gutsy Gibbon 7.10 Live CD or later.
If you find the program which causes the wrong DPMS settings please post it for people with the same issue.

Changed in gnome-power-manager:
status: Incomplete → Invalid
Revision history for this message
Ewen McNeill (ewen) wrote :

I think I've figured out how to trigger it.

The computer in question is a laptop, with an external CRT connected via a docking station some of the time -- and all the times the DPMS Off: value has been incorrectly set, the laptop has been docked with the CRT connected.

In order to trigger it I seem to need to:
- boot up docked, with the CRT on
- suspend to RAM
- turn off the CRT
- unsuspend (which is hit the power button in the case of this laptop)
- while unsuspending, turn on the CRT (at the "right" time)

In that situation I get:

DPMS (Energy Star):
  Standby: 0 Suspend: 0 Off: 60
  DPMS is Enabled
  Monitor is On

or:

DPMS (Energy Star):
  Standby: 0 Suspend: 0 Off: 300
  DPMS is Enabled
  Monitor is On

with the "Off:" time being set to the difference between the Power Mangement time and the Screensaver time. And if that time is non-zero, then playing with the adjusters seems to set the Off: time to the difference between the two (which definitely seems to be the wrong behaviour to me).

So there appears to be two things going on:
- there's something in Gnome (presumably Power Management) which is incorrectly setting the DPMS Off time to the difference between the Power Management off time and the Screensaver time (possibly when it notices a non-zero Off: time -- but irrespective, it's still doing the wrong thing: if it's going to set it, it should be to the total Power Management off time, or 0)

- there's a race condition between the CRT waking up and the DPMS being reset to zero (possibly by some other power management program or task), where the DPMS setting doesn't "stick" until the CRT is ready to accept it (for which the fix is presumably to have the power management reapply the setting a little while, eg, 30 seconds, after either (a) unsuspend, or (b) the arrival of a new monitor.

It appears once it becomes a non-zero value it's difficult to get the "reset to 0" behaviour back; I did manage it with one suspend (powering on the CRT a little earlier in the unsuspend), but other attempts still didn't reset it to zero (including ensuring the CRT was fully powered on before unsuspending).

In case it matters, the laptop is a HP NC6220, which has Intel integrated graphics (Intel 915GM), with a HP docking station, and a Viewsonic E70 CRT connected to it.

Anyway it seems to me that if the Gnome power manager is going to manage the display power off itself, it should probably be explicitly resetting the X DPMS Off: time (and others) to 0, and definitely never setting it to the difference between the screensaver time and the Power Management screen off time. That seems to be the core bug.

Ewen

Revision history for this message
Ewen McNeill (ewen) wrote :

Resetting status to New since there is now (hopefully) a way for others to reproduce it.

Changed in gnome-power-manager:
status: Invalid → New
Revision history for this message
unggnu (unggnu) wrote :

Thanks for pointing it out. Does the same happen with Hardy Alpha 4 Live CD? You can download it from http://cdimage.ubuntu.com/releases/hardy/alpha-4/ .

Changed in gnome-power-manager:
status: New → Incomplete
Revision history for this message
Ewen McNeill (ewen) wrote :

Tested with Hardy Alpha 4 (x86 Desktop). The Gnome configuration (apps->gnome-power-manager->timeout) still stores the difference between the screen saver time and the power management time, as in Gutsy. However I wasn't able to trigger the behaviour of the X11 DPMS off timeout being set to a non-zero amount even in half a dozen suspend-to-ram/resume cycles. So either the bug does not exist in Hardy, or it's much harder to trigger, or perhaps its difficult to trigger resuming from a Live CD boot. (It did seem that the resume in Hardy is noticeably faster, even off a Live CD, than in Gutsy, which I guess might change the circumstances of any race condition.)

At this stage I think it's probably safe to assume that the issue is resolved in Hardy. (And I planned to upgrade to Hardy anyway, once it's released.)

Ewen

unggnu (unggnu)
Changed in gnome-power-manager:
status: Incomplete → Fix Released
Revision history for this message
Liken Otsoa (liken) wrote :

Same problem with Hardy uptodate. After resume/suspend it fails to turn LCD off. For test, you put screensaver to 1 min and then it attempts to star one second but it reverts. Xset -q shows dpms 0 0 0.

Revision history for this message
DarkStarSword (darkstarsword) wrote :

I have experienced this behavior on two systems running Hardy, but am unsure of the trigger at present. It might have something to do with the display being suspended (possibly though other means - on one of the systems I have win+F9 rigged to run 'xset dpms force suspend' and noticed the screen turned off faster after executing that one time, but haven't noticed it other times, so I'm not sure).

Revision history for this message
vince (lapcchan) wrote :

i've trying to figure out why my laptop can only sleep after 9 minutes and i finally got to this bug report
i am using 8.10

even i didn't enable the gnome-screensaver "off" Activate screensaver when computer is idle
but i have 8 minutes on Regard the coputer as idle after 8 minute

then all the timeout on gnome-power-manager will have +8minute offset.

current workaround for me is to set 1 minute on "Regard the computer as idle after"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.