From owner-freebsd-acpi@FreeBSD.ORG Thu Apr 17 05:20:01 2014 Return-Path: Delivered-To: freebsd-acpi@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B8D2C0F for ; Thu, 17 Apr 2014 05:20:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A6E7147A for ; Thu, 17 Apr 2014 05:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s3H5K0NG079944 for ; Thu, 17 Apr 2014 05:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s3H5K02i079943; Thu, 17 Apr 2014 05:20:00 GMT (envelope-from gnats) Date: Thu, 17 Apr 2014 05:20:00 GMT Message-Id: <201404170520.s3H5K02i079943@freefall.freebsd.org> To: freebsd-acpi@FreeBSD.org Cc: From: Kevin Oberman Subject: Re: kern/173414: [acpi] ACPI battery time incorrect X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Kevin Oberman List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 05:20:01 -0000 The following reply was made to PR kern/173414; it has been noted by GNATS. From: Kevin Oberman To: bug-followup@FreeBSD.org, jb.1234abcd@gmail.com Cc: Subject: Re: kern/173414: [acpi] ACPI battery time incorrect Date: Wed, 16 Apr 2014 22:11:16 -0700 --047d7b10cf8b0fcbe604f736106a Content-Type: text/plain; charset=UTF-8 Im most systems, ACPI does not return the battery lifetime when on AC power. The actual remaining time is calculated by the EC BIOS and is calculated mostly be taking the discharge rate in mW and the current capacity in mWh. As far as I know, no OS attempts to calculate the time. It is simply read from the the EC via ACPI. When plugged in to AC, the discharge rate is 0, making the calculation undefined (division by zero). Even the remaining battery time reported by ACPI is, at best, a very rough guess as discharge rate can vary dramatically depending on system load. On FreeBSD you can see detailed information on batteries with the acpiconf(8) command. "acpiconf -i N" where 'N' is the battery number; 0 if only one battery is present. My system on battery: esign capacity: 50540 mWh Last full capacity: 46660 mWh Technology: secondary (rechargeable) Design voltage: 10800 mV Capacity (warn): 2333 mWh Capacity (low): 200 mWh Low/warn granularity: 1 mWh Warn/full granularity: 1 mWh Model number: 42T4795 Serial number: 2654 Type: LION OEM info: SONY State: discharging Remaining capacity: 96% Remaining time: 2:12 Present rate: 20460 mW Present voltage: 11652 mV And after plugging in to AC: Design capacity: 50540 mWh Last full capacity: 46660 mWh Technology: secondary (rechargeable) Design voltage: 10800 mV Capacity (warn): 2333 mWh Capacity (low): 200 mWh Low/warn granularity: 1 mWh Warn/full granularity: 1 mWh Model number: 42T4795 Serial number: 2654 Type: LION OEM info: SONY State: high Remaining capacity: 96% Remaining time: unknown Present rate: 0 mW Present voltage: 11648 mV Looking at the raw sysctl when on battery shows hw.acpi.battery.time: -1. This is normal. I don't see that ACPI -- R. Kevin Oberman, Network Engineer, Retired E-mail: rkoberman@gmail.com --047d7b10cf8b0fcbe604f736106a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Im most systems, ACPI does not return = the battery lifetime when on AC power. The actual remaining time is calcula= ted by the EC BIOS and is calculated mostly be taking the discharge rate in= mW and the current capacity in mWh. As far as I know, no OS attempts to ca= lculate the time. It is simply read from the the EC via ACPI. When plugged = in to AC, the discharge rate is 0, making the calculation undefined (divisi= on by zero). Even the remaining battery time reported by ACPI is, at best, = a very rough guess as discharge rate can vary dramatically depending on sys= tem load.

On FreeBSD you can see detailed information on batteries with the= acpiconf(8) command. "acpiconf -i N" where 'N' is the ba= ttery number; 0 if only one battery is present.
My system on batte= ry:
esign capacity:=C2=A0=C2=A0=C2=A0 50540 mWh
Last full capacity:=C2=A0=C2= =A0=C2=A0 46660 mWh
Technology:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 sec= ondary (rechargeable)
Design voltage:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 10800 mV
Capacity (warn):=C2=A0=C2=A0=C2=A0 2333 mWh
Capacity (lo= w):=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 200 mWh
Low/warn granularity:= =C2=A0=C2=A0=C2=A0 1 mWh
Warn/full granularity:=C2=A0=C2=A0=C2=A0 1 mWh
Model number:=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 42T4795
Serial number:=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A02654
Type:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 LION
OEM info:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 S= ONY
State:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 disch= arging
Remaining capacity:=C2=A0=C2=A0=C2=A0 96%
Remaining time:=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 2:12
Present rate:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 20460 mW
Present volt= age:=C2=A0=C2=A0=C2=A0 11652 mV

And after plugging in to AC:Design capacity:=C2=A0=C2=A0=C2=A0 50540 mWh
Last full capacity:=C2=A0= =C2=A0=C2=A0 46660 mWh
Technology:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = secondary (rechargeable)
Design voltage:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 10800 mV
Capacity (= warn):=C2=A0=C2=A0=C2=A0 2333 mWh
Capacity (low):=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 200 mWh
Low/warn granularity:=C2=A0=C2=A0=C2=A0 1 mWhWarn/full granularity:=C2=A0=C2=A0=C2=A0 1 mWh
Model number:=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 42T4795
Serial number:=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A02654
Type:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 LION
OEM i= nfo:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 SONY
State:=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 high
Remaining capacity:=C2=A0=C2= =A0=C2=A0 96%
Remaining time:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 unkno= wn
Present rate:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 0 mW
Present vo= ltage:=C2=A0=C2=A0=C2=A0 11648 mV

Looking at the raw sysctl wh= en on battery shows hw.acpi.battery.time: -1. This is normal. I don't s= ee that ACPI
--
R. Kevin Oberman, Network = Engineer, Retired
E-mail: rkoberman@gmail.com
--047d7b10cf8b0fcbe604f736106a--