Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203306 - gnome-extra/gnome-power-manager lists two batteries but system has only one
Summary: gnome-extra/gnome-power-manager lists two batteries but system has only one
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
: 212859 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-25 14:42 UTC by Priit Laes (IRC: plaes)
Modified: 2009-01-16 17:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
hal-0.5.10-sysfs-battery-fixes.patch (hal-0.5.10-sysfs-battery-fixes.patch,20.61 KB, patch)
2008-04-19 22:07 UTC, Gilles Dartiguelongue (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Priit Laes (IRC: plaes) 2007-12-25 14:42:54 UTC
This is with sys-apps/hal-0.5.10  USE="acpi crypt -apm -debug -dell -disk-partition -doc (-selinux)"

udi = '/org/freedesktop/Hal/devices/acpi_BAT0'
  battery.alarm.design = 3948  (0xf6c)  (int)
  battery.alarm.unit = 'mWh'  (string)
  battery.charge_level.capacity_state = 'ok'  (string)
  battery.charge_level.current = 30450  (0x76f2)  (int)
  battery.charge_level.design = 74880  (0x12480)  (int)
  battery.charge_level.granularity_1 = 1  (0x1)  (int)
  battery.charge_level.granularity_2 = 1  (0x1)  (int)
  battery.charge_level.last_full = 78970  (0x1347a)  (int)
  battery.charge_level.low = 200  (0xc8)  (int)
  battery.charge_level.percentage = 38  (0x26)  (int)
  battery.charge_level.rate = 44931  (0xaf83)  (int)
  battery.charge_level.unit = 'mWh'  (string)
  battery.charge_level.warning = 3948  (0xf6c)  (int)
  battery.is_rechargeable = true  (bool)
  battery.model = '42T4506'  (string)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = true  (bool)
  battery.rechargeable.is_discharging = false  (bool)
  battery.remaining_time = 3887  (0xf2f)  (int)
  battery.reporting.current = 30450  (0x76f2)  (int)
  battery.reporting.design = 74880  (0x12480)  (int)
  battery.reporting.granularity_1 = 1  (0x1)  (int)
  battery.reporting.granularity_2 = 1  (0x1)  (int)
  battery.reporting.last_full = 78970  (0x1347a)  (int)
  battery.reporting.low = 200  (0xc8)  (int)
  battery.reporting.rate = 44931  (0xaf83)  (int)
  battery.reporting.technology = 'LION'  (string)
  battery.reporting.unit = 'mWh'  (string)
  battery.reporting.warning = 3948  (0xf6c)  (int)
  battery.serial = '1761'  (string)
  battery.technology = 'lithium-ion'  (string)
  battery.type = 'primary'  (string)
  battery.vendor = 'SANYO'  (string)
  battery.voltage.current = 15832  (0x3dd8)  (int)
  battery.voltage.design = 14400  (0x3840)  (int)
  battery.voltage.unit = 'mV'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.product = 'Battery Bay'  (string)
  info.udi = '/org/freedesktop/Hal/devices/acpi_BAT0'  (string)
  linux.acpi_path = '/proc/acpi/battery/BAT0'  (string)
  linux.acpi_type = 0  (0x0)  (int)
  linux.hotplug_type = 4  (0x4)  (int)


and
udi = '/org/freedesktop/Hal/devices/computer_power_supply_0'
  battery.charge_level.current = 15800  (0x3db8)  (int)
  battery.charge_level.last_full = 78970  (0x1347a)  (int)
  battery.charge_level.percentage = 20  (0x14)  (int)
  battery.charge_level.rate = 0  (0x0)  (int)
  battery.current = 41868  (0xa38c)  (int)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = true  (bool)
  battery.rechargeable.is_discharging = false  (bool)
  battery.remaining_time = 5352  (0x14e8)  (int)
  battery.reporting.current = 15800  (0x3db8)  (int)
  battery.reporting.design = 74880  (0x12480)  (int)
  battery.reporting.last_full = 78970  (0x1347a)  (int)
  battery.reporting.technology = 'Li-ion'  (string)
  battery.reporting.unit = 'mWh'  (string)
  battery.technology = 'lithium-ion'  (string)
  battery.type = 'primary'  (string)
  battery.vendor = 'SANYO'  (string)
  battery.voltage.current = 15507  (0x3c93)  (int)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.product = 'Li-ion'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_0'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'power_supply'  (string)
  linux.sysfs_path = '/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0'  (string)
Comment 1 Saleem Abdulrasool (RETIRED) gentoo-dev 2007-12-25 22:34:43 UTC
Not an issue with gpm, its hal that lists it twice and thats caused by the duplication in /proc/acpi (disable your /proc/acpi, yes, Im aware, no acpid, but thats unneeded).
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2008-03-09 19:26:30 UTC
*** Bug 212859 has been marked as a duplicate of this bug. ***
Comment 3 Stafford Brunk 2008-03-10 00:04:18 UTC
(In reply to comment #1)
> Not an issue with gpm, its hal that lists it twice and thats caused by the
> duplication in /proc/acpi (disable your /proc/acpi, yes, Im aware, no acpid,
> but thats unneeded).
> 

That is all well and good but it does not fix the underlying issue.  The patches referenced in the following blog post should be applied to the ebuild so that hal can correctly coexist with both a sysfs and procfs battery interface.

Blog: http://dkukawka.blogspot.com/2008/01/hal-sysfs-acpi-batteries-fixed.html
Comment 4 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-03-10 00:29:22 UTC
in fact acpid still works even when removing the deprecated stuff from /proc that would make it stop showing 2 batteries so I can't see a good reason to keep the deprecated interfaces.
Comment 5 Stafford Brunk 2008-03-25 05:14:15 UTC
(In reply to comment #4)
> in fact acpid still works even when removing the deprecated stuff from /proc
> that would make it stop showing 2 batteries so I can't see a good reason to
> keep the deprecated interfaces.
> 

Bug 212859 has a patch that can be applied to Hal 0.5.10 to fix this problem without removing the /proc stuff.

http://bugs.gentoo.org/show_bug.cgi?id=212859
Comment 6 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-04-19 22:07:02 UTC
reopening since using only sysfs interface had issues I didn't figured out before.
Comment 7 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-04-19 22:07:42 UTC
Created attachment 150331 [details, diff]
hal-0.5.10-sysfs-battery-fixes.patch

attaching patch from the duped bug.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-04-19 22:09:32 UTC
@gentopia, hey guys, could we get your opinion on this bug+patch ?
Comment 9 gruemelmonster 2008-04-25 09:49:02 UTC
it looks like it is quiet the same patch i proposed for BUG #213469.

So yes for me it works perfectly, with and without /proc enabled additionaly to /sysfs

gnome-power-manager realizes if the Batterystatus changes, and shuts down whenever the Battery goes close to empty...

Comment 10 Stafford Brunk 2008-04-25 15:20:46 UTC
(In reply to comment #9)
> it looks like it is quiet the same patch i proposed for BUG #213469.
> 
> So yes for me it works perfectly, with and without /proc enabled additionaly to
> /sysfs
> 
> gnome-power-manager realizes if the Batterystatus changes, and shuts down
> whenever the Battery goes close to empty...
> 

It is the same patch.  Gilles just now realized what I tried to tell him before.  We needed a patch that fixes the issue.  Simply removing the /proc interfaces was a workaround and a poor one at that.  This patch works fine for me as well (as I posted earlier).
Comment 11 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-04-25 15:33:33 UTC
(In reply to comment #10)
> It is the same patch.  Gilles just now realized what I tried to tell him
> before.  We needed a patch that fixes the issue.  Simply removing the /proc
> interfaces was a workaround and a poor one at that.  This patch works fine for
> me as well (as I posted earlier).
> 

be more explicit next time ;)
Disabling /proc interface wasn't enough because the sysfs interface isn't polled which results in g-p-m not updating battery status anymore. Now I'd really like to hear from gentopia people because I don't want to break hal :)
Comment 12 Stafford Brunk 2008-04-25 15:41:16 UTC
> be more explicit next time ;)
> Disabling /proc interface wasn't enough because the sysfs interface isn't
> polled which results in g-p-m not updating battery status anymore. Now I'd
> really like to hear from gentopia people because I don't want to break hal :)
> 

I'm not sure this is going to matter much longer since hal 0.5.11 is in RC2 status.
Comment 13 Andrew Cowie 2008-04-29 02:09:17 UTC
Well, until a new Hal _is_ released, this bug is a serious piss off for anyone who has upgraded to Linux 2.6.24 and has unwittingly agreed to setting CONFIG_ACPI_SYSFS_POWER.

The upstream bug seems to be:

http://bugs.freedesktop.org/show_bug.cgi?id=13669

which is reported fixed, but obviously is not in a release yet. If that is the origin of the patch suggested, then it really would be excellent if it could be included in Gentoo's hal-0.5.10 package as a revbump.

Various other distro reports that may be relevant:

https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/194052
https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/177570
https://bugzilla.novell.com/show_bug.cgi?id=342808
http://bugs.archlinux.org/task/9605

but whatever. The workaround I just employed was to revert CONFIG_ACPI_SYSFS_POWER to 'n' but that seems a bit backward looking.

AfC
Comment 14 Stafford Brunk 2008-05-13 11:55:05 UTC
You could just apply the linked patch.  Create an overlay out of the hal 0.5.10 ebuild and add an epatch line src_unpack()
Comment 15 Priit Laes (IRC: plaes) 2009-01-16 17:13:39 UTC
I think this has been solved by now...

So closing.