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

Search This thread

eugene373

Retired Recognized Developer
Aug 11, 2009
5,844
7,424
eb-productions.proboards.com
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...

[B]CPU Sleeper[/B]
[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[/QUOTE]

[U]What is it?[/U]
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.

[U]How does it work?[/U]
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.

[B][COLOR="red"]WARNING! READ THIS![/COLOR][/B]
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!

[U][COLOR="Red"]Instructions[/COLOR][/U]
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.

[I]Version 1: Flashable[/I]
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.

[I]Version 2: Script only[/I]
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.

[U]Init.d supported kernel:[/U]
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.

[U]Script Manager[/U]
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.


[U]What do I do if I can't boot after using this?[/U]
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.


[B]Downloads[/B]
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: [COLOR="Red"]Script Only - Recommend Install via Script Manager App[/COLOR]
[URL="http://d-h.st/N1N"]CPU Sleeper script only[/URL]

Quad Core:
Download: [COLOR="Red"]Script Only - Recommend Install via Script Manager App[/COLOR]
[url=http://www66.zippyshare.com/v/9249467/file.html]cpusleep[/url]

Thanks to [COLOR="DarkGreen"]pio_masaki[/COLOR] for rewriting the OP
 
Last edited:

klarthur

Senior Member
Feb 5, 2011
480
77
Will this script still work correctly if i have a setcpu profile to downclock when the screen is off?

Sent from my SPH-L710 using Tapatalk 2
 

nabbed

Senior Member
Aug 15, 2010
2,382
347
I wouldn't use a script like that.
1) This phone already sleeps like a champ.
2) The script looks like it may interfere with samsung's way of handling the second core.
 

jchap2k

Senior Member
Mar 23, 2007
195
10
Dallas
Installed your script (prior to all this drama)

I have to say I'm very impressed. Before if I forgot to plug my phone in at night I would wake up and it would be down to about %10-15 by morning. I forgot to plug it in today and found I was only down 5%.

I'd say I'm happy with the results and wanted to say thanks!
 
  • Like
Reactions: eugene373

eugene373

Retired Recognized Developer
Aug 11, 2009
5,844
7,424
eb-productions.proboards.com
Installed your script (prior to all this drama)

I have to say I'm very impressed. Before if I forgot to plug my phone in at night I would wake up and it would be down to about %10-15 by morning. I forgot to plug it in today and found I was only down 5%.

I'd say I'm happy with the results and wanted to say thanks!

thank you, the script does work very well & it's so simple I can see how people would think it doesn't work...

However, this isn't the case & it works awesome...

Funny how a little script can make life better...

PS.
I turned this into an App also.
 
  • Like
Reactions: ghostzyden

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    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...
    
    [B]CPU Sleeper[/B]
    [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[/QUOTE]
    
    [U]What is it?[/U]
    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.
    
    [U]How does it work?[/U]
    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.
    
    [B][COLOR="red"]WARNING! READ THIS![/COLOR][/B]
    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!
    
    [U][COLOR="Red"]Instructions[/COLOR][/U]
    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.
    
    [I]Version 1: Flashable[/I]
    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.
    
    [I]Version 2: Script only[/I]
    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.
    
    [U]Init.d supported kernel:[/U]
    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.
    
    [U]Script Manager[/U]
    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.
    
    
    [U]What do I do if I can't boot after using this?[/U]
    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.
    
    
    [B]Downloads[/B]
    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: [COLOR="Red"]Script Only - Recommend Install via Script Manager App[/COLOR]
    [URL="http://d-h.st/N1N"]CPU Sleeper script only[/URL]
    
    Quad Core:
    Download: [COLOR="Red"]Script Only - Recommend Install via Script Manager App[/COLOR]
    [url=http://www66.zippyshare.com/v/9249467/file.html]cpusleep[/url]
    
    Thanks to [COLOR="DarkGreen"]pio_masaki[/COLOR] for rewriting the OP
    16
    Everything and anything you flash in this forum is always to be considered beta
    Every phone and every user is different so may not get the same results when flashing
    If the script didn't work for you post a logcat or help diagnose
    Negative comments help NO ONE.
    No one forces anyone to use anything on XDA and all is AT YOUR OWN RISK
    Backup your stuff, be respectful and be helpful or be gone
    Thank you for your cooperation
    Friendly Neighborhood Moderator
    8
    How about answering this man here Eugene? He posted some tough evidence, or is again some of that "they are reported offline but they really arent"? I still can't believe you're being allowed to keep these threads opened.

    Well considering I import pegasusq governor from sgs3 source to test battery drains...

    without app / script I get 1.4% to 1.6% battery drains, which isn't bad...

    however, I keep hearing you!

    With that being said, with app / script I get 0.7% to 0.9% battery drains...

    I've put the work in to double check & verify it does work due to nay sayers like yourself, so despite what you have to say nor anyone else, I know for a fact it works, and it works nicely...

    The only problem I had was the script running to often while awake via the app & cause more of awake battery pulls, however I did get this issue resolved.

    Last time I respond to pointless post like this.

    ~Eugene
    7
    If I post it, it's cool to use.... Credit is nice, but not required!
    That's what open source is about correct :)

    ~Enjoy
    5
    App Download: CPUSleep.apk
    Version 1.3 Release Notes:
    ~ Fixed issue with Phone getting hot
    ~ Secondary Cores will now Disable while Talking on Phone if Needed
    ~ Secondary Cores Now Come back online
    ~ Fixed Superuser Notification being displayed every second
    ~ Fixed Cores Coming back online while screen is Off
    ~ Phone's while charge semi-faster while not being used
    ~ Fixed Lag issue when coming back online

    ~ Auto-Start on Reboot is still borked