More nuanced battery offset

The battery offset is a good idea, but it still seems to be a linear offset to the percentage reported by the hardware.

Since the voltage is directly accessible by the OS, why not ignore the hardware reported percentage and instead calculate it based on the voltage.

The way I envision this is separate user settable voltage for 0% and 100%. For example my device will happily run for 2 hours after hitting 0% only actually cutting off when reaching around 3V under load.

It would be good to set 0% to be something like 3.2V instead of ~3.5V where the hardware seems to put it.

I know the percentage will never be accurate, but it could be more useful than it currently is.

Voltage curves were implemented, but I don’t remember if they’re already there in Jacaranda, or will they come with Andromeda. Devs certainly made improvements to the reported percentage :grin:

Further thoughts:

With the current system, applying an offset just means the battery percentage sits at 0+n% between 3.5V and the machine actually shutting off. The percentage can’t go down to 0 because the hardware reported percentage can’t go negative.

Using a voltage target would mean people get low battery warnings when they’re useful rather than just being trained to ignore them because they pop up really early.

That’s a related but different thing I think. This is less about the curve and more about the endpoints.

All I can say is it still seems to be out of whack on Jacaranda on my 34XX. The devs advice to pay more attention to the voltage than to the percentage is spot on, I’m just suggesting that the system also pay attention to the voltage.

The entire battery % calculation has been replaced for Andromeda. We’re no longer just reading the (inaccurate) # from PMIC.

1 Like

Ah cool, you’re way ahead of me then. Thanks to all devs for their amazing work.