I've asked this question numerous times on many posts and have never once has it answered, so I'm going to ask it again.
Anybody running Linux on a Pixel 3a or OnePlus 6(T) able to provide a comparison of battery life vs the battery life of an average Android device?
#mobilelinux #linuxmobile #mobian #postmarketos #pmos

@jawsh its super variable. android has fancy features to restrict background activity which we don't, but we do have fairly good suspend.

if you turn on airplane mode and but the same op6 to sleep running pmos and android, you'll get a few days in pmos but a few weeks in android (we don't reach the lowest levels of power consumption in upstream linux).

if you're using the phone actively, you'll notice a big difference based on if you close apps before putting it in your pocket. On mobile data, if you enter suspend with any tcp connections open and the server sends you data the device will wake up, android has filtering rules in place to limit this behaviour to only the push notification server.

so basically, if you use it like an android phone the battery life is noticeably worse, but if you adapt your usage patterns you can easily get a day or maybe 2 if you're very light, but the idle power consumption is a little higher.

@cas @jawsh Seems like it shouldn't be hard to make the task manager SIGSTOP apps you've selected not to run in background, SIGCONT when refocusing.

@dalias @jawsh yeah it works ok but not super reliable. freezing at a cgroup level (e.g. systemd slices) is very consistent though. then you just need to integrate with pipewire and other bits to avoid doing this to apps that you actually do want in the background, provide some API to let apps ask to keep running and you're more or less good to go?

just don't make the same mistake android did in giving apps too much control and then spending a decade fighting to get it back without breaking them.

@cas @jawsh I'd rather the user declare it than the app. Apps don't know the user's priorities or usage models. For example a lot of apps may assume I want them running to receive notifications, while I want absolutely no notifications except from Signal or Cwtch or something and thus don't care if they get to run and want to save energy.
@dalias @cas @jawsh Then again push notifications (the ones you receive when the app is not running) should be handled through a dedicated daemon, not the app itself. #UnifiedPush for example.
@bart @cas @jawsh They really shouldn't. That's compromising privacy outsourcing data handling to third parties who can't be trusted. There's no fundamental reason for it to be more efficient than a sleeping process waiting on input from a socket.
@dalias @cas @jawsh What? Not at all. With UnifiedPush you can completely self host the thing, including the push server itself.
I'm not saying we should follow the Google and Apple way, not at all.
@bart @cas @jawsh Who self hosts? The user? That's a non starter for vast majority.

@dalias @bart @cas @jawsh I'm not convinced by Push Notif. servers. Self-host is out of question for regular users. So someone has to host, pay for it and then there is privacy/trust issues.

Is it really the end of the world battery-wise if instead of polling 1 server, we poll a few of them (signal, email, etc.) ?

The various apps could subscribe to a OS-deamon that pools on their behalf and wakes the app up when needed. This deamon would be sort of a local on-device push server

@woxom98179 @dalias @bart @jawsh

the point is not to poll, you maintain a persistent TCP connection and configure hardware (specialised co-processors and/or WoWLAN capable wifi) to drop all packets except ones from the push server telling you there's a notif (and maybe you buffer it unless the priority is high enough)

idk if it's reasonable to ask signal to offer to serve thousands (more!!) persistent tcp connections, and the actual tooling to keepalive and service them.

this needs to be a dedicated service, and i think it's honestly a bit dumb to have privacy concerns. The way signal handles push anyway is that it only sends a ping that there is a message so that the phone will wake up and actually retrieve it (since messages are encrypted!), same for matrix and others. At that point it's only metadata, which can also be further anonymised.

if you're in the position where you don't trust a service hosted by the people who make your OS, you're using the wrong OS my friend. They could just as easily insert malicious software on your device itself.

@cas @woxom98179 @dalias @bart @jawsh UnifiedPush works very well for this scenario and it even has a Linux spec. I'm currently self-hosting a server but there's free servers from ntfy.sh and https://github.com/mozilla-services/autopush-rs from Mozilla.
I've been thinking about writing a background service for this but I have not yet gotten around to it. It also looks like this might not work in sleep using Cellular Networks as there's no wake on packet support there.
GitHub - mozilla-services/autopush-rs: Push Server in Rust

Push Server in Rust. Contribute to mozilla-services/autopush-rs development by creating an account on GitHub.

GitHub
@katzenmann @cas @woxom98179 @dalias @jawsh There already is #kunifiedpush by @VolkerKrause, but it doesn't wake the device yet which would be desperately needed.