ppkbbat-tools Update: Parallel Charging

After (I thought) I was “done” and made a post about ppkbbat-tools, I used the finished public version under regular day-to-day circumstances on Sxmo for the first time instead of under equal testing conditions of minimal or artificially high usage. And just as I did that, I became aware of a problem: Unlike at least Plasma Mobile, Sxmo automatically suspends while charging. Which is good since the KB battery being connected also usually is interpreted as charging since it is a power source and suspension means less power usage. But being suspended while charging also means that ppkbbat-d isn’t active during that time and so it can’t switch from PP charging to KB charging once the PP is full. So I had an idea: What if it charged both at the same time relative to their maximum capacities so that two different charge stages aren’t even necessary?

This sounds very obvious and also would be easier on the batteries since slower charging is better, but I had never thought about it before now as I was so focused on solving and circumventing my initial issue of the PP battery percentage going down even while connected to a charger because the KB has priority and will charge first. And I also apparently never in my countless tests compared charge speed between regular kernel-managed charging and ppkbbat-d charging. Which turned out to differ greatly. But I was also not sure if parallel charging would be fast enough because of the x/2 thing and because what is math (numbers please don’t hurt me no more). But I tried it and it turned out to work perfectly and improve charge time greatly, to exactly the same kernel-managed charging can achieve (4h instead of 5.5h).

Since this is now definitely very dependent on what power supply one uses and also on how much power the PP regularly consumes while charging, I both kept the old behaviour as an optional mode and made them customisable via a config file. Which unfortunately means that it might require the user to do testing for a good configuration for their setup. But that shouldn’t be too big of an issue considering the target audience of this device, and it’s only temporary until proper kernel power management exists. If you need any help using ppkbbat-d, which is very likely, the readme might not be that understandable because there are too many PPKB things floating around in my brain and because I’m sleep-deprived and I just want to be done with it instead of making it perfect, then just contact me, I’m always happy to help.