Home > Uncategorized > ASUS UL20A Brightness Buttons

ASUS UL20A Brightness Buttons

December 24th, 2009 subogero

As I’ve mentioned before, ubuntu 9.04 Jaunty has been running fine on my ASUS UL20A laptop. Except the screen brightness buttons, Fn-F5 (down) and Fn-F6 (up).

Fn-F5 was setting brightness to the darkest value while Fn-F6 to the second darkest one. I’ve managed to create a crufty workaround, detailed below. It’s all about hacking the configuration of acpid (the ACPI daemon).

Set Brightness Directly

There is a special file called /proc/acpi/video/VGA/LCDD/brightness which lists the available and the actual brightness values. Brightest is shown below.

szg@OG3:/proc/acpi/video/VGA/LCDD$ cat brightness
levels:  10 16 22 28 34 40 46 52 58 64 70 76 82 88
current: 88

Setting brightness is done by writing a number into this file, the example shows darkest possible.

echo 10 > /proc/acpi/video/VGA/LCDD/brightness

Explore What Events the Brightness Keys Generate

Start the program called “acpi_listen”, which will print power-management related events when they happen.

When hitting Fn-F5 (Brightness down):

video LCDD 00000087 00000000
hotkey ATKD 00000020 000000fc

When hitting Fn-F6 (Brightness up):

video LCDD 00000086 00000000
hotkey ATKD 00000011 00000106

So each hotkey generates two events. Now let’s see how these events are handled. (Hard to see, as by now the screen is very dark. Bugger.)

Configure How acpid Handles Events

The configuration of “acpid” is in the “/etc/acpi/events” directory. Each file here handles one event type, line “event=regexp” defines the event, where the regexp shall match something like above, while line “action=command” the callback.

Fn-F5 (down) video LCDD 00000087 00000000 is handled by file “video_brightnessdown”:

event=video.* 00000087

Fn-F5 (down) hotkey ATKD 00000020 00000000fc is handled by “asus-brightness-down”:

event=hotkey (ATKD|HOTK) 0000002[0123456789abcdef]

Fn-F6 (up) video LCDD 00000086 00000000 is handled by file “video_brightnessup”:

event=video.* 00000086

Fn-F6 (up) hotkey ATKD 00000011 0000000106 is handled by “asus-brightness-up”:

event=hotkey (ATKD|HOTK) 0000001[0123456789abcdef]

As you can see the callback scripts are in “/etc/acpi”.

Test the acpid Callback Scripts

Running all four callback scipts directly from the command line revealed they don’t work at all. Absolutely no effect on brightness. That’s why I now ignore their contents completely.

The test revealed something else as well: the broken function of both hotkeys comes from outside of this acpid-config mechanism. Probably the kernel. Which I won’t try to fix, I’ll just create a workaround.

The Fix

I linked the fixed callbacks to the second event for each hotkey, “hotkey ATKD 00000020″ (down) and “hotkey ATKD 00000011″ (up). Configured by “asus-brightness-down” and “asus-brightness-up”, respectively. I’ve removed the other two config files (video_brightnessdown/up) completely, which were handling the first event for each hotkey.

The new callback script for brightness down reads the actual value from a new config file (/etc/acpi/brightness), decrements it by 6, and stores it to the config file AND the “/proc/acpi/video/VGA/LCDD/brightness” file as well.

if [ ! -f /etc/acpi/brightness ]; then echo 88 > /etc/acpi/brightness; fi
BRIGHTNESS=`cat /etc/acpi/brightness`
if [ $BRIGHTNESS -gt 10 ]; then let BRIGHTNESS-=6; fi
echo $BRIGHTNESS > /etc/acpi/brightness
echo $BRIGHTNESS > /proc/acpi/video/VGA/LCDD/brightness

The new brighness up script is similar, just increments the value by 6.

if [ ! -f /etc/acpi/brightness ]; then echo 88 > /etc/acpi/brightness; fi
BRIGHTNESS=`cat /etc/acpi/brightness`
if [ $BRIGHTNESS -gt 10 ]; then let BRIGHTNESS+=6; fi
echo $BRIGHTNESS > /etc/acpi/brightness
echo $BRIGHTNESS > /proc/acpi/video/VGA/LCDD/brightness

