GNOME Bugzilla – Bug 659066
Suspend when inactive doesn't work
Last modified: 2011-09-26 17:09:29 UTC
Since the move from gnome-power-manager to g-s-d, the suspend when inactive feature doesn't work. gnome-settings-daemon 3.1.91 upower 0.9.13 System is a laptop without a battery, always on AC
I'm seeing the same, but it is not suspending after the set time on battery either, it seems.
This is more crazy idle timeout mess. there's a X idle timer that gets set for 'idle dim' - but has the side-effect of setting (or not) the x_idle variable. Which in turn gets checked when we get the session idle change event. On my system, idle dim seems turned off, so when the session goes idle, the suspend never happens.
So I guess you either need to set x_idle to TRUE unconditionally when idle dim is disabled, or remove the early exits from idle_evaluate
commit dfd4505e4ebd21d5c6b06c039852a4c13896b8e8 Author: Richard Hughes <richard@hughsie.com> Date: Fri Sep 16 17:16:55 2011 +0100 power: Do not use G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES when we want to read properties Hopefully resolves https://bugzilla.gnome.org/show_bug.cgi?id=659066
(In reply to comment #3) > So I guess you either need to set x_idle to TRUE unconditionally when idle dim > is disabled, or remove the early exits from idle_evaluate Ahh, I've got dimming enabled on AC, so I didn't see this. I'll debug more tomorrow.
can a possible reason be that /usr/lib/gnome-settings-daemon-3.0/libpower.so doesn't link to libxext?
unlikely
Richard, any progress on this ?
Created attachment 197343 [details] [review] trivial patch to prevent debug spew
Created attachment 197344 [details] [review] fix this bug Fix this bug. See commit message. Thanks.
Review of attachment 197343 [details] [review]: ::: plugins/power/gsd-power-manager.c @@ +2731,3 @@ + /* reset brightness if we dimmed */ + if (manager->priv->pre_dim_brightness > 0) { Below you initialize to -1. Should this check be >= 0 ? Admittedly brightness of 0 is maybe not that useful. But still an allowed value ?
(In reply to comment #11) > Review of attachment 197343 [details] [review]: > > ::: plugins/power/gsd-power-manager.c > @@ +2731,3 @@ > > + /* reset brightness if we dimmed */ > + if (manager->priv->pre_dim_brightness > 0) { > > Below you initialize to -1. Should this check be >= 0 ? > Admittedly brightness of 0 is maybe not that useful. But still an allowed value > ? Yes, i pondered that. It's still technically allowed, but it's not useful to set. Using >= 0 would be more correct I suppose. Did the rest of the patch work?
Review of attachment 197344 [details] [review]: ::: plugins/power/gsd-power-manager.c @@ +144,3 @@ typedef enum { GSD_POWER_IDLE_MODE_NORMAL, + GSD_POWER_IDLE_MODE_DIM, /* set even if no dim action */ Tbh, I don't think this comment helps. If these modes don't mean what their name says, they should be renamed. And it would be good to have a comment explaining them all. @@ +2662,3 @@ + } + if (!ret) { + g_debug ("not dimming due to policy"); Seeing this g_debug here, I realize that we should set up per-plugin log domains, maybe. @@ +3267,3 @@ return; } + if (g_strcmp0 (key, "idle-dim-time") == 0) { keys going away ? obsolete keys ? this should probably be a separate commit.
i've tried this patches and still doesn't work. nome-settings-daemon:11090): power-plugin-DEBUG: idletime alarm: 1 (gnome-settings-daemon:11090): power-plugin-DEBUG: normal to dim (gnome-settings-daemon:11090): power-plugin-DEBUG: Doing a state transition: dim (gnome-settings-daemon:11090): power-plugin-DEBUG: not dimming due to policy (gnome-settings-daemon:11090): power-plugin-DEBUG: setting up blank callback for 600s (gnome-settings-daemon:11090): power-plugin-DEBUG: setting up sleep callback 300s (gnome-settings-daemon:11090): housekeeping-plugin-DEBUG: housekeeping: checking thumbnail cache size and freshness (gnome-settings-daemon:11090): power-plugin-DEBUG: session is not idle, cannot SLEEP (gnome-settings-daemon:11090): power-plugin-DEBUG: Received gnome session status change (gnome-settings-daemon:11090): power-plugin-DEBUG: Received gnome session status change (gnome-settings-daemon:11090): power-plugin-DEBUG: idletime reset (gnome-settings-daemon:11090): power-plugin-DEBUG: Doing a state transition: normal (gnome-settings-daemon:11090): power-plugin-DEBUG: X not idle note that i set up suspend on idle 5 minutes and screensaver at 10 minutes. the screensaver kicks on time
(In reply to comment #13) <snip> > @@ +2662,3 @@ > + } > + if (!ret) { > + g_debug ("not dimming due to policy"); > > Seeing this g_debug here, I realize that we should set up per-plugin log > domains, maybe. We already do. PLUGIN_CFLAGS="-DG_LOG_DOMAIN=\"\\\"\$(plugin_name)-plugin\\\"\"" in configure.ac
(In reply to comment #13) > Review of attachment 197344 [details] [review]: > > ::: plugins/power/gsd-power-manager.c > @@ +144,3 @@ > typedef enum { > GSD_POWER_IDLE_MODE_NORMAL, > + GSD_POWER_IDLE_MODE_DIM, /* set even if no dim action */ > > Tbh, I don't think this comment helps. > If these modes don't mean what their name says, they should be renamed. > And it would be good to have a comment explaining them all. Sure, valid. What about s\GSD_POWER_IDLE_MODE_DIM\GSD_POWER_IDLE_MODE_XIDLE? > @@ +3267,3 @@ > return; > } > + if (g_strcmp0 (key, "idle-dim-time") == 0) { > > keys going away ? obsolete keys ? this should probably be a separate commit. Well, it's the fact that there's no point them being there with this reshuffle.
(In reply to comment #14) > i've tried this patches and still doesn't work. > (gnome-settings-daemon:11090): power-plugin-DEBUG: session is not idle, cannot > SLEEP That's a different issue. We check if the session is really idle before actually doing the suspend, so it's likely there's a sanity check there.
With these patches, I've actually seen my machine suspend when idle for a while. What makes testing all this horribly confusing is that it is all set off by the session idle-delay, which is usually set to some largish value (600s). Setting org.gnome.desktop.session idle-delay 30 org.gnome.settings-daemon.plugins.power idle-sleep-ac-timeout 30 Make my machine suspend after a short wait of ~ a minute.
it's idle-sleep-ac-timeout because i don't have that. i do have sleep-inactive-ac-timeout gsettings get org.gnome.desktop.session idle-delay uint32 600 gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 1800 i'll try tonight to see if it's sleeping after screensaver is started
suspend works for me
*** Bug 660074 has been marked as a duplicate of this bug. ***
Comment on attachment 197343 [details] [review] trivial patch to prevent debug spew I've committed this to master.
(In reply to comment #18) > What makes testing all this horribly confusing is that it is all set off by the > session idle-delay, which is usually set to some largish value (600s). This is basically a sanity check, as the session idle is controlled by things like the inhibits available. We're never going to want to set the suspend-on-idle value in the power control panel to less than 10 minutes, and so I don't think there is a problem here.
Comment on attachment 197344 [details] [review] fix this bug I've committed this to master with minor fixes. I think it's a bit late for gnome 3.2, but we can push this to gnome-3-2 after the hard code freeze opens so it's fixed in 3.2.1.