Skip navigation.
Home
Now Shipping Version 7.0

Suspending to RAM


Posts: 7

Hi, I have IBM x31 with Mepis 6.5 Beta5. I have a problem with suspending to RAM: when I do this
the screen is black but remains on (!) and drains the battery. I went though modifying files 'menu.lst'
and 'events' in powersave folder to get suspending working but this issue stays. I read somewhere
that you can write some script to power off the screen when suspending but I do not know how to do that.
Please help, Adam
PS. Suspending to disk works great but it takes ~40sec. to restore MEPIS.

copy and paste the contents

copy and paste the contents of file /etc/powersave/sleep, see if I get an idea....

Newbie or not Newbie, there's always a question

Carlops, here is my sleep

Carlops, here is my sleep file: Thanks a lot!
## Path: System/Powermanagement/Powersave/Sleep_Modes
## Description: Configuration of all three sleep modes (S2 is not supported):
## S1 sleep (only ACPI) low wake-up latency,
## S3 (ACPI) suspend to ram or (on APM systems) standby and
## S4 (ACPI) suspend to disk or (on APM systems) suspend.
##
## For some hardware, modules have to be unloaded before entering the
## sleep state. You can configure these in this section. These modules
## will be unloaded in the specified order. Modules which depend on one
## of the specified modules, will also be unloaded. If not all modules
## can be unloaded, entering the sleep state will fail.
## After resuming, the modules that have been unloaded will be reloaded
## in reverse order.
## The same applies for the "SERVICES_TO_RESTART"-variables which defines
## services which have to be stopped before entering a sleep state.

