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