You are not logged in.

#1 2007-06-13 12:42:20

ArchPad
Member
Registered: 2007-03-26
Posts: 81

Suspend to RAM

When I ran Arch in KDE, I was able to configure my button actions in KLaptop such that on closing my laptop lid, the computer suspended to RAM. No further configuration was required. Now, on a fresh GNOME install, I've enabled the same setting in gnome-power-manager, but I receive a "failed to suspend" error when I close the lid, or suspend from the desktop.

The Suspend to Disk wiki page recommends installing the beyond kernel to enable Hibernate and Suspend functions. Why is it that I was able to suspend without this before? In short, I'd really just like to get Suspend to RAM working on my GNOME desktop without using a different kernel.

Offline

#2 2007-06-13 13:40:09

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Suspend to RAM

I guess klaptop just did a raw suspend to ram request to the kernel since it didn't find a suspend/hibernate infrastructure in your system.
You could probably do the same with (i'm going to assume you already have acpi installed and run at startup);
echo -n "mem" > /sys/power/state
I'm surprised this worked without a glitch. However, since gnome might demand some sort of infrastructure to be in place, why don't you install one? You don't need another kernel just to have suspend working. suspend2 is just an alternative to regular kernel suspend (and yes, suspend 2 also requires it's own kernel).

Try powersave, or hibernate-script. Both are different animals, but they both fly...


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#3 2007-06-13 14:00:14

ArchPad
Member
Registered: 2007-03-26
Posts: 81

Re: Suspend to RAM

Acpi is installed and in my daemons. So that line will suspend?

Offline

#4 2007-06-13 14:02:42

ArchPad
Member
Registered: 2007-03-26
Posts: 81

Re: Suspend to RAM

pelle.k wrote:

However, since gnome might demand some sort of infrastructure to be in place, why don't you install one? You don't need another kernel just to have suspend working.

What infrastructure are you referring to?

Offline

#5 2007-06-13 19:03:35

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Suspend to RAM

Try powersave, or hibernate-script. Both are different animals, but they both fly...

I'm sorry to quote myself, but this is what i was reffering to. Both these are infrastructures that handle suspend/hibernate.

1. with powersave you get a daemon part (you don't need acpid with powersaved, it starts acpid automatically), and powersave is the binary supplied.
2. hibernate-scripts are just that. scripts. (they depend on acpid running) You can read about hibernate-scripts in the wiki.


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#6 2007-06-14 11:34:12

krishnarao
Member
Registered: 2007-05-19
Posts: 33

Re: Suspend to RAM

Doesn't gnome-power-manager need powersave to be able to suspend.

Offline

#7 2007-06-14 11:50:16

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Suspend to RAM

Yes, but only with powersave and hibernate-script you are able to configure all the routine stuff required by a proper suspend/resume cycle on 90% of machines (unload/load modules, restart services, unload/reload partitions, restore video card with vbetool etc.) In my opinion, hibernate-script is more flexible and easy to configure.

About the fact that it worked before and now it does not work, remember that there are frequent regressions in the linux kernel development about suspension. Example given, 2.6.21 fails to resume properly from suspension to ram for me, while 2.6.20 worked fine. I posted the bug in the kernel bugzilla and Thomas Gleixner posted a solving patch. But the regression can be anywhere (mostly in drivers), and it is often enough to unload the guilty module with the hibernate-script or similar tools.


Mortuus in anima, curam gero cutis

Offline

#8 2007-06-17 17:51:10

retsaw
Member
From: London, UK
Registered: 2005-03-22
Posts: 132

Re: Suspend to RAM

On a recent test of Ubuntu I discovered that suspend worked on my machine.  I tried powersave and that didn't work, so I figured that instead of trying to get powersave working I'd write my own custom suspend script so I'd know exactly what's going on and it fits in better with the KISS philosophy since I can't make my script any simpler than it is.  This is my script:

#!/bin/sh
vbetool vbestate save > /tmp/state       #Save video state
/etc/rc.d/monitd stop                    #Sevice to be stopped
/etc/rc.d/mythbackend stop               #Sevice to be stopped
netcfg --stop ath0                       #Stop wireless network
modprobe -r ath_pci                      #Unload wireless card modules
modprobe -r ath_rate_sample              #Unload wireless card modules
modprobe -r ath_hal                      #Unload wireless card modules
modprobe -r saa7134_dvb                  #Unload TV card module
echo -n mem > /sys/power/state           #Suspend
vbetool vbestate restore < /tmp/state    #Restore video state after coming back from suspend
xinit /bin/false -- :9 >/dev/null 2>&1 & #Reinitialise graphics otherwise xv video won't work properly on my Unichrome graphics chipset
modprobe ath_pci                         #Reload wireless network card module
modprobe saa7134_dvb                     #Reload TV card module
netcfg main                              #Restart wireless network
/etc/rc.d/mythbackend start              #Restart service
/etc/rc.d/monitd start                   #Restart service

Obviously this is custom to my specific setup so it may not work for anyone else, but it could still be useful as a guide to anyone who wants to do it this way.  I saved this script and set acpid to execute it when I pressed the power button (because I don't have a suspend button).

I also added the "highres=off nohz=off" options to my kernel commandline since I didn't want to patch my kernel for the bug in the 2.6.21 kernel that patroclo7 mentioned.

Last edited by retsaw (2007-06-17 17:58:18)

Offline

Board footer

Powered by FluxBB