13

I use Ubuntu 12.04 on my Sony Vaio (VPCCW2HGX). At the first times, brightness control works well, but after the activating additional drivers (nvidia accelerated graphics driver) brightness control doesn't work. I searched this issue on so many Ubuntu and Linux forums, but solutions doesn't work. I tried these ways:

  1. Installing xbacklight
  2. Adding Option "RegistryDwords" "EnableBrightnessControl=1" to /etc/X11/xorg.conf
  3. Updating Nvidia drivers
  4. To try to change brightness by typing sudo setpci -s 00:02.0 F4.B=xx

All of these ways doesn't work. I still can't set screen brightness. Is there anyone know this?

5
  • open a terminal and post result of ls /sys/class/*/brightness
    – Web-E
    Jul 11, 2012 at 9:46
  • there is nothing in the /sys/class/backlight so i didn't find the path that you say
    – sundowatch
    Jul 11, 2012 at 9:53
  • sorry my mistake, Please see the answer
    – Web-E
    Jul 11, 2012 at 9:56
  • this method will work on most nvidia devices.. askubuntu.com/a/179050/82136 Sep 26, 2012 at 15:34
  • I guess xbacklight doesn't work with proprietary NVidia drivers. Aug 10, 2014 at 0:02

9 Answers 9

10

To get working brightness keys, try the following.

Run the command:

sudo -H gedit /etc/default/grub

Change this line

GRUB_CMLINE_LINUX_DEFAULT="quiet splash"

to something like below

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor

Execute sudo update-grub and reboot. See if brightness keys are working.

It is still possible Ubuntu won't remember your brightness settings. So you have to change brightness each time.

Please let us know the result as many Sony users are facing this problem.


This is for setting brightness manually after doing the above steps.

Try following for paths shown by ls /sys/class/backlight/*/brightness and replace accordingly.

For example, paths will be like:

/sys/class/backlight/acpi_video0/brightness

For the above path Get the maximum brightness:

cat /sys/class/backlight/acpi_video0/max_brightness

Try a lower value to set the brightness, say output is 16 so I will try with half of it:

echo 8 | sudo tee  /sys/class/backlight/acpi_video0/brightness

If this works, make this happen in each login automatically by doing the following

sudo -H gedit /etc/rc.local

Enter this line just before exit 0. It should look like:

echo YOUR_VALUE_HERE > /sys/class/backlight/acpi_video0/brightness
exit 0

Also you can try with xdotool Install xdotool

6
  • I did whatever you say, but still not working. And there is no path like sys/class/backlight/acpi_video0/brightness or sys/class/backlight/acpi_video0/max_brightness. sys/class/backlight/ is empty. My Fn keys works except of brightness keys.
    – sundowatch
    Jul 11, 2012 at 10:18
  • did you update the grub with acpi_backlight= vendor ?
    – Web-E
    Jul 11, 2012 at 10:49
  • yes, i updated the grub, and still not working
    – sundowatch
    Jul 11, 2012 at 12:15
  • I think it is not about Ubuntu, because I have the same problem on Linux Mint 12.
    – sundowatch
    Jul 11, 2012 at 12:20
  • Updating the grub worked for me with Ubuntu 12.10
    – Indika K
    Oct 25, 2012 at 17:14
7

For those who end up here while looking for a solution, I've found the text below from here and this works for my Ubuntu 12.04 64bit.

sudo nano /etc/X11/xorg.conf

This will open your X server configuration (after prompting for your password). You should see a section titled "Device" that looks as follows:

Section "Device"
        Identifier      "Default Device"
        Driver  "nvidia"
        Option  "NoLogo"        "True"
EndSection

Append a line so it appears like this:

Section "Device"
        Identifier      "Default Device"
        Driver  "nvidia"
        Option  "NoLogo"        "True"
        Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection

You will need to restart your graphical server (or reboot) for this change to take effect.

2
  • Changing screen brightness no longer worked for me on Ubuntu 13.10 after installing nvidia driver. This answer fixed the problem for me.
    – brady
    Mar 24, 2014 at 21:18
  • Changing screen brightness wasn't working on Linux Mint 17.1 Rebecca since the beginning. This answer worked for me.
    – Ekin
    Mar 29, 2015 at 9:14
7

Actually both grub and xorg.conf modifications are needed.

First modify /etc/defaults/grub to add ACPI parameters. The GRUB_CMDLINE_LINUX_DEFAULT line may then look liee:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"

Update GRUB to apply that change, by running the command:

sudo update-grub

Second, in the file /etc/X11/xorg.conf, find the in Device section and add Option EnableBrightnessControl, so it looks like this:

Section "Device"
     Identifier     "Device0"
     Driver         "nvidia" 
     VendorName     "NVIDIA Corporation" 
     BoardName      "GeForce GT 330M" 
     Option         "RegistryDwords" "EnableBrightnessControl=1"
EndSection

This works for me on Samsung R780 with Nvidia GeForce 330M.

2
  • thx, only solution that worked for me with same notebook setup. Jan 7, 2015 at 13:49
  • Thanks, this worked for me, even on Mint 18.3 witihout modifying GRUB. I'm on a Thinkpad T410 with latest nvidia drivers.
    – normic
    Apr 2, 2018 at 1:33
6

I had the same problem with my Vaio and Ubuntu.

I got it working with the nvidiabl-module and the oBacklight script.

The script is available from this repository, and these instructions may be helpful.

