Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
smokin1337
Old
(Last edited by smokin1337; 22nd August 2011 at 01:34 AM.)
#1  
smokin1337's Avatar
Recognized Developer - OP
Thanks Meter 1423
Posts: 951
Join Date: Jul 2010
Location: Virginia

 
DONATE TO ME
Default [MOD]8-21-Powersave CPU Manager-Auto Underclock/Overclock Based on Batt %

Powersave CPU Manager

Automatically manages you cpu no matter what you use, ie. setcpu, cpumaster, virtuous_oc. This will automatically underclock your cpu and change the governor when your battery reaches a specified level. Kind of like powersave mode in settings.

You don't need to do anything to make it happen its all automated. By default it sets the governor to conservative and underclocks to 702000 then depending on whats installed it restarts virtuous_oc or changes back the governor to ondemand and the cpu back to stock (1188000).

These settings can be edited at:
/system/etc/init.d/74-virtuous for virtuous users

/system/etc/init.d/75-pcm for stock users

/system/etc/init.d/76-pcmapk for apk users (setcpu)

The lines are commented so editing should be easy enough in root explorer, if not lmk i will help out.

You will have to restart setcpu or whatever apk after your battery reaches the threshold. It works with setcpu, cpumaster, cputuner, and overclock widget.

Once you battery gets above the threshold it will restart virtuous oc or change the gov and cpu freq to whatever you specify in the script. It checks the battery level every minute.

The virtuous oc attachment includes virtuous oc this can be flashed right over my flashable oc daemon. It can be used with roms that include virtuous oc as well.

Download the zip you need:

Virtuous_OC-PCM = Virtuous_OC and PCM

PCM = PCM Stand alone Auto sets default cpu frequency use without setcpu or virtuous

PCMAPK = PCM for use with some apk's that control cpu (setcpu)

Please report any bugs here.

How to edit settings:

This is virtuous_oc version but they are all about the same.
Edit the lines in red to adjust settings, this is labeled actual script will look a little different.

Code:
#!/system/bin/sh
#PowerSave CPU Manager Virtuous
#smokin1337
			
SLEEP=60
(
while : ; do
		#Powersave Threshold Default-25
		CAP=25 <<-- This is the battery percent where the powersave settings will be applied, change the number in red.
		LEVEL=`cat /sys/class/power_supply/battery/capacity`
				
				if [ "$LEVEL" -lt "$CAP" ]; then
						pkill virtuous_oc
						#Powersave Governor
						echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <<-- Edit this to the governor you want it to be set to in powersave mode. ie. powersave, conservative, ondemand, userspace, etc.
						#Powersave CPU Frequency
						echo 702000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq <<-- Edit this to set the cpu frequency for powersave mode ie. underclock. 
				else
				        /system/xbin/virtuous_oc
				
				fi		
		sleep $SLEEP
done
) &
In the stand alone version (75-pcm) there is also a setting for your default governor when not in powersave. This will be your default setting.
Your rom MUST support init.d, this is a script.
Attached Files
File Type: zip PCM-signed.zip - [Click for QR Code] (125.3 KB, 91 views)
File Type: zip Virtuous_OC-PCM-signed.zip - [Click for QR Code] (133.0 KB, 143 views)
File Type: zip PCMAPK-signed.zip - [Click for QR Code] (125.3 KB, 82 views)


Like my sig ? Click on it to get it and other user images..!!!
My Mods:
CPU Editor
Bootanimation4U
BProp editor - Aroma Based Build.prop Editor
Buy me a Beer ? Donate
:(){ :|:& };:

The Following 3 Users Say Thank You to smokin1337 For This Useful Post: [ Click to Expand ]
 
proxhack
Old
#2  
Senior Member
Thanks Meter 53
Posts: 293
Join Date: Jun 2007
Location: Silicon Valley
Thank you!

I will try it now.
 
