Brightness Hotkeys Only Slightly Work

I just installed Precise on my Samsung Laptop (QX412-S01au, using Ubuntu 2D). The brightness hotkeys sort of work:

  • Adjusting the brightness using the slider in the control panel works just fine
  • Pressing the brightness keys brings up the brightness notification
  • Pressing "Up" raises the brightness to maximum, no matter what it was before
  • Pressing "Down" lowers the brightness to one step below maximum, no matter what it was before.

Another answer I looked (can't find the link, sorry) got my to try this:

echo "0" | sudo tee /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0/brightness

which takes the brightness to the lowest setting. And

echo "7" | sudo tee /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0/brightness

which takes the brightness to the highest setting. Each step inbetween works too.

Between that and the control panel working, I think the drivers are fine. Any idea why the hotkeys (and only the hotkeys) seem to get stuck on the top two brightness settings?

p.s. Happy to hit up the command line to make it work :)


Testing:

  • When you turn on your laptop, do you see the Grub menu? If yes, proceed. If no, hold shift while powering on, to access Grub menu.
  • Select the proper option (The usual Ubuntu entry is what you are looking for) and instead of hitting enter to select, press e to edit boot parameters.
  • When in edit mode, search for the line
    linux /vmlinuz-<your kernel version number> <some parameters here>
    and add acpi_backlight=vendor after quiet splash, separated by a space on both sides.

    If you do it right, this will not change anything permanently. it will be a one-time change, and all changes are wiped away on reboot, so feel free to play with the options. You may use this as a reference.

  • Then press Ctrl+X OR F10 to boot.
  • Now it should boot into Ubuntu, as usual. login, and try testing your keys for changing brightness. If that works, you can make the change permanent.

Making permanent change

Note:

To play safe, test everything before making permanent changes. And if you are not-so-experienced, follow the steps exactly as described to prevent future boot failure. Any damage can be reverted, but save yourself some trouble.

  • Open a terminal(Ctrl+Alt+T)
  • type sudoedit /etc/default/grub and hit enter. Enter your password when prompted.
  • Your favourite (default) editor will open with a file. Search for the line that reads
    GRUB_CMDLINE_LINUX_DEFAULT="<some boot parameters>" Usually, the <some-boot-parameters> are quiet splash by default.
  • Add acpi_backlight=vendor at the end, within quotes, separated by a space from existing arguments.
  • Save the file, and exit the editor.
  • run sudo update-grub from terminal to write changes to grub menu.

Changes get applied on restart.


I have found the fix. No workaround.

If you update your kernel to the latest stable release which is 3.11 as of writing it will 100% work

How to update kernel to the latest mainline version without any Distro-upgrade?

This site explains it. Once you download the 3 parts, install in listed order by right clicking the deb and open with software centre then install. Do for all 3 then restart and voila.

I am unsure why nobody has discovered this sooner. Please note my linux kernel was 3.0.8.29 prior and my hotkeys for brightness displayed the bar but did not actually change the brightness. After this it is 100% working.

I hope ubuntu team ready this and can apply this into an update for ubuntu 12.04 which I was using. This should solve it across the board and it also comes with improvements listed here.

http://www.linux.com/news/featured-blogs/200-libby-clark/736790-linux-kernel-311-release-boosts-performance-efficiency

Thank you all and good luck. I will only end by saying that with any kernel upgrade there is always a possibility of panic but I am unlucky and had no issue this time around. Always at own risk.


I found a workaround for my dell 5521 with switchable ati/intel graphics

First try changing the value of /sys/class/backlight/intel_backlight/brightness to some value and see if this changes your brightness. use nano for example with admin rights.

What is actually happening is that the toggle keys increases the value of /sys/class/backlight/acpi_video0/brightness so what I did is a script to take the event from the function keys and increment the value of /sys/class/backlight/intel_backlight/brightness.

First add create two event function related to your brightness keys :

sudo nano /etc/acpi/events/dell-brightness-down

add the following code :

# /etc/acpi/events/dell-brightness-down

event=video DD01 00000087 00000000
action=/etc/acpi/dell-brightness-down.sh

then

sudo nano /etc/acpi/events/dell-brightness-up

add the following code :

# /etc/acpi/events/dell-brightness-up

event=video DD01 00000086 00000000
action=/etc/acpi/dell-brightness-up.sh

Note the value of event can be obtained by running acpi_listen and pressing the brightness toggle keys for corresponding up and down brightness mine were fn+f4 and fn+f5

Then create the related script to perform your desired action:

sudo nano /etc/acpi/dell-brightness-down.sh

then add this "feel free to tweak":

#!/bin/bash

brightness=$(cat /sys/class/backlight/intel_backlight/brightness)

a=$((brightness-100))

if [ "$brightness" -gt 600 ]; then
echo $a >> /sys/class/backlight/intel_backlight/brightness
fi

600 is a random min value, feel free to chose your desire min value but stay in range of

cat /sys/class/backlight/intel_backlight/max_brightness

the other :

sudo nano /etc/acpi/dell-brightness-up.sh

add :

#!/bin/bash

brightness=$(cat /sys/class/backlight/intel_backlight/brightness)

a=$((brightness+100))

if [ "$brightness" -lt 4000 ]; then
echo $a >> /sys/class/backlight/intel_backlight/brightness
fi

then

chmod +x /etc/acpi/dell-brightness-up.sh

and

chmod +x /etc/acpi/dell-brightness-down.sh

Finally :

chmod 666 /sys/class/backlight/intel_backlight/brightness

to have write access to the backlight value file.

reboot, and brightness now works fine for me.