## Path: System/Powermanagement/Powersave/Sleep_Modes
### Type: string
## Default: "usb_storage sbp2 ohci_hcd uhci_hcd stir4200 ohci1394 ipw2200 rt2500 prism54 ath_pci r8169 lt_modem Intel536 Intel537 ndiswrapper"
## ServiceRestart:
#
# These modules will be unloaded before entering suspend to disk
# See README.unload-modules for more information.
# "NONE" means don't unload any modules.
UNLOAD_MODULES_BEFORE_SUSPEND2DISK=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
### Type: string
## Default: "usb_storage sbp2 ohci_hcd uhci_hcd stir4200 ohci1394 ipw2200 rt2500 prism54 ath_pci r8169 lt_modem Intel536 Intel537 ndiswrapper"
## ServiceRestart:
#
# These modules will be unloaded before entering the corresponding
# sleep state. See README.unload-modules for more information.
# "NONE" means don't unload any modules.
UNLOAD_MODULES_BEFORE_SUSPEND2RAM=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
### Type: string
## Default: "usb_storage sbp2 ohci_hcd uhci_hcd stir4200 ohci1394 ipw2200 rt2500 prism54 ath_pci r8169 lt_modem Intel536 Intel537 ndiswrapper"
## ServiceRestart:
#
# These modules will be unloaded before entering the corresponding
# sleep state. See README.unload-modules for more information.
# "NONE" means don't unload any modules.
UNLOAD_MODULES_BEFORE_STANDBY=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: string
## Default: "slmodemd irda upsd apcupsd"
#
# All services that have to be stopped before entering a sleep mode
# and restarted after the machine resumes.
# If you notice problems of some services that may be related to
# suspend/standby, restarting the service may solve the problem.
# The names to enter here are simply the filenames of the init scripts
# in /etc/init.d. The services are stopped in the order entered here.
# They are restarted after resume in the reverse order.
# Entering "NONE" disables restarting of services ("" means default).
SUSPEND2DISK_RESTART_SERVICES=""
SUSPEND2RAM_RESTART_SERVICES=""
STANDBY_RESTART_SERVICES=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "yes"
#
# Should FAT and NTFS filesystems be unmounted before entering
# a sleep mode and remounted after the machine resumed?
# You should do this for suspend to disk if you want to boot
# Windows while Linux is suspended to avoid severe data corruption
# on the Windows filesystems.
# Note that suspend will fail if the partitions cannot be unmounted.
# This may cause problems with external storage media connected during
# suspend.
# Defaults to yes for suspend to disk, no for suspend to RAM / standby.
SUSPEND2DISK_UNMOUNT_FATFS=""
SUSPEND2RAM_UNMOUNT_FATFS=""
STANDBY_UNMOUNT_FATFS=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
#
# Should PCMCIA cards (CardBus and PC-Card) be ejected before entering
# a sleep mode and reinserted after the machine resumed?
# This should not be necessary for most CardBus cards, PC-Cards seem to
# need this more often.
SUSPEND2DISK_EJECT_PCMCIA=""
SUSPEND2RAM_EJECT_PCMCIA=""
STANDBY_EJECT_PCMCIA=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
## ServiceRestart: powersaved
#
# Set this variable to yes to disable suspend to disk.
DISABLE_USER_SUSPEND2DISK=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
## ServiceRestart: powersaved
#
# Set this variable to no to enable suspend to RAM.
# If the /usr/sbin/s2ram binary is available, it will be used to detect
# if the machine is capable of suspend to RAM. You can override this
# detection with SUSPEND2RAM_FORCE below.
DISABLE_USER_SUSPEND2RAM=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
## ServiceRestart: powersaved
#
# If /usr/sbin/s2ram is installed but does not know about your machine,
# you can force suspend to RAM for unknown machines by setting this
# variable to yes.
# Be careful, this might crash your machine.
# See also the SUSPEND2RAM_ACPI_SLEEP, SUSPEND2RAM_VBE_POST and
# SUSPEND2RAM_VBE_SAVE variables.
SUSPEND2RAM_FORCE=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: integer(0:3)
## Default: "0"
## ServiceRestart: powersaved
#
# If SUSPEND2RAM_FORCE is set to yes and s2ram is installed, you can set
# the acpi_sleep parameter here. This is a number, 1 means "s3_bios",
# 2 means "s3_mode" 3 means "s3bios,s3mode".
# These parameters are explained in the kernel sources under
# Documentation/power/video.txt
# Leaving this empty or setting it to 0 means "don't touch this setting",
# you might still have one of the options set from the kernel commandline.
# Be careful, this might crash your machine.
SUSPEND2RAM_ACPI_SLEEP=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
## ServiceRestart: powersaved
#
# if SUSPEND2RAM_FORCE is set to yes and s2ram is installed, you can enable
# the equivalent of "vbetool vbestate save/restore" before/after suspend to
# RAM with this variable. This does restore the state of the graphics chip
# on many machines.
# Be careful, this might crash your machine.
SUSPEND2RAM_VBE_SAVE="yes"

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
## ServiceRestart: powersaved
#
# if SUSPEND2RAM_FORCE is set to yes and s2ram is installed, you can enable
# the equivalent of "vbetool post" after suspend to RAM. This reinitializes
# the graphics chip on many machines.
# Be careful, this might crash your machine.
SUSPEND2RAM_VBE_POST="yes"

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "yes"
## ServiceRestart: powersaved
#
# Set this variable to no to enable standby (also needs BIOS support!)
DISABLE_USER_STANDBY=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: integer(0:1000)
## Default: 0
#
# Specify the time in seconds a sleep state should be delayed. This can
# be used to delay a power-button-induced suspend for some seconds to
# be able to power off the machine hard.
#
SUSPEND2DISK_DELAY=""
SUSPEND2RAM_DELAY=""
STANDBY_DELAY=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: string(platform,firmware,shutdown,reboot)
## Default: "platform"
#
# Specify the shutdown method the kernel uses after suspend-to-disk.
# "shutdown" is known to work on most machines, "platform" may work,
# too. "firmware" will most likely not work, "reboot" is for
# debugging only. Use only if you know what this is for.
#
SUSPEND2DISK_SHUTDOWN_MODE=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
#
# Should the system clock be reset from the hardware clock after
# suspend-to-disk or suspend-to-RAM? This may be unneccessary depending
# on kernel version and SUSPEND2DISK_SHUTDOWN_MODE, but will not hurt.
SUSPEND2DISK_RESTORE_CLOCK="yes"
SUSPEND2RAM_RESTORE_CLOCK="yes"
STANDBY_RESTORE_CLOCK="yes"

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
#
# Should we suspend to disk even if it seems the kernel in /boot
# is not matching the running kernel? This is very dangerous, if
# the kernels don't match, resume will not work. Use only if you
# absolutely need to (e.g. you are compiling a custom kernel).
#
SUSPEND2DISK_IGNORE_KERNEL_MISMATCH="yes"

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: yesno
## Default: "no"
#
# Should we switch to a text console _in userspace_ before entering
# a sleep mode? The kernel usually does this anyway, but if you need
# to run some initialization code before switching back to X, this
# might be handy. Also on ppc, the kernel does not switch, so this needs
# to be "yes" there.
SUSPEND2DISK_SWITCH_VT="yes"
SUSPEND2RAM_SWITCH_VT="yes"
STANDBY_SWITCH_VT="yes"

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: integer
## Default: 500
#
# The size of the image in MB that will be written to disk upon suspend.
# A bigger image will make your system feel more responsive after resume,
# but take additional time for writing and reading your data.
# This value specifies the maximum image size to use. The image can be
# smaller if not enough swap is available or memory usage is low, it also
# can be bigger if the size is not enough for suspending the machine.
# setting it to "0" will restore the old behaviour and always create the
# smallest possible image.
SUSPEND2DISK_IMAGE_SIZE=""

