Wouter Verhelst <wou...@debian.org> writes: > On Fri, Apr 24, 2015 at 10:07:36PM +0200, Marco d'Itri wrote: >> > I'm not sure, if the "acpi" command line utility is that useful which >> > would warrant having it installed by default. The attached patch drops >> > it as well. Incidentally, this was also suggested for the laptop-task, >> > which still pulls it in. >> The acpi package is *totally useless* and should be immediately dropped >> from hw-detect and task-laptop. > > Disagree. > > - Acpi is a useful command-line tool to easily read values of things > like battery life expectancy and other ACPI power-related values, > without having to dig through files in /sys.
I'd have to disagree after trying it out just now. For command like usage I am used to looking at the sysfs files, doing something like bjorn@nemi:~$ grep . /sys/class/power_supply/BAT0/{energy_,voltage_,power_,alarm}* /sys/class/power_supply/BAT0/energy_full:39480000 /sys/class/power_supply/BAT0/energy_full_design:43200000 /sys/class/power_supply/BAT0/energy_now:38980000 /sys/class/power_supply/BAT0/voltage_min_design:10800000 /sys/class/power_supply/BAT0/voltage_now:12455000 /sys/class/power_supply/BAT0/power_now:0 /sys/class/power_supply/BAT0/alarm:1964000 which gives me a nice overview over the battery status. Note that the design values (both capacity and voltage) match the DMI data from the battery: nemi:/tmp# dmidecode -t 22 # dmidecode 2.12 SMBIOS 2.4 present. Handle 0x0034, DMI type 22, 26 bytes Portable Battery Location: Rear Manufacturer: SANYO Name: 42T4643 Design Capacity: 43200 mWh Design Voltage: 10800 mV SBDS Version: 03.01 Maximum Error: Unknown SBDS Serial Number: 0097 SBDS Manufacture Date: 2014-03-03 SBDS Chemistry: LION OEM-specific Information: 0x00000000 I agree that acpi would have been a useful tool if it provided the same (or equivalent) information without having to know which sysfs attributes to look at. But it doesn't. The view it presents is confusing and plain wrong: bjorn@nemi:~$ acpi -i -b Battery 0: Unknown, 98% Battery 0: design capacity 3468 mAh, last full capacity 3169 mAh = 91% So what happened to the capacities presented by the battery firmware? Looks like they were "converted" from their native µWh values to mAh, apparently using the current voltage for the conversion. Anyone remotely familiar with battery charging will see the problem... The rest can study the numbers after unplugging AC (repeated a number of times with a second or two between to help illustrate the point): bjorn@nemi:~$ acpi -i -b Battery 0: Discharging, 98%, discharging at zero rate - will never fully discharge. Battery 0: design capacity 3468 mAh, last full capacity 3169 mAh = 91% bjorn@nemi:~$ acpi -i -b Battery 0: Discharging, 98%, 03:00:13 remaining Battery 0: design capacity 3509 mAh, last full capacity 3206 mAh = 91% bjorn@nemi:~$ acpi -i -b Battery 0: Discharging, 98%, 02:41:10 remaining Battery 0: design capacity 3523 mAh, last full capacity 3219 mAh = 91% bjorn@nemi:~$ acpi -i -b Battery 0: Discharging, 98%, 02:33:16 remaining Battery 0: design capacity 3530 mAh, last full capacity 3226 mAh = 91% bjorn@nemi:~$ acpi -i -b Battery 0: Discharging, 98%, 02:32:43 remaining Battery 0: design capacity 3524 mAh, last full capacity 3221 mAh = 91% So why do both capacities *increase* after unplugging AC? You would expect them to be stable. The problem is of course that the voltage decreases. And it will continue to do so, although not at the alarming rate we see here, until AC power is plugged in again. Where does this leave acpi? Lying. The battery design capacity was never 3468, 3509, 3523, 3530 or 3524 mAh. It is 43200 mWh. No need to mess with that. acpi does indeed look like a useless tool, not even usable by the few of us wanting to look at this stuff from the command line. Bjørn -- To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/87bni7gwfs....@nemi.mork.no