You are not logged in.
Hi all,
I have LXDE with kernel 2.6.30, xf86-video-intel-newest (2.8 rc) on my Samsung NC10, and like many people I have been unable to change the backlight settings in X with kms turned on.
I have tried the various solutions on the forum and none of them work for me, so here are two little bash scripts that use the setpci command to change the backlight.
Note 1: I have a little file .backlight in my home dir that I store the backlight setting because I don't know how to read the value back from the pci address. So if you use this script you need to do this first:
echo FF > ~/.backlight
Note 2: These scripts also requre bc from extra to do the hex conversion & maths.
sudo pacman -Sy bc
It's only 240 K in size, but if you are trying to keep the number of installed packages low, then you won't like this
Here is the package details from pacman:
Name : bc
Version : 1.06-5
URL : None
Licenses : GPL
Groups : None
Provides : None
Depends On : readline
Optional Deps : None
Required By : None
Conflicts With : bc-readline
Replaces : bc-readline
Installed Size : 240.00 K
Packager : Allan McRae <allan@archlinux.org>
Architecture : i686
Build Date : Sat 02 Aug 2008 14:18:04 IST
Install Date : Thu 25 Jun 2009 16:06:53 IST
Install Reason : Explicitly installed
Install Script : No
Description : An arbitrary precision calculator language
bc /usr/
bc /usr/bin/
bc /usr/bin/bc
bc /usr/bin/dc
bc /usr/share/
bc /usr/share/info/
bc /usr/share/info/bc.info
bc /usr/share/info/dc.info
bc /usr/share/man/
bc /usr/share/man/man1/
bc /usr/share/man/man1/bc.1.gz
bc /usr/share/man/man1/dc.1.gz
You also need to know the address of you graphics card:
lspci | grep Display
For me this returns:
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
This is needed for this command in the scripts:
sudo setpci -s 00:02.1 F4.B=$var3
Note the 00:02.1 is the address for my laptop screen, 00:02.0 is the address for the vga out controller for me.
Increase backlight:
#!/bin/bash
var1=`cat ~/.backlight`
var2=`echo "16 i $var1 F + p"|dc`
if (( ( "$var2" \> "-1") && ( "$var2" \< "256" ) ));
then
var3=`echo "10 i 16 o $var2 p"|dc`
echo $var3 > ~/.backlight
sudo setpci -s 00:02.1 F4.B=$var3
fi
Decrease backlight:
#!/bin/bash
var1=`cat ~/.backlight`
var2=`echo "16 i $var1 F - p"|dc`
if (( ( "$var2" \> "-1") && ( "$var2" \< "256" ) ));
then
var3=`echo "10 i 16 o $var2 p"|dc`
echo $var3 > ~/.backlight
sudo setpci -s 00:02.1 F4.B=$var3
fi
Obviously someone else can write a much smarter/better set of scripts than me, but I hope is can be of use for someone!
Edit:Here are my openbox bindings for the scripts:
<keybind key="XF86MonBrightnessUp">
<action name="Execute">
<command>~/bin/blightu.sh</command>
</action>
</keybind>
<keybind key="XF86MonBrightnessDown">
<action name="Execute">
<command>~/bin/blightd.sh</command>
</action>
</keybind>
Last edited by makimaki (2009-07-11 14:26:08)
====* -- Joke
O
\|/ --- Me
/ \ Whooooosh
Offline
makimaki, it is dc or bc in your script?. This should be bc , correct this.
Last edited by kgas (2009-09-29 15:05:56)
Offline
makimaki, it is dc or bc in your script?. This should be bc , correct this.
No, it uses dc to do the calculation, which is included in the bc package. I chose dc for its reverse polish notation, as I found that easier to use.
====* -- Joke
O
\|/ --- Me
/ \ Whooooosh
Offline
Thanks, for me using dc gives stack empty error may be due to language setting.
Offline
FYI: The new xf86-video-intel (2.9) has just been released:
http://article.gmane.org/gmane.comp.fre … xorg/40733
According to the release announcement, the new driver fixes the backlight issue with KMS:
* Add support for BACKLIGHT property when using kernel modesetting
(KMS). This allows backlight adjustment with programs such as
"xbacklight -set <percentage>" or "xrandr --set BACKLIGHT <value>".
Offline
Thanks for the information,
I built the latest driver from AUR and xbacklight works again.
Offline
I've been using xf86-video-intel-newest from AUR for a while, so I hadn't noticed xbacklight works again! I upgraded to the latest firmware though, and like someone in the nc10 thread my brightness fn keys don't work nicely with xbacklight (still fine with the hack-around I use).
====* -- Joke
O
\|/ --- Me
/ \ Whooooosh
Offline
With latest upgrade (xf86-video-intel 2.9.1 went to extra), still no xbacklight support with KMS enabled :
$ xbacklight
No outputs have backlight property
(here on samsung nc10)
Offline
See my backlight script and function key instructions here:
http://wiki.archlinux.org/index.php/Samsung_N140
Offline
I don't want to use setpci. I prefer to disable KMS.
I just thought that v2.9 of the intel driver fixed this issue.
Offline
2.6.32 is out, with KMS enabled by default.
I would like to know if people still need this workaround script to set the backlight, or if everything works well with xbacklight ?
For me, xbacklight is still not working at all, even with the driver from testing.
Offline
2.6.32 is out, with KMS enabled by default.
I would like to know if people still need this workaround script to set the backlight, or if everything works well with xbacklight ?
For me, xbacklight is still not working at all, even with the driver from testing.
[oups, double posted !]
Last edited by john_schaf (2009-12-31 13:55:07)
Offline
with KMS enabled in kernel 2.6.32, backlight is working fine by default (Lenovo N500/N100 laptops)
Offline
See my backlight script and function key instructions here:
http://wiki.archlinux.org/index.php/Samsung_N140
Thanks Aedit, this works beautifully.
Offline
does anyone know the difference between setpci method and xbacklight method?
in my laptop HP 2540p, the xbacklight method works, but setpci doesn't work.
From my understanding, the setpci method se the register directly and should work at every laptop.
But I don't undestand why it doesn't work at my laptop.
Offline