Or use the newer DKMS-based way described in the README file. If you use that technique, you really should read that file thoroughly. However, one method that should work is to download a .deb file and install it. The project is inactive so nvidiabl-dkms_0.87_all.deb will likely remain the latest .debpackage. You can download and install that package with these two commands:

wget https://raw.githubusercontent.com/guillaumezin/nvidiabl/master/install/deb/nvidiabl-dkms_0.87_all.deb
sudo dpkg -i nvidiabl-dkms_0.87_all.deb

The README has information on other ways to install, as well as uninstalling.

4
  • it really works, thanks. Eventually, I couldn't imagine it is solved by a script. I think sony hates Linux :)
    – sundowatch
    Jul 11, 2012 at 12:48
  • 1
    not sony but nvidia :) nothing works out of the box backlight, hibernate/suspend, dual-screen,..
    – Achim A
    Jul 11, 2012 at 12:51
  • oh, dual-screen not working? I am falling disappointment.
    – sundowatch
    Jul 11, 2012 at 13:50
  • it works, but not everything, e.g. for switching the primary monitor you need to enable/disable/reenable the configuration, etc :)
    – Achim A
    Jul 13, 2012 at 9:21
5

Install xbacklight:

sudo apt-get install xbacklight

You can set brightness to X% as (no sudo required):

xbacklight -set X

To make the setting permanent, go to Startup Applications and add a new startup program, with the following command (where X% is your desired brightness):

xbacklight -set X

Modifying /etc/rc.local as many others have suggested does not work for me (on a Dell Studio 1535).

4
  • Worked for me on my Idepad Y500. GPU Geforce GT 750m. Using ElementaryOS(based on Ubuntu 12.04) Mar 3, 2014 at 5:29
  • Worked for me on Lenovo W530 with Debian wheezy Jul 1, 2014 at 1:32
  • Worked for me on my asus g53jw. None of the other answers (with registrydword or acpi stuff) worked.
    – marcelocra
    May 11, 2015 at 0:24
  • Works on my Lenovo W530 (nvidia K1000M) with proprietry driver, doesn't work with nouveau. Sep 26, 2016 at 20:29
2

I use nvidia 970. I wrote a script and mapped keyboard shortcuts to increase or decrease brightness ( This uses xrandr ):

Remember to give executed permission to file

chmod +xfile

Add the following line to keyboard shortcuts

To increase:

filepath/file--increment

and to decrease

filepath/file--decrement

where file is the name of file containing the below script:

#!/bin/sh

#get the video port to which screen is connected

VAR_DISPLAY=`xrandr --verbose | grep  " connected"| sed 's/ connected.*//g'`

if [ -z $VAR_DISPLAY ]

then

        echo "Err:Display details could not be found using xrandr"
        exit 1
fi

echo $VAR_DISPLAY

##

#get the current brightness settings [0 - 1]

VAR_BRIGHTNESS=$(xrandr --verbose | grep  "Brightness"| sed 's/.*Brightness: //g')

if [ -z $VAR_BRIGHTNESS ]

then

        echo "Err:Brightness setting could not be found using xrandr"
        exit 1
fi

##

#increase or decrease brightness

if [ -z $1 ]

then

        echo "Specify one of following option --increment | --decrement"
else if [ $1 = "--increment" ]

then

        test $( expr `expr "$VAR_BRIGHTNESS + .05"|bc`" > 1"|bc ) -eq 1 || xrandr --output $VAR_DISPLAY --brightness `expr "$VAR_BRIGHTNESS +.05"|bc`
else if [ $1 = "--decrement" ]

then

        test $( expr `expr "$VAR_BRIGHTNESS - .05"|bc`" < 0"|bc ) -eq 1 || xrandr --output $VAR_DISPLAY --brightness `expr "$VAR_BRIGHTNESS - .05"|bc`
else

        echo "Specify one of following option --increment | --decrement"
fi

fi

fi

##
1
  • I've tried a bunch of different solutions (listed here and elsewhere) and none of them worked. This, so far, is the patch that works. Thanks!
    – kneeki
    Nov 17, 2016 at 5:19
0

I have a fix for my sony vaio F Model # VPCF23EFX by Follow the steps below:

  1. install Nvidia drive

  2. run Nidia x server settings which you can find in appliction menu

  3. select x server display configuration and chose the save to x configuration file option. This will build file xorg.conf and close Nvidia x server settings.

  4. sudo gedit /etc/X11/xorg.conf in terminal

  5. find

    Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 540M"
    EndSection 
    
  6. change it like this

    Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 540M"
    Option "RegistryDwords" "EnableBrightnessControl=1"
    EndSection
    
  7. reboot

0

I also had a problem using xbacklight to control display brightness while using the nvidia driver.

I found that using light was the best generic solution, as it doesn't rely on xorg configuration.

Here are the changes I made to my dotfiles in order to install and use it with keyboard shortcuts: https://github.com/ruebenramirez/.dotfiles/commit/a18fd396a4f53238c7d6d96e3e0d39bdbae2c56c

0

Try using xrandr to change the brightness or gamma while using the nvdidia drivers:

determine the output name of your monitor:

xrandr -q | grep connected

my monitor name is returned as DVI-I-1 and I use:

xrandr --output DVI-I-1 --brightness 0.8 --gamma 0.7:0.7:0.7

to change the brightness/gamma

You can create custom keys that run these commands.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .