screen brightness keys work, change is very slow

phalange

Active Member

Reaction score: 45
Messages: 130

This is a T470s, and I started with only intel-backlight installed. I wanted to assign intel_backlight incr and decr to the brightness keys, but these are apparently not exposed to X. xev(1) sees the other xf86 keys (like volume), but not screen brightness.

So I put acpi_video_load="YES" in my loader.conf, and now I the brightness keys change the brightness.

But I have to press the key about 1000 times to effect any change. It's way too fine-grained.

I tried putting
Code:
hw.acpi.video.led0.levels=10 20 [...] 100
in sysctl.conf as per acpi_video(4), but no change in granularity. With no example, I can't even tell the correct syntax (comma, space, equal, colon).

Any suggestions?
 

mjollnir

Daemon

Reaction score: 835
Messages: 1,267

hw.acpi.video.lcd0.levels is a readonly sysctl knob. It tells which levels are available. What you want is /usr/local/etc/devd/acpi-video-intel-backlight.conf:
Code:
notify 100 {
        match "system" "ACPI";
        match "subsystem" "Video";
        match "type" "brightness";
        action "/usr/local/bin/intel_backlight $notify";
};
 
OP
P

phalange

Active Member

Reaction score: 45
Messages: 130

Thanks, I tried this but no change. Still each keypress makes only a tiny change in brightness. I'm surprised that setting hw.acpi... has no effect. The man page says the defaults can be set.
 

mjollnir

Daemon

Reaction score: 835
Messages: 1,267

Thanks, I tried this but no change. Still each keypress makes only a tiny change in brightness. I'm surprised that setting hw.acpi... has no effect. The man page says the defaults can be set.
EDIT 1st unload the acpi_video(4) and then load the acpi_vendor kernel module e.g. kldload acpi_ibm. If it works, do sysrc kld_list+=" acpi_ibm" to make it persistent.
Next EDIT Maybe you have to reboot without acpi_video & with acpi_ibm; switching at runtime does not seem to work.
 
OP
P

phalange

Active Member

Reaction score: 45
Messages: 130

I do have drm-kmod. I think I needed it to get video working.
I also have a T430s with FreeBSD which works really well. That one was even easier to configure since the brightness keys showed up as XF86MonBrightnessUp / Down in X.

And circling back, my brightness keys work, I was just hoping to decrease the number of brightness levels (and key presses) to something sane. It must be 100 right now.
 

Elazar

Well-Known Member

Reaction score: 145
Messages: 370

It seems more like an issue with the keyboard driver or window manager to me.

Acpi_video doesn't care about brightness keys at all. And yes, hw.acpi.video.lcd0.levels is read-only.

FreeBSD Laptops t430s says that intel-backlight is required for the media keys.
 
OP
P

phalange

Active Member

Reaction score: 45
Messages: 130

It seems more like an issue with the keyboard driver or window manager to me.

That was my thought too. I'm using spectrwm. But using xev, there is no response to pressing Fn-F5 (brightness down) or Fn-F6 (up). The volume keys do show up. Fn-F1 -F2 -F3 all show up in xev as XF86[...]. And the F5 and F6 keys show up too, so the keys themselves are working.

And as I found, with acpi_video loaded, the brightness keys do work (Fn-F5 -F6), it just takes an extraordinary number of presses to make a change. But with or without acpi_video loaded, xev doesn't see those brightness keys.
 

mjollnir

Daemon

Reaction score: 835
Messages: 1,267

The vendors change the key scancodes every now and then... You'd need to find a tool to log the keycodes and patch the appropiate driver...
 
Top