Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 02-08-10, 12:59 AM   #25
damdim
Registered User
 
Join Date: Jan 2010
Posts: 21
Default Re: Linux backlight driver

Quote:
Originally Posted by keptile View Post
To make the Fn keys to work, Ubuntu loads the sony-laptop module. When nvidia_bl is also loaded, then lshal shows two backlight devices in /sys/devices/virtual/backlight, which are sony and nvidia_backlight. Fn-F5, Fn-F6 keys, gnome-power-preferences and gnome-brightness applet actually work but they all change /sys/class/backlight/sony/brightness.

As a workaround, I use a slightly modified version of the script at
https://bugs.launchpad.net/ubuntu/+s...39/comments/26. Then I added two files into /etc/acpi/events to map Fn-F5 and Fn-F6 keys to change the brightness using that script.
Using xev I also see that Fn keys work when sony-laptop is loaded, but they control sony backlight instead of nvidia_backlight interface. I can even map them to various actions in kde, although there isn't any for controlling brightness. I read somewhere that KDE SC 4.4 might have these actions, but for now I also have to use your scripts...
Could you paste the code of these scripts, and how you mapped them with Fn keys?
Thanks.
damdim is offline   Reply With Quote
Old 02-08-10, 01:23 PM   #26
keptile
Registered User
 
Join Date: Feb 2010
Posts: 5
Default Re: Linux backlight driver

I am attaching the scripts.
  1. chbrn is a script that gets and sets the brightness, put it somewhere in your $PATH.
  2. sony-brightness-up and sony-brightness-down go to /etc/acpi/events. Run acpi_listen in terminal, and get the events when you press Fn-F5 and Fn-F6. Edit those files to match the events. Since your laptop is also Sony, I believe they will be the same.
  3. sony-brn-down and sony-brn-up go to /etc/acpi. Change the brightness levels as you like. I set 8 levels, as there are 8 brightness levels of the laptop.
Attached Files
File Type: gz scripts.tar.gz (866 Bytes, 807 views)
keptile is offline   Reply With Quote
Old 02-09-10, 06:26 AM   #27
alberto80
Registered User
 
Join Date: Feb 2010
Posts: 1
Default Re: Linux backlight driver

Hi keptile! and Hi all!
It seems you found a solution to control the brightness on sony vaio CW, isn't it? may you summarise what to do in some simple passage for the sony vaio cw series? I found many people looking for it.
Thanks a lot.
Alberto
alberto80 is offline   Reply With Quote
Old 02-09-10, 03:20 PM   #28
hrh
Registered User
 
Join Date: Feb 2010
Posts: 6
Default Re: Linux backlight driver

Hello Please Help me to fix brightness on vaio cw16fg with geforce 230.

thank you
hrh is offline   Reply With Quote
Old 02-10-10, 08:23 AM   #29
damdim
Registered User
 
Join Date: Jan 2010
Posts: 21
Default Re: Linux backlight driver

Here are the steps summarized for the people asking:

1. Install dkms. f.e. in Ubuntu run
Code:
sudo apt-get update && sudo apt-get install dkms
2. Download "nvidia_bl-0.52.tar.gz", created by guillaumezin, from the first post of the thread and run the following command in the folder you've saved it.
Code:
sudo dkms ldtarball --archive=nvidia_bl-0.52.tar.gz
3. Go to http://us.download.nvidia.com/XFree8...ppendix-a.html and find your card and note the Device PCI ID f.e. GeForce GT 230M has Device PCI ID "0x0A2A"

4. Edit as root the file "/usr/src/nvidia_bl-0.52/nvidia_bl.c" and in the section "static DEFINE_PCI_DEVICE_TABLE(nvidia_bl_device_table)" add the corresponding line for your card f.e. for GeForce GT 230M the following line has to be added.
Code:
/* NVIDIA Geforce 230M */
	{ PCI_VDEVICE(NVIDIA, 0x0A2A), (kernel_ulong_t)&nv5x_driver_data },
5. Save the file and run
Code:
sudo dkms add build install -m nvidia_bl -v 0.52
6. Run
Code:
sudo modprobe nvidia_bl
to load the module. It should not complain that it didn't find a supported chip.

7. Run
Code:
cat /sys/class/backlight/nvidia_backlight/brightness
It should return a number that is your current brightness.

8. Run
Code:
echo 50 | sudo tee -a /sys/class/backlight/nvidia_backlight/brightness
It should darken your screen.

9. Edit as root the file "/etc/modules" and add the line "nvidia_bl" so that the module is loaded every time you boot.

10. If you use KDE4 then with the Powerdevil applet you should be able to control the brightness.
If not make sure that you sony-laptop module is loaded. Run
Code:
lsmod | grep sony
and if it doesn't return "sony-laptop" run
Code:
sudo modprobe sony-laptop
and follow the steps from keptile's post to control the brightness with Fn keys.
http://www.nvnews.net/vbulletin/show...8&postcount=26
damdim is offline   Reply With Quote
Old 02-12-10, 07:46 PM   #30
reddemon666
Registered User
 
