[Moto Maxx Android Development] Septfox:
Lots of speculation in this post, take it with the requisite amount of salt.

Might be due to both having a fairly intolerant battery controller.

Looking around, there were a fair number of people who only complained of it happening when the battery was cold; probably some batteries can't deliver their rated power under a certain temperature, and they go out of range. I'm pretty sure that li-po/li-ion batteries are only intended for use above freezing (0*C/32*F).

Result is the same: battery controller sees inadequate voltage when a large momentary load is placed on the processor (current draw spikes, causing voltage to "sag"), and either shuts off because it thinks it needs to prevent battery damage or simply shuts off because it doesn't have enough voltage to run properly.

Unfortunately, the operational voltage range is probably a hardware attribute that can't simply be patched to make it wider/more tolerant. For the Pixel, they might have just gone and added the same processor throttling that we're supposed to have, and nobody's noticed it yet because the newer Snapdragon SoCs are efficient enough to not show any real slowdown at the required underclocks.

54%...assuming you're running at ~2.7ghz your battery is doing a lot better than mine. Then again, I baked mine on a regular basis there for a while :silly:

Another pretty good draw I found while testing was Street View, but it still wasn't as aggressive as Substratum.

Yea, that was the most substantial piece of evidence that I left out: the problem goes away if the phone is plugged in. A turbo/quickcharger delivers more than enough to power the CPU.

Even a standard 2A "tablet" charger should keep up, though a saturated CPU wouldn't allow much charge to accumulate (phone only pulls up to 1.43A@5V, if I recall right).

While I'm not going to say it can't be worked around, there's only so much to be done for deficient hardware. The aforementioned CPU throttling definitely works, but the phone will get progressively slower as the battery dies.

There's one sure way to fight hardware with hardware: undervolting. The problem with that is that we have a potentially wide range of CPU binnings (0-13, average is probably 6), and even the ones under the same bin # can vary in how much voltage they need to run. Our dev knows that trying to impose a universal undervolt would likely be disastrous and only serve to undermine the kernel's reputation.

For myself, I'm using a combination of the above: I have an AutomateIt script that reduces my CPU speed at 25% (2.2ghz) and 15% (1.7ghz), and am currently undervolting by 50mv (bin 6). I haven't tested it hard yet and know it won't survive Substratum, but I feel the thresholds are a good starting point; I often have problems as I near 15%, and rarely made it past that without shutting off under normal loads. Accidentally got to 9% the other night without it dying on me :good:

If I recall right 1.7ghz is what the stock throttle is when reaching ~20%, but I honestly don't remember for sure, and I'm not going to flash stock just to find out.

----

A bit further on the Pixel, I'd like to point out that the Snapdragon 820 was plagued by heat issues until they started thermal-throttling the crap out of it and/or reintroducing proper thermal solutions. Lots of heat suggests it pulled quite some power under load, despite the considerably lower frequency compared to our 805.

The 821 used in the Pixel is supposed to be more efficient (5-10% is what I've read) than the 820, but I'm guessing it still draws quite a bit of power compared to its contemporaries. If Google didn't take this into account when choosing their power management IC, and only chose one that was "just enough" without taking into account battery degradation/operating temperatures...well, it's easy to see how they would have the same issues that we would.

Oh Google, you're supposed to learn from your experiences...*shakes head sadly*