You are not logged in.

#1 2011-04-29 16:49:45

vikyboss
Member
Registered: 2010-12-27
Posts: 22

[SOLVED] Brightness issue and the steps taken

I have a HP dv6 2154ca. Brightness key never worked at all. So I was looking through the forums and found from this page https://bbs.archlinux.org/viewtopic.php?id=76799

1) nvidia-bl package installation
2) "acpi_backlight=vendor" needs to be added to the grub line

Before doing this step, my brightness indicator that appears on screen goes to either 0 or 100(actual brightness becomes full but the indicator looks like this [==                     ]) , but I was able to change brightness using power managers.

After doing the above steps my brightness indicator works perfect(meaning it doesnt get stuck on 0  or 100, it goes through all values), this gave me confidence that I'm on right direction, but actual brightness doesn't change, it is always high. Couldn't even change brightness through the power manager.

Moreover, I put this line in xorg.conf under Devices

Option         "RegistryDwords" "EnableBrightnessControl=1"

still no luck...

Last edited by vikyboss (2011-05-08 02:11:36)

Offline

#2 2011-04-29 19:50:00

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 156

Re: [SOLVED] Brightness issue and the steps taken

The brightness should be controlled by the value in /sys/class/backlight/nvidia_backlight/brightness
So you could write a simple bash script that increases, decreases that value and map it to the corresponding key  (XF86MonBrightnessUp and XF86MonBrightnessDown).


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#3 2011-04-29 20:03:21

vikyboss
Member
Registered: 2010-12-27
Posts: 22

Re: [SOLVED] Brightness issue and the steps taken

When I try to actually change the value in /sys/class/backlight/nvidia_backlight/brightness it doesn't change but when I force write values in it, it still doesnt affect the brightness. Brtightness is all time high after the steps that I mentioned on my first post.

Offline

#4 2011-04-29 22:39:11

vikyboss
Member
Registered: 2010-12-27
Posts: 22

Re: [SOLVED] Brightness issue and the steps taken

Larsson wrote:

The brightness should be controlled by the value in /sys/class/backlight/nvidia_backlight/brightness
So you could write a simple bash script that increases, decreases that value and map it to the corresponding key  (XF86MonBrightnessUp and XF86MonBrightnessDown).


What I meant in the last post is this,

[praba@earth ~]$ echo 10 > /sys/devices/virtual/backlight/nvidia_backlight/brightness

bash: /sys/devices/virtual/backlight/nvidia_backlight/brightness: Permission denied

[praba@earth ~]$ sudo echo 10 > /sys/devices/virtual/backlight/nvidia_backlight/brightness

bash: /sys/devices/virtual/backlight/nvidia_backlight/brightness: Permission denied

Also, after logged in as root, I tried the above, this time they don't give any error, but the brightness disn't change.

Thanks.

Offline

#5 2011-04-30 07:20:04

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 156

Re: [SOLVED] Brightness issue and the steps taken

This lets everyone read and write to the file. Then changes the value.

sudo chmod a+rw /sys/devices/virtual/backlight/nvidia_backlight/brightness 
echo 30 > /sys/devices/virtual/backlight/nvidia_backlight/brightness 

Last edited by Larsson (2011-04-30 07:28:36)


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#6 2011-04-30 18:18:27

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [SOLVED] Brightness issue and the steps taken

Larsson wrote:

This lets everyone read and write to the file. Then changes the value.

sudo chmod a+rw /sys/devices/virtual/backlight/nvidia_backlight/brightness 
echo 30 > /sys/devices/virtual/backlight/nvidia_backlight/brightness 

Not the solution. Use:

echo 30 | sudo tee /sys/devices/virtual/backlight/nvidia_backlight/brightness

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#7 2011-05-01 13:07:35

vikyboss
Member
Registered: 2010-12-27
Posts: 22

Re: [SOLVED] Brightness issue and the steps taken

Thanks both Larrson and Stebalien, much appreciated. Now I learnt how to use echo and chmod, thank you very much. I don't know anything about bash scripting to run these commands, could any please point me towards how this brightness controlled with bash scripts? thanks once again..

Offline

#8 2011-05-01 20:24:47

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 156

Re: [SOLVED] Brightness issue and the steps taken

It could probably be done a lot easier then this, but it works. Although the user you run the script as need to have read and write permissions to the file. Save as script.sh

#/!bin/bash

declare -i brightness=`cat /sys/class/backlight/nvidia_backlight/brightness`

if [ "$1" == + ]; then
    declare -i test=$brightness+5
    `echo $test > /sys/class/backlight/nvidia_backlight/brightness`

elif [ "$1" == "-" ]; then
    declare -i test=$brightness-5
    `echo $test > /sys/class/backlight/nvidia_backlight/brightness`
else
    exit 0;
fi

