GNOME Bugzilla – Bug 576169
Screens never turnś off / dpms broken (again and again and again)
Last modified: 2009-04-28 17:44:44 UTC
Please describe the problem: Since years i have this problem and today i know its gpm's or gnome-screensaver's fault. Sometimes dpms works but usually it does not. After the time specified in gnome-screensaver the screens fades black and right before it reaches full blackness it jumps back to full brightness. I never shuts down the screen now. I have this on 4 different Laptops that ran multiple Distros over the years and i had this problem everywhere. Currently i use Jaunty and Intrepid on 2 Thinkpad X60Ts, a Thinkpad T42 and a Thinkpad X22. When i use Xfce4 and xfce's power-manager (which was released only a few weeks ago) the screen always and reliably shuts off. Steps to reproduce: 1. Set the energy-settings to a short time and leave your computer 2. Wait for the screen to dimm 3. Repeat daily for 5 years and write down the results Actual results: Usually it does not dimm Expected results: I would expect my computer to shut down the monitor. Does this happen every time? No but most of the time. Sometimes after a fresh boot it works but not always. Other information: Im not using fullscreen-modes, Video-playback or anything im aware of that could intentionally inhibit the screen-dimming.
I've applied this in trunk: 2009-03-23 Richard Hughes <richard@hughsie.com> * src/gpm-dpms.h: * src/gpm-dpms.c: (gpm_dpms_error_quark), (gpm_dpms_x11_get_mode), (gpm_dpms_x11_set_mode), (gpm_dpms_mode_from_string), (gpm_dpms_mode_to_string), (gpm_dpms_set_mode), (gpm_dpms_get_mode), (gpm_dpms_poll_mode_cb), (gpm_dpms_class_init), (gpm_dpms_init), (gpm_dpms_finalize), (gpm_dpms_test): Rewrite the DPMS class to have 1% of the complexity. Don't try and sync with the XServer, as each distro seems to default to doing different things, and if XOrg is managing DPMS then we disagree when the idle point happens. We can't rely of the XServer to tell us a changed signal for policy, as it's only polled once every 10 seconds. In this new model we just tell the server to turn on and off when required. Should fix #576169. * data/gnome-power-manager.schemas.in: Change the default DPMS off mode to "off". * src/gpm-backlight.c: (gpm_backlight_set_mode), (gpm_backlight_get_mode), (gpm_conf_gconf_key_changed_cb), (gpm_backlight_button_pressed_cb), (idle_changed_cb), (control_resume_cb), (gpm_backlight_finalize), (gpm_backlight_init): * src/gpm-idle.c: (gpm_idle_set_mode), (gpm_idle_evaluate), (gpm_idle_idletime_alarm_expired_cb), (gpm_idle_idletime_reset_cb), (gpm_idle_finalize), (gpm_idle_init): Make sure the backlight mode is scheduled, as a typo prevented it from activating in 2.26.x code, and IDLETIME was reset with the DPMS request which made the server come straight back to life. Basically, it was terminally broken, and it's now fixed. * src/gpm-manager.c: (gpm_manager_blank_screen), (gpm_manager_unblank_screen), (idle_changed_cb), (update_dpms_throttle), (screensaver_auth_request_cb): Trivial method renames. * src/gpm-prefs-core.c: (gpm_prefs_sleep_slider_changed_cb), (gpm_prefs_setup_sleep_slider), (gpm_prefs_brightness_slider_changed_cb), (prefs_setup_ac), (prefs_setup_battery), (prefs_setup_ups): We don't base our DPMS off on the session idle anymore, so don't add the session idle timeout to DPMS sliders. * src/gpm-self-test.c: (main): Add some unit tests for the DPMS code. Could you try trunk and tell me what you think please? Thanks. Richard.
Your quick and promising reply really cheered me up! I built gpm-trunk (on jaunty) and immediately noticed that the "idle-time" in gnome-power-manager is no longer dependent on gnome-screensaver's timeout setting. I can have gpm at 1m and gnome-screensaver at 10m. Usually everything is fine for a few hours after a fresh reboot until suddenly dpms breaks in some way where the screen is either not dimming down completely, the backlight not turning off or nothing happening at all. Therefore i will keep this laptop running for at least a week until i get my hopes up. I will report how it goes.
Cool, thanks for testing so quick. I would appreciate some stress testing this week, as then I can backport the important bits back to 2-26, and get a 2.26.1 release with working DPMS. Please also comment if things are working 100% okay. Thanks.
Everything went fine until i had a power-loss today and needed to restart the machine. Then i had the feeling the screen blanks too quickly and indeed it did turn off the screen several times after only 30s instead of the configured 1m. I started to change the settings around and see what happens. gpm = gnome-power-manager gs = gnome-screensaver 1m S = Screensaver kicks in after 1m 1m P = Screen switched off by gpm after 1m gpm 10m, gs 1m: 1m S gpm 1m, gs 10m: 30s P, 1m P, 1m P, 1m P. gpm 1m, gs 2h: 1m P, deactivated gs in its gui now, 2m P, 4m P, 4m P, re-activated gs, 4m P, disabled gs again, 8m P, enabled gs, 20m P, 20m P. no time left for this series. gpm 1m, gs 10m: more than 4m. gpm 1m, gs 1m: 1m S, gs keeps running. 1m S, deactivated gs, more than 3m (no time left). Unfortunately i ran out of time here. Obviously the timeout is growing for some reason, if and how gs has an effect on this is not so obvious though. I should not have messed with so many variables at one (gs times, deactivating gs), i will continue tomorrow. PS: During this test i am not updating any parts of the system.
Yes, if you undim immediately after it dims, g-p-m doubles the dim time, the logic being that it dimmed too quickly for what you are trying to do.
Wow thats a really nice feature but maybe this adjusted dim time could be displayed by gpm's gui. Alright then, i will continue the testing.
Currently the screen blanks after 1m 30s no matter what time i choose. 1m, 5m, 10m, 30m, 1h, it always switches off after 1m 30s.
2009-03-26 Richard Hughes <richard@hughsie.com> * src/gpm-manager.c: (gpm_conf_gconf_key_changed_cb): Monitor the backlight blank time GConf value change, and set the blank idle time when this changes. Can you try now please? Thanks.
There are no issues to report since i updated to trunk on 09-03-26.
Unfortunately i was speaking too quickly. When i set the time to 1m, 5m, 10m, 15m, 19m everything seems fine. At 20m and 21m the screen blanks for half a second (at the right time) and immediately comes back on. At 25m and 30m it does not seem to turn off at all.
gpm crashed twice while watching a movie (with gnome-mplayer). This is the error-msg from the terminal: (gnome-power-manager:26499): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: DPMS is not enabled [1]+ Segmentation fault (core dumped) gnome-power-manager
2009-04-06 Richard Hughes <richard@hughsie.com> * src/gpm-backlight.c: (gpm_backlight_button_pressed_cb), (idle_changed_cb), (control_resume_cb): * src/gpm-button.c: (coldplug_buttons): * src/gpm-manager.c: (gpm_manager_unblank_screen): * src/gpm-notify.c: (notify_general_clicked_cb): * src/gpm-prefs-core.c: (gpm_dbus_method_bool), (gpm_dbus_method_int), (pk_prefs_set_defaults_cb): Verify that all GError's are initialised to NULL before they are used. Should fix #576169 Can you try again please? Thanks.
It did not crash yet but the problem with 20+ minutes remains. When i set it to anything from 1m to 19m it works fine but with 20m or more the screen immediately turns on again. I tried it several times after the update yesterday and twice after a fresh boot today.
I am also having a new issue now. The brightness goes constantly one step down and one step up again. This happens every few seconds, it goes down and one second later it goes up again.
It changes brightness because it thinks the AC is getting unplugged, thats not the case though. I have no battery in it so it could not possibly continue running if there were a problem with the cable.
Created attachment 132426 [details] g-p-m verbose log basically, the first cycle normal -> dim -> blank -> normal occurs in a timely fashion, the problem happens during the second cycle where blanking never occurs. In the log file, blanking occurs after 4 mins. Could the problem in the second cycle be related by the "failed to remove timer" messages ?
(In reply to comment #13) > It did not crash yet but the problem with 20+ minutes remains. > When i set it to anything from 1m to 19m it works fine but with 20m or more the > screen immediately turns on again. Can you try again please: 2009-04-13 Richard Hughes <richard@hughsie.com> * src/gpm-dpms.c: (gpm_dpms_clear_timeouts), (gpm_dpms_init): Ensure we clear the default DPMS timeout of 1200s. Should fix #576169
about comment #16, I also noticed that this behaviour happens when gnome-screensaver locks the screen before gpm state changes to blank. In this case, just unlocking the screensaver, and doing no other mouse/keyboard action prevents gpm to change state from blank to normal. The function gpm_idle_idletime_reset_cb() with id=0 is not called. On the contrary, when the screen is not locked when unblanking, an "idletime reset: 0" immediately occurs.
I did 5 tests between 20m and 30m and it worked fine.
Still working fine :-)
Excellent, thanks. I've rolled up these changes and released 2.26.1 (Fedora packages here: http://koji.fedoraproject.org/koji/taskinfo?taskID=1311033) Many, many, thanks for your help with this.
Unfortunatley, after the upgrade to 2.26.1, I think I developed a version of this problem. I have g-p-m preferences set to never put the display to sleep and not dim when idle. These settings are the same for both on AC and on battery. Everything was fine. But after the upgrade to 2.26.1 the backlight on my (laptop) monitor started turning off all the time and somewhat randomly. Sometimes after just a second, usually after 30 seconds to 1 minute. I tried using "setterm -powerdown 0" which had no effect. Then found that if I disable dpms (with: xset -dpms), this serves as a workaround for the problem--although of course that's totally bypassing the g-p-m settings and wouldn't be a solution for someone who wants the display to be put to sleep after some period of time. Although, curiously, running "xset -dpms" in my .xinitrc has no effect, but setting it up as a start up program in System > Preferences > Startup Applications works. I'm running Arch64. Again the problem arose very clearly a couple days ago right after the upgrade to g-p-m 2.26.1. Six other people have reported the same problem on a thread I started in the Arch forums (see: http://bbs.archlinux.org/viewtopic.php?id=70733).
Same problem reported by C Bispham happening here. Maybe we could open another bug since this is closed?