Join Date: Feb 2010
Posts: 3
Default Re: Linux backlight driver

Hi damdim,

I've got the same laptop Sony VPCCW1

I followed the steps you mentioned exactly, but when I try
Code:
echo 50 | sudo tee -a /sys/class/backlight/nvidia_backlight/brightness
as you mentioned, the brightness does not change.

I've even tried removing and recompiling the nvidia_bl module, but it still has no effect.

Please help!
reddemon666 is offline   Reply With Quote
Old 02-13-10, 06:36 AM   #31
damdim
Registered User
 
Join Date: Jan 2010
Posts: 21
Default Re: Linux backlight driver

When you execute
Code:
cat /sys/class/backlight/nvidia_backlight/brightness
what number is returned?

What distribution do you use? Perhaps you don't have sudo installed, so you need this command instead
Code:
su -c "echo 50 | tee -a /sys/class/backlight/nvidia_backlight/brightness"
You can also test the brightness with the following command. Run it as normal user, not root.
Code:
dbus-send --print-reply --system --dest=org.freedesktop.Hal  /org/freedesktop/Hal/devices/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.SetBrightness  int32:50
P.S. You can try lower values than 50
damdim is offline   Reply With Quote
Old 02-14-10, 04:43 PM   #32
reddemon666
Registered User
 
Join Date: Feb 2010
Posts: 3
Default Re: Linux backlight driver

Hey damdim,

Thanks for the quick reply. In the meantime, I had updated my drivers from nvidia version 190 to 195, and recompiled the nvidia_bl module, I'm not sure if that helped in any way, but I managed to get the brightness working using your suggestion of using different values of brightness, so far without the Fn+F5 and Fn+F6 keys. My brightness levels range from 0 to 10.

I am using Ubuntu Karmic x64. The number that is returned after initially executing
Code:
cat /sys/class/backlight/nvidia_backlight/brightness
is 127.

I then tried
Code:
dbus-send --print-reply --system --dest=org.freedesktop.Hal  /org/freedesktop/Hal/devices/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.SetBrightness  int32:0
and it dimmed the display to the lowest level

I also tried keptile's suggestions as you mentioned in your previous post, and when I enter
Code:
chbrn 0
it does the same, and dims the display to the lowest level, as well as to other brightness levels by trying different values using the range 0 to 10.

The Fn+F5 and Fn+F6 keys don't work.
I even tried to change the levels in the sony-brn-down and sony-brn-up scripts provided by keptile, but I had no luck.
I check the events using acpi_listen, and they are correct for the sony-brightness-up and sony-brightness-down scripts

Do you or keptile have any suggestions I can try?

Thanks for the help so far
reddemon666 is offline   Reply With Quote

Old 02-15-10, 12:11 AM   #33
hrh
Registered User
 
Join Date: Feb 2010
Posts: 6
Default Re: Linux backlight driver

I have the nvidia 190.53 version and no luck!
where did you find 195 version ? the official site have 190.53 as latest version!
hrh is offline   Reply With Quote
Old 02-15-10, 03:53 AM   #34
reddemon666
Registered User
 
Join Date: Feb 2010
Posts: 3
Default Re: Linux backlight driver

Hi hrh,

yes,you're right, the official site has Nvidia version 190.53.
I first installed it using:
Code:
sudo apt-get purge nvidia-glx-190
sudo apt-get install nvidia-glx-195
before removing it again, and using the Ubuntu route in the System >> Administration >> Hardware drivers menu.
reddemon666 is offline   Reply With Quote
Old 02-19-10, 09:59 PM   #35
hrh
Registered User
 
Join Date: Feb 2010
Posts: 6
Default Re: Linux backlight driver

i Installed 195 but no luck
nvidia_bl module is running and every thing is OK except the finish
it didn't dim my back light
what is the problem?
hrh is offline   Reply With Quote
Old 02-20-10, 03:30 AM   #36
damdim
Registered User
 
Join Date: Jan 2010
Posts: 21
Default Re: Linux backlight driver

A small update for the double backlight interface problem. It is possible to blacklist the sony one and keep sony-laptop module running. I found the solution to this post:
http://ubuntuforums.org/showpost.php...77&postcount=8
Create the file /etc/hal/fdi/preprobe/sony.fdi and paste the following text
Code:
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">

<device>
<!-- Ignore backlight interface created by sony_laptop
-->
<match key="linux.sysfs_path" string="/sys/devices/virtual/backlight/sony">
<merge key="info.ignore" type="bool">true</merge>
</match>
</device>
</deviceinfo>
Edit the string="/sys/devices/virtual/backlight/sony" to match your system. You can find it with lshal.
After you restart hal if you lshal you should see that the "linux.sysfs_path" string="/sys/devices/virtual/backlight/sony" is registered to a temp interface. After that gnome-power-manager can control the backlight of the vaio. Although kde4 powerdevil still cannot with the Fn keys.
damdim is offline   Reply With Quote
Reply


Thread Tools

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 -5. The time now is 02:30 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.