[MyL5] First Impressions of Evergreen (Tim's story)

You would not want to wake up the phone by any traffic. On the other hand you want your traffic to be encrypted so that only the phone knows that there has been a call or message. To decrypt the traffic the phone has been active. So the phone has to be active to notify me of an incoming call or text. So let’s sleep the phone and wake it up regularly to check if there’s a call or text. Calls are real time. No caller waits 5 minutes for other phones to check for calls. I hang up calls after 10-30s. Have in mind that accepting a call also takes some time (getting your phone out of the pocket, leaving a room, plugging in a headset …). It would be unpleasant if you always miss calls. So the phone could only sleep for second(s).

I conclude from this, that in order to use it as the ip narritive phone in everyday use for parents, CEOs and tech geeks suspend is not the solution to the battery run time problem.

But I could be wrong :slight_smile:

1 Like

Yup, but that’s okay. There is a requirement that the CPU firmware and kernel can cheaply and quickly move in and out of the suspend state. When the phone gets ready to sleep, it should disconnect everything that shouldn’t send notifications. This decreases the amount of traffic it’ll have to deal with. Then it software suspends the userspace stuff. Then it goes to sleep. When network traffic comes in, it wakes just the kernel, checks to see if something in userspace needs to be made aware (usually not, usually it’s just keepalive messages), and goes back to sleep. This wake->think->sleep cycle will happen a few times per second, but if it takes 20 μs to do one interrupt process, and does that 3 times a second, you’re talking 0.000060 seconds spent not asleep per second. Depending on the wifi card used, it might not even need to wake the kernel for simple ACK/ICMP packets.

As for the 20μs number… Assuming the CPU is running at 1GHz, 20μs is 20 000 cycles, which should be enough to see if the message is going to a userspace application.

2 Likes

Thanks and best regards to you. I suppose one probably must be sincere to commit the money and time we have to the phone. The world needs better choices.

3 Likes

Hi dos, thank you for your reply, I appreciate it. When the mic input level was at its out-of-the-box value of about 50%, my test call recipients had trouble hearing me amplitude-wise as well as intelligibility-wise. With the mic input cranked up to 100%, the sound level meters appeared below over-modulation, but I will reduce the mic input level down to 80% and try with the same test people this weekend.
In my particular case, phone call quality is the most important thing I use a phone for. Everything else is a nice to have except the hard switches, which fortunately for me already work. The camera for me is not a big deal, but others undoubtedly have different use cases. I know Purism has finite resources to accomplish many software items. If there’s any way I can help elaborate on what I’m finding, feel free to direct message me.
Take care,
Tim

@ruff nearly every time posts with interesting background informationg :wink:

The average linux admin would solve the problem by just having an wake-up interval - which clearly doesn’t help in the phone-over-ip setup if you’d expect a signal when an sms-over-ip or a call-over-ip arrives.

Another approach would be the one I see for the pinephone: They start to replace (parts of) the system running on the modem and I’m wondering whether it would be possible to implement very simple services there.

E.g. the modem could listen for traffic and when some data (like voice and sms also do) matches a certain pattern it could wake up the mainboard. Very rough and there is no real concept behind it, but it would implement some kind of wake-on-lan for mobile connection.

Well, we’ll see whether you’re right or not :wink: … The pinephone does suspend already and we can follow the progress to make it last longer unsuspended.

1 Like

Thanks for the clarification :slight_smile: I am eager to see this in the real world :slight_smile:

I sort of disagree. I am going to be annoyed that I have to power off my device and lose my session because suspend isn’t there.

I just need suspend to ram. I don’t care if the only way to wake from that is the power button initially. This ability is about cutting the cycle of charging simply to use the device. In a day I’m rarely actually using my phone for more than 2 hours a day collectively. The power on time is good enough already.

Furthermore, given the state of the Linux phone right now, standby is just a reality of phone life. Ignoring it to chase down a rabbit hole that is infinitely deep (optimization work is NEVER done) is something that can be fully embraced when there is a reliable power saving scheme in place. This scheme is standby (suspend to RAM) for the time being. This gives you all the time in the world to develop a low power mode, or work on runtime optimization.

From the discussion above it seems that there could be different types of suspend that work best for different usage patterns. Maybe this could be something that could be configured in settings. I guess that the “low power mode” on phones is one of them. Maybe there could be several others.

I’m talking about suspend to RAM as used by Linux. Other kinds of PM like turning the cores and peripherals off while not in use are either already there or being worked on.

2 Likes

Wait… because I was wondering about that. I have read in several places in this forum that the CPU is working although the screen is off, and thus it consumes energy from the battery. If I manually turn of all but 1 core (leave 1 core on for handling incoming calls) using something similar to

echo 0 > /sys/devices/system/cpu/cpu2/online

will this save me power? Or the phone already does that by default?

I do agree that the energy savings are of higher priority than suspend as you say. I just wrote that it seems that nothing has been done on the suspend front so far.

1 Like

Actually this is better:

for x in /sys/devices/system/cpu/cpu*/online; do echo 0 >"$x" ; done

since cpu0 (typically) can not be turned off

@Products4People Thank you for the time taken to write that post and sharing your impressions. Wish you and all us others good luck and pleasure with our (future) Librem 5 handheld-computer.

1 Like

I think people tend to forget how rough around ALL edges were Android and iOS when they first came out. I think we, as customers first, and mostly Linux geeks second, are sometimes to harsh on people that are trying to do something new within our fav ecosystem. It might not be perfect now, but it will be soon thanks to the likes of Purism, Pine64 and the great community we all are part of.

5 Likes

My Android is still rough around the edges! :face_with_raised_eyebrow:

3 Likes

That’s a somewhat simplistic description. We do have working cpuidle in the kernel, so the cores that aren’t used shouldn’t consume much energy. However, CPU cores are far from the only things present in the whole SoC - there are many components driven by many clocks and regulators with complicated structure and dependencies. Some things can be clocked down, others can be fully disabled, for some you can even cut the power straight from the PMIC. Parts of that are already working, other parts aren’t done yet.

In my experience turning the cores off with /sys/devices/system/cpu/cpu*/online didn’t really influence power usage compared to having them still on but idle, but otoh I haven’t really made a scientific experiment and the difference may have been there but drowned in measurement noise. Anyway, you’re the root, feel free to use it if you find out it makes a difference for your use case :wink:

7 Likes

Reminds me of the time I first saw a “screen saver”, in the mid 1980’s, the engineer who was not using the computer at the moment said: “A busy computer is a HAPPY computer!”

2 Likes

You’re very welcome and your post made me realize I have been calling my Librem 5 a “Linux phone” to my social circle for the past three years. I see Purism going the “handheld computer” or “computer in your pocket” route, which is certainly true as well. I guess I’ve been hoping people would have heard of Linux but for those who never have, those other definitions may inspire their interest.

Thanks for your comment and I think that’s very true. It’s pretty sad because who would be upset at someone else who buys a new kind of phone. It’s not anything against anyone else what phone you choose to buy, for crying out loud.

Where it’s likely to make a difference is when the phone is not idle. The VRMs for the CPU have an efficiency curve, and likely the CPU cores themselves do. Hard to say if running 1 core at full speed 4x as long will use more or less energy than 4 cores 1x as long. As you say, best thing to do, if it matters, is try it and see with a particular workload.

Well, they also still mainly call it a phone. A Security & Privacy Focused Phone.
Actually, recently I thought it’s “wrong” to call Purism a Linux company or the Librem 5 a Linux phone.
Why? Well, who calls Tesla a Lithium company?

Linux is the means, but not a value in itself. One can realize that when somebody points out “But Android is also Linux!”. Then you go “But I mean… GNU/Linux… You know, pure!”
But that’s not the point.
Purism could have chosen (or could switch to) any libre OS. Of course, Linux is the natural choice.
The word Linux appears one time on the product page, and only after you scroll quite a few pages… And it makes sense. Purism doesn’t want to cater to Linux fans, but to those who desire freedom, security and privacy.
Our friends and relatives probably really don’t care much about penguins and gnus, but more and more are looking for those things, and we need to focus on them.

1 Like