Would disabling all cpu's except one save power on the PPP?
#1
Hi all, this is just a question to stimulate conversations and ideas, in the hope that something useful might come out of it;

I have had personal success on an original pinephone in saving significant power by disabling cpu's, and though I do not own a pinephone pro, I just thought I would post a copy of a post I have just made in the original pinephone section of the forum, in case there is anything of value in it for the pinephone pro??

Please bear in mind that I have never used a pinephone pro, and don't know how the script could be implemented, if at all, -and what problems it might cause, so this information is simply provided "as is", for research purposes for competent developers.


Here is a copy of the post:

Post Title:  Will this battery-saving script cause problems?

Just thought I would try to get some feedback on this script that I use on an older (6 months ago?) Mobian version which saves me quite a bit of battery life.


Disclaimer: though I use this myself, I don't know if there are negative side-effects, so I'm only seeking opinions from developers, I'm not recommending that anyone should try this themselves


I only use my pinephones (2gb and 3gb editions) in a very simple way, for file-management, storage and utility purposes, like a handheld computer, not even for web-browsing, and I do not have the modem enabled, though I sometimes enable wifi to update and install programs.


I use the following scripts to enable or disable all cpu's except for cpu0



Script to disable them:

#!/bin/bash
echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu2/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu3/online



Script to enable them:

#!/bin/bash
echo 1 | sudo tee /sys/devices/system/cpu/cpu1/online
echo 1 | sudo tee /sys/devices/system/cpu/cpu2/online
echo 1 | sudo tee /sys/devices/system/cpu/cpu3/online


the results are surprising, as can be seen in the powersupply app, with a quite significant reduction in power usage.


Because the reduction is while the phone is in use running programs, it gives a noticable improvement in power consumption during use, as sleep mode already works well when it is not in use. I suppose it would increase my phone-use time by 1-to-several hours depending on what was being run.


Speed is not affected hugely, though there is some effect. I suppose that most programs I use are using one just cpu anyway. I have found it far preferable to have extended use time, and to put up with an occasional second or so delay in program start times etc.


Shutdown is the only thing where I've noticed a problem, and I have to reenable the other 3 cpu's to shutdown properly, or I don't see the splash screen.


Disabling and reenabling the cpu's seems flawless, even multiple times. I can't remember it failing (although maybe it happened and I forgot...).


As stated, I do not use the modem (or gps or bluetooth), and I have no idea how they would react to this.


PS: I also tried reducing the cpu frequency, but that did not reduce power very much, and had a big impact on speed, so I did not bother to try to incorporate it into the script.


Does anyone have any feedback, opinions, warnings or suggestions in regard to doing this?


Regards everybody.
  Reply
#2
This is really interesting! I am currently on holidays and don‘t have my PinePhone Pro with me, but I‘ll test this on my PinePhone and will see if I can achieve something similar on my Librem 5.
  Reply
#3
I do this in my pplockd Python script. It does save power, but not nearly as much as suspending does. You still won't get good battery life even if you disable all but one core and scale it to 800Mhz -- speaking from experience. :^(
  Reply
#4
(08-23-2022, 10:59 AM)Subsentient Wrote: I do this in my pplockd Python script. It does save power, but not nearly as much as suspending does. You still won't get good battery life even if you disable all but one core and scale it to 800Mhz -- speaking from experience. :^(
Will your script work on the Pro? when I checked it was designed for the original and I never tried it.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Power issue with the Pro Freitag 13 8,624 04-25-2022, 06:14 AM
Last Post: LPIZ
  Guide to power off the Pinephone Pro on low battery Ulfnic 5 4,774 02-11-2022, 02:47 PM
Last Post: dexy

Forum Jump:


Users browsing this thread: 3 Guest(s)