Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,786,551 Members 37,573 Now Online
XDA Developers Android and Mobile Development Forum

{Script} CPU1 disabler while in sleep!!! The Battery Saver Mod!

Tip us?
 
eugene373
Old
(Last edited by eugene373; 3rd July 2012 at 04:40 PM.)
#1  
eugene373's Avatar
Recognized Developer - OP
Thanks Meter 7,299
Posts: 5,626
Join Date: Aug 2009

 
DONATE TO ME
Default {Script} CPU1 disabler while in sleep!!! The Battery Saver Mod!

Script Version!
This time I present to you a script that will in theory (and so far for me, in reality) save us some battery without having to risk our hardware with undervolting! I present to you...

CPU Sleeper
Quote:
Honestly the Script can be made to work with any Dual Core / Quad Core! The Only Problem is you need to be Rooted!
~ Currently the issue with CM9, is that the boot becomes incomplete while in init.d folder without Modification to the sysinit..

~ however, with any rooted device you can download the script & continue to use it via a script manager app on every boot.

~ With the Script Manager App, this script virtually can run on any Multi-Processor CPU

Hope that clears things Up,
~~Eugene
What is it?
Its a fairly simple script that will put CPU 1 OFFLINE when the screen turns off. Once the screen comes back on, it will allow CPU 1 back ONLINE.

How does it work?
Since we have dual core CPUs, we have a CPU 0 and a CPU 1, core 1 and core 2, while the screen is off we really only need to have 1 core active, this script will make sure CPU 1 shuts off while the screen is off, then resumes normal usage when the screen comes back on.

WARNING! READ THIS!
This script relies on init.d OR script manager! CM9, for some reason, tends to run this at the exact same time it runs some other script (I forget atm which) and it will clash, causing no boot! CM9 users MUST use the script manager version install! Flex Reaper appears to work fine with it as init.d. I strongly urge you to use the script manager version of this, NOT the flashable version. Always make a nandroid backup before modifying the system, including this!

Instructions
Available in 2 versions, script only version which you can place wherever you want and run however you want, or a CWM/TWRP flashable zip that will place the file for you in /system/etc/init.d and set permissions.

Version 1: Flashable
Same as any of my flashable releases, I did most of the work for you!
Make a full backup
Download to external SD card
Install from SD card
Pick the cpu sleeper zip file
it'll be almost instant
reboot
Shouldn't be any need to clear caches or anything like that.

Version 2: Script only
This can be run in 2 ways, via init.d support, or via script manager. Both are pretty similar, and can be done a number of ways, however this is the basis of how.

Init.d supported kernel:
Make a backup!
Download the script file, making sure no extensions get added onto the file. Copy the file to /system/etc/init.d and set the permissions to the following:
XOX
XOX
XOX
Once done, reboot the system, and it will take effect when your system is finished rebooting.

