Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Hardware & Laptops
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hardware & Laptops
Problems with hardware & laptops not being detected or supported during or after install.

 
Thread Tools Display Modes
Old August 5th, 2008   #1
countrylane
5 Cups of Ubuntu
 
Join Date: Mar 2008
Beans: 23
HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

By the number of questions floating around these forums, laptop screen brightness issues seem to be a common problem. I tried several solutions addressed towards other makes/models of laptops. None worked. I could not find any references to Compaq's either.

I was able, however, to modify 2 suggestions that I found and make them work with my laptop. I take no credit for the basic code. I found it in several locations. All I did was modify a few things to make it work in my laptop. My how-to might get a bit long, but hopefully it makes sense once you read it through and helps some Compaq folks, or anybody else that has been frustrated by the inability to change screen brightness.

For reference my laptop is a new (August 200 Compaq Presario A900 series (specifically A940AN). It came loaded with Win Vista. I repartitioned the HD and now dual-boot Ubuntu 8.04 and Vista. I also run WinXP inside Ubuntu using VirtualBox, primarily because I need to run MS Office Accounting 2008 that I purchased several months back. I bought the XP version and couldn't get it to load in Vista....so dual boot Ubuntu/Vista + VirtualBox = Works great.

Anyway...screen brightness. I found this suggestion in another thread:
--------
sudo -s
echo -n 50 > /proc/acpi/video/VGA/LCD/brightness
exit
--------
(50 is 50% screen brightness...100 would be 100% screen brightness).

It didn't work because my directory structure is different. My Compaq has the following structure (not sure why its different):

/proc/acpi/video/OVGA/DD0X/brightness

so the command needs to look like this:
sudo -s
echo -n 50 > /proc/acpi/video/OVGA/DD0X/brightness
exit

Note that O in OVGA is like the capital letter O in the alphabet and 0 in DD0X is zero. Also X in DD0X is a number, since, on my PC I have several directories under the OVGA directory as follows: DD01, DD02, DD03, DD04, and DD05.

I first tried DD01, then DD02 in the command line
"echo -n 50 > /proc/acpi/video/OVGA/DD0X/brightness"
Neither worked. When I used DD03 as in echo -n 50 > /proc/acpi/video/OVGA/DD03/brightness, I immediately noticed a bump down in the brightness. You may need to try DD04 and DD05 if DD03 doesn't work. I then tried:
echo -n 100 > /proc/acpi/video/OVGA/DD03/brightness
and my screen immediately jumped to full-bright.

NOTE. In the help/how-to that I found this command in, the writer used the following values for percentages:
12 25 37 50 62 75 87 100
Except for 50 and 100, these DID NOT work on my Compaq. I had to use:
30 40 50 60 70 80 90 100.
Again, why the difference? I don't know, but mine is in multiples of 10 and works for me.

OK....so now I can change my brightness and is a decent solution, but it doesn't get your Fn (function) key + F7 and fn + F8 key combos to change the brightness. Here is how to make them work. (Again, I found this code in several help forums and modified it to make it work for my Compaq). Make a backup of these files (video_brightnessup.sh and video_brightness_down.sh) so you can put things back the way they were if necessary.
------------THIS WORKED FOR ME---------------
sudo gedit /etc/acpi/video_brightnessup.sh
Replace everything in this file with:

#!/bin/bash

CURRENT=$(grep "current:" /proc/acpi/video/OVGA/DD03/brightness |awk '{print $2}')


case "$CURRENT" in

100)
echo -n 100 > /proc/acpi/video/OVGA/DD03/brightness;
;;
90)
echo -n 100 > /proc/acpi/video/OVGA/DD03/brightness;
;;
80)
echo -n 90 > /proc/acpi/video/OVGA/DD03/brightness;
;;
70)
echo -n 80 > /proc/acpi/video/OVGA/DD03/brightness;
;;
60)
echo -n 70 > /proc/acpi/video/OVGA/DD03/brightness;
;;
50)
echo -n 60 > /proc/acpi/video/OVGA/DD03/brightness;
;;
40)
echo -n 50 > /proc/acpi/video/OVGA/DD03/brightness;
;;
30)
echo -n 40 > /proc/acpi/video/OVGA/DD03/brightness;
;;
*)
echo -n 100 > /proc/acpi/video/OVGA/DD03/brightness ;
;;
esac

--------------END of VIDEO-BRIGHTNESS_UP---------

Now do the brightness_down file:

--------------BEGIN BRIGHTNESS_DOWN------------
sudo gedit /etc/acpi/video_brightnessdown.sh
Replace everything in this file with:

#!/bin/bash

CURRENT=$(grep "current:" /proc/acpi/video/OVGA/DD03/brightness |awk '{print $2}')


case "$CURRENT" in

30)
echo -n 30 > /proc/acpi/video/OVGA/DD03/brightness;
;;
40)
echo -n 30 > /proc/acpi/video/OVGA/DD03/brightness;
;;
50)
echo -n 40 > /proc/acpi/video/OVGA/DD03/brightness;
;;
60)
echo -n 50 > /proc/acpi/video/OVGA/DD03/brightness;
;;
70)
echo -n 60 > /proc/acpi/video/OVGA/DD03/brightness;
;;
80)
echo -n 70 > /proc/acpi/video/OVGA/DD03/brightness;
;;
90)
echo -n 80 > /proc/acpi/video/OVGA/DD03/brightness;
;;
100)
echo -n 90 > /proc/acpi/video/OVGA/DD03/brightness;
;;
*)
echo -n 60 > /proc/acpi/video/OVGA/DD03/brightness ;
;;
esac

