Hacker News new | ask | show | jobs
by chasil 498 days ago
Unless your Pixel 4a is from Verizon (locked), keep it.

Unlock the bootloader, then install LineageOS, MindTheGapps, and Magisk.

Once you have Magisk stabilized, install the Advanced Charging Controller, and configure it to halt charging at 80%.

That should solve your problems, and turn the updates back on. I don't think there is a way to make Google Pay work in this configuration, which is a drawback.

I can put all the URLs here if you ask.

Edit:

https://lineageos.org/

[I did not remember that Lineage hosts gapps images]

https://wiki.lineageos.org/gapps/

[IIRC, the APK is renamed to a ZIP and flashed with recovery, then name it back and install the app]

https://github.com/topjohnwu/Magisk/releases/tag/v28.1

https://magiskmanager.com/

https://github.com/VR-25/acc/releases/tag/v2023.10.16

10 comments

Problem with pretty much every modern battery-powered device is that battery is flogged to near death at every charge. From @marcan's mastodon post, Pixel 4a's battery is charged to 4.45V:

  qcom,max-voltage-uv = <0x43e6d0>;
This is completely insane, and it's a small miracle that this phone didn't follow Note7's fate.

As for charge limiting... limit at 80% is an okay workaround (certainly better than no limit at all!), but it's far from perfect. Namely, with this approach, charge controller chip doesn't know cut-off is coming, and will shove several amperes into the battery until last second, thus overshooting safe voltage level. This wears the battery (less so than with no limit, but still more than necessary).

Battery charging limiting should be done by voltage: this way, controller chip knows where to stop, so it makes soft taper-off at the end of charge cycle, by gradually nudging current down to stay within voltage envelope.

Charging profile could be observed from a rooted adb console:

  grep NOW <$(find /sys/devices/platform \
  | grep battery/uevent$ | head -1)
(depending on phone model and firmware, some tweaking might be required to find/grep to get the right battery status file)
Thank you for sharing your expertise.

It seems to be unbelievable that none of this has become part of AOSP.

I should have a battery setting that optimizes either for battery longevity, or for maximum power delivery. These settings should incorporate best practice, such as you have outlined.

The last stable ACC release was in late 2023, and it appears to remain the best battery management tool for longevity.

Why is this so?

I rewrote your script slightly, and ran it on my Pixel 3.

  find /sys/devices/platform |
  grep battery/uevent$ |
  head -1 |
  xargs grep NOW

  POWER_SUPPLY_VOLTAGE_NOW=3955800
  POWER_SUPPLY_CURRENT_NOW=-222656
Also:

  find /sys/devices/platform -name uevent |
  grep battery |
  head -1 |
  xargs grep NOW


  find /sys/devices/platform \
    -path '*/battery/*' \
    -name uevent |
  head -1 |
  xargs grep NOW
> I should have a battery setting that optimizes either for battery longevity, or for maximum power delivery.

Newer Pixels have a concept of "bed time" and charge slower overnight, for battery health.

This is also present in my 4a, perhaps it's a feature of Android 13.
>Once you have Magisk stabilized, install the Advanced Charging Controller, and configure it to halt charging at 80%.

That will reduce future wear, but won't suddenly make the battery better. If anything it'll make the battery even worse, at least in the short term.

Installing Lineage by itself will drastically reduce power consumption on many devices, as vendor bloat is wiped. A net gain is possible, even with ACC 80% in place.

With a Pixel, there is less bloat, so it is less of a factor with this particular device. However, you don't get the full suite of Chrome/Maps/Gmail/Drive/Photos/etc. installed by default, and what you have not installed will not drain your battery.

In any case, one would hope that Google's safeguards are equaled by ACC.

My 4a went from 3 day battery life to less than a day, immediately after the "update".
This seems surprisingly high to me, unless you're constantly on extreme power saving mode. I liked the 4a and still have it in a drawer, but replaced it partly because I couldn't order a new screen and the battery life was frustratingly terrible after a while
It doesnt have to be on powersaving- just by leaving wifi and bluetooth off I would regularly get 3 days on a charge.

Data is cheap where I live, but also I dont use my phone to stream music/video.

wifi uses more power than cell data?
It seems to in my house - possibly the wifi signal is not strong enough where I leave my phone and it is constantly searching. I also find that on wifi data, apps constantly update and sync themselves - they don't do this on metered network data.

  > https://magiskmanager.com/
WARNING: this is not the official site for Magisk [0], keep to the actual GitHub hosted repo and builds [1].

[0]: https://www.xda-developers.com/psa-magiskmanager-com-not-off...

[1]: https://github.com/topjohnwu/Magisk

> I can put all the URLs here if you ask.

I'm not who you replied to but can you please do? I've been wanting to make a LineageOS device for a while but was being cheap (and it wasn't high enough priority). But maybe now there will be a lot of cheap Pixel 4a on eBay in the near future and I'll go for it.

Just be careful that you do not get anything sold by Verizon, as these unfortunates do not allow bootloader unlocking.

I also remember some rumor that all Pixels must access WiFi before they will allow bootloader unlocking in the developer options.

That defeats the whole point of a Pixel, the camera app.
A URL can be found below to load it back into your custom ROM, and supposedly the same camera can be found in the Play store.
>>> Unlock the bootloader, then install LineageOS, MindTheGapps, and Magisk.

Unless you have researched this and are comfortable doing these things, this is not something that's easy to do. I bricked my OnePlus Nord100 not once, but TWICE trying to install Ubuntu Touch.

It happened because the Nord100 shipped with a more current Android version (11.xx) and Ubuntu can only be installed over two very specific versions (10.xx) on the Nord. I bricked it once thinking it could be installed over the 11 version. Then I had to figure out how to reflash the phone back to the 10 version, then run the UBports installer.

I was lucky because I bought the Nord100 for like $50 on ebay so it wasn't a big deal if I wasn't able to unbrick the phone, but if you do this to a more expensive phone, the consequences are a lot more expensive.

I love Lineage OS and have it running on a Pixel 4XL, but my experience flashing and re-flashing the phone several times, and all the work I went into just to get UT running on that phone, really dampened my enthusiasm to ever do this again.

I've loaded Cyanogenmod on the HTC Incredible 1 & 2, and the BN Nook color.

I've loaded Lineage on the Nexus 6, Oneplus 3a & 5 & Nord N200, the original Pixel, and the Pixel 3a XL.

Pixels are the most forgiving, and the hardest to brick. They are also the best for VoLTE.

I also have an N100, which is not supported by Lineage.

Do I misunderstand what Ubuntu Touch is? I thought it was its own thing whose only relation to Android was the BSP, not some type of layer on top of Android. If so then it seems irrelevant and unfair to bring up w/r/t the well-tested Android-to-different-Android path.
Unless your phone has full mainline kernel support (pinephone, librem 5, pocophone f1 etc...), All these Linux on phone projects mostly use Android system services (init, surfaceflinger, rild etc..) to talk to the device hardware, without bringing up the Android UI.

They do this so that they don't have to reverse engineer and write the hardware drivers from scratch and simply use Android's user space drivers for them.

I haven't been involved in that domain for a while, but it basically meant reusing the contents of your device's /system and /vendor partitions and simply installing the Linux OS into /data.

Thanks for the info! My pixel has already applied the update unfortunately - any ideas if switching to lineageos is still helpful in that case?

They’re not offering the free battery replacement in Aus otherwise I’d do that - hard to be sure that getting a new battery in a local repair shop wouldn’t be similarly affected by the new limits (presumably some sort of blacklist on serial numbers?).

Installing Lineage should help battery life. @marcan[1] dissected the new update and puts the blames an overlay in the new kernel that changed the charge voltage.

1. https://social.treehouse.systems/@marcan/113914172433692339

What the hey, let's do it...

Random Google engineer on personal machine trashes Pixel 4a batteries in GPL violation

https://social.treehouse.systems/@marcan/113914172433692339

"So... this was built by a random engineer on their personal machine."

How did this random engineer command that all previous firmware images be taken offline?

Alternate ROMs look much safer right now.

Should this be submitted to HN separately?

The new battery behavior is probably just some POSIX userspace process running under Linux, or perhaps some kernel tweak.

The whole of userspace will be replaced when LineageOS reformats all of the partitions.

It is possible that the new battery behavior has been injected into some deeper part of the hardware, but LineageOS is unlikely to make that worse.

> Once you have Magisk stabilized, install the Advanced Charging Controller, and configure it to halt charging at 80%.

If we install LineageOS, should we worry about Google's firmware update? Then why bother with all these steps?

I think the comment is responding to the fears of..

"My most charitable view is that Google have found a major fault with the Pixel 4a battery and want to mitigate a repeat of the Galaxy Note 7 without saying it outright and causing a panic."

These lithium batteries usually last longer when you don't fully discharge them and fully charge them regularly. 20-80%. No idea why manufacturers don't just call that range as 0-100%.

Why go all through that pain when graphene OS gives you a straightforward install?
Because the 4a is on extended support, is not recommended, and cessation can happen any time now?

https://grapheneos.org/faq#supported-devices

Is that different on lineageOS or just not as clearly stated?
LineageOS devices are subject to desupport at any time, when the maintainer(s) makes the decision to retire it (and no volunteers appear to replace the maintainer).

With the sunset of 3g, many devices that were not capable of 4g were retired.

That being said, Lineage still does support several Pixels that Graphene has desupported. In fact, I am typing this on a Pixel 3a XL which is in this category.

The original Pixel, Pixel 2 and 2XL are still supported by LineageOS:

https://wiki.lineageos.org/devices/#google

Graphene has explicitly removed everything prior to the Pixel 4, including:

Pixel 3a XL (bonito), Pixel 3a (sargo), Pixel 3 XL (crosshatch), Pixel 3 (blueline), Pixel 2 XL (taimen), Pixel 2 (walleye), Pixel XL (marlin), Pixel (sailfish).

Edit: This extended support does come at some risk. The chipsets used in Android can sometimes have showstopper bugs. Sometimes, these cannot be patched, although maintainers will go to great lengths to find solutions. The "firmware age" is reflected in the "vendor security patch" date in Lineage - the older, the more dangerous.

Graphene largely does not allow this.

And then you can't access bank or government apps anymore... I used to root my phone, it's not worth it anymore
Play Integrity Fix usually solves that. Be sure to leave one star reviews for apps that mistreat you in this way.

https://github.com/chiteroman/PlayIntegrityFix

The Wells Fargo app runs on my Oneplus 5/Lineage. It is not rooted (with Magisk), but root adb is offered in developer settings.

Cisco Duo also runs on this device.

This will be a decision for the app vendor, but I'd rather get monthly updates than maintain a locked bootloader.

Uber has done some strange things.