PINE64
Will this battery-saving script cause problems? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: Will this battery-saving script cause problems? (/showthread.php?tid=17200)



Will this battery-saving script cause problems? - rp3 - 08-22-2022

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.


RE: Will this battery-saving script cause problems? - biketool - 08-28-2022

(08-22-2022, 07:00 AM)rp3 Wrote: 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.

This is very interesting, considering how well the old 2009 Nokia N900 worked on one 600mhz CPU I hope this will make things better.  If this works out a CPU throttle which would only turn on more CPUs after a few seconds of arduious work.  There is no reason we should have a hot phone most of the time and I hope this will bring down the wasted amp/hours on pinephone!

(early testing) Loading a website will start to affect an audio book playing on Cozy, that is partly because I think Cozy is all CPU and doesn't buffer audio or use hardware acceleration which also wastes electricity. The Phosh UI is as snappy as always until it tries to load something. It would usually get pretty hot loading BBC onto Firefox while taking too long; now it still takes too long but I don't care it is a phone not a laptop at least it stayed cooler but not cold. I think I will leave it on the cool setting to test wakeup for phone calls, outgoing already is tested to work.
This could be a major improvement in my PP experience!