You are not logged in.

#1 2012-03-07 00:30:53

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

brightness control: acpi_video0 or intel_backlight0?

I've been using laptop mode tools to automatically manage brightness on my laptop. I also let KDE further reduce the brightness when the battery is "low". I have noticed that if I need to manually alter the brightness for some reason using the function keys, things don't work quite as they should. The correct function keys do control brightness but they control it in very large steps so that it is not possible to get very much control over the brightness in this way. In particular, I can't use the function keys to get back my "normal" (on AC) brightness because that brightness level is between steps.

So I thought I should read some of this again and started looking at https://wiki.archlinux.org/index.php/La … brightness. According to the wiki, the directory under /sys/class/backlight indicates the graphics card controlling the brightness. In particular, it says that acpi_video indicates an ATI card is in control and intel_backlight indicates an intel card is in control.

ls /sys/class/backlight/
acpi_video0@  intel_backlight@

This is a bit confusing because I definitely do not have an ATI graphics card. Nonetheless, laptop mode tools uses acpi_video0 to control the backlight and this definitely works. Moreover, the numbers for this which are on a completely different scale to those used by intel_backlight apparently get translated correctly so that a 15, say, sets maximum brightness even though for intel the max is 4882. The scales aren't linear in some sense, though, since 12 on the one is 2412 on the other. (Unless intel starts at -something!)

Is there something wrong somewhere which is confusing things and causing acpi_video0 to be created as well as intel_backlight? I figured I should try to understand this before trying to solve the function key issue!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-03-08 01:17:24

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: brightness control: acpi_video0 or intel_backlight0?

OK. So some googling suggests the wiki is just wrong on this one. Plenty of people seem to have acpi_video for backlight without having ATI cards.

So I'll assume that bit is fine.

So is there a way to make the function keys use finer-grained control for changing brightness? At the command line, I can get from 0 to 15 using the acpi_video0 interface. Is there a way to replicate this for the function keys?

I do have thinkpad_acpi installed.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2012-03-09 07:49:57

patriotpie
Member
Registered: 2008-09-21
Posts: 6

Re: brightness control: acpi_video0 or intel_backlight0?

I have a similar experience, I use an Acer Aspire with an intel_backlight, and my /sys/class/backlight/acpi_video0/brightness runs from 0 to 9. So, I use intel_backlight instead to get finer control over brightness. You can add cases in your /etc/acpi/handler.sh file to control your brightness keys. Add the following to the end of /etc/acpi/handler.sh:

BRIGHTNESS_FILE="/sys/class/backlight/intel_backlight/brightness"

case "$1" in
    video/brightnessdown)
        brightness=`cat $BRIGHTNESS_FILE`
        brightness=`expr $brightness - 75`
        echo $brightness > $BRIGHTNESS_FILE
    ;;

    video/brightnessup)
        brightness=`cat $BRIGHTNESS_FILE`
        brightness=`expr $brightness + 75`
        echo $brightness > $BRIGHTNESS_FILE

esac

(sorry for sloppy script, I only know enough to get by)
Since intel_backlight runs from 0 to 976 (on my machine), I gain greater control by incrementing it by 75 than if I were to increase acpi_video0's brightness by just 1.

Offline

#4 2012-03-09 10:13:16

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: brightness control: acpi_video0 or intel_backlight0?

cfr wrote:

OK. So some googling suggests the wiki is just wrong on this one. Plenty of people seem to have acpi_video for backlight without having ATI cards.

ACPI is not something specific to AMD. The wiki is not wrong, you read it wrong tongue It says that you'll have acpi_video if you have an AMD card, not the other way around.

Offline

#5 2012-03-09 23:05:55

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: brightness control: acpi_video0 or intel_backlight0?

Raynman wrote:

The wiki is not wrong, you read it wrong tongue It says that you'll have acpi_video if you have an AMD card, not the other way around.

Actually, it depends which bit of the wiki you read. I'd been reading https://wiki.archlinux.org/index.php/La … brightness:

To change your display brightness, first check /sys/class/backlight:

   # ls /sys/class/backlight/
   intel_backlight

So this particular backlight is managed by an Intel card. Keep in mind that different cards might manage this differently! It is called acpi_video0 on an ATI card, for instance.

I grant that this is logically consistent with the claim that it is also called acpi_video0 on other graphics cards but I don't think it is consistent with having acpi_video0 listed as well as intel_backlight for intel cards!

@patriotpie

What bothers me is not so much that the acpi levels are insufficiently fine-grained. I can see that and might want to fiddle there, too. My main issue right now is that the function buttons to control brightness are much less fine grained than even the acpi interface. That runs from 0 to 15 on my machine but it is not possible to hit 12, for example, using the function keys because 12 is "in between" two levels. The function keys change the brightness in enormous steps. For now, I'd be more than happy to get them to recognise the full 15 offered by acpi_video0!

Last edited by cfr (2012-03-09 23:07:11)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-03-11 01:34:02

patriotpie
Member
Registered: 2008-09-21
Posts: 6

Re: brightness control: acpi_video0 or intel_backlight0?

cfr wrote:

That runs from 0 to 15 on my machine but it is not possible to hit 12, for example, using the function keys because 12 is "in between" two levels. The function keys change the brightness in enormous steps. For now, I'd be more than happy to get them to recognise the full 15 offered by acpi_video0!

Sorry, I didn't realize you were having this problem - my system is completely unresponsive to changes in acpi_video0 I ignore it and rely on modifying intel_backlight for lm-tools, fn keys, etc. I don't know why only certain levels of acpi_video0/brightness would be recognized.

Offline

Board footer

Powered by FluxBB