----------END VIDEO=BRIGHTNESS_DOWN------------
Save both files.
Your FN +F7 for screen brightness down and Fn + F for screen brightness up should now work. (No reboot required).
Hope this helps somebody.

Last edited by countrylane; August 5th, 2008 at 08:13 PM..
countrylane is offline   Reply With Quote
Old August 6th, 2008   #2
mattn
First Cup of Ubuntu
 
Join Date: Aug 2008
Beans: 3
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

Thank you so much! This worked to fix the brightness controls on my Compaq C751NR laptop, running Ubuntu 8.04

Many, many thanks!

Matt
mattn is offline   Reply With Quote
Old August 6th, 2008   #3
ChrisMP1
Just Give Me the Beans!
 
Join Date: Dec 2007
Location: Upstate New York
Beans: 52
Ubuntu 8.10 Intrepid Ibex
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

Many thanks! Didn't realize it.

Of cource, you can replace those long files with:

Code:
#!/bin/bash
## video_brightnessup.sh

CURRENT=`grep "current:" /proc/acpi/video/OVGA/DD03/brightness \
    | awk '{print $2}'`

if [[ "$CURRENT" -ge 100 ]]; then
    echo -n 100 > /proc/acpi/video/OVGA/DD03/brightness
else
    echo -n `expr $CURRENT + 10` > /proc/acpi/video/OVGA/DD03/brightness
fi
and

Code:
#!/bin/bash
## video_brightnessdown.sh

CURRENT=`grep "current:" /proc/acpi/video/OVGA/DD03/brightness \
    | awk '{print $2}'`

if [[ "$CURRENT" -le 30 ]]; then
    echo -n 30 > /proc/acpi/video/OVGA/DD03/brightness
else
    echo -n `expr $CURRENT - 10` > /proc/acpi/video/OVGA/DD03/brightness
fi
ChrisMP1 is offline   Reply With Quote
Old August 7th, 2008   #4
david819
Spilled the Beans
 
Join Date: May 2008
Beans: 13
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

Not related: Almost identical setup. Dual booting Vista/Ubuntu 8.04 running XP in VB.
Related: Initially I was frustrated with brightness as well, and recently while altering my menu bar I found a solution. When you right click on your menu bar, and go to "Add to Panel..." you will find an applet called "Brightness Applet". Not sure if this is related to what you guys are talking about.
david819 is offline   Reply With Quote
Old August 7th, 2008   #5
countrylane
5 Cups of Ubuntu
 
Join Date: Mar 2008
Beans: 23
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

re david819 and the applet, I tried the applet and it didn't work for me. I just tried the applet again after doing the suggestions in my original howto post and it still doesnt work, so whatever makes it work, must be pulling information from other/different config files.
countrylane is offline   Reply With Quote
Old August 9th, 2008   #6
Dalox
First Cup of Ubuntu
 
Join Date: Jul 2008
Beans: 1
Compaq Presario C700

Thank you so much! This worked to fix the brightness controls on my Compaq Presario C700 laptop Ubuntu Hardy 8.04
Dalox is offline   Reply With Quote
Old August 12th, 2008   #7
kspncr
Way Too Much Ubuntu
 
kspncr's Avatar
 
Join Date: Apr 2008
Location: Bellevue, WA, USA
Beans: 253
Ubuntu 8.04 Hardy Heron
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

Awesome dude! Works perfectly!
__________________
My main system: AMD Athlon 64 X2 3.1Ghz, Nvidia 8800GT, 4GB RAM, Debian Lenny/Windows 7 dual-boot. My laptop (Compaq C700): Intel Celeron 1.7Ghz, Intel X3100, 1GB RAM, Ubuntu Hardy.
kspncr is offline   Reply With Quote
Old August 15th, 2008   #8
trevypoos
First Cup of Ubuntu
 
trevypoos's Avatar
 
Join Date: Oct 2006
Beans: 1
Ubuntu 6.06
Send a message via MSN to trevypoos
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

Thank you! I have just come back to Ubuntu with my new laptop, as my old one got stolen.

So far today I have cracked wireless and now this. Going well.

Thanks again.
trevypoos is offline   Reply With Quote
Old August 15th, 2008   #9
Mikhaily
First Cup of Ubuntu
 
Join Date: Apr 2008
Beans: 1
Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

Thank you country lane and chrismp1! I've spend days searching forums and messing about with various codes. Huge thumbs up!

Thanks
Mikhaily is offline   Reply With Quote
Old August 26th, 2008   #10
skybro
First Cup of Ubuntu
 
Join Date: Jun 2006
Beans: 5
Talking Re: HowTo: Screen brightness on a Compaq Laptop Hardy 8.04

This is exactly what I needed for my new Compaq Presario A940NR. i bit the bullet and went full ubuntu 8.04 install, as I am unable to fathom the idea of Vista entering my house. Lovin the full system now !!!!

Thanks SOOO much!
skybro is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:14 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry