Bug 14797

Summary: GetBrightness broken on dell latitude since sysfs battery change
Product: hal Reporter: Sebastien Bacher <seb128>
Component: haldAssignee: Danny Kukawka <danny.kukawka>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: harrydeboer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Sebastien Bacher 2008-03-03 14:42:37 UTC
The sysfs battery change broke GetBrightness on dell latitude computers. The issue is there since ubuntu using this change, http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=4541abd23fd02118a1a7f8b825aed338d2a5d638 on 0.5.10, the current git version has the same bug

$ dbus-send --system --print-reply --dest=org.freedesktop.Hal `hal-find-by-capability --capability laptop_panel`  org.freedesktop.Hal.Device.LaptopPanel.GetBrightness
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

when running this command the hald log gets the error

"[20311]: 23:39:42.424 [D] addon-dell-backlight.cpp:231: Received GetBrightness DBUS call
process 20311: arguments to dbus_message_get_args() were incorrect, assertion "(error) == NULL || !dbus_error_is_set ((error))" failed in file dbus-message.c line 1667.
This is normally a bug in some application using the D-Bus library."

Reverting the change

$ dbus-send --system --print-reply --dest=org.freedesktop.Hal `hal-find-by-capability --capability laptop_panel`  org.freedesktop.Hal.Device.LaptopPanel.GetBrightness
method return sender=:1.100 -> dest=:1.107 reply_serial=2
   int32 6

and the hald log has

"[20436]: 23:41:43.964 [D] addon-dell-backlight.cpp:231: Received GetBrightness DBUS call
[20436]: 23:41:43.968 [D] addon-dell-backlight.cpp:82: Reading 6 from the AC backlight register"
Comment 1 Sebastien Bacher 2008-03-03 15:08:45 UTC
Thanks to Sjoerd Simons who figured the issue

addon-dell-backlight.cpp filter_function() is using

	AC = libhal_device_get_property_bool (halctx, 
					     "/org/freedesktop/Hal/devices/acpi_AC",
					     "ac_adapter.present",
					     &err);

or since the sysfs changes there is no "ac_adapter.present" key there and the same err variable is used when calling dbus_message_get_args later
Comment 2 Danny Kukawka 2008-03-03 16:50:01 UTC
see patch here:
http://thread.gmane.org/gmane.comp.freedesktop.hal/10866
Comment 3 Danny Kukawka 2008-03-04 04:45:46 UTC
*** Bug 14792 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.