Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Aug 2024 17:53:38 -0500
From:      "Marc Coquand" <marc@mccd.space>
To:        <freebsd-acpi@freebsd.org>
Subject:   acpi_ibm brightness man page example not working + fix
Message-ID:  <D3HPEMO28LSQ.3B2FYGFSMSFDB@mccd.space>

next in thread | raw e-mail | index | archive | help
Hi!

Apologize in advance if I'm reporting this wrong, this is my first post
to the mailing list and my first time contributing to Freebsd. :)

I noticed that the example in the manpage for acpi_ibm, specifically for
setting up brightness was not working for me. The specific part that did
not work for me is:

+ 0x10|0x11)
+       LEVEL=3D`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
+       PERCENT=3D`${ECHO} "${BC_PRECOMMANDS} ; \
+               ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\
+               ${CALC} | ${CUT} -d . -f 1`
+       MESSAGE=3D"brightness level ${PERCENT}%"
+       ;;
+

This was tested on my Thinkpad T480s. It makes sense that it would not
work, because manually changing the brightness with `sysctl
dev.acpi_ibm.0.lcd_brightness=3DXXX` did not do anything either on my
laptop.

Since FreeBSD 13.0, there is a new backlight utility, and with that I
was able to fix backlight on my computer by simply creating the
following devd config:

/etc/devd/acpi_ibm_brightness.conf
+ notify 20 {
+       match "system" "ACPI";
+       match "subsystem" "IBM";
+       match "notify" "0x10";
+       action "/usr/bin/backlight incr 10";
+ };
+
+ notify 20 {
+       match "system" "ACPI";
+       match "subsystem" "IBM";
+       match "notify" "0x11";
+       action "/usr/bin/backlight decr 10";
+ };

Maybe the examples in acpi_ibm manpages should use backlight utility
instead?

Alternatively, maybe the devd rules above could be added by default so
that backlight works out of the box if you load acpi_ibm? It'd be easy
to also add support for volume control with mixer. I am happy to make a
patch if this is of interest.

Sincerely,
Marc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D3HPEMO28LSQ.3B2FYGFSMSFDB>