GNOME Bugzilla – Bug 331458
Can't set lcd brightness
Last modified: 2006-02-18 23:17:39 UTC
I own a Toshiba Satellite M40X laptop with a Phoenix bios, which works with the omnibook[1] kernel module. lcd brightness can be set through /proc/omnibook/lcd (values between 0 and 7): echo $value > /proc/omnibook/lcd Reading the value is done by reading this file: cat /proc/omnibook/lcd I don't know how turning off the lcd display through this module. I have tried to modify /usr/share/hal/scripts/hal-system-lcd-set-brightness to add this support (and modifying permissions to give full access to /proc/omnibook/lcd), but the script is not executed (I added a flag like echo "toto" > /tmp/LCD at the beginning of the file to check that). Cheers, Julien [1] http://sourceforge.net/projects/omnibook/
You have to add support into the acpi.c file as well, as this sets up the allowed types of panel and any other properties. When you do "cat /proc/omnibook/lcd" what is returned, "brightness: 6" or just "6"? Richard.
Also, /proc/omnibook/lcd is really odd. Does /proc/acpi/omnibook/lcd also work? All the other ACPI modules are under /proc/acpi.
"cat /proc/omnibook/lcd" returns "LCD brightness: 7" (value beteween 0 and 7 - 2 spaces between ":" and the value!). This module is not an ACPI module, that is why it is in /proc/omnibook. Cheers, Julien
Created attachment 59570 [details] [review] patch to enable onmibook functionality Can you test this patch please -- it's against HAL CVS. This should make your laptop brightness "just work" with g-p-m. I'll also send it to the HAL m/l for review.
Created attachment 59603 [details] Extract of gpm debug output Unfortunately this patch does not work. I applied it to Debian hal unstable sources (version 0.5.6), but gpm debug output shows errors about "no ACPI method found" (see attachment). Is there anything I can test? Cheers, Julien
You sure hal is executing the new hal-power-* scripts? It looks to me as if the old ones are being used, i.e. they do not recognise the onmibook string. If you run hal in a seporate directory, you have to use ./run-hald.sh, and this only worked for me very recently. If thats not the prob, can you attach the lshal for your laptop_panel object please, and if you're feeling brave, find out what hal-system-lcd-set-brightness is being sent as an argument (e.g echo HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD to /tmp/log.txt) Thanks, Richard.
The new scripts are executed (as they replace the old). The problem is due to the fact that $HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD has no value. Replacing $HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD with $HAL_PROP_LAPTOP_PANEL_ACPI_METHOD works! Cheers, Julien
Ohh, you are patching an old HAL, gotcha. 2006-01-29 Richard Hughes <richard@hughsie.com> * doc/spec/hal-spec.xml.in, hald/linux2/acpi.c (laptop_panel_refresh), hald/linux/pmu.c (laptop_panel_refresh), tools/hal-system-lcd-get-brightness, tools/hal-system-lcd-set-brightness: Rename acpi_method to access_method and HAL_PROP_LAPTOP_PANEL_ACPI_METHOD->HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD for the laptop_panel device. This is required as the access method can now be "pmu" which is nothing to do with acpi. I'm not aware of this being used anywhere outside of HAL, so we should be okay changing the key name. Nice to see that it works. Richard.
ok, that is clear now. Hopefully hal authors will accept your patch! Thanks again for your quick answers. Julien
2006-02-18 Richard Hughes <richard@hughsie.com> * hald/linux2/acpi.c (laptop_panel_refresh, acpi_synthesize_hotplug_events): add handler for omnibook displays. * tools/hal-system-lcd-get-brightness, tools/hal-system-lcd-set-brightness: Add omnibook support. * hald/linux2/acpi.c (acpi_synthesize_display): don't prepend the acpi/ here as the new omnibook isn't under /proc/acpi. See http://bugzilla.gnome.org/show_bug.cgi?id=331458 for details.