Brightness and dim on idle/battery do not work on Dell laptop

Bug #201433 reported by harrydb
10
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Invalid
Undecided
Unassigned
hal (Ubuntu)
Invalid
Undecided
Unassigned
libsmbios (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: hal

hal Version: 0.5.10+git20080301-1ubuntu1
gpm Version: 2.21.92-0ubuntu2

On my Dell Inspiron 1501 laptop (bios 2.6.3) changing brightness and idle/battery do not work. I narrowed it down to the following method in addon-dell-backlight.cpp not working (or the libsmbios function it calls):
    static void write_backlight (u32 newBacklightValue, dbus_bool_t onAC)

hald gives the following messages
[8587]: 16:18:39.466 [D] addon-dell-backlight.cpp:210: Received SetBrightness DBus call
[8587]: 16:18:39.466 [E] addon-dell-backlight.cpp:113: Could not access the dcdbas kernel module. Please make sure it is loaded

The 'dcdbas' module is loaded according to lsmod (and read_backlight does work).

harrydb (harrydeboer)
description: updated
description: updated
Revision history for this message
Pedro Villavicencio (pedro) wrote : Re: Dim on idle/battery does not work on Dell laptop

Thanks for taking the time to report this bug and helping to make Ubuntu better. Could you please attach the resulting log file of: gnome-power-bugreport.sh &> gpm.log to the report? You might also want to take a look to the Debugging instructions located at https://wiki.ubuntu.com/DebuggingGNOMEPowerManager for submit any other logs related to your problem.Thanks in advance.

Changed in hal:
status: New → Incomplete
Changed in gnome-power-manager:
status: New → Incomplete
Revision history for this message
harrydb (harrydeboer) wrote :

Here's the output from gnome-power-bugreport.sh The other debugging thingies don't provide more information, I already looked at them intensively for this (kinda related, but solved) bug: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/176687

I already made a quick&dirty hack to make setbrightness work and make gpm not do setbrightness on keypresses there, but it's not generic (echo the values to /proc/acpi/video/VGA/LCD/brightness and comment out two lines in gpm-brightness-lcd). It works perfectly for this machine though.

Revision history for this message
Ted Gould (ted) wrote :

I'm dropping this from GPM as it seems to be HAL issue in that it is controlling the backlight the wrong way for this laptop.

Thanks. Ted.

Changed in gnome-power-manager:
status: Incomplete → Invalid
Revision history for this message
harrydb (harrydeboer) wrote :

Setting gpm status back to new, since as I explained gpm is also affected because it needs to respect 'laptop_panel.brightness_in_hardware' which I think can't be handled properly in hal. If you have good reasons to believe otherwise, please set it back as you wish.

Changed in gnome-power-manager:
status: Invalid → New
Revision history for this message
Christian Schürer-Waldheim (quincunx) wrote :

I had a similar problem - because I had a BIOS password set. Try to unset the BIOS password if you have set one, then changing the brightness on idle should work.

Revision history for this message
harrydb (harrydeboer) wrote :

Good point since I saw in the code that password support is not implemented. Unfortunately it still does not work after unsetting the password.

Revision history for this message
harrydb (harrydeboer) wrote :

Ah but it does produce some different results, hal does not seem to receive the brightness level correctly.

hald:
[6665]: 16:24:06.793 [D] addon-dell-backlight.cpp:246: Received GetBrightness DBUS call
[6665]: 16:24:06.793 [D] addon-dell-backlight.cpp:84: Reading 7 from the BAT backlight register
[6665]: 16:24:06.799 [D] addon-dell-backlight.cpp:246: Received GetBrightness DBUS call
[6665]: 16:24:06.800 [D] addon-dell-backlight.cpp:84: Reading 7 from the BAT backlight register
[6665]: 16:24:06.938 [D] addon-dell-backlight.cpp:210: Received SetBrightness DBus call
[6665]: 16:24:06.939 [D] addon-dell-backlight.cpp:120: Wrote 0 to the BAT backlight
[6665]: 16:24:06.956 [D] addon-dell-backlight.cpp:210: Received SetBrightness DBus call

gpm:
[ac_adapter_changed_cb] gpm-manager.c:1040 (16:24:05): Setting on-ac: 0
[gpm_idle_set_system_timeout] gpm-idle.c:287 (16:24:06): Setting system idle timeout: 300
[ac_adapter_changed_cb] gpm-manager.c:1044 (16:24:06): emitting on-ac-changed : 0
[gpm_screensaver_add_throttle] gpm-screensaver.c:318 (16:24:06): adding throttle reason: 'On battery power': id 843317522
[gpm_screensaver_poke] gpm-screensaver.c:410 (16:24:06): poke
[gpm_brightness_lcd_get_hw] gpm-brightness-lcd.c:116 (16:24:06): GetBrightness returned level: 7
[gpm_brightness_lcd_get] gpm-brightness-lcd.c:318 (16:24:06): brightness changed underneith us. It is (7), we thought it was (6).
[gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:378 (16:24:06): 1. currently set brightness 1.000000
[gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:415 (16:24:06): 2. battery change by -0.300000, brightness 0.700000
[gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:453 (16:24:06): 3. idle change by -0.300000, brightness 0.700000
[gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:473 (16:24:06): 4. ambient scale 1.000000, brightness 0.700000
[gpm_brightness_lcd_get_hw] gpm-brightness-lcd.c:116 (16:24:06): GetBrightness returned level: 7
[gpm_feedback_display_value] gpm-feedback-widget.c:144 (16:24:06): Displaying 0.700000 on feedback widget
[gpm_refcount_add] gpm-refcount.c:100 (16:24:06): refcount now: 1
[gpm_refcount_add] gpm-refcount.c:101 (16:24:06): non zero, so sending REFCOUNT_ADDED
[gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:491 (16:24:06): emitting brightness-changed : 70
[gpm_brightness_lcd_dim_hw] gpm-brightness-lcd.c:267 (16:24:06): new_level_hw=4
[gpm_brightness_lcd_dim_hw_step] gpm-brightness-lcd.c:198 (16:24:06): new_level_hw=4, last_set_hw=7
[gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:155 (16:24:06): Setting 7 of 7
[gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:155 (16:24:06): Setting 6 of 7
[gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:165 (16:24:06): ERROR: Brightness level is invalid
*** WARNING ***
[gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:170 (16:24:06): SetBrightness failed!

Revision history for this message
harrydb (harrydeboer) wrote :

Setting to 'new' since there is more info.

Changed in hal:
status: Incomplete → New
Revision history for this message
Christian Schürer-Waldheim (quincunx) wrote :

What does the command "dellLcdBrightness" do (you have to run it as root)? Can you set the brightness with this program? Is the kernel module loaded?

Revision history for this message
Ted Gould (ted) wrote :

Yes, I think HAL should be handling how the brightness gets set.

Changed in gnome-power-manager:
status: New → Invalid
Revision history for this message
harrydb (harrydeboer) wrote :

About gpm, leave it invalid for now, but I guess when the hal bug is fixed it still requires gpm changes so it does not do stuff twice.

* reading:
harry@picknick:~$ dellLcdBrightness
An Error occurred. The Error message is:
Could not instantiate SMBIOS table.
harry@picknick:~$ sudo dellLcdBrightness
[sudo] password for harry:
Read Battery Mode Setting
    current: 7
        min: 0
        max: 7

* Trying to set:
sudo dellLcdBrightness -v 7
Read Battery Mode Setting
    current: 4
        min: 0
        max: 7

Write Battery Mode Setting
    current: 0
        min: 0
        max: 0

The kernel module is loaded (and GetBrightness does work with the kernel module).

Revision history for this message
harrydb (harrydeboer) wrote :

I added libsmbios to this bug because I think it is caused there. I recompiled the source with debug output enabled (apt-get source & debuild). I cannot set the brightness with the tools in libsmbios-bin either. Results are as above and I noted two other things: When trying to set the AC mode brightness I get an error (see below) and when a password (system and/or user) is set in the bios this is not detected while it should display an error and try again with a password.

sudo dellLcdBrightness -a -v 6
Read AC Mode Setting
    args are : 0x0 0x0 0x0 0x0
    res was : 0x0 0x7 0x0 0x7
    current: 7
        min: 0
        max: 7

Write AC Mode Setting
Try #0 for writeSetting()
    args are : 0x0 0x6 0x0 0x0
An Error occurred. The Error message is:
Unsupported SMI call.

Revision history for this message
harrydb (harrydeboer) wrote :

Oh yes, the brightness keys do not change the brightness anymore since some update between 8.04-beta and now. hal/gpm do get events for them though (which is good) but I do not have any means of changing the brightness now.

Revision history for this message
Alroger Filho (alroger-cafe-ti) wrote :

Same here and with some friends that are crying for help. Dell Latitude 131L here, Ubuntu Hardy lastest.

HAL daemon reports:
[9374]: 16:36:30.595 [D] addon-dell-backlight.cpp:214: Received SetBrightness DBus call
[9374]: 16:36:30.596 [E] addon-dell-backlight.cpp:116: Could not access the dcdbas kernel module. Please make sure it is loaded
16:36:30.635 [I] device.c:1894: Removing locks from ':1.344'

dellLcdBrightness reports:
root@dellturion:~/Desktop# sudo dellLcdBrightness -a -v 7
Read AC Mode Setting
    current: 7
        min: 0
        max: 7

Write AC Mode Setting
An Error occurred. The Error message is:
Unsupported SMI call.

I have already removed any BIOS passwords, just to make sure.

I can set the brightness via /proc/acpi/video/VGA/LCD/brightness normally. Why doesn't HAL just use the ACPI way, in case the new ways don't work?

harrydb, can you post your quick'n'dirty patches for us?
Shouldn't it be as simples as adding another elif in /usr/lib/hal/scripts/linux/hal-system-lcd-set-brightness-linux for the right acpi path and brightness steps? I can't figure out where these variables in hal come from, like $HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD. Can anyone help?

Revision history for this message
Alroger Filho (alroger-cafe-ti) wrote :

Hey, did you know it works good on Fedora8 and 9?
If I only knew what to look for...

Revision history for this message
harrydb (harrydeboer) wrote :

I tried fedora 9 and indeed the brightness keys work, but not correctly! (No dim on idle etc). It worked on ubuntu this way during hardy's alpha's (stopped working somewhere around alpha 6/beta). For this to work correctly all brightness changes should be done by hal so dim on idle/battery can function correctly. In Fedora this did not work (not for me at least) just as in ubuntu.

The situation right now is as follows:
- brightness keys are recognised by hal and the correct function in addon-dell-backlight is called -> correct
- brightness is not changed hardwarematicly -> correct (or by a kernel driver that catches the keys or something like that)
- the libsmbios call to change brightness does not seem to work -> fail (try the command line thingie).

Revision history for this message
harrydb (harrydeboer) wrote :

updated incorrect assumption in bug description, reflecting my post above.

description: updated
Revision history for this message
Mario Limonciello (superm1) wrote :

It's possible that your laptop model doesn't support the necessary SMI calls, and that is exactly what it is sounding like the issue is.

Revision history for this message
Mario Limonciello (superm1) wrote :

Closing the libsmbios task. The calls are correct, but not all Dell BIOSes support them.

Changed in libsmbios:
status: New → Won't Fix
Revision history for this message
Alroger Filho (alroger-cafe-ti) wrote :

If it doesn't work then don't use it! How do I put back the hal version that used to work?

Revision history for this message
Alroger Filho (alroger-cafe-ti) wrote :

Sorry, I meant: why not ACPI, instead of the new libsmbios?

Revision history for this message
Alroger Filho (alroger-cafe-ti) wrote :

It works in Ubuntu Intrepid Alpha6!!! Great!

Revision history for this message
harrydb (harrydeboer) wrote :

somewhat... it jumps multiple levels at a time and slows down the pc a lot, for me at least. But it is definitely improvement!

Revision history for this message
Daniel T Chen (crimsun) wrote :

How about trying 9.04 with linux-image-2.6.28-1-ub-generic?

Changed in hal:
status: New → Incomplete
Revision history for this message
harrydb (harrydeboer) wrote :

Dim on idle/battery works fine now (on intrepid), only when using the brightness keys the events are sometimes repeated more than once (I understand this is already known?). I also do not experience slowdowns anymore. For me this bug is now solved.
I cannot afford to try the testing release right now to see if that solves all.

Revision history for this message
Victor Vargas (kamus) wrote :

This bug report is being closed due to your last comment regarding this being fixed with an update. Thank you again for taking the time to report this bug and helping to make Ubuntu better. Please submit any future bugs you may find.

Changed in hal (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.