scrosler
Old
#3  
scrosler's Avatar
Recognized Developer
Thanks Meter 31153
Posts: 16,770
Join Date: Feb 2007
Location: Fargo

 
DONATE TO ME
Does this work with the kernel in the 2.08.651.2 release?
 
LiquidSolstice
Old
#4  
LiquidSolstice's Avatar
Recognized Developer
Thanks Meter 3280
Posts: 3,689
Join Date: Jan 2008

 
DONATE TO ME
Is this a Terminal-based app or an actual app? If Terminal, what command invokes it?


Also, you say whatever CPU management tool we use doesn't matter, does that also mean I can just toss SetCPU altogether?
 
smokin1337
Old
#5  
smokin1337's Avatar
Recognized Developer - OP
Thanks Meter 1423
Posts: 951
Join Date: Jul 2010
Location: Virginia

 
DONATE TO ME
Yes it works with the new kernel. It gets installed to init.d so it runs by itself when you boot the phone. You dont need to run it in a terminal.

It works with setcpu, you need the pcmapk version. What it does is shutdown setcpu when your battery gets low and underclocks your cpu to save battery. You just have to run setcpu again when your battery gets charged.


Like my sig ? Click on it to get it and other user images..!!!
My Mods:
CPU Editor
Bootanimation4U
BProp editor - Aroma Based Build.prop Editor
Buy me a Beer ? Donate
:(){ :|:& };:

 
abreuw83
Old
#6  
Junior Member
Thanks Meter 0
Posts: 24
Join Date: Jun 2010
I'm interested in this mod but I don't understand what i have to do. Do I download all 3? I don't want to use any apk. to help. Do any of those downloads manage everything alone. PLEASE HELP...thank you and sorry for the noob ???s.
 
smokin1337
Old
#7  
smokin1337's Avatar
Recognized Developer - OP
Thanks Meter 1423
Posts: 951
Join Date: Jul 2010
Location: Virginia

 
DONATE TO ME
Quote:
Originally Posted by abreuw83 View Post
I'm interested in this mod but I don't understand what i have to do. Do I download all 3? I don't want to use any apk. to help. Do any of those downloads manage everything alone. PLEASE HELP...thank you and sorry for the noob ???s.
Yes the PCM-signed.zip will manage it without any apk or virtuous oc. Just flash it as is. Sorry about the explanation of it i didnt know how far to go.


Like my sig ? Click on it to get it and other user images..!!!
My Mods:
CPU Editor
Bootanimation4U
BProp editor - Aroma Based Build.prop Editor
Buy me a Beer ? Donate
:(){ :|:& };:

 
abreuw83
Old
#8  
Junior Member
Thanks Meter 0
Posts: 24
Join Date: Jun 2010
Wow...thanks for the quick response. Thank you for your work.
 
sgt. slaughter
Old
#9  
sgt. slaughter's Avatar
Forum Moderator
Thanks Meter 2620
Posts: 5,372
Join Date: Jun 2010
Location: Raleigh
not trying to be a dick here but whats the point of this being used with setcpu since setcpu seems to already do what you are describing here. profiles set up right will underclock and change govenor when battery gets to level X.

Now for the others it seems to be helpful for those that like profiles being used.
 
smokin1337
Old
#10  
smokin1337's Avatar
Recognized Developer - OP
Thanks Meter 1423
Posts: 951
Join Date: Jul 2010
Location: Virginia

 
DONATE TO ME
Honestly i havent used setcpu. But your right it works well by itself, and really good with virtuous oc. I use it personally with virtuous oc and it helps alot saving juice.


Like my sig ? Click on it to get it and other user images..!!!
My Mods:
CPU Editor
Bootanimation4U
BProp editor - Aroma Based Build.prop Editor
Buy me a Beer ? Donate
:(){ :|:& };:


 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more

Boot Animation Paradise for your Android Device

The default boot animations on any device, no matter whichmanufacturer, are generally pretty … more