You are not logged in.

#1 2010-01-03 21:24:40

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Howto integrate s2ram with KDE Powerdevil?

Hi,

I have a Sony VGN-FW53GF which runs Arch incredibly well. The only thing I would like to get going is suspend to ram/disk when I close the lid.

At the moment if I suspend to ram, it does, but on resume black screen ... have to reboot.

I installed  "pacman -S uswsusp" so that I could use the user space s2ram utility .... and that works great, I just do a "s2ram -f" and it suspends/resumes
just great .. doesn't even break my wireless or sound (I have to add the -f parameter because my laptop is not on the "whitelist" ...yet).

My question is: How do I get KDE Powerdevil manager to use s2ram instead of whatever it uses to suspend.
Is there a script someplace that I can plugin a call to s2ram?

I have searched the forum to no avail.

Thanks,

Offline

#2 2010-01-03 21:58:51

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Howto integrate s2ram with KDE Powerdevil?

Powerdevil uses pm-utils, so you got to create a file in /etc/pm/config.d/ with SLEEP_MODULE="uswsusp".

Offline

#3 2010-01-03 23:07:01

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

lucke wrote:

Powerdevil uses pm-utils, so you got to create a file in /etc/pm/config.d/ with SLEEP_MODULE="uswsusp".

Ok, but how does uswsusp know to do a "s2ram -f"   is there a config file somehere??

Offline

#4 2010-01-03 23:15:06

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Howto integrate s2ram with KDE Powerdevil?

pm-utils calls "s2ram --force".

cat /usr/lib/pm-utils/module.d/uswsusp

Offline

#5 2010-01-03 23:26:13

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

Cool, thanks will try it ..

Offline

#6 2010-01-03 23:45:59

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

No such luck sad

I still get the blank screen on resume ..

I also notice that on boot from a normal power start that I get asked for the path to the resume device (which in my case is /dev/sda2 .. swap)
even though I have placed this path in /etc/suspend.conf as below  ... and it obviously works calling s2ram -f from the console.

snapshot device = /dev/snapshot
resume device = /dev/sda2
#image size = 350000000
#suspend loglevel = 2
#compute checksum = y
#compress = y
#encrypt = y
#early writeout = y
#splash = y

By the way, the suspend to ram wiki does not say what to put for the snapshot device, so I just left it.

Thanks

EDIT: I had to add resume=/dev/sda2 to the kernel line in /boot/grup/menu.1st ... that got rid of the boot issue wanting the path to the resume device.

Last edited by bmentink (2010-01-04 00:10:43)

Offline

#7 2010-01-04 01:55:27

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Howto integrate s2ram with KDE Powerdevil?

uswsusp does not read or work with the resume kernel parameter, that is for kernel native suspend. Instead it reads the "resume device" setting in /etc/suspend.conf.

Looks like you have the wrong hook in your /etc/mkinitcpio.conf file, the resume (kernel) instead of uresume (uswsusp). When you replace the hooks you also have to rebuild your initram.


You need to install an RTFM interface.

Offline

#8 2010-01-04 19:38:40

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

With either resume or uresume, it makes no difference .. still a black screen.

I suspect it is something todo with my ATI driver

Cheers,

Offline

#9 2010-01-04 20:08:17

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Howto integrate s2ram with KDE Powerdevil?

With either resume or uresume, it makes no difference

You have to use the uresume hook with uswsusp and remove the resume one and resume kernel parameter, that's how it is, do it.

Then there is no need to experiment further with hooks... if you are really using uswsusp and this powerdevil thing is not pulling your nose. I can't even be certain you are using uswsusp (or using it properly) so I will stop wandering in the dark.

Play a detective. Suspend with s2ram. Then enable uswsusp in pm-utils and suspend with pm-suspend. Then if that works go to powerdevil...

Last edited by anrxc (2010-01-04 20:14:00)


You need to install an RTFM interface.

Offline

#10 2010-01-05 00:16:26

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

With either resume or uresume, it makes no difference
You have to use the uresume hook with uswsusp and remove the resume one and resume kernel parameter, that's how it is, do it.

Yes Sir! Already did that, not that thick! ...:mad:

.. if you are really using uswsusp and this powerdevil thing is not pulling your nose. I can't even be certain you are using uswsusp (or using it properly) so I will stop wandering in the dark.

Play a detective. Suspend with s2ram. Then enable uswsusp in pm-utils and suspend with pm-suspend. Then if that works go to powerdevil...

Yes, I am using uswsusp properly, how else did you thing I could do a successful  "s2ram -f" from the console ..

The issue is: If powerdevil uses pm- utils, and pm-utils calls "s2ram --force" in it's script, why is it not working just as running it from the console .... that is the only issue I have ..
are we clear?

EDIT: Update, pm-suspend has the same problem ... black screen ...
/etc/pm/config.d/config =

SLEEP_MODULE="uswsusp"
S2RAM_OPTS="-f"

