Date: Thu, 17 Apr 2014 05:20:00 GMT From: Kevin Oberman <rkoberman@gmail.com> To: freebsd-acpi@FreeBSD.org Subject: Re: kern/173414: [acpi] ACPI battery time incorrect Message-ID: <201404170520.s3H5K02i079943@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/173414; it has been noted by GNATS. From: Kevin Oberman <rkoberman@gmail.com> 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 <div dir=3D"ltr"><div><div><div><div>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.<br> <br></div>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.<br></div>My system on batte= ry:<br> esign capacity:=C2=A0=C2=A0=C2=A0 50540 mWh<br>Last full capacity:=C2=A0=C2= =A0=C2=A0 46660 mWh<br>Technology:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 sec= ondary (rechargeable)<br>Design voltage:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 10800 mV<br>Capacity (warn):=C2=A0=C2=A0=C2=A0 2333 mWh<br>Capacity (lo= w):=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 200 mWh<br>Low/warn granularity:= =C2=A0=C2=A0=C2=A0 1 mWh<br> Warn/full granularity:=C2=A0=C2=A0=C2=A0 1 mWh<br>Model number:=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 42T4795<br>Serial number:=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A02654<br>Type:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 LION<br>OEM info:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 S= ONY<br>State:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 disch= arging <br>Remaining capacity:=C2=A0=C2=A0=C2=A0 96%<br>Remaining time:=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 2:12<br> Present rate:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 20460 mW<br>Present volt= age:=C2=A0=C2=A0=C2=A0 11652 mV<br><br></div>And after plugging in to AC:<b= r>Design capacity:=C2=A0=C2=A0=C2=A0 50540 mWh<br>Last full capacity:=C2=A0= =C2=A0=C2=A0 46660 mWh<br>Technology:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = secondary (rechargeable)<br> Design voltage:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 10800 mV<br>Capacity (= warn):=C2=A0=C2=A0=C2=A0 2333 mWh<br>Capacity (low):=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 200 mWh<br>Low/warn granularity:=C2=A0=C2=A0=C2=A0 1 mWh<br= >Warn/full granularity:=C2=A0=C2=A0=C2=A0 1 mWh<br>Model number:=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 42T4795<br>Serial number:=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A02654<br> Type:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 LION<br>OEM i= nfo:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 SONY<br>State:=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 high <br>Remaining capacity:=C2=A0=C2= =A0=C2=A0 96%<br>Remaining time:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 unkno= wn<br>Present rate:=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 0 mW<br>Present vo= ltage:=C2=A0=C2=A0=C2=A0 11648 mV<br><br></div>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<br> -- <br><div><div><div><div><div><div dir=3D"ltr">R. Kevin Oberman, Network = Engineer, Retired<br>E-mail: <a href=3D"mailto:rkoberman@gmail.com" target= =3D"_blank">rkoberman@gmail.com</a><br></div> </div></div></div></div></div></div> --047d7b10cf8b0fcbe604f736106a--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404170520.s3H5K02i079943>