Comment 75 for bug 12637

Revision history for this message
Miguel J (mjulier) wrote :

I struggled with the same problem, before making my own workaround: screen would sometimes dim
  - after install,
  - at boot (but tends to improve with boot number: I even thought it was fixed, 1 month without trouble, and then back again),
  - after using Windows Vista,
  - when gdm starts,
  - when VLC starts playing a video
  - after running "xset dpms force off; sleep 1; xset dpms force on"
  - after closing/opening lid (this is corrected is set "do nothing" on lid closing; it still switch off the screen though)

When logged in, I could correct the brightness using Fn-F5 (darker) or Fn-F6 (brighter), or 2 times Fn-F7 (LCD OFF/ON). When in GDM or in console mode, the only key that works is 2 times Fn-F7 (LCD OFF/ON).

I could find no real "good" solution, but I made a perfect (but ugly) workaround, which stills allows me to adjust the brightness, and even still adjusts the brightness on (dis)connecting the AC cord.

I found that the brightness value is stored in /sys/devices/virtual/backlight/asus-laptop/brightness (in my case), that the value is correct even when the actual brightness is wrong, and that it is corrected if I rewrite the same value in the same file. So I launch a program that precisely does that every second.

So my workaround is the following:

In /etc/rc.local, add this line before "exit 0":

/home/<your_login>/bin/laptop-brightness &

And in this file, copy this (adjust "FILE=" as necessary):

#!/bin/sh
FILE="/sys/devices/virtual/backlight/asus-laptop/brightness"
PID=$$
COMMAND=`basename "$0"`
if ps -e | grep $COMMAND | grep -v $PID > /dev/null; then
  echo "Program $COMMAND already running, not launching again"
else
  while true; do
    a=`cat "$FILE"`
    echo "$a" > "$FILE"
    sleep 1
  done
fi

My information:
Linux 2.6.24-19-generic #1 SMP
Ubuntu 8.04 LTS
Laptop: ASUS M51L