Last edited by bmentink (2010-01-05 00:25:06)

Offline

#11 2010-01-05 01:05:48

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Howto integrate s2ram with KDE Powerdevil?

The issue is: If powerdevil uses pm- utils, and pm-utils calls "s2ram --force" in it's script, why is it not working just as running it from the console

That's what I was saying in the above post, because there are not many explanations; one is that powerdevil is not using uswsusp and the other brings us to:

EDIT: Update, pm-suspend has the same problem ... black screen ...

...which suggests that one of the quirks in pm-utils hooks could be the culprit here (especially some connected to video, if video is the problem). Check them out in the directory /usr/lib/pm-utils/sleep.d and I think you have a good chance of fixing it. Because the only difference between s2ram and pm-suspend are those hooks.

Edit: just in case you don't know this, you can disable any hook by placing an emtpy file of the same name in the directory /etc/pm/sleep.d and in case you want to modify a hook you can copy it to the above mentioned directory, make your changes, and it will take precedence over that in /usr/lib.

Last edited by anrxc (2010-01-05 01:10:01)


You need to install an RTFM interface.

Offline

#12 2010-01-05 02:08:26

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

@anrc: Thanks, that was very useful information, I didn't know that.

The culprit was a script called 00auto-quirk

If I put a dummy file of that name in /etc/pm/sleep.d/ then pm_suspend now works ..... yay, further down the track ...

However, powerdevil still does not work (i.e if I use the "suspend to ram" menu option in KDE.

I guess I could bypass powerdevil and use acpi to call s2ram direct on a lid event .... but it would bve nice to have it work in KDE.

Thanks

Last edited by bmentink (2010-01-05 02:08:56)

Offline

#13 2010-01-05 02:33:36

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Howto integrate s2ram with KDE Powerdevil?

Excellent. Quick glance at the script tells me that that hook probes HAL for any information regarding your machine and any quirks it will need, because HAL also maintains a whitelist (part of the hal-info package). Your machine is probably in there (or is matched by some generic rule) and it tells pm-suspend to use some specific quirk which in your case unfortunately causes problems.

If you are interested you can check /usr/share/hal/fdi/information/10freedesktop directory, and also take a look at 20-video-quirk-pm-sony.fdi

Btw this is just a wild guess (but will get you started), maybe PowerDevil tries to be smart and probes HAL for quirks and then passes them on to pm-utils? I would not be surprised.


You need to install an RTFM interface.

Offline

#14 2010-01-05 04:51:03

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

Ok, not sure how to progress now, but thanks.

I had a go at doing the acpi thing ... had the following script in /etc/acpi/actions/lid_handler.sh

!/bin/sh
# check if the lid is open or closed, using the /proc file
if grep closed /proc/acpi/button/lid/LID/state >/dev/null ; then
    # if the lid is now closed, save the network state and suspend to RAM
    /usr/lib/wicd/suspend.py
    /usr/sbin/pm-suspend
else
    # if the lid is now open, restore the network state.
    # (if we are running, a wakeup has already occured!)
    /usr/lib/wicd/autoconnect.py
fi

However, when I shut the lid, wicd suspends and resumes on lid open, but the suspend does not happen.
Any clues?

Thanks

Last edited by bmentink (2010-01-05 04:51:31)

Offline

#15 2010-01-08 19:32:21

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

Anyone help on the acpi stuff? Thanks.

Offline

#16 2010-01-09 00:18:56

PiklesOnFire
Member
From: USA
Registered: 2009-04-10
Posts: 21
Website

Re: Howto integrate s2ram with KDE Powerdevil?

bmentink wrote:

Ok, not sure how to progress now, but thanks.

I had a go at doing the acpi thing ... had the following script in /etc/acpi/actions/lid_handler.sh

!/bin/sh
# check if the lid is open or closed, using the /proc file
if grep closed /proc/acpi/button/lid/LID/state >/dev/null ; then
    # if the lid is now closed, save the network state and suspend to RAM
    /usr/lib/wicd/suspend.py
    /usr/sbin/pm-suspend
else
    # if the lid is now open, restore the network state.
    # (if we are running, a wakeup has already occured!)
    /usr/lib/wicd/autoconnect.py
fi

However, when I shut the lid, wicd suspends and resumes on lid open, but the suspend does not happen.
Any clues?

Thanks

change the line that reads:

    /usr/lib/wicd/suspend.py

to:

    /usr/lib/wicd/suspend.py&

I'm also having the black screen on resume issue though...
blegh


System Error: Signature not found.
(ohnoze!!!)

Offline

#17 2010-01-09 21:27:02

bmentink
Member
From: New Zealand
Registered: 2009-08-23
Posts: 442

Re: Howto integrate s2ram with KDE Powerdevil?

Thanks, tried that, but still doesn't suspend ..

Oh well, just have to continue with "s2ram -f" or "pm-suspend" from the console for now ...:/

Offline

Board footer

Powered by FluxBB