Problem with LCD backlight remaining on during ACPI sleep

From ThinkWiki
Jump to: navigation, search

Problem description

On some models the LCD backlight remains on during ACPI sleep.

Affected Models

  • ThinkPad 390X with kernel boot option ACPI=force
  • ThinkPad A30
  • ThinkPad A31p
  • ThinkPad T30
  • ThinkPad X31,X32
  • ThinkPad R51

(according to the relevant bug on the Kernel bug tracker (bug 2576))

Partial solution

If the ThinkPad has a radeon video chip, then switching off the light with the command

 radeontool light off

will work, but only in a text-mode virtual terminal. If X is running, the light apparently comes back on when the kernel switches to text mode prior to sleeping. The solution in that case it to switch to a text mode console first.

logger "Software suspend to ram."
chvt 1
radeontool light off
echo -n 3 >/proc/acpi/sleep
logger "Woke up from suspend."
radeontool light on

Improvements are clearly possible. :-)

On the X32, at least, the bios will switch off the screen by default on a lid close, and suspending to ram interrupts this, and the screen will turn back on. This can be fixed by simply adding "sleep 5" before "echo -n 3 > /proc/acpi/sleep". The suspend will take longer, but the screen will remain off.

A similar script can be found on the acpid configuration HOWTO page.

In Debian Testing (and maybe other Distributions/Debian versions using the hibernate-tool) you can simply uncomment the "RadeonTool yes" line in /etc/hibernate/ram.conf

Using Powersaved

If you use powersaved you can just edit the two scripts prepare_suspend_to_ram and restore_after_suspend_to_ram which are stored in /usr/lib/powersave/scripts/

add two lines to prepare_suspend_to_ram nearly at the end of the script:

 # insert the next two lines:
 chvt 1
 radeontool light off
 # this changes to a console nr. 1 and switches the light off
 $SCRIPT_RETURN $EV_ID 0 "prepare_sleep finished successfully for $1"

and to restore_after_suspend_to_ram

 # insert the next two lines:
 radeontool light on
 chvt 7
 # this switching the light on and changes to display #7 (where the x-server runs) - 
 #you can change it to another display if you want... 
 #(the way doing this with a variable like in the script above doesn't work, because it can't be stored between
 #the two different scripts.
 # $SCRIPT_RETURN is called in restore_after_sleep.

Than you can suspend to ram with /usr/bin/powersave -u or just configure powersaved in a way that it suspends to ram when your notebook is closed. (As a frontend kpowersave is recomended).

Using s2ram

Just using the s2ram command from the uswsusp (Userspace Suspend) package should do the trick by appending the "-r" option (-r, --radeontool: turn off the backlight on radeons before suspending.).

Editing menu.lst in OpenSuse

A simple change in a start-up file in OpenSuse 11.3 corrected this problem

1. Open a terminal and type gnomesu gedit /etc/grub/menu.lst. When prompted, type root password and click OK.

2. Gedit opens with the menu.lst file displayed. Down the page a bit, there are several sections that begin with "###Don't change this comment"

3. The first section gives details for the default boot operating system. Somewhere in this long spec, find "vga=0x314" or vga=(something specific to your system).

4. Just before or after this vga spec, type "nomodeset" separated from the vga spec by a space.

5. Save the file and reboot. In OpenSuse, suspend/resume now works normally.