## Path: System/Powermanagement/Powersave/Sleep_Modes
## Type: string
## Default: ""
#
# to make sure that there is enough swap available, you can configure an
# additional swap partition, which will only be used for suspend. This
# partition should not be in /etc/fstab and should not normally be used.
# Its size should be the amount of physical RAM the machine has, or at
# least SUSPEND2DISK_IMAGE_SIZE.
# Enter the device node of this partition here to have it activated before
# suspend and deactivated after resume.
# You also need to make sure that the resume= boot parameter points to
# this partition.
SUSPEND2DISK_RESUME_DEVICE=""

hmmm, no strange things

hmmm, no strange things there.
Maybe we can find a workaround. Could you try this:
- open a console
- type in this command: xset dpms force off

Tell me if the screen goes into power save mode.

Newbie or not Newbie, there's always a question

I typed this and screen shut

I typed this and screen shut down. When I press any key, the screen is back on.

Good, then let's see if this

Good, then let's see if this works.

- type alt-F2
- kdesu kwrite and root password
- you have a blank textfile. Paste in the content below:

#!/bin/bash
# powers down screen before suspending
xset dpms force off

- save this file as /etc/init.d/pwr_dwn_screen. Do not close kwrite
- still in kwrite, open /etc/powersave/sleep
- find SUSPEND2RAM_RESTART_SERVICES=""
- change to SUSPEND2RAM_RESTART_SERVICES="pwr_dwn_screen"
- save file and close kwrite
- open console
- su
- cd /etc/init.d
- chmod +x pwr_dwn_screen
- /etc/init.d/powersaved restart

Try if it works.

Basically, we have created a tiny script that is invoked when suspend to ram is called (and afterwards). The script issues the powerdown command we tried earlier. I hope it works.

Cheers

Newbie or not Newbie, there's always a question

It does not help

Hi, Thank you for your tip but it does not work... I did what you said and the screen still is on after suspending to RAM. Maybe I should forget about RAM and use suspending to disk... What do you think? Thanks, Adam

wait, I think the script has

wait, I think the script has a mistake. The line should read:
/usr/bin/xset dpms force off.

I always forget to give the full pathname in scripts, duh...

modify it and try again (do the powersaved restart bit before trying)

Newbie or not Newbie, there's always a question

warren's picture

little scripts

Does the script have/need execute permission?

Does the script work when run from the commandline?

Script is working but ...

Thanks! Script is working - I can see the screen powers off the moment I press 'suspend to RAM' but then it comes back on to display all text and after I can read at the bottom of the screen "stopping all tasks" it becomes black but it is on! Magic... Sorry about that Eye-wink Any other idea? Thanks a lot, Adam

A possibility in the trial

A possibility in the trial and error department.

Edit /etc/powersave/sleep. Find SUSPEND2RAM_SWITCH_VT="yes" and change to "no". This might also hang your machine, so make sure you have no apps open. Again: restart powersave before trying.

Newbie or not Newbie, there's always a question

think I found the fix

Look here: http://www.thinkwiki.org/wiki/Problem_with_LCD_backlight_remaining_on_during_ACPI_sleep

Undo the changes I suggested and go for that page. In your case, you need to edit the /usr/lib/powersave/scripts bit

Newbie or not Newbie, there's always a question

Thank you! Your last tip

Thank you! Your last tip indeed did not work - I powered off the screen but I was unable to un-suspend the machine. I will undo all the commands and try thinkwiki solution - I do not know why I did not look there earlier... Anyway, thank you very much forr your help and I will let you know if the other solution works. Adam

No go so far

OK, I modified two files: prepare_suspend_to_ram and restore_after_suspend_to_ram as recommended at thinkwiki. But I still have backlight after I suspend to RAM. There is also second option how to solve it but as far as I understand I should use powersaved. I will try and play more later. Thanks, Adam

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.