You are not logged in.

#1 2008-12-23 21:35:14

bji
Member
Registered: 2008-05-19
Posts: 20

Suspend-to-ram on Intel integrated graphics

Hey all.  I have successfully installed Arch on my Panasonic Y2 laptop.  A failed hard drive prompted a new installation of Linux, and I decided to go with Arch, ending a 10+ years' reign of RedHat/Fedora Core as my Linux distro of choice.

One problem I encountered was with suspend-to-ram.  The suspend worked fine, but on resume, the backlight would not be lit (resulting in a very dark screen where I could just barely make out the outline of windows on my desktop).  I searched extensively and found many similar problem reports in many different bug databases for many different Linux distributions and desktops.

After puzzling through lots of advice, I hit upon some commands which end up solving this problem for me.  This may be beneficial to others as this problem appears to be very widespread with newer xorg releases (including the xorg currently standard in Arch Linux).

I made a script, /usr/local/sbin/suspendram, and this is what it contains:

#!/bin/sh

echo -n mem > /sys/power/state
chvt 1
vbetool post &
chvt 7
sleep 1
kill $!

I'm using standard kernel support for ACPI suspend to ram (via the echo command to /sys/power/state).  Upon resume, the subsequent commands run, which then switch to virtual console 1 (because the remaining commands need to be run outside of X), then run "vbetool post" to reset the graphics hardware, then change console back to my X desktop, and finally, I have to manually kill the vbetool post command since it seems to basically just hang after its done its job.

A few points:

- This assumes you want to return to virtual console 7 after resume, which is always true for me since I'm always suspending from X on the standard vc7
- The reason for the vc switching is because the vbetool post messes up the X display so you have to change away from X and then back again (doing the vbetool post in the middle) for X to end up in good shape
- I tried using the hibernate-scripts tools for suspending to ram, including its support for "vbe post" fixes, but my script is the only thing that works seamlessly and doesn't require manual flipping of consoles and such when coming back from resume

So now, suspend to ram works perfectly for me.  Hope this helps someone else ...

Last edited by bji (2008-12-23 21:37:27)

Offline

#2 2008-12-23 22:43:10

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

Re: Suspend-to-ram on Intel integrated graphics

- I tried using the hibernate-scripts tools for suspending to ram, including its support for "vbe post" fixes, but my script is the only thing that works seamlessly and doesn't require manual flipping of consoles and such when coming back from resume

Pm-utils would be something like a standard framework on every major distribution now... it already has quirks for this, but you could just as easily place a script not very different from yours in it's /etc/pm/sleep.d/ directory. Pm-utils supports all three suspend methods (tuxonice, uswsusp, direct kernel), while Gnome (and KDE?) have GUI tools which also rely on it, so you get a complete package.


You need to install an RTFM interface.

Offline

#3 2008-12-25 00:16:50

bji
Member
Registered: 2008-05-19
Posts: 20

Re: Suspend-to-ram on Intel integrated graphics

anrxc wrote:

- I tried using the hibernate-scripts tools for suspending to ram, including its support for "vbe post" fixes, but my script is the only thing that works seamlessly and doesn't require manual flipping of consoles and such when coming back from resume

Pm-utils would be something like a standard framework on every major distribution now... it already has quirks for this, but you could just as easily place a script not very different from yours in it's /etc/pm/sleep.d/ directory. Pm-utils supports all three suspend methods (tuxonice, uswsusp, direct kernel), while Gnome (and KDE?) have GUI tools which also rely on it, so you get a complete package.

Thanks for the info ... actually I based my decision to use the hibernate-script package instead of pm-utils on the advice given on the Arch Linux "Suspend to Disk" page at:

http://wiki.archlinux.org/index.php/Suspend_to_Disk

That page claims that pm-utils only works with the "vanilla" kernel suspend-to-disk method.  Admittedly, I'm only using the hibernate-script for suspend-to-disk so I suppose I could use pm-utils just for suspend-to-ram (since I am using vanilla kernel suspend-to-ram facilities), but I didn't want to introduce the possibility of problems/conflicts/confusion by installing both packages.

And as a side note, I find that if I leave the laptop suspended to ram for any significant length of time, the display is often messed up on resume even with my script's facilities for trying to correct for it.  Fixing it is as simple as manually changing away to a different console and back to X, but it's unfortunate that my script doesn't quite work as automatically as I had hoped.  At any rate, it works with a little manual intervention, which is better than I was getting just using vanilla kernel suspend-to-ram with no extra steps.

EDIT:

I just realize that pm-utils is already installed on my system, as it's required for hal, which is required for xorg.  However, it suffers from the same problem (dark screen after resume) as a vanilla suspend, even if I use its "--quirk-vbe-post" option; so I am not going to use it.  It's really amazing to me that suspending to disk and ram is so poorly supported on Linux as to require so many packages and kernel patches.  I have used suspend2 (now tuxonice) for years with great success, and to this day I cannot understand why it's not part of the standard kernel ... seems really shortsighted on the part of the kernel devs to me.

Last edited by bji (2008-12-25 01:54:51)

Offline

#4 2008-12-25 02:11:36

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819

Re: Suspend-to-ram on Intel integrated graphics

[stijn@hermes ~]$ cat /etc/pm/sleep.d/00hacks 
#!/bin/bash
case $1 in
    suspend)
        #/etc/rc.d/mpd stop
        chvt 1
        ;;
    resume)
        chvt 7
        #/etc/rc.d/mpd start &
    ;;
esac

Pretty much does it for me smile. X3100 integrated graphics here.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2008-12-25 04:51:09

bji
Member
Registered: 2008-05-19
Posts: 20

Re: Suspend-to-ram on Intel integrated graphics

B wrote:

Pretty much does it for me smile. X3100 integrated graphics here.

Thanks, I tried your script, but it doesn't work for my system, I still get the dark screen problem on resume.

However, I do agree that your approach is a better place to put custom suspend logic than in a special script like I did.  So I modified your 00hacks file and this is what works for me:

#!/bin/bash                                                                     

case $1 in
    suspend)
        ;;
    resume)
        chvt 1
        vbetool post &
        sleep 1
        kill $!
        chvt 7
    ;;
esac

Now pm-suspend works just like my script did, and it all goes well.

Note that I put the chvt 1 in the resume step; if I chvt 1 before suspending, then I get some very weird artifacts on the screen as it suspends (it writes little random pixels all over the place), and I find them disconcerting - it almost looks like the display adapter is melting.

Offline

#6 2008-12-25 12:30:09

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819

Re: Suspend-to-ram on Intel integrated graphics

Nice to see you got it to work smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2009-09-24 23:35:38

bji
Member
Registered: 2008-05-19
Posts: 20

Re: Suspend-to-ram on Intel integrated graphics

An update: after recent updates to the Intel video drivers for this laptop, as well as kernel updates, I could no longer reliably suspend to ram or disk using the instructions that I provided earlier in this email.

I have switched to using uswsusp as my suspend mechanism, and while not quite as "pretty" as TuxOnIce, it does the job without a custom kernel.

To suspend to ram, I use:

s2ram -f -p

To suspend to disk, I use:

s2disk

I didn't have to use any special configuration options for either, aside from the -p option to s2ram.

It all works perfectly!

Offline

Board footer

Powered by FluxBB