After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 314182 - vaio fs215M: battery doesn't shows up
vaio fs215M: battery doesn't shows up
Status: VERIFIED FIXED
Product: gnome-applets
Classification: Other
Component: battery
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-22 17:12 UTC by Paolo Borelli
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix. (1.20 KB, patch)
2005-08-22 17:26 UTC, Allison Karlitskaya (desrt)
none Details | Review
new fix. (1.20 KB, patch)
2005-08-22 17:29 UTC, Allison Karlitskaya (desrt)
none Details | Review
fix to hal (1.83 KB, patch)
2005-08-22 17:54 UTC, Richard Hughes
none Details | Review

Description Paolo Borelli 2005-08-22 17:12:52 UTC
battstat doesn't shows my battery. However hal and acpi seems to know about it...

alarm:                   unsupported
present:                 yes
design capacity:         4400 mAh
last full capacity:      4400 mAh
battery technology:      non-rechargeable
design voltage:          12588 mV
design capacity warning: 1000 mAh
design capacity low:     400 mAh
capacity granularity 1:  100 mAh
capacity granularity 2:  100 mAh
model number:
serial number:
battery type:            LiOn
OEM info:                Sony Corp.
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            unknown
remaining capacity:      4400 mAh
present voltage:         unknown

udi = '/org/freedesktop/Hal/devices/acpi_BAT0'
  info.udi = '/org/freedesktop/Hal/devices/acpi_BAT0'  (string)
  linux.hotplug_type = 4  (0x4)  (int)
  battery.charge_level.percentage = 0  (0x0)  (int)
  battery.remaining_time = 0  (0x0)  (int)
  battery.charge_level.rate = 0  (0x0)  (int)
  battery.charge_level.last_full = -4400  (0xffffeed0)  (int)
  battery.charge_level.current = -4400  (0xffffeed0)  (int)
  battery.reporting.rate = 0  (0x0)  (int)
  battery.reporting.current = 4400  (0x1130)  (int)
  battery.rechargeable.is_discharging = false  (bool)
  battery.rechargeable.is_charging = true  (bool)
  battery.is_rechargeable = true  (bool)
  battery.charge_level.granularity_2 = 1259500  (0x1337ec)  (int)
  battery.charge_level.granularity_1 = 1259500  (0x1337ec)  (int)
  battery.charge_level.low = 5038000  (0x4cdfb0)  (int)
  battery.charge_level.warning = 12595000  (0xc02f38)  (int)
  battery.charge_level.design = 55418000  (0x34d9c90)  (int)
  battery.voltage.design = 12595  (0x3133)  (int)
  battery.voltage.unit = 'mV'  (string)
  battery.reporting.granularity_2 = 100  (0x64)  (int)
  battery.reporting.granularity_1 = 100  (0x64)  (int)
  battery.reporting.low = 400  (0x190)  (int)
  battery.reporting.warning = 1000  (0x3e8)  (int)
  battery.reporting.design = 4400  (0x1130)  (int)
  battery.reporting.last_full = 4400  (0x1130)  (int)
  battery.reporting.unit = 'mAh'  (string)
  battery.technology = 'LiOn'  (string)
  battery.vendor = 'Sony'  (string)
  battery.present = true  (bool)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  battery.type = 'primary'  (string)
  info.product = 'Battery Bay'  (string)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  linux.acpi_type = 0  (0x0)  (int)
  linux.acpi_path = '/proc/acpi/battery/BAT0'  (string)
Comment 1 Allison Karlitskaya (desrt) 2005-08-22 17:18:58 UTC
hald bug:

Present voltage is unknown.
Attempting to read current voltage will get you a -1 inside HAL.
Current charge (in mA) is multiplied by current voltage (4400 * -1 = -4400)
battstat sees negative charge and gets angry.

cc:ing Richard Hughes on this one.
Comment 2 Allison Karlitskaya (desrt) 2005-08-22 17:19:43 UTC
Richard: basically, you should check to see if the return value of the 'present
voltage' is -1 and if so then fallback to the design voltage.
Comment 3 Allison Karlitskaya (desrt) 2005-08-22 17:26:06 UTC
Created attachment 51134 [details] [review]
fix.

Richard: this is what a fix might look like.  Completely untested.

pbor: please try applying this to your HAL and see if it fixes the problem for
you.
Comment 4 Allison Karlitskaya (desrt) 2005-08-22 17:29:23 UTC
Created attachment 51136 [details] [review]
new fix.

hahah.	I should have at least tried to compile it first :)
Comment 5 Paolo Borelli 2005-08-22 17:47:23 UTC
The patch seems to work good for me.

Thanks for the quick fix Ryan! Who says filing bugs is useless... :)
Comment 6 Richard Hughes 2005-08-22 17:54:34 UTC
Created attachment 51140 [details] [review]
fix to hal

Shall I push the attached upstream? I've changed a few lines in your patch,
adding a warning and changed voltage_current to just voltage (as it's
misleading otherwise) - I think I was working on the patch simultanous to you!
Comment 7 Allison Karlitskaya (desrt) 2005-08-22 20:26:34 UTC
HAL_WARNING (("battery.voltage.current invalid, using battery.voltage.design"));

I don't think this is appropriate since there are real-world situations where
this occurs and it's not a bug.

The other warning might be appropriate, though.  I guess we'll find out if that
code is ever used for anyone.......

Push this into HAL.  I'll notify the Ubuntu guys.  I'm closing this bug now
since it doesn't really have anything to do with battstat :)
Comment 8 Martin Pitt 2005-08-23 10:57:21 UTC
Thanks for notifying me. However, this part is bogus:

+		if (voltage <= 0) {
+			HAL_WARNING (("battery.voltage.current invalid, using battery.voltage.design"));
+			voltage = hal_device_property_get_int (d, "battery.voltage.current");

In the last line you need to s/current/design/ to make it do what you want. :-)

I did that fix in the Ubuntu version.
Comment 9 Richard Hughes 2005-08-23 11:00:27 UTC
Yes, sorry, I already noticed this, and fixed the patch before I committed it to
hal. I committed the patch to fix this issue this morning, so if you try HAL
cvs, the issue should be fixed.

Richard.