Script Manager
This method is probably the better method, and should work with any kernel/ROM. Download the script file, making sure no file extensions get added, and copy it to /system/etc. Set the file permissions to:
XOX
XOX
XOX
Once done, load up script manager, select browse as root (if it isn't already set from the crossix mod method in the guide) then browse to /system/etc and select the script file S98cpu_sleep, then select ROOT and BOOT options. After this is set, reboot system.


What do I do if I can't boot after using this?
You made that backup, right? Ok, then here is what you do.
Hold the power button until the tablet powers off
Press and hold the volume down button, next to the screen lock switch
Press and hold Power (while holding volume down)
Once the recover kernel message comes up, release the buttons
In CWM go to advanced, mounts, mount system, then format system
In TWRP, go to wipe, then wipe system
In CWM go to restore, advanced restore, restore ONLY system
In TWRP select restore, then uncheck all so ONLY system is checked
After restoring system, wipe cache and dalvik cache, then reboot system.
System should boot normally.


Downloads
Available in 2 versions, script only version which you can place wherever you want and run however you want, or a CWM/TWRP flashable zip that will place the file for you in /system/etc/init.d and set permissions.

Dual Core:
Download: Script Only - Recommend Install via Script Manager App
CPU Sleeper script only

Quad Core:
Download: Script Only - Recommend Install via Script Manager App
cpusleep

Thanks to pio_masaki for rewriting the OP
Image Hosting Provided by http://i.imgur.com
TMO SGS2 & Nexus S
Eugene373's github
T-Mobile US

Follow me on Twitter.
http://twitter.com/#!/Eugene373

Like my Work, Buy Me a RedBull by clicking on my Can


Just Remember, Only you can Stop XDA Forest Fires!
The Following 13 Users Say Thank You to eugene373 For This Useful Post: [ Click to Expand ]
 
schurgatzi
Old
#2  
Senior Member
Thanks Meter 30
Posts: 157
Join Date: Mar 2012
I gonne try this the next days. But first i have to get a battery-life reference for my phone/settings.

Sent from my GT-I9300 using xda premium
The Following User Says Thank You to schurgatzi For This Useful Post: [ Click to Expand ]
 
eugene373
Old
#3  
eugene373's Avatar
Recognized Developer - OP
Thanks Meter 7,299
Posts: 5,626
Join Date: Aug 2009

 
DONATE TO ME
Quote:
Originally Posted by schurgatzi View Post
I gonne try this the next days. But first i have to get a battery-life reference for my phone/settings.

Sent from my GT-I9300 using xda premium
Thanks! It's been confirmed working perfect for all Dual / Quad Cores device with no ill effect..
Image Hosting Provided by http://i.imgur.com
TMO SGS2 & Nexus S
Eugene373's github
T-Mobile US

Follow me on Twitter.
http://twitter.com/#!/Eugene373

Like my Work, Buy Me a RedBull by clicking on my Can


Just Remember, Only you can Stop XDA Forest Fires!
 
9Lukas5
Old
#4  
9Lukas5's Avatar
Senior Member
Thanks Meter 1,196
Posts: 2,617
Join Date: Dec 2010
Location: near Stuttgart

 
DONATE TO ME
I think that this script is placebo effect if someone thinks to see a difference in battery life. On the Galaxy Nexus this maybe is a battery saver, but on the Galaxy s3 Samsung has delivered us the pegasusq governor and controls every core for itself. So your script doesn't change anything in the functionality if I understand it correct what it does. Because without this script the phone shuts down the uneeded cores, so where's the difference?

L
Device: jfltexx (SGS4)
Recovery: TWRP 2.7.0.5-F2FS + z31s1g's Holo Theme
Baseband: I9505XXUFNC4
Android: 4.4.4
Rom: cm11
Kernel/MOD: Alucard / -CrossBreeder MOD
/system /data /cache formatted to F2FS <-- click here for instructions

Device: grouper (Nexus7 2012)
Recovery: TWRP 2.7.1.0
Android 4.4.4
Rom: Stock KTU84L
/system /data /cache formatted to F2FS <-- click here for instructions

 
dladz
Old
#5  
dladz's Avatar
Senior Member
Thanks Meter 754
Posts: 3,662
Join Date: Aug 2010
Location: Liverpool

 
DONATE TO ME
@ the op, what are you getting in terms of time without charge?

I've seen these ideas come and go and I give you merit for trying.

What is your up time from max charge to depletion?

If it works it works and I'm sure people will use it , we just need to make sure it's not a placebo and that it is actually saving battery.

Is there any lag on wake? Does the script ever cause too deep a sleep, forcing a restart or battery pull? What's been your experience?

I am curious about this because I've found the battery life on this phone to be no better than my evo 3D.

Many thanks.

Sent from my GT-I9300 using xda premium
Phones: Moto 888 - Nokia 6110 - Nokia 3210 - Nokia 3310 - Nokia 8210 - Samsung e250 - Sony F305 - LG Viewty - G1 - HTC Hero - HTC Desire HD - HTC Sensation - Nokia Lumia 800 - HTC EVO 3D - Samsung i9300 - Asus Prime TF201 silver - HTC One - Galaxy Camera - Z1 - Galaxy S5
The Following 2 Users Say Thank You to dladz For This Useful Post: [ Click to Expand ]
 
eugene373
Old
(Last edited by eugene373; 2nd July 2012 at 05:42 AM.)
#6  
eugene373's Avatar
Recognized Developer - OP
Thanks Meter 7,299
Posts: 5,626
Join Date: Aug 2009

 
DONATE TO ME
lmao... then don't use it... CPU 1/2/3 is always online! even if it's report offline...

If you don't like it, don't use it! simple fact is, even when asleep there online & being used...

Quote:
Originally Posted by dladz View Post
@ the op, what are you getting in terms of time without charge?

I've seen these ideas come and go and I give you merit for trying.

What is your up time from max charge to depletion?

If it works it works and I'm sure people will use it , we just need to make sure it's not a placebo and that it is actually saving battery.

Is there any lag on wake? Does the script ever cause too deep a sleep, forcing a restart or battery pull? What's been your experience?

I am curious about this because I've found the battery life on this phone to be no better than my evo 3D.

Many thanks.

Sent from my GT-I9300 using xda premium
Don't Care.... People who have used it enjoy it... so??

yeah I don't care at this point!
Image Hosting Provided by http://i.imgur.com
TMO SGS2 & Nexus S
Eugene373's github
T-Mobile US

Follow me on Twitter.
http://twitter.com/#!/Eugene373

Like my Work, Buy Me a RedBull by clicking on my Can


Just Remember, Only you can Stop XDA Forest Fires!
The Following 2 Users Say Thank You to eugene373 For This Useful Post: [ Click to Expand ]
 
DallasJones
Old
(Last edited by DallasJones; 2nd July 2012 at 12:07 AM.)
#7  
Member
Thanks Meter 17
Posts: 72
Join Date: May 2011
Location: Launceston
I'll give it a go and let you guys know how I find the mod under different situations.

Thanks for sharing OP!

edit: Isn't this what a Tegra 3 does? It has 4 cores and a sleep core. This might be good for non Tegra 3 devices but I can't see this helping.
Current devices: Nexus 4 and 7
Non Android toys: Apple iPod Touch 64GB (never leaves my car) ASUS VX7 laptop and 2002 AUDM DC5 Integra Type R (My baby)

Previous devices: Too many to mention. A few HTCs, some Samsungs and a couple of ASUS tablets. Favourite was my Galaxy S3

Please consider a donation to the developers that make all of this possible. It's a small price to pay for the improvements they make to the expensive devices you use every day.
 
manveru0
Old
#8  
manveru0's Avatar
Senior Member
Thanks Meter 251
Posts: 291
Join Date: Oct 2011
Location: Bern
Quote:
Originally Posted by eugene373 View Post
lmao... then don't use it... CPU 1/2/3 is always online! even if it's report offline...

If you don't like it, don't use it! simple fact is, even when asleep there online & being used...



No lag, battery is increased & there is no placebo!

This has been confirmed from Quad-core users before even posting it...... You only see Battery increase during sleep, if you are a heavy user then likely no you will not see any increase......

however, this works great due to android even when asleep still uses all the CPU..... I Don't f'k care if it's being report offline.....

when asleep, this scripts force all CPU offline until awake, as 1 cpu asleep can handle everything the phone is doing.
hmmm, I've watched how the cores behave for quite some time via adb. Actually everytime I send the phone to sleep mode aka push power button, core 1-3 is going offline. So I guess pegasusq does its work already
 
JSale
Old
#9  
JSale's Avatar
Senior Member
Thanks Meter 31
Posts: 200
Join Date: Jan 2012
I downloaded the script in order to place in init.d but it was downloaded as a .txt file, what should the file extension be/how do I download it without altering the extension?

Regards
Jack
Current:
Samsung Galaxy SIII - Null_21/Perseus alpha34.3 [-100mv CPU&GPU] - Samsung 32Gb Class 10
Samsung Galaxy Note 10.1 Wi-Fi - Baked #8 - Samsung 32Gb UHS-1

PC:
CPU: 2500k - 3.3Ghz (0.990v) -H60 pull
GPU: HIS HD7950
MoBo: MSI p67A-GD55 (B3)
RAM: 12GB 1600Mhz RipjawsX -Dual channel XMP
HDD/SSD: WD Green 500GB/128GB Samsung 830
Case: NZXT Phantom(Black)
PSU: XFX Core 750w
OS:W7 64 bit/ZorinOS
If you understand my avatar, let me know
 
ausdim
Old
#10  
ausdim's Avatar
Senior Member
Thanks Meter 2,058
Posts: 836
Join Date: Jan 2007

 
DONATE TO ME
Quote:
Originally Posted by eugene373 View Post
making sure no file extensions get added
Quote:
Originally Posted by JSale View Post
I downloaded the script in order to place in init.d but it was downloaded as a .txt file, what should the file extension be/how do I download it without altering the extension?

Regards
Jack
So..
Delete the file extension and that's all.
.: If you like what i do or what i offer please click the "Thanks" button or make a small donate to me :.

THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes