Saturday, October 27, 2007

GOD said "video.ko" and the LCD was BRIGHT :)

Just in case you are cursed with LCD brightness blues in Linux, here is some help. Please bear in mind that it is a very basic and general giude which is based on my own experience and digging while using GENTOO and SuSE. So here we go :


THE PROBLEM
You are unable to change your Laptop's display brightness

QUICK SOLUTIONS
There are custom ACPI packages for a number for laptop like acer,apple,thinkpad,etc. Search for them in your distro's package manager.

MANUAL (GENERAL) WAY
A more general (read as harder) way is to setup the necessary stuff manually. This is what this post is all about. So here we go...


PHASE A
  1. LCD brightness control needs acpi/video.ko module. Although it is an old approach and newer options are there, this one works most of the time.
  2. First make sure acpi/video module is loaded correctly. Run "lsmod" to see all the loaded modules. Look for the entry "video". If it is there, you are good to go. Skip to PHASE C. If not, you will have to load this module manually. Proceed to Step 3.
  3. Check for the availability of this module in your distro. Fo this, run "modprobe -l" as root to see all the available modules. Look out for an entry "/acpi/video.ko". If it is there, proceed to Setp 4. Although this is a very common module, but if in rare cases you did not find it, you will have to patch your kernel which is a long process and this beyond the scope of this guide (a nice way of saying that I DONT KNOW!!!). Anyways, you've got the module, you may proceed.
  4. Run "modprobe video" as root to load this module. Then run "lsmod" and you will see video listed at top. If you can not see the module listed here, goto Phase B, else skip to Phase C.
PHASE B
Before proceeding, please go thru Phase A once more and check that you haven't missed anything.
Now comes a catch. Introduced as a new "feature", xorg blocks "video" module from loading. As a workaround, do the following :
  1. Edit "/etc/modprobe.d/xorg-x11-driver-video" as root
  2. Comment the line "install video /bin/true"
  3. Run "modprobe video" as root to load the module. Then run "lsmod" and you will see video listed at top.
  4. If it fails again, then you will have to debug the issue thru dmesg. If this is the case, close this site and check your mails instead! If it loads fine, you have all the rights to proceed!

PHASE C
  • If you pass the above steps, there will be a "/proc/acpi/video/VGA/LCD/brightness" (exact path may change slightly)
  • Cat the file to see its contents. In my case, this file contains possible brightness values, as well as a place for new value. Note that you can only set brightness level to these predefined values.
  • And you are done! Use the command "echo NEW_BRIGHTNESS | sudo dd of=/proc/acpi/video/VGA/LCD/brightness" (run as root) for instant action :)

You can also make scripts/applets to set the brightness and if you do, please send a copy to me too, coz I am too lazy for that ;)

Feel free to critisize me, I dont read such posts anyways :D

27 comments:

shining.pappu said...

G.R.E.A.T.!!!
Thanks a lot!

arg3ntum said...

Thanks , followed until phase C , and now
my fn+F6 fn+F7 keys works again :)
Distro : openSuse 10.3
Laptop : Toshiba A200-1GB

carlo said...

thank you from my eyes 0_0 o_o ._.

pickwick said...

Yaaaay for battery life! Thank you so much!!!

distro: openSUSE 10.3
laptop: Toshiba Satellite A100-01L

Todd said...

Thank you so much. My eyes thank you, my HP dv6000 thanks you, and....well....just thank you.

Matatra said...

thanks, it worked:
Distro: openSuse 10.3
Laptop: Dell Vostro 1310

munkhbayarb said...

thank you, its working.
OS: Ubuntu 8.04
HW: NEC Lavie LR700/9

Kyle said...

OMGOMGOMG Thank You!! I've been trying to get this LCD to work for like....2 billion years...OMG you rock!
OS: Gentoo 2007.0
Laptop: HP dv6458se

Andreya said...
This comment has been removed by a blog administrator.
Thomas ten Cate said...

Awesome, thanks a lot! Ubuntu on my ASUS laptop will only let me make the brightness less (Fn+F5), but the increase key (FN+F6) does not work. I will use this magic until Ubuntu fixes the problem or I have time to troubleshoot it myself. Thanks again!

Kira said...

Your blog is awesome and you too are awesome! Just felt the need to say that (hehe) Plus your work is simply great! I don't want to boast on and on you really did a good job formatting this blog!
Compaq laptop lcd screen

Gürkan Gür said...

not need to use sudo there i think.. (the | sudo part..) you're already running this as root.. as you said.. :)

MR said...

Man that was cool!!

I have a Toshiba A100, with OpenSUSE 10.3 fully updated.

The only problem I had was that modprobe video did not load the module.

I had to manually insmod /path/to/acpi/video.ko and suddenly Fn+F6/F7 worked!!

Thanks a lot.

Ken S. said...
This comment has been removed by the author.
Ken S. said...
This comment has been removed by the author.
Ken S. said...

Thanks for the tip. I wrote a pair of programs, ++b and --b, that you can run from the command line to increase or decrease the brightness using a variant of the idea posted here. Find the source here, http://code.google.com/p/clbright/

Exiquio said...

I use Xmonad on Arch Linux. I am going to check the post left by KenS. In the mean time I intend to add a custom key to xmonad that does something akin to this:

echo `cat /proc/acpi/video/VGA/LCD/brightess | xargs | awk '{print $13 + 10}'` | dd=of/proc/acpi/video/VGA/LCD/brightness

Can anyone think of a cleaner way to do that via command line? BTW, I chown to my user on /proc/*/*/*/*/brightness

Thanks for the post.

Exiquio said...

I lied. I never read Ken S. stuff. I am sure it works. I wrote a script to handle this for me. I will assign it to some function key. I chmod'ed brightness with 554 in /etc/rc.local (Arch Linux). Here is the script (thanks for the post):

#!/bin/zsh
# exiquio [at] gmail.com

# Brighness levels variables
MIN_LEVEL=0
MAX_LEVEL=100
CHANGE_LEVEL=10
CURRENT_LEVEL=`cat /proc/acpi/video/VGA/LCD/brightness | xargs | awk '{print $13}'`

# Program options
UP="up"
DOWN="down"

# Program functions
function increase {
if [ $CURRENT_LEVEL = 100 ]; then
quit
else
let NEW_LEVEL=$CURRENT_LEVEL+$CHANGE_LEVEL
change $NEW_LEVEL
fi;
}
function decrease {
# Anything less than 10 is useless (imho)
if [ $CURRENT_LEVEL = 10 ]; then
quit
else
let NEW_LEVEL=$CURRENT_LEVEL-$CHANGE_LEVEL
change $NEW_LEVEL
fi;
}
function change {
`echo $1 | dd of=/proc/acpi/video/VGA/LCD/brightness`
}
function quit {
exit 0
}

# Main program
if [ $1 = $UP ]; then
increase
elif [ $1 = $DOWN ]; then
decrease
fi;
quit

Exiquio said...

my bad y'all. chmod 664 /******/brightness

Mark said...

well it 2010 and I still needed this on RHEL5 unless of course I am missing something. Thanks! that made my ole eyes a whole let less sore ...

anurag said...

nice your blog and very nice dear your blog psoting we like its you can see our also website for online shopping

DreamBox 500S Dreamboxhome supplies DreamBox 500S,DreamBox500C, DreamBox 7025, DreamBox Remote Controls.DreamBox 500S,DreamBox 500c and DreamBox 70200 are available on whole sale best prices.



SONY Dell Acer Apple battery Yahoo battey supplies high quality laptop batteries on lowest prices with 30-day money-back guarentte.Yahoo batteries also carry a 12-month full repair of replacement warrantly for any form of manufacturing defects.

interphone wireless inter phone wireless is an online store for wireless computer peripherals, mobile phones, car accessories, iphone & ipod accessories, laptop motherboard and accessories.

Jesús said...

i use arch linux can somebody help me with my brightness issue? my email is lic.guzman at gmail.com we can chat in gtalk or irc..or via forums or emails....i have several days trying to handle my brightness on linux....is a shame that intel is giving me problems

velikkakam said...

Command lsmod gives me entry "video" (video 17375 1 i915) but I don't have any folder called video under "/proc/acpi/".

"modprobe -l" also gives me "/acpi/video.ko" along with other output like kernel/drivers/acpi/video.ko
kernel/drivers/media/video/usbvideo/usbvideo.ko
kernel/drivers/media/video/usbvideo/konicawc.ko
kernel/drivers/media/video/uvc/uvcvideo.ko . So then I follwed phase B but there I don't have any thing like /etc/modprobe.d/xorg-x11-driver-video"

What shall I do. I m using Ubutu 10.04 LTS in samsung 148 model. Pls help me

Andrea said...

It's the first time that i can set brightness on my Samsung laptop under Linux! Thank you so much! Just had to use /proc/acpi/video/PEGP/LCD/brightness as path (VGA doesn't exist any more on some new machines)

Lcd laptop screen said...

Wow! It’s really great news. Thanks for put on view.
Lcd laptop screen

Employ said...

Really its amazing news..its becomes so helpful things.thanks to put these types of news .

Freelance Job

Kind of Technology said...

Wow what a weblog i am so happy to here can you more discuss here, i am back again again to your site as soon as possible and i have lot of collection for you just click here for more information.
u150