Bug #42

remaining CHARGE time is wrong in Summary mode with 2 battaries (battery status determined incorrectly)

Added by Raiko Nitzsche - 806 days ago. Updated 801 days ago.

Status:Assigned Start:
Priority:Normal Due date:
Assigned to:Tobias Roeser % Done:

0%

Category:KThinkBat for Kicker
Target version:KThinkBat 0.2.10 for Kicker
Resolution:


Description

When 2 batteries are installed and the batteries are charging, then the remaining charge time in the summary mode is worng. In single mode the correct time is shown for the battery being charged. In summary mode the remaining time depends on which battery is charged, the first or the second one. On my machine, the batteries are charged and discharged one after the other.
I attach 2 pictures showing the second bat being charged in single and sum mode. Since the second battery is being charged last, that means the first one is already full and the remaining time in both modes should be (almost) the same.
First suspicion from the numbers I see is, that the remaining time in the sum mode is calculated as "remaining capacity / current rate" from the /proc/acpi/../state file, rather than the difference of the last full cap and the remaining capacity.

ciao
Raiko

KThinkBat-Charge-Single.jpg (2.3 KB) Raiko Nitzsche -, 30.12.2007 23:16

KThinkBat-Charge-Sum.jpg (1.7 KB) Raiko Nitzsche -, 30.12.2007 23:17

KThinkBat-Single.jpg (2.3 KB) Raiko Nitzsche -, 04.01.2008 00:02

BAT0.info (433 Bytes) Raiko Nitzsche -, 04.01.2008 00:03

BAT0.state (189 Bytes) Raiko Nitzsche -, 04.01.2008 00:03

BAT1.info (429 Bytes) Raiko Nitzsche -, 04.01.2008 00:05

BAT1.state.charging (193 Bytes) Raiko Nitzsche -, 04.01.2008 00:05

BAT1.state.discharging (197 Bytes) Raiko Nitzsche -, 04.01.2008 00:05

History

Updated by Raiko Nitzsche - 802 days ago

Hi,

I investigated a bit more what leads to the wrong time calculation. In fact, it shows the calculation from the discharging mode, but not because the formula is wrong, but because the state of the batteries is determined incorrectly. In summary mode, with two batteries on an A30 it determines the batteries being discharged instead of being charged. I will attach the state and info files of the batteries for others to test.

One problem I already found, is that the isCharging() function on batinfosum.cpp is returning false as soon as one of the batteries is not charging.

if(bat->isInstalled() && (!bat->isCharging() || !bat->isFull())) {
return false;

But that is wrong at least on an A30 system. Here, the main battery is always idle as long as the second battery is either charged or discharged. This logic needs to be changed to: return true as soon as one of the batteries is charging. A quick test with that logic still didn't return the expected results because the underlying states of the single batteries were also not correct.
One example is the isOnline state. It is determined by "state != discharging", but the main battery is in status "charged", which is also not "discharging" and hence, this battery is determined as being online, while the other battery is discharging (see KThinkBat-Single.jpg).

The status determination is quite complex, especially when supporting many different notebooks that behave differently in battery usage. I think we need to walk through more examples to find a working mechanism for all.

ciao

Updated by Tobias Roeser 801 days ago

  • Status changed from New to Assigned

Also available in: Atom PDF