Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,479 Members 49,045 Now Online
XDA Developers Android and Mobile Development Forum

[Script] {APP} CPU Sleeper, The Battery Saver Mod! 07/12/2012 Release 2.1

Tip us?
 
eugene373
Old
(Last edited by eugene373; 12th July 2012 at 03:46 PM.)
#1  
eugene373's Avatar
Recognized Developer - OP
Thanks Meter 7298
Posts: 5,626
Join Date: Aug 2009

 
DONATE TO ME
Default [Script] {APP} CPU Sleeper, The Battery Saver Mod! 07/12/2012 Release 2.1

App Version:
CPU Sleeper
~Free to all XDA Memebers
~ Must Be Rooted to use App

What is it?
Its a fairly simple App that will put CPU 1/2/3 OFFLINE when the screen turns off. Once the screen comes back on, it will allow CPU 1/2/3 back ONLINE.

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

Compatibility?
Works with any Dual Core & Quad Core Devices!
~ICS
~Gingerbread

Battery Saving?
Battery savings all depends on Usage & idle times.

App Download: CPUSleep.apk

Credits:
Handlerexploit for co-creation of this wonderful App.



Script Version!
Code:
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 45 Users Say Thank You to eugene373 For This Useful Post: [ Click to Expand ]
 
teh roxxorz
Old
#2  
teh roxxorz's Avatar
Recognized Contributor
Thanks Meter 2043
Posts: 8,065
Join Date: Nov 2010
Interesting, I'll give this a go. Will report back in a bit.
この こえ かれて も きえない メロヂー

The difference between the strong and weak willed is that the weak traverse with wounds covered up and hide when attacked, while the strong stride on with open hands and tears. Wounds bared open, and will continue to go on, even when broken at their core

Nexus 5
Teh Kernel kill count: 3
</3


If you wanna chat, message me.
Xbox Live: teh roxxorz [Live is up]
PSN [PS3 | PS4]: tehroxxorz666 [Where you'll likely find me]

My dropbox is a little hungry again, if you'd like a dropbox, register via my link, and we'll both get an extra 500mb storage. Thank you in advance you beautiful person you.

 
PhantomHacker
Old
#3  
PhantomHacker's Avatar
Recognized Developer
Thanks Meter 6444
Posts: 2,613
Join Date: Sep 2010
Nice, will check it out.
Please do not PM me, if you have a question ask it in the proper thread.
 
eugene373
Old
#4  
eugene373's Avatar
Recognized Developer - OP
Thanks Meter 7298
Posts: 5,626
Join Date: Aug 2009

 
DONATE TO ME
Thanks Guys,

It's been Confirmed working Perfect for all Dual / Quad Core Device!
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!
 
clark44
Old
#5  
clark44's Avatar
Senior Member
Thanks Meter 6647
Posts: 2,764
Join Date: Mar 2011
Location: Virginia

 
DONATE TO ME
Thanks Eugene! Are we allowed to include these in our Roms?

Sent from my SPH-L710 using Tapatalk 2



Phone: Samsung Galaxy S4 16GB White
Recovery: TWRP!
ROM: FreeGS4 v4.0.0
Modem: MDL

IRC Channel: #TeamSonic Freenode
FreeGS4 For Sprint By Team Sonic
FreeGS3 For Sprint By Team Sonic
Lean Stock SGS3 Sprint
Bekinged EVO 4G
Absurd Rom
How-To Root S-OFF Evo 3D
ICS SDK Port For HTC EVO3D
 
PhantomHacker
Old
#6  
PhantomHacker's Avatar
Recognized Developer
Thanks Meter 6444
Posts: 2,613
Join Date: Sep 2010
Quote:
Originally Posted by clark44 View Post
Thanks Eugene! Are we allowed to include these in our Roms?

Sent from my SPH-L710 using Tapatalk 2
Probably wouldn't be much use until we get a kernel with init.d support, unless we already have one.
Please do not PM me, if you have a question ask it in the proper thread.
 
master acehole
Old
#7  
master acehole's Avatar
Senior Member
Thanks Meter 256
Posts: 782
Join Date: Oct 2011
Very interesting will give this a go
 
clark44
Old
#8  
clark44's Avatar
Senior Member
Thanks Meter 6647
Posts: 2,764
Join Date: Mar 2011
Location: Virginia

 
DONATE TO ME
Quote:
Originally Posted by PhantomHacker View Post
Probably wouldn't be much use until we get a kernel with init.d support, unless we already have one.
My Rom has It

Sent from my SPH-L710 using Tapatalk 2



Phone: Samsung Galaxy S4 16GB White
Recovery: TWRP!
ROM: FreeGS4 v4.0.0
Modem: MDL

IRC Channel: #TeamSonic Freenode
FreeGS4 For Sprint By Team Sonic
FreeGS3 For Sprint By Team Sonic
Lean Stock SGS3 Sprint
Bekinged EVO 4G
Absurd Rom
How-To Root S-OFF Evo 3D
ICS SDK Port For HTC EVO3D
The Following 2 Users Say Thank You to clark44 For This Useful Post: [ Click to Expand ]
 
eugene373
Old
#9  
eugene373's Avatar
Recognized Developer - OP
Thanks Meter 7298
Posts: 5,626
Join Date: Aug 2009

 
DONATE TO ME
If I post it, it's cool to use.... Credit is nice, but not required!
That's what open source is about correct

~Enjoy
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 7 Users Say Thank You to eugene373 For This Useful Post: [ Click to Expand ]
 
clark44
Old
#10  
clark44's Avatar
Senior Member
Thanks Meter 6647
Posts: 2,764
Join Date: Mar 2011
Location: Virginia

 
DONATE TO ME
Quote:
Originally Posted by eugene373 View Post
If I post it, it's cool to use.... Credit is nice, but not required!
That's what open source is about correct

~Enjoy
That's right I will give credit and link to this thread! Thanks Eugene!

Sent from my SPH-L710 using Tapatalk 2



Phone: Samsung Galaxy S4 16GB White
Recovery: TWRP!
ROM: FreeGS4 v4.0.0
Modem: MDL

IRC Channel: #TeamSonic Freenode
FreeGS4 For Sprint By Team Sonic
FreeGS3 For Sprint By Team Sonic
Lean Stock SGS3 Sprint
Bekinged EVO 4G
Absurd Rom
How-To Root S-OFF Evo 3D
ICS SDK Port For HTC EVO3D

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes