Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 2010 19:54:22 -0500
From:      "J.R. Oldroyd" <fbsd@opal.com>
To:        freebsd-ports@freebsd.org
Subject:   xfce4-power-manager-0.8.5 and hal
Message-ID:  <20101128195422.522143f3@shibato.opal.com>

next in thread | raw e-mail | index | archive | help
I am nominally maintaining the xfce4-power-manager port; sadly this
is a port that gets only rare attention.  Now is one of those rare
occasions.

If someone else is willing to take this port over, that'd be ideal,
since I am not an expert on hal, d-bus or power-management/acpi stuff
in general.  Please send me an email if you're interested in taking
this on.

In the meantime...

On bringing the port up-to-date, it became clear that much of the
application's functionality is not working on FreeBSD.  Certain things
can be made to work with changes to PolicyKit.conf and sysctl settings
and these will now be documented in the port's pkg-message.

Other things are still not working.

1. The xfce4-power-manager program uses hal to obtain a list of buttons
   on which to request d-bus messages.  It gets the list using a
   FindDeviceByCapability call.  On my laptop the buttons are:

   udi = '/org/freedesktop/Hal/devices/acpi_button_0'
     button.type = 'power'  (string)
     freebsd.driver = 'acpi_button'  (string)
     freebsd.unit = 0  (0x0)  (int)
     info.capabilities = {'button'} (string list)
     info.category = 'button'  (string)
     info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
     info.product = 'Power Button'  (string)
     info.subsystem = 'platform'  (string)
     info.udi = '/org/freedesktop/Hal/devices/acpi_button_0'  (string)
     platform.id = 'acpi_button.0'  (string)
     pnp.description = 'ACPI power button device'  (string)
     pnp.id = 'PNP0C0C'  (string)

   udi = '/org/freedesktop/Hal/devices/acpi_lid_0'
     button.has_state = true  (bool)
     button.state.value = true  (bool)
     button.type = 'lid'  (string)
     freebsd.driver = 'acpi_lid'  (string)
     freebsd.unit = 0  (0x0)  (int)
     info.ignore = true  (bool)
     info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
     info.product = 'Ignored Device'  (string)
     info.subsystem = 'platform'  (string)
     info.udi = '/org/freedesktop/Hal/devices/ignored-device'  (string)
     platform.id = 'acpi_lid.0'  (string)
     pnp.description = 'ACPI lid device'  (string)
     pnp.id = 'PNP0C0D'  (string)
   
   Now, acpi_lid_0 is being omitted from the list given to
   xfce4-power-manager because it does not have an info.capability
   value of "button" - it does not have info.capability at all.  (Note
   also, that lshal lists it as an ignored device.)  Why is this, and
   what must be changed to add the capability to the lid device?

2. If I force inclusion of the lid device in xfce4-power-manager's device
   list, xfce4-power-manager then does perform the configured action on
   lid closure.

   However, if the action is to suspend the system, on resume, the
   display "brightness" is very low.  I say "brightness" in quotes,
   beecause the cursor's brightness is normal, and the backlight
   is clearly on, it is merely the contents of the display that are
   dimmed.

   Switching to the console gives dimmed console text, too.

   The brightness seems to be at a random value typically from as
   low as 5% to about 50% of normal.  Repeated suspend/resume cycles
   done using xfce4-power-manager tend to further lower the brightness
   more until it gets to be unusable.  One can still "drive blind"
   though, and things do work.

   sysctl hw.acpi.video.lcd0.brightness remains at 100 throughout.

   Killing the X server and allowing it to restart brings everything
   back to normal brightness.

   This does NOT happen on a normal suspend/resume initiated from the
   Xfce shutdown pane - this works perfectly and repeatedly here meaning
   my reset_video settings etc are OK for normal suspend/resume cycles.

   It also does NOT happen for a suspend/resume for a lid closure
   controlled by setting sysctl hw.acpi.lid_switch_state=S3... this
   also works perfectly.

   Only when the suspend is initiated by xfce4-power-manager is the
   display dimmed on resume.

   This suggests there is a problem with to xfce4-power-manager's
   brightness or backlight support which is messing up.

   Any thoughts on what might be going on here?

I'll probably add some other questions about hal/dbus in due course,
once we've resolved these.

As I said at the top, ideally it would be great if someone else could
take this one over and get it working, but in the absence of this,
and with some help, I'll get it going as time permits.

Thanks,
	-jr



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