Bug 128696 - Monitor Power Saving Settings Reverting
Summary: Monitor Power Saving Settings Reverting
Status: RESOLVED FIXED
Alias: None
Product: kcontrol
Classification: Miscellaneous
Component: kcmenergy (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
: 136542 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-05 18:04 UTC by Patrick
Modified: 2008-11-12 00:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fix saving of DPMS settings (1.28 KB, patch)
2006-11-07 03:18 UTC, Sebastian Kügler
Details
patch from kubuntu (1.01 KB, patch)
2007-01-06 16:29 UTC, Luka Renko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick 2006-06-05 18:04:35 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Ubuntu Packages
OS:                Linux

The time setting for the monitor power saving are reverting to the default setting after each reboot. I tell it e.g. to switch off after 10 mins, but after a reboot it will be back to the default 30 mins.
I am not sure if this is a KDE bug or a Kubuntu specific issue. At least there are several people reporting this problem in the kubuntu forums.

First I thought it was related to the bug http://bugs.kde.org/show_bug.cgi?id=128610 as they appeared at the same time (i.e. after updating to 3.5.3). But there I was told it's a different  bug.
Comment 1 Patrick 2006-06-05 21:40:50 UTC
Editing /etc/X11/Xorg.conf and adding

option "offtime" "10"

in the ServerLayout section will set kcmenergy to switching off the monitor after 10 minutes, and it does switch off after that time. 

During a session you can change the time in kcmenergy and it will act accordingly.
But if you set it, let's say, to 20 mins and reboot the system it will be back to the 10 minutes that were set in the Xorg.conf.

This offtime option was missing in the original Xorg.conf, it was suggested in a forum to add it.
Comment 2 mike 2006-06-06 00:00:08 UTC
I have this problem as well. Same version etc as Patrick.

If I run /usr/bin/systemsettings from  console then go to Display > Power Saving and adjust the time to 15 mins I see this in the console -

/usr/bin/xset dpms 900 900 900

The man page for xset says

 These settings will be reset to default values when you log out.

Which would seem to explain the cause of the problem so I guess the solution is a change to the way systemsettings sets the value.


Hope that's useful.
Comment 3 mike 2006-06-06 00:13:14 UTC
I forget to say I had this same problem in 3.5.2 as well. That was a fresh install of Kubuntu 6.06. I subsequently updated to 3.5.3 with Kubuntu packages as obtained from a mirror listed at http://kubuntu.org/announcements/kde-353.php
Comment 4 Juan Carlos Torres 2006-06-09 03:09:46 UTC
It seems that it's not only the time setting that is reverting, but also whether Power Saving is enabled or disabled as well. Power Saving reverts to the default setting of enabled after 30 minutes everytime KDE is restarted.

Using Kubuntu 6.06 LTS, KDE 3.5.3.
Comment 5 Alan W. Irwin 2006-06-28 23:05:50 UTC
I confirm this problem with displayconfig.  I invoked this module specifically (to be sure I had the correct one) by

kcmshell displayconfig

For now I have given up on displayconfig.  Instead, I use the tried and true display module which is part of Kubuntu dapper, but which is not displayed in any of the menus by default.  The way to remove displayconfig from the menus and replace with display is to edit /usr/share/applications/kde/display.desktop and /usr/share/applications/kde/displayconfig.desktop.  Remove the last line (NoDisplay=true) from display.desktop and insert it in displayconfig.desktop instead.
Comment 6 Sebastian Kügler 2006-09-07 23:04:28 UTC
We're now writing dpms values to displayconfigrc and reading them back by means of displayconfig-restore at login. This should resolve this issue.
Comment 7 Patrick 2006-09-18 09:14:37 UTC
Hello again.

I am sorry to say that after a fresh installation of Kubuntu 6.06 Dapper with KDE 3.5.4 I am still experiencing the same bug. I had to resort to the "Offtime" option in Xorg.conf to get my monitor to switch off at the desired time.
Still the values set in kcontrol revert to the standard 30 minutes after each reboot.
Comment 8 Patrick 2006-09-18 09:38:13 UTC
There is a thread on kubuntuforums where people report this bug in KDE 3.5.4: http://kubuntuforums.net/forums/index.php?topic=8180.0
Comment 9 Joseph Dal Molin 2006-09-26 04:36:54 UTC
I am having the same problem as #7 using Kubuntu for AMD64. I lose the settings on reboot and they revert to 30 min but with power savings unchecked. When I set the savings to 1 minute... the screen goes to sleep but wakes up again about a minute or two later.
Comment 10 Lithium 2006-10-31 01:38:04 UTC
I'm seeing this bug in Kubuntu 6.10.  I guess I never noticed it in Kubuntu 6.06 because I always set OffTime to 30 minutes in kcmenergy.  In Edgy Eft, the OffTime reverts to 5 hours when I reboot.  Its a very annoying problem I hope gets fixed soon.
Comment 11 johnfw 2006-11-02 01:56:13 UTC
The bug, reversion to default values, which affects Power Saving, Date and Time and Screensaver is still presnt in 3,5,5 and thus in the Kubuntu 6.10 release

It looks as if it will be around for some time yet
Comment 12 Patrick 2006-11-05 16:54:22 UTC
*** This bug has been confirmed by popular vote. ***
Comment 13 Patrick 2006-11-05 17:00:01 UTC
Also here the power saving settings revert to 5 hours after reboot on a freshly installed Kubuntu Edgy 6.10 using KDE 3.5.5.
Comment 14 Sebastian Kügler 2006-11-07 03:18:16 UTC
Created attachment 18450 [details]
Fix saving of DPMS settings

DPMS settings were not saved (as opposed to what I told earlier), this patch
resolves it. If it doesn't, please check ~/.kde/share/config/displayconfigrc if
it's in there, if yes, report it here and reopen this bug.
Comment 15 Sebastian Kügler 2006-11-07 03:19:02 UTC
*** Bug has been marked as fixed ***.
Comment 16 Jim Van Donsel 2006-11-25 17:43:01 UTC
I don't think that actually fixed the problem.  I think there is a units problem.   Setting the timeout to 15 minutes in the control panel causes a value of 900 to be placed in the displayconfigrc file, presumably in units of seconds. But on the next reboot, 'xset q' reports the timeout is 54000 seconds.  The startup scripts interpreted the 900 as 900 minutes (54000 seconds), not 900 seconds.

I'm running Kubuntu Edgy.
Comment 17 Dave Meyers 2006-11-26 01:46:36 UTC
I'm with Jim on this one, also running Kubuntu Edgy. 

There's something very weird going on. I even went and modified diplayconfig-restore.py and hardcoded  the xset command and looked at what the before and after was.

I changed line #169 'cmd = "xset dpms 260 260 260"'. Also, writing the output of "xset q" to a file before and after the command is run, the values were "Standby: 420  Suspend: 420  Off: 420" and corresponded to the values I have set under ServerFlags in xorg.conf. After the command is run the values were "Standby: 260  Suspend: 260  Off: 260", which is what we would expect. BUT, after KDE has started and I open a Konsole and check "xset q" again the values are all scaled by a factor of 60 => "Standby: 15600  Suspend: 15600  Off: 15600". If I change the hardcoded values passed to "xset dpms" to say 300, I will get 18000 showing up with "xset q", again a factor of 60.

So something else is setting the dpms values after displayconfig-restore.py is run, multiplying whatever displayconfig-restore.py sets by 60. Any ideas?
Comment 18 Joan Tur 2006-11-28 09:50:23 UTC
I completely agree with Jim Van Donsel: I log into kde, run displayconfig command, and notice the power off time is set to 2 hours; I then cat ~/.kde/share/config/displayconfigrc, and "dpmsSeconds=120" is shown, so despite it says "seconds", "minutes" are being used.

I then change the 2 hours setting in displayconfig to 2 minutes, then click on apply.  It now powers off the screen fine after those 2 minutes time, BUT after logging out & logging in again this setting is reverted to 2 hours.

I've got the same behaviour before and after applying Sebastian Kügler's patch above (I'm running edgy).

So I'd reopen this bug, because it seems to be still alive.
Comment 19 Patrick 2006-11-28 13:34:09 UTC
As the latest reports show the bug seems not to be fixed. Therefore I reopen this bug report.
Comment 20 Patrick 2006-11-29 12:39:10 UTC
I would also suggest to lift this bug to the "grave" priority level. The power saving is a fundamental issue in my eyes and I don't even want to know how much energy this bug was eating already. At the moment the monitor standby settings default to 5 hours (!!!) with every boot (at least in Kubuntu). This is a environmental issue and modern desktop systems should treat this with the required seriousness. 

Apart from that this bug is plainly annoying for the average user. It is around since half a year now.
Comment 21 Sebastian Kügler 2006-11-30 08:21:02 UTC
This bug is Ubuntu only, and it does also happen in the GNOME version. It is highly unlikely that this is a bug in guidance, so I'm closing it again.
See also
https://launchpad.net/distros/ubuntu/+source/kde-guidance/+bug/65791
Comment 22 Luka Renko 2007-01-06 16:15:31 UTC
As logged in Ubuntu bug, I think the root cause of this bug is that kenergy does not have consistent handling of dpms config file values. Timeout defaults are in minutes, when timeouts are set, they are properly multiplied by 60, but in other place DPMS settings are read and used as is (and they are in seconds). 

My proposed patch for 3.5.6 ensures that values read from current setting (reported by xset -q) are properly divided by 60 in order to use them as defaults if config file is not used.
Comment 23 Luka Renko 2007-01-06 16:29:46 UTC
Created attachment 19129 [details]
patch from kubuntu
Comment 24 Luka Renko 2007-01-07 17:14:30 UTC
SVN commit 620866 by lure:

DPMS timeout settings on the system are in seconds and need to be divided
by 60 when used as defaults for reading config file timeout values 
of kcontrol's energy module in order to have consistent handling.
>From 3.5 branch (revision 620863)

CCBUG: 128696


 M  +3 -3      energy.cpp  


--- trunk/KDE/kdebase/workspace/kcontrol/energy/energy.cpp #620865:620866
@@ -117,9 +117,9 @@
 	    DPMSInfo(dpy, &pre_configured_status, &pre_configured_enabled);
 	    /* let the user override the settings */
 	    enabled = cfg->readEntry("displayEnergySaving", bool(pre_configured_enabled));
-	    standby = cfg->readEntry("displayStandby", int(pre_configured_standby));
-	    suspend = cfg->readEntry("displaySuspend", int(pre_configured_suspend));
-	    off = cfg->readEntry("displayPowerOff", int(pre_configured_off));
+	    standby = cfg->readEntry("displayStandby", int(pre_configured_standby/60));
+	    suspend = cfg->readEntry("displaySuspend", int(pre_configured_suspend/60));
+	    off = cfg->readEntry("displayPowerOff", int(pre_configured_off/60));
 	} else {
 	/* provide our defauts */
 	    enabled = true;
Comment 25 Jonathan Riddell 2007-01-07 17:22:15 UTC
Fixed with last commit by Luka Renko.
Comment 26 Matt Stevens 2008-02-26 07:22:13 UTC
running 3.5.8 and this problem is still present.
Comment 27 FiNeX 2008-11-12 00:08:43 UTC
*** Bug 136542 has been marked as a duplicate of this bug. ***
Comment 28 FiNeX 2008-11-12 00:10:45 UTC
@Jonathan: are you still experiencing this issue even with 3.5.10? If so, please tell us! I'll reopen this report if the problem has not been solved.