Page 1 of 3 123 LastLast
Results 1 to 25 of 67
Like Tree6Likes
  1. Thread Author  Thread Author    #1  

    Default [MOD] Collin_ph Battery Tweak

    This script was originally created by for the HTC Hero. This is the port of that to the Optimus S.

    DO NOT RUN ANY KIND OF PROGRAM THAT CONTROLS THE CPU WHILE USING THIS MOD. NO SETCPU, NO CPU WIDGET, NONE OF THEM!!!!!! This includes the built in CPU manager in CM. You need to make sure Menu>Settings>Cyanogenmod settings>Performance>CPU - "Set on boot" is not checked! If this is checked, please uncheck it, reboot the phone, then recovery and flash.


    This is a tool for power users
    If you don't consider yourself 'comfortable' with messing with your phone, then don't. This is not for the faint of heart!

    So what does it do?:
    • This tweak creates a service that periodically checks the phone's power source.
    • If the power source changes, it reconfigures the device for maximum performace, battery and safety.
    • Tweaks memory settings for current power source
    • Re-clocks CPU based upon battery remaining or current power source
    • Reclocks for maximum performance if on AC power
    • Reclocks for maximum performance and charging safety if on USB
    • Reclocks for performance and battery if on Battery
    • As Battery life is diminished, Maximum CPU frequency is lowered
    • Tweaks scaling characteristics depending on power source
    • CPU Scales up less frequently on battery power
    • CPU Scales up more frequently on USB/AC power
    • The CPU is allowed to scale dynamically in all charging states based upon CPU usage
    • Includes a batt-cfg utility to configure the system
    • You may load 1 of 4 pre built profiles
    • Manually configure CPU Frequencies in all charging states
    • Determine the percentage of underclocking as the battery drains
    • Configure how often to poll the power state / battery status
    • Disable batt.sh service from running at startup
    • Includes a batt-rm.sh uninstall utility
    • Includes a batt-diag diagnostic utility
    • Includes optional Disk performance tweaks (enabled by default)
    • Includes overheating controls to lower your cpu if the phone starts to overheat


    Please read post #2 prior to flashing otherwise you won't know how to use this.

    Please read post #2 prior to flashing otherwise you won't know how to use this.

    If you feel like buying me a coffee, you can do so by clicking below. Not expected but humbly accepted

    Credit & Thanks:
    - - Original author of the script
    - - Worked with Collin to make the script even better
    - jondevere - Thanks for being willing to be my crash test dummie
    - Nick7 - Testing the mod and being willing to tweak RebornROM for all the users who may want to use this mod.
    Last edited by KSmithInNY; 07-14-2011 at 10:10 AM.
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
    Thanked by 11:
    + Show/Hide list of the thanked
  2. Thread Author  Thread Author    #2  

    Default re: [MOD] Collin_ph Battery Tweak


    IMPORTANT INFORMATION:
    The service doesn't start when i reboot?
    It is the job of your kernel and ROM developer to ensure this service starts on boot. Until they have taken the proper actions, you will need to restart the service after each boot by
    Code:
    su
    batt-cfg
    and select the default setting you wish you have.

    For ROM developers or kernel developers:
    You need 2 things for the script to survive a reboot:
    An overclockable kernel
    An 'import' call for init.local.rc in init.rc in the ramdisk. Just paste this into init.rc after the "Define TCP buffer sizes" setprops
    Code:
    # Include extra init file so that the battery tweak will function
        import /system/etc/init.local.rc
    How do i know it's working?:
    Open terminal emulator and type
    Code:
    su
    pidof batt.sh
    If it shows a number, it's running

    I didn't see a setting for screen off?
    This mod doesn't control screen off profiles. Users of a kernel that has the smartass governor will benefit from a screen off profile via their kernel.

    batt-cfg:
    This is the 'main menu' of sorts, as it gives the user all the options and allows them to toggle tweaks/mods on the fly.
    Code:
    su
    batt-cfg


    batt-diag:
    It's a diagnostics utility, allowing you or someone knowledgeable to figure out any issues that you may be having with your device and be able to pinpoint exactly where the problem is.
    Code:
    su
    batt-diag
    batt-rm.sh:
    t's a battery tweak removal script, follow the onscreen prompts and it should remove just about any trace of the battery tweak script. YOU MUST MOUNT /SYSTEM AS R/W FOR THE REMOVAL SCRIPT TO WORK
    Code:
    su
    batt-rm.sh
    The Presets:
    The presets are just default configurations that I have set up that can make your phone more efficient without you, the user, having to manually set everything. The preset of 748 literally means that 74800 is the scaling_max_freq, or the max frequency, that your phone can achieve after you enable it.

    Preset #1 is 748, #2 is 768, #3 is 787 and #4 is 806.

    Customize Settings:
    This is only for the experienced user, and it allows you to manipulate most/ifnotall the configurables on your device.
    NOTE: You do not need to configure anything to enable this battery mod. Default settings will be assigned at 748MHz.


    Disk Boost:
    Remounts via noatime and nodiratime. Look up what that means on your own, and why it benefits performance the way it does.

    Will this work on (insert ROM)?
    Probably. Try it and find out. Just make a nand backup and give it a go. If it doesn't survive a reboot contact your developer and tell them to adjust their ROM to support this mod.

    This is a bit too complex for me.
    Ok, well there's nothing I can do about that but you can not use this and use profiles in SetCPU to accomplish a similar thing but it requires an apk. Please see my thread here about this topic.



    If you feel like buying me a coffee, you can do so by clicking below. Not expected but humbly accepted
    Last edited by KSmithInNY; 07-12-2011 at 01:41 PM.
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
    Thanked by:
  3. #3  

    Default

    Jon tested, Kevin approved
    Thanked by:
    jstntp 
  4. #4  
    jstntp's Avatar
    AC Forums Android Developer

    Posts
    1,718 Posts
    ROM
    aosp - JellyBean

    Default

    Nice job guys, ill have to check this out.
  5. #5  
    basketthis's Avatar

    Posts
    1,478 Posts
    Global Posts
    1,480 Global Posts
    ROM
    AOSP!!!

    Default Re: [MOD] Collin_ph Battery Tweak

    Can't wait to give this a try!

    EDIT: This works much better than cputuner for cm7 gingerbread. No lag. No superuser permissions. Works without editing. You've done it again ksmithand jondevere(testing). Thanks very much for both of your work.
    Last edited by basketthis; 07-15-2011 at 03:13 PM.
    "Th- th- thinking of a master plan"
  6. #6  
    arizanic's Avatar

    Posts
    57 Posts
    ROM
    CyanogenMod 7

    Default Re: [MOD] Collin_ph Battery Tweak

    would this be functional with cm7 even though cm7 has a program built in that controls cpu
  7. #7  

    Default Re: [MOD] Collin_ph Battery Tweak

    Quote Originally Posted by arizanic View Post
    would this be functional with cm7 even though cm7 has a program built in that controls cpu
    not to sound rude but


    WARNING:
    DO NOT RUN ANY KIND OF PROGRAM THAT CONTROLS THE CPU WHILE USING THIS MOD. NO SETCPU, NO CPU WIDGET, NONE OF THEM!!!!!!

    CM7 does control the cpu
  8. Thread Author  Thread Author    #8  

    Default

    Try it. My guess is as long as you aren't using the cm CPU control agent to OC or UC, it will work. Nand backup, flash, test. Worst case scenario you nand restore but the way the script is written I'm pretty sure it will work.
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
  9. #9  

    Default Re: [MOD] Collin_ph Battery Tweak

    testing now...
  10. #10  
    arizanic's Avatar

    Posts
    57 Posts
    ROM
    CyanogenMod 7

    Default Re: [MOD] Collin_ph Battery Tweak

    Well i flashed booted ok started in terminal emulator configured settings and all seems to be going well i went back in to the cpu manager for cm7 and the speeds changed from stock to what i selected during the configuration of this tweak so im pretty sure its working perfectly
  11. Thread Author  Thread Author    #11  

    Default

    Quote Originally Posted by arizanic View Post
    im pretty sure its working perfectly
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
  12. #12  

    Default Re: [MOD] Collin_ph Battery Tweak

    Yea verified working...

    Clean install of CM7 on full battery without AC or USB.. got pid of 1261


    DEFINATLEY WORKING ON CM7!
    Thanked by:
  13. Thread Author  Thread Author    #13  

    Default

    Great news. So for you CM7 users this is the only way you can possibly set CPU profiles. Enjoy

    Thanks for checking jon and ariz
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
  14. #14  
    8616v's Avatar

    Posts
    143 Posts
    ROM
    oICSv43 GLaDOS v2.6

    Default Re: [MOD] Collin_ph Battery Tweak

    it appears to remain enabled on boot with cm7
    I power cycled went back to terminal entered pidof command and got 1622 back.
  15. #15  

    Default

    KSmithInNY, any idea which method (this or SetCPU profiles) will provide the better battery life with Reborn ROM 2.2.2? Thanks.

    Sent from my LS670 using Tapatalk
  16. Thread Author  Thread Author    #16  

    Default Re: [MOD] Collin_ph Battery Tweak

    Quote Originally Posted by tmeader View Post
    KSmithInNY, any idea which method (this or SetCPU profiles) will provide the better battery life with Reborn ROM 2.2.2? Thanks.
    It's really subjective and theres no answer to it. Both are completely customizable/changeable based on what you want so if you had the one set for performance and ran it for a day. Then set another for battery and ran it for a day, then the one you set for battery is going to give better battery while the other will give better benchmarks at lower battery levels.

    It's really a preference thing with the exception of CM users. They have to use this if they want to gain more control. Profiles don't work in CM so they don't have the SetCPU option.
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
  17. #17  
    8616v's Avatar

    Posts
    143 Posts
    ROM
    oICSv43 GLaDOS v2.6

    Default

    Just to confirm that I understand correctly ...by default everything gets remounted noatime correct? And there isn't anything I can do through the script to change that?

    Also,...I have my on battery min set to 320 but when originally set this up I was on AC power and that min is 600...8 hours later batt .diag shows power source as battery but my min settting hasn't been changed from 600. Would having set on boot in cm7 checked cause this?
    Last edited by 8616v; 07-12-2011 at 02:37 PM.
  18. Thread Author  Thread Author    #18  

    Default Re: [MOD] Collin_ph Battery Tweak

    Quote Originally Posted by 8616v View Post
    Just to confirm that I understand correctly ...by default everything gets remounted noatime correct? And there isn't anything I can do through the script to change that?
    Correct and no i dont think so. I'd have to look. Not currently using the tweak right now because I'm working on other stuff.

    EDIT- just confirmed that's a non-configurable option.

    Quote Originally Posted by 8616v View Post
    Also,...I have my on battery min set to 320 but when originally set this up I was on AC power and that min is 600...8 hours later batt .diag shows power source as battery but my min settting hasn't been changed from 600. Would having set on boot in cm7 checked cause this?
    Uncheck, reboot.
    DO NOT RUN ANY KIND OF PROGRAM THAT CONTROLS THE CPU WHILE USING THIS MOD. NO SETCPU, NO CPU WIDGET, NONE OF THEM!!!!!!
    Last edited by KSmithInNY; 07-12-2011 at 03:09 PM.
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
  19. #19  
    8616v's Avatar

    Posts
    143 Posts
    ROM
    oICSv43 GLaDOS v2.6

    Default

    Copy. thanks
    basketthis likes this.
  20. #20  
    8616v's Avatar

    Posts
    143 Posts
    ROM
    oICSv43 GLaDOS v2.6

    Default Re: [MOD] Collin_ph Battery Tweak

    for the next person who fails to heed the warning in the op....

    so after i unchecked and rebooted the mod was still installed and i could run through the script but the changes weren't being applied. so i ran batt.rm-sh to remove the script. rebooted now the cm7 cpu setting were acting weird, i set it to over clock it wasn't(i set to 787 but it wouldn't run over 600 and current cpu setting was showing odd numbers that weren't even choices...622). rebooted again after setting set on boot(at this point i was just trying to get cm7 cpu settings to work again) still acting wierd rebooted again. cm7 cpu settings finally work normally, unchecked set on boot with default settings for speed. rebooted into recovery flashed script, booted, went into batt-cfg set everything up agian and it seems to be working.

    long story short...heed the warning...
  21. #21  
    basketthis's Avatar

    Posts
    1,478 Posts
    Global Posts
    1,480 Global Posts
    ROM
    AOSP!!!

    Default Re: [MOD] Collin_ph Battery Tweak

    CPUtuner seems to work on cm7
    "Th- th- thinking of a master plan"
  22. Thread Author  Thread Author    #22  

    Default Re: [MOD] Collin_ph Battery Tweak

    Quote Originally Posted by 8616v View Post
    for the next person who fails to heed the warning in the op....

    so after i unchecked and rebooted the mod was still installed and i could run through the script but the changes weren't being applied. so i ran batt.rm-sh to remove the script. rebooted now the cm7 cpu setting were acting weird, i set it to over clock it wasn't(i set to 787 but it wouldn't run over 600 and current cpu setting was showing odd numbers that weren't even choices...622). rebooted again after setting set on boot(at this point i was just trying to get cm7 cpu settings to work again) still acting wierd rebooted again. cm7 cpu settings finally work normally, unchecked set on boot with default settings for speed. rebooted into recovery flashed script, booted, went into batt-cfg set everything up agian and it seems to be working.

    long story short...heed the warning...
    The weird numbers are normal but not to worry. The way this tweak works is it gradually scales down (or up) the CPU a certain percent based off battery percent (or other variables). So while it may boot at 748 (it actually boots higher), when the battery hits 97% it may be at 744MHz. The way the processor works is it tries to find the closest MHz to the number, without going over the number (think the price is right lol). So if it's showing 744MHz, the closest we have without going over is 729MHz so it will be running at 729MHz until it gets down to 728MHz then it will be running at 600MHZ. To keep phones running at the highest CPU speed possible, I've actually adjusted the top levels of each preconfigured setting. For example, when you select 748000 it really sets it to 767999. This means the phone uses 748 for a longer period of time before it goes down to the next level. Prior to me making this adjustment if you selected 748MHz literally within minutes the CPU was UC'ing and putting you to 729. I wanted people to enjoy the OC a little bit prior to it starting it's scale down process.

    Even with all the above said, running this while using any form of app that controls the CPU is going to cause bad, undesirable, just generally crappy things to happen
    [CENTER][URL="https://plus.google.com/u/0/+KPSmith/posts"]Follow me on Google +
  23. #23  
    basketthis's Avatar

    Posts
    1,478 Posts
    Global Posts
    1,480 Global Posts
    ROM
    AOSP!!!

    Default Re: [MOD] Collin_ph Battery Tweak

    These are my results with cm7 and cputuner

    EDIT: Still considering trying this script to see differences/benefits.
    Attached Thumbnails Attached Thumbnails [MOD] Collin_ph Battery Tweak-screenshot-1310522084076.png  
    Last edited by basketthis; 07-12-2011 at 09:04 PM.
    "Th- th- thinking of a master plan"
  24. #24  
    8616v's Avatar

    Posts
    143 Posts
    ROM
    oICSv43 GLaDOS v2.6

    Default

    Ah. I thought that the scaling back was only happening over the last portion of the battery not the whole time the battery is discharging.

    So actually the only time I would see the Max set freq on my CPU monitor widget would be when I'm on some sort of external power and the first...say..15% of battery at which point it will slowly reduce to 25% of Max(if that's what I set that last question in the script to)?

    Do I have that right now?

    and how does the set min freg come in because i'm not seeing that show up at all. I see it idle down to 480 which is where i have it set for external power sources but on battery it should be going to 320 and it isn't.

    should add that i had set it to power save rather than underclock. i changed it now
    Last edited by 8616v; 07-12-2011 at 10:46 PM.
  25. #25  
    8616v's Avatar

    Posts
    143 Posts
    ROM
    oICSv43 GLaDOS v2.6

    Default Re: [MOD] Collin_ph Battery Tweak

    I can't get it work right. i've tried going back to my nand and reinstalling with out the set on boot ever being set before i even flashed the zip. it won't switch power source profiles even though the script is aware that the source has changed from usb to batt. when i reboot on battery and enable the script it flat doesn't work. i have a log of the batt-diag that i can post in the morning to show it not switched from usb to batt when i'm on batt.
Page 1 of 3 123 LastLast

Posting Permissions

B