Then you can run "script.sh +" or "script.sh -" to increse, decrease the brightness. Use xbindkeys or something like that to map it to a key.


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#9 2011-05-02 00:59:54

vikyboss
Member
Registered: 2010-12-27
Posts: 22

Re: [SOLVED] Brightness issue and the steps taken

Larsson wrote:

It could probably be done a lot easier then this, but it works. Although the user you run the script as need to have read and write permissions to the file. Save as script.sh

#/!bin/bash

declare -i brightness=`cat /sys/class/backlight/nvidia_backlight/brightness`

if [ "$1" == + ]; then
    declare -i test=$brightness+5
    `echo $test > /sys/class/backlight/nvidia_backlight/brightness`

elif [ "$1" == "-" ]; then
    declare -i test=$brightness-5
    `echo $test > /sys/class/backlight/nvidia_backlight/brightness`
else
    exit 0;
fi

Then you can run "script.sh +" or "script.sh -" to increse, decrease the brightness. Use xbindkeys or something like that to map it to a key.


Thank you very much. All setup seems to work. Even I used xbindkeys and mapped my Super+f(8/7) for Brightness{Up/Down}, i wasn't able to use  fn+keys as when i press fn+f7/f8 brightness completely goes to lowest or highest brightness(I read I have to use xdotools and xmacro to map actual fn keys. Now the problem is that I get this error when every I restart and try to use the keys, it looks like the permission of the acpi/brightness gets reverted back to root. Here is the error I get after every restart:

./script.sh: line 7: /sys/devices/virtual/backlight/acpi_video0/brightness: Permission denied

Is there any way to permanantly change the permission so I can use the keys without everythime logging in as root or use sudo? Thanks once again.

Offline

#10 2011-05-02 05:58:27

ViruSzZ
Member
From: The Streets
Registered: 2010-10-14
Posts: 202
Website

Re: [SOLVED] Brightness issue and the steps taken

vikyboss wrote:

Is there any way to permanantly change the permission so I can use the keys without everythime logging in as root or use sudo? Thanks once again.

You may try to change the permission of the file at system startup by adding something like this inside your '/etc/rc.local' file:

chown "__your-username__"  /sys/devices/virtual/backlight/acpi_video0/brightness

if for some reason the above is not working for you you can try chmod`N the file instead of chown`N.

Take Care,

ViruSzZ


Their Momma Made Em, Their Momma Gave em & now she can`t even SAVE`em | My WebLog

Offline

#11 2011-05-07 06:54:03

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 156

Re: [SOLVED] Brightness issue and the steps taken

Did you solve your problem?


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#12 2011-05-08 02:05:08

vikyboss
Member
Registered: 2010-12-27
Posts: 22

Re: [SOLVED] Brightness issue and the steps taken

Sorry for not replying on time, I was so busy at work couldn't get time to play with ARCH. Finally the problem is solved. I did what ViruSzZ said and I even made a default value to boot with

chown username  /sys/devices/virtual/backlight/acpi_video0/brightness
echo 1> /sys/devices/virtual/backlight/acpi_video0/brightness

And Xbindkeys is set to autostart, everything works perfect. Thanks Larsson, Stebalien, and ViruSzZ. Thanks once again Larsson for caring to make sure the problem is fixed. Much apprecited! smile

Last edited by vikyboss (2011-05-08 02:06:18)

Offline

#13 2011-07-04 12:09:56

gory
Member
From: EU
Registered: 2010-09-25
Posts: 11

Re: [SOLVED] Brightness issue and the steps taken

chown username  /sys/devices/virtual/backlight/acpi_video0/brightness
echo 1> /sys/devices/virtual/backlight/acpi_video0/brightness

Not working for me, because after restarting owner of   /../../brightness again root!

Dont know what to do. Now I have permission to use "sudo tee" in SUDOERS (echo 10 > sudo tee /../../brightness), but it is unsafe.

Offline

#14 2011-07-04 14:34:41

atomkarinca
Member
From: Somewhere but Not Here
Registered: 2008-07-03
Posts: 95
Website

Re: [SOLVED] Brightness issue and the steps taken

@gory, have you tried nvclock? e.g. for %80 brightness:

nvclock -S 80

Offline

#15 2011-07-05 01:24:40

gory
Member
From: EU
Registered: 2010-09-25
Posts: 11

Re: [SOLVED] Brightness issue and the steps taken

nvclock not working with my vga card, because I have a Gforce 9300m, which is not supported by nvclock.
I have not troubles with brightness - I can change it with keyboard out of the box. Just writing small script, which should dim display after a few seconds of inactivity, but I do not want allow executing "tee" command with root permissions and I search another way to resolve that. Changing owner was good idea,but not work after restart.

Last edited by gory (2011-07-05 13:03:18)

Offline

Board footer

Powered by FluxBB