Will this battery-saving script cause problems?
#1
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
(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!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Stability problems with 6.1 kernel Zebulon Walton 9 3,791 05-12-2023, 08:09 AM
Last Post: zetabeta
  Battery problem with a Pinephone keyboard and Mobian elode 2 2,740 12-22-2022, 07:10 PM
Last Post: acid andy
  Possible solutions to the battery draining issue? 3x5co 5 3,321 11-28-2022, 10:58 AM
Last Post: 3x5co
  DNS Problems with Mobile Data arno_nuehm 29 21,048 10-29-2022, 09:16 AM
Last Post: treebeard
  Problems after Tow-Boot Dinosaur1946 3 2,334 09-18-2022, 12:48 AM
Last Post: SpaggettiCoder
  Tow-boot problems and restoring uboot Zebulon Walton 15 10,223 08-14-2022, 11:09 AM
Last Post: shulamy
  Battery Management jsch 4 2,722 07-27-2022, 11:17 AM
Last Post: jsch
  Bookworm Navigation Enabler Script biketool 2 2,016 06-02-2022, 04:12 AM
Last Post: biketool
  Browser cog - Problems on Mobian arno_nuehm 5 4,853 02-10-2022, 03:27 PM
Last Post: pothos
  ARM Microsoft Teams-problems installing eaglebeckley 15 16,893 01-14-2022, 01:59 AM
Last Post: Tazdevl

Forum Jump:


Users browsing this thread: 1 Guest(s)