Difference between revisions of "Problem with LCD backlight remaining on during ACPI sleep"

From ThinkWiki
Jump to: navigation, search
m (Add solution for X32 and OpenSuse 11.3)
 
(12 intermediate revisions by 9 users not shown)
Line 3: Line 3:
  
 
==Affected Models==
 
==Affected Models==
 +
*ThinkPad {{390X}} with kernel boot option ACPI=force
 +
*ThinkPad {{A30}}
 
*ThinkPad {{A31p}}
 
*ThinkPad {{A31p}}
 
*ThinkPad {{T30}}
 
*ThinkPad {{T30}}
*ThinkPad {{X31}}
+
*ThinkPad {{X31}},{{X32}}
 +
*ThinkPad {{R51}}
 
(according to the relevant bug on the Kernel bug tracker ([http://bugzilla.kernel.org/show_bug.cgi?id=2576 bug 2576]))
 
(according to the relevant bug on the Kernel bug tracker ([http://bugzilla.kernel.org/show_bug.cgi?id=2576 bug 2576]))
  
Line 13: Line 16:
 
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.
 
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.
  
I use the following script to suspend my machine.  The hwclock lines compensate for the clock running at double speed during suspend (this is fixed in the 2.6.11 release candidate kernels, various distributions may backport the fix).
 
 
  logger "Software suspend to ram."
 
  logger "Software suspend to ram."
sync
 
 
  FGCONSOLE=`fgconsole`
 
  FGCONSOLE=`fgconsole`
/sbin/hwclock --systohc
 
 
  chvt 1
 
  chvt 1
 
  radeontool light off
 
  radeontool light off
 
  echo -n 3 >/proc/acpi/sleep
 
  echo -n 3 >/proc/acpi/sleep
/sbin/hwclock --adjust
 
/sbin/hwclock --hctosys
 
 
  logger "Woke up from suspend."
 
  logger "Woke up from suspend."
 
  radeontool light on
 
  radeontool light on
Line 28: Line 26:
  
 
Improvements are clearly possible. :-)
 
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 [[How to configure acpid|acpid configuration HOWTO]] page.
 
A similar script can be found on the [[How to configure acpid|acpid configuration HOWTO]] page.
 +
 +
{{NOTE|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
 +
 
 +
  progress_finish
 +
  $SCRIPT_RETURN $EV_ID 0 "prepare_sleep finished successfully for $1"
 +
  EXIT 0
 +
 +
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.
 +
  EXIT 0
 +
 +
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.

Latest revision as of 18:47, 14 January 2011

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."
FGCONSOLE=`fgconsole`
chvt 1
radeontool light off
echo -n 3 >/proc/acpi/sleep
logger "Woke up from suspend."
radeontool light on
chvt $FGCONSOLE

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.

NOTE!
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
 
 progress_finish
 $SCRIPT_RETURN $EV_ID 0 "prepare_sleep finished successfully for $1"
 EXIT 0

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.
 EXIT 0

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.