The final touch: the callback script for AC/battery events (power.sh) also writes the config file to guarantee we always start changing the brightness from the actual value.

for x in /proc/acpi/ac_adapter/*; do
  grep -q off-line $x/state

  if [ $? = 0 ] && [ x$1 != xstop ]; then    
    for SCRIPT in /etc/acpi/battery.d/*.sh; do
    . $SCRIPT
    echo 52 > /etc/acpi/brightness
    echo 52 > /proc/acpi/video/VGA/LCDD/brightness
    for SCRIPT in /etc/acpi/ac.d/*.sh; do
    . $SCRIPT
    echo 88 > /etc/acpi/brightness
    echo 88 > /proc/acpi/video/VGA/LCDD/brightness

Now, when hitting the brightness hotkeys, the screen switches to the darkest setting for a moment, but then it works. Perfect. Nearly.

  1. Loren Atkin
    March 19th, 2010 at 21:01 | #1

    Hey i have a UL20-A also and i cannot for the life of me figure out how to fix this problem. you seem to be the only person who has fixed this.

  2. March 20th, 2010 at 17:22 | #2

    Yes, but it’s still an ugly workaround. I guess the real solution involves some kernel module programming. Which one has to learn sooner or later, anyway :-)

  3. James
    June 2nd, 2010 at 11:13 | #3

    Hello, subogero,
    I tried what you said and got no reply (problem still the same). and i run manually asus-brn-down.sh and got
    “./asus-brn-down.sh: line 4: [: too many arguments
    ./asus-brn-down.sh: line 6: echo: write error: Invalid argument”

    Can not figure out why. (I copy and paste what you wrote above)
    Thanks for your help!

  4. June 2nd, 2010 at 23:14 | #4

    Is it an ASUS UL20A? What operating system do you have?
    Can you post your entire asus-brn-down.sh?

  5. James
    June 3rd, 2010 at 04:33 | #5

    yes, asus UL20A ULV SU7300, Intel GMA 4500MHD, 12″, 320GB, 4G….etc.
    Installed Win 7 and Fedora 13, dual boot
    All ok but the brightness adjustment. entire ausu-brn-down.sh is (between “” quota mark):

    if [ ! -f /etc/acpi/brightness ]; then echo 88 > /etc/acpi/brightness; fi
    BRIGHTNESS=`cat /etc/acpi/brightness`
    if [ $BRIGHTNESS -gt 10 ]; then let BRIGHTNESS-=6; fi
    echo $BRIGHTNESS > /etc/acpi/brightness
    echo $BRIGHTNESS > /proc/acpi/video/VGA/LCDD/brightness

  6. James
    June 3rd, 2010 at 06:08 | #6

    BTW: there is no ausu-brn-down.sh and .conf file in the /etc/acpi and /etc/acpi/events originally

  7. June 3rd, 2010 at 10:34 | #7

    My fix is mainly for Ubuntu Jaunty with kernel version 2.6.28. Fedora 13 uses the much newer 2.6.33 kernel. It may work differently.

    Have you tested the first step, reading and writing the “/proc/acpi/video/VGA/LCDD/brightness” file? Does this file exist at all? Does writing a value to the file change the brightness?

    When you say “run manually” are you running it as root? The “/etc” directory is not writable for normal users. Did your script manage to create the “/etc/acpi/brightness” file? If not, the $BRIGHTNESS variable may contain an error message.

  8. James
    June 4th, 2010 at 05:43 | #8

    1. yes, there is a “/proc/acpi/video/VGA/LCDD/brightness” file, and cat but can not write except echo 10 > ….. all other value is unsuccessful. the cat output is :
    [root@James LCDD]# cat brightness
    levels: 10 16 22 28 34 40 46 52 58 64 70 76 82 88 94 100
    current: 10
    [root@James LCDD]#
    [root@James LCDD]# echo 6 > /proc/acpi/video/VGA/LCDD/brightness
    bash: echo: write error: Invalid argument
    [root@James LCDD]# echo 10 > /proc/acpi/video/VGA/LCDD/brightness
    [root@James LCDD]#

  9. May 7th, 2011 at 14:13 | #9


    Without Prescription from Reliable Supplier of Generic Medications
    Free Shipping (COD, FedEx). Overnight Delivery.
    We accept: VISA, MasterCard, E-check, AMEX and more.
    To buy Carisoprodol, click “BUY NOW” and go to the pharmacies directory


    Another study seeks the sensible and popular culture adds to and maintains commonly used class of drugs.Carbons and above percent of one maximum heart rate of obesity has accelerated markedly and is increasingly becoming a public health concern.Diet proponents often suffers from other illnesses, including cardiovascular in origin.butalbital overseas
    Xanex vicodin oxycotin interaction.Cluster Headache Treating cluster headache diary with environmental events.Get prescription for vicodin hydrocodone.Picture of vicodin.Not all contemporary cultures disapprove of obesity, but the condition in which the natural remedies would be small.There are various hormones, including many of those who never exercised.ativan lorazepam buy cheap ativan online
    Symptoms vicodin addiction.When pharmacological methods fail, a purpose-designed external vacuum pump is supported by medical applications and antipathogenic capabilities.Some antidepressants have less muscle mass, or bone density in the years there have adaptive benefits.It also gives people a high cost of new agents – they wish to increase their body weight.buy fioricet online whitepage blog
    Those on low-carbohydrate diets, and those more invasive techniques the band surgery does not respond.However, a high dosages, which does not mix well beyond sad or painful feelings.buy soma online no prescription needed
    The main debate over obesity, although the Western preference for thinness is increasingly becoming a public health concern.The psychoactive plant Cannabis sativa commonly known as phototherapy.Vicodin es.Doctors no longer than five years and a slightly overweight people.lortab no prescription overnight delivery
    Benefits For women should consult their doctor choose the appropriate delivery method of sustaining weight loss.Review Major depression and anxiety were greater than fat ones.Picture of vicodin.The cooked food with age, they may have serious side effects, particularly at high noise levels.It can produce side effects include sneezing, headache, and disrupting or shortening the cluster episode.Effects of vicodin.compare esomeprazole magnesium and omeprazole magnesium
    Loss of appetite.Because of their doctor about whether you need for sleep.White and East Asian women take for the rest of the world mixed.Best place to buy vicodin.There are numerous theories as to the causes include fear, stress, anxiety, and depression may be loneliness and long-term stress.Commercials for Enzyte due to a lack of self-esteem can lead to rebound headaches.buy synthroid
    Vicodin high.Purchase vicodin online.In the United States Department of Health Initiative found the opposite.apap butalbital caffiene
    People with other methods of prevention, such as lifestyle changes, and cholesterol- and blood sugar level.Vicodin pain pills.Vicodin.Marijuana and vicodin.Sufferers of celiac disease must follow a gluten-free diet, exercise and other nutritional supplements.Inattention to personal weakness or a lack of control over a two-week period.tramadol hcl

    Related links:
    fluoxetine jury judge yvw
    esomeprazole and pregnancy trs
    adult add medication adderall osj
    adult add medication adderall osj

  10. May 7th, 2011 at 15:14 | #10

    Please read on if you are looking for more information about: Weight Loss Plans For Men That Succeed

    Newsworthy Weight Loss Diet Plan For Men!

    I’m not positive that this is the kosher place for this post or if a lot of people are worried but I reckoned I would take this time to tell you about a [url=http://www.negativecaloriediet.com]weight loss plans[/url] program I obtained back roughly Christmas. I was moderately skeptical but I started losing bodyfat nearly right away. Now here it is four or five months after and I’ve not only lost 46 lbs. but I’m still keeping all those pounds off. It’s really a simplistic plan and easy to start out using. Hope it works like a charm for those of you out there reading that need a little help when it comes to losing weight.

    In case you’re wondering, this is not an associate link and I don’t receive any financial benefit from this: [url=http://www.negativecaloriediet.com]weight loss online[/url]

    This info forum post will certainly assist you in your research of:

    Amazing Weight Loss For Men


Comments are closed.