Ubuntu won't suspend automatically any more

Asked by Sparhawk on 2012-09-07

In the last few months, Ubuntu (12.04) has stopped sleeping automatically. I would like to restore this behaviour. I've gone to System Settings > Power, and verified (and toggled) "suspend on inactive for" to 5 minutes (for both battery and "when plugged in"), but the system stays awake.

Also, I've tried used code similar to

$ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 300
$ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 300

to set the timeout values. I've also verified these values in dconf Editor. Previously, I could set this quite low to make my computer sleep quickly, but now it no longer works either.

I'm not sure if this is relevant, but under old versions of Ubuntu, if I wanted my computer to never suspend (via the CLI), I would also set

$ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac false

At some point, this seemed to have been depreciated (and now gives me the error "No such key 'sleep-inactive-ac'"). Since then, I found that it was enough to set sleep-inactive-ac-timeout to 0. This worked for a while, but at some point auto-suspend stopped working. Oddly enough, the sleep-inactive-ac key is still present when I look via dconf editor. However, when I click it, it says "no schema", and the summary, etc. fields are blank. Also, "Set to default" does nothing.

I'm also not sure if this is relevant, but I uninstalled gnome-screensaver, and installed xscreensaver ages ago. As mentioned, automatic sleep worked fine a month ago, when I had this same configuration. In any case, I tried killing xscreensaver and re-installing gnome-screensaver, but this did not help.

To test if the dconf power plugin was working, I tried playing around with other settings in the schema. Idle-dim-time and idle-dim-ac work as expected. However, setting sleep-display-ac to 5 seconds has no effect. xscreensaver can trigger though, so I suspect there is not some program preventing the detection of idle behaviour, but rather a problem with the gnome-suspend daemon.

I've also tried creating a new user account, then logging out of the main account and into the new account. I've tried modifying the timeouts via dconf, but get the same results as above (i.e. it doesn't work, nor does sleep-display-ac, but idle-dim-time and idle-dim-ac work). Also, the depreciated sleep-display-ac key is not visible, so I think that this is probably unrelated.

I also attempted to restart and log into the new account immediately, just in case my main account was "poisoning" the system. Automatic suspend still fails, but oddly enough, sleep-display-ac now works, and respects the values that I put in it.

I've also noticed some trouble with DPMS. I'm not sure if this is related, but I'll put the information here, just in case. Using xscreensaver, I set Power Management to enabled, with standby and suspend timeouts to 10 minutes. I've verified these settings in ~/.xscreensaver and xset q. However, the screen blanks after about 30 seconds. If I turn off DPMS (either via xscreensaver GUI or modifying ~/.xscreensaver), it won't blank at all, so I know that DPMS is partially reading the xscreensaver settings.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-power-manager Edit question
Assignee:
No assignee Edit question
Solved by:
Sparhawk
Solved:
2012-09-24
Last query:
2012-09-24
Last reply:
2012-09-11

Have you looked in screensaver and power settings in dash?

Sparhawk (sparhawkthesecond) said : #2

Thank you for the response. Unfortunately, I've already tried the equivalent of both. Screensaver just opens up xscreensaver for me (as I've uninstalled gnome-screensaver), and power (via dash) opens up the same module as System Settings > Power, which I've already tried.

N1ck 7h0m4d4k15 (nicktux) said : #3

Hello ,

Very good description of the problem.

I don't know what could possibly created this problem , but here are the default values , (Ubuntu Fresh installation , last night)
just for a comparison

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type suspend
gsettings set org.gnome.settings-daemon.plugins.power active true
gsettings set org.gnome.settings-daemon.plugins.power button-suspend suspend
gsettings set org.gnome.settings-daemon.plugins.power button-sleep hibernate
gsettings set org.gnome.settings-daemon.plugins.power idle-dim-ac false
gsettings set org.gnome.settings-daemon.plugins.power idle-dim-battery true
gsettings set org.gnome.settings-daemon.plugins.power idle-dim-time 90
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 600
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 600
set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type suspend
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type suspend
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thanks

Sparhawk (sparhawkthesecond) said : #4

Thanks NikTh. I've been struggling with this for months, hence why the description is so lengthy!

My settings are slightly different to that. I'm not sure that the settings are to blame though, because I did troubleshoot with a new user account, which had the default settings.

Also, does your machine actually automatically suspend? It seems like it wouldn't, from:
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0

N1ck 7h0m4d4k15 (nicktux) said : #5

Thanks NikTh. I've been struggling with this for months, hence why the
> description is so lengthy!
>
> My settings are slightly different to that. I'm not sure that the
> settings are to blame though, because I did troubleshoot with a new user
> account, which had the default settings.
>
> Also, does your machine actually automatically suspend? It seems like it
> wouldn't, from:
> gsettings set org.gnome.settings-daemon.plugins.power
> sleep-inactive-ac-timeout 0
> gsettings set org.gnome.settings-daemon.plugins.power
> sleep-inactive-battery-timeout 0
>
>
>
Hi ,
No , I don't use the automatic suspend option. I just gave you the defaults
in case you want to examine them.

The problem must be related to that schema missing thing.
How can you restore a missing schema ?
Search with this term , maybe helps you.

Thanks

Sparhawk (sparhawkthesecond) said : #6

Thanks again NikTh, but I don't think the missing schema is to blame, because I've tried creating a new user account. This new user has the default settings, with no missing schema. However, automatic suspend is still broken.

N1ck 7h0m4d4k15 (nicktux) said : #7

> Thanks again NikTh, but I don't think the missing schema is to blame,
> because I've tried creating a new user account. This new user has the
> default settings, with no missing schema. However, automatic suspend is
> still broken.
>
>
>

Hello ,

is you system suspend normally ?

e.g:

++++++++++++++++++++++++
sudo pm-suspend
++++++++++++++++++++++++

Thanks

Sparhawk (sparhawkthesecond) said : #8

Yes, that works fine.

N1ck 7h0m4d4k15 (nicktux) said : #9

Try to reinstall some packages

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sudo apt-get install --reinstall gnome-power-manager indicator-session pm-utils upower
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thanks

Sparhawk (sparhawkthesecond) said : #10

Thanks again NikTh. I gave that a go, but but it didn't help. I even tried it with the fresh account, but nothing. Cheers.

Peter Wolf (peterwolf) said : #11

Had same issue on 12.04, fixed by setting org.gnome.settings-daemon.plugins.power "sleep-display-battery" to a value lower than "sleep-inactive-battery-timeout".

Sparhawk (sparhawkthesecond) said : #12

Hi peterwolf, thanks for the response.

Unfortunately, I already had that value lower. In addition, sleep-display-ac and sleep-display-battery seem to do nothing on my system. Cheers.

Sparhawk (sparhawkthesecond) said : #13

Thanks for moving this to gnome-power-manager. I've actually since changed from unity to gnome-shell, and I still have this problem.

Sparhawk (sparhawkthesecond) said : #14

I'm not sure why, but toggling settings as per http://askubuntu.com/a/180505/53508 fixed it for me. It's frustrating though, because I don't think it's enough information for a bug report. I've filed a bug report for the sleep settings being not accurate at https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/1055874

spark (sparky-plug) said : #15

I have the same issue in gnome ubuntu 14.04 .Sleep after 10 minutes is just too short for me. Any other suggestions?