From nobody Fri Aug 16 23:30:21 2024 X-Original-To: freebsd-acpi@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WlysM5Cvwz5TldB for ; Fri, 16 Aug 2024 23:30:31 +0000 (UTC) (envelope-from lumiwa@dismail.de) Received: from mx1.dismail.de (mx1.dismail.de [78.46.223.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WlysL2S1cz4PfQ for ; Fri, 16 Aug 2024 23:30:30 +0000 (UTC) (envelope-from lumiwa@dismail.de) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dismail.de header.s=20190914 header.b=Xl29Av9o; dmarc=pass (policy=reject) header.from=dismail.de; spf=pass (mx1.freebsd.org: domain of lumiwa@dismail.de designates 78.46.223.134 as permitted sender) smtp.mailfrom=lumiwa@dismail.de Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 09e7ce40 for ; Sat, 17 Aug 2024 01:30:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=20190914; bh=ddY+qwf9 sgk7Mu7ArU165pk9r2b53P5JBXKpiC1L7WI=; b=Xl29Av9ojYwNK4pSINtRURcM V20fWApSC3pK1XvpA2hwnrB2LdJcpn9PIw4x1xo0StONJWZNDVNAfuID47Kc47wc WTEAELv2YAQplw8+1NXL/TE5b+IGEzI5V06EC7lGTT1GPGxWoEh4v6/MUXHkePPJ /8reaq5VfWMrWPpJLIZQjTIXFIXHi89NocM9melHkacWUo0SmhLLrr9cwPrnxvXU iZuqXDObEPoeD0WHmj3rgGwLsyYcppAZlRfyLlr7PwFc+kzL5NWRP19b8Jaoabox fHL6soxC0KKzeDd94ZUooE7jfnNNyDfI4gaIwDVcSqOEOLU5WaYSa0O7zqyncg== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id e02c318c for ; Sat, 17 Aug 2024 01:30:25 +0200 (CEST) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id c13d301b for ; Sat, 17 Aug 2024 01:30:25 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 9640d50e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 17 Aug 2024 01:30:25 +0200 (CEST) Date: Fri, 16 Aug 2024 19:30:21 -0400 From: LuMiWa To: freebsd-acpi@freebsd.org Subject: Re: acpi_ibm brightness man page example not working + fix Message-ID: <20240816193021.57d16978@dismail.de> In-Reply-To: References: X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: ACPI and power management development List-Archive: https://lists.freebsd.org/archives/freebsd-acpi List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-acpi@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.10 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[dismail.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[dismail.de,reject]; R_DKIM_ALLOW(-0.20)[dismail.de:s=20190914]; R_SPF_ALLOW(-0.20)[+ip4:78.46.223.134]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[78.46.223.134:from]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:78.46.0.0/15, country:DE]; MLMMJ_DEST(0.00)[freebsd-acpi@freebsd.org]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-acpi@freebsd.org]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[dismail.de:+] X-Rspamd-Queue-Id: 4WlysL2S1cz4PfQ On Fri, 16 Aug 2024 17:53:38 -0500 "Marc Coquand" wrote: > Hi! >=20 > 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. :) >=20 > 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: >=20 > + 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}%" > + ;; > + >=20 > 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. >=20 > 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: >=20 > /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"; > + }; >=20 > Maybe the examples in acpi_ibm manpages should use backlight utility > instead? >=20 > 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. >=20 > Sincerely, > Marc >=20 The same problem is on Thinkpad T495.=20 I am using script from: https://forums.freebsd.org/threads/backlight.94548/ --=20 =E2=80=9CI hate books; they only teach us to talk about things we know noth= ing about.=E2=80=9D =E2=80=95 Jean-Jacques Rousseau=20