This is really a tool for power users
If you don't consider yourself 'comfortable' with messing with your phone, then don't.
This is mostly the work of collin_ph, all the ideas are mostly his and I have only contributed in part to getting some things functioning correctly and some optimizations. We've been enjoying the performance/battery life benefits for about a month now and everyone is, hopefully, enjoying it as well.
Collin, myself and a couple others have decided to turn this script into an app which I hope, and we hope, will be on the market sooner than later.
http://tweaktool.com
The original thread can be found here: http://forum.xda-developers.com/showthread.php?t=762283
This script is more functional and more efficient than applications that constantly run in the background(like setcpu,ocwidget); the reason for this is that it only polls all dependencies every 60 seconds(default) to check for changes. Even the polling interval can be changed.
Why use this?
This script has proven time and time again to not only battery life(on average, about 3-4 hours), but also improve the performance of the device.
Enough of the backstory, into the details:
READ THIS
Original documentation can be found here: http://www.primoweb.com/froyo/battery_tweak_v3.html
The entire 'application' is written in shell code and was first written just to give a performance and battery boost, but since has evolved more and more.
All the tools mentioned will be utilized either through the terminal, or in adb shell.
The Tools
batt.sh
This is the core of the entire script. Don't mess with it.
The one thing you should do after installing the script:
Code:
pidof batt.sh
If theres any number showing up after it, then it's working fine. Don't touch it.
batt-cfg
This is the 'main menu' of sorts, as it gives the user all the options and allows him to toggle tweaks/mods on the fly.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
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 806 literally means that 806400 is the scaling_max_freq, or the max frequency, that your phone can achieve after you enable it.
Just typing 1, and then enter, you'll be ready and set to go. Same with 2.
Customize Settings
This is only for the experienced user, and it allows you to manipulate most/ifnotall the configurables on your device.
All the settings explain what each option does, so read them carefully.
Disk Boost
Remounts via noatime and nodiratime. Look up what that means on your own, and why it benefits performance the way it does.
Audio 'Fix'
Disables stagefright for bettery audio quality, though it will hinder your benchmark scores only because it affects the AAC codec and how it behaves.
CFS Tweak
Echos NO_NEW_FAIR_SLEEPERS to sched_features to change CFS into more of a traditional scheduler like BFS, which gives a noticeable benchmark performance boost, but hinders how gps behaves(kind of like the real BFS).
Temperature Management
This new tool allows you to set a temperature(in celsius) at which to override the maximum frequencies to something a bit safer to save your phone battery from melting. It allows you to choose the override max frequency and the override min frequency.
So lets say that you choose the 710 preset.
And you enable the Temperature Management, and set the temperature to 450(45.0 C*) and you set the override max frequency to 537600mhz.
At 45 C*, the tweak will override the preset and echo 5376000 to scaling_max_freq until your battery temperature drops below 45.0 C*, at which point it will resume 710mhz.
Enjoy!
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.
batt-diag -v gives a more thorough output as you can see here; http://pastie.org/1162034
batt-rm.sh
It's a battery tweak removal script, follow the onscreen prompts and it should remove just about any trace of the battery tweak script.
Prerequisites needed to run this
If you're running a version of CM6, this will work completely fine.
If you're running any other kind of rom, that developer will need to add an 'import' call in the init.rc(in the ramdisk) that imports the init.d script necessary for this application to function at boot. If you don't know how to do this, well, pm me, I might help you, depending on how much I like you.
This script will WORK even if you don't have the import call at boot, but it won't survive on the next reboot.
You can check via:
Code:
adb logcat | grep collin_ph
Code:
pidof batt.sh
NOTE: This script will also prompt you to try to run itself as root if you use it in terminal. Should work fine in CM6 ROMS but may not run fine in other ones.
Credits:
Collin_ph
Myself
Tomatosoup
s0be
Barackisbrown
vinylfreak89 for being so naggy about porting this here
Download Collin_ph BatteryTweak v3 DecaMod v2.2http://dl.dropbox.com/u/9992367/BatteryTweak-ERISv2.2.zip
MD5: 64c40363fdc1f4c5745154a627894850
Last update: Tues 10/26/2010 11:08AM CST.
Download Collin_ph BatteryTweak v3 DecaMod v2(TazzFroyo/KaosFroyo) TAKEN DOWN
MD5: 7ade3a05e20fedc958c714e62ef27bd8
If you flashed this earlier, it breaks wifi, so just reflash your ROM over the top. Tell your ROM cook to fix his CM6 !
Flash via recovery, enjoy!
Why doesn't it work for KaosFroyo/TazzFroyo?
Because they're not built like the CM6 repos, and do not have the init.local.rc import and updated busybox's as well lacking some dependencies found in CM6 itself when its built from source.
ROMs that need to have init.rc patched with import call of init.local.rc(This is necessary for this script to work correctly)
KaosFroyo
TazzFroyo
'start collin_ph' starts the service created in init.local.rc. If init.local.rc isn't imported at boot via the init.rc, then it fails.
Original Source: http://github.com/collinph/battery-tweak-v3
My Source: http://github.com/Decad3nce/battery-tweak-v3
Help us debug!
Before you complain about anything, do this.
Code:
adb shell batt-diag -v > battdiag.txt
and upload that txt file so that we can diagnose your problems more thoroughly.
For ROM Modders
You need 3 things for the script to survive a reboot:
An overclockable kernel(duh)
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
Proper file structuring/permissions(The update script in the update.zip really does all of this for you)
Yay it got ported. Thanks.
im naggy huh... no seriously... great job dude... immediately my CPU usage has gone down and tomorrow we'll see if battery life goes up as well.. i sure hope so... phone is overall... smoother
oh happy day! i had been using the original version of this and am happy to see it ported and enhanced... me and my eris thank you greatly!
I'm assuming that since this sets frequencies on it's own that it would be ill advised to use along with something like SetCPU?
UNCbassbone said:
I'm assuming that since this sets frequencies on it's own that it would be ill advised to use along with something like SetCPU?
Click to expand...
Click to collapse
It' CONFLICTS with setcpu, so no.
Same thing with OC widget.
Thanks checkin it out... see how tomorrow goes..
After choosing option [1] in batt-cfg I noticed it said "/system/bin/batt-cfg: line 467: load_806: command not found". I did the "pidof batt.sh" command before running batt-cfg and no number displayed after inputting the command. I ran it again after saving settings in batt-cfg and it displayed a number.
burndtjamb said:
After choosing option [1] in batt-cfg I noticed it said "/system/bin/batt-cfg: line 467: load_806: command not found". I did the "pidof batt.sh" command before running batt-cfg and no number displayed after inputting the command. I ran it again after saving settings in batt-cfg and it displayed a number.
Click to expand...
Click to collapse
Oops, bug. Thanks. Will fix in a sec
EDIT: Fixed. Same URL, check md5.
Thanks, Decad3nce. Choosing option [1] resulted in an '...integer expression expected' and saved settings. Is it normal for it to show 'Starting batt.sh /system/bin/batt-cfg: line 107: start: command not found' afterwards? The phone just rebooted (no android skateboards) as I was typing this while looking at the terminal prompt.
edit: Had to pull the battery, it froze at the loading animation. Running KaosFroyo V34 + CFSv4, for reference.
burndtjamb said:
Thanks, Decad3nce. Choosing option [1] resulted in an '...integer expression expected' and saved settings. Is it normal for it to show 'Starting batt.sh /system/bin/batt-cfg: line 107: start: command not found' afterwards? The phone just rebooted (no android skateboards) as I was typing this while looking at the terminal prompt.
Click to expand...
Click to collapse
NVM. sec. ...
I'm guessing pidof batt.sh doesn't bring back anything?
Got it flashed, messed with the settings.. looks all good so far!
Decad3nce said:
NVM. sec. ...
I'm guessing pidof batt.sh doesn't bring back anything?
Click to expand...
Click to collapse
Running the 'pidof batt.sh' command does not result in anything.
Thanks and good work.
Sent from my ERIS using XDA App
burndtjamb said:
Running the 'pidof batt.sh' command does not result in anything.
Click to expand...
Click to collapse
Means its not running at all. :S Try reflashing it, also, could you check for the dependencies necessary in batt-diag
Installed for me very smoothly on kaos34 w/CFS. pidof shows a #3
Thanks for bringing this over.
Sent from my FroyoEris using Tapatalk
Decad3nce said:
Means its not running at all. :S Try reflashing it, also, could you check for the dependencies necessary in batt-diag
Click to expand...
Click to collapse
Reflashed again, same result.
Code:
sh-3.2# pidof batt.sh
pidof batt.sh
sh-3.2# batt-diag
batt-diag
Collin_ph Battery diagnostic utility
batt-diag -v for verbose diagnostics
Checking if batt.sh service is running
pidof batt.sh:
Checking dependencies. If any dependency is blank the battery tweak may not func
tion and should be disabled
sleep: /system/xbin/sleep
mount: /system/xbin/mount
expr : /system/xbin/expr
log :
Checking tweak files and permissions
Checking batt.sh service
-rwxr-xr-x 1 root shell 7174 Aug 1 2008 /system/bin/batt.sh
Checking batt.conf configuration file
-rwxr-xr-x 1 root shell 411 Aug 1 2008 /system/etc/batt.conf
Checking batt-cfg configuration utility
-rwxr-xr-x 1 root shell 12241 Aug 1 2008 /system/bin/batt-cfg
Checking batt-rm.sh service
-rwxr-xr-x 1 root shell 889 Aug 1 2008 /system/bin/batt-rm.sh
Checking Configuration
----batt.conf file contents----
audio_fix=0
CFStweaks=0
MOUNToptions=1
enabled=1
LEDfix=0
cpu_limiting_method=1
min_freq_on_battery=245000
max_freq_on_battery=691200
min_freq_on_USBpower=245000
max_freq_on_USBpower=691200
min_freq_on_power=245000
max_freq_on_power=691200
polling_interval_on_battery=60
polling_interval_on_power=15
polling_interval_on_USBpower=15
cpu_max_underclock_perc=33
scaling_governor=interactive
cpu_scheduler=deadline
----end of batt.conf----
----Mount points----
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /mnt/asec type tmpfs (rw,mode=755,gid=1000)
/dev/block/mtdblock3 on /system type yaffs2 (rw)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noe
xec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,ioch
arset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,size=0k,mode=000)
/proc/mounts/
cat: can't open '/proc/mounts/': Not a directory
Displaying CFS tweaks.----
/sys/kernel/debug/sched_features
NEW_FAIR_SLEEPERS NORMALIZED_SLEEPER WAKEUP_PREEMPT START_DEBIT AFFINE_WAKEUPS C
ACHE_HOT_BUDDY SYNC_WAKEUPS NO_HRTICK NO_DOUBLE_TICK ASYM_GRAN LB_BIAS LB_WAKEUP
_UPDATE ASYM_EFF_LOAD NO_WAKEUP_OVERLAP LAST_BUDDY
/proc/sys/kernel/sched_latency_ns
10000000
/proc/sys/kernel/sched_min_granularity_ns
4000000
/proc/sys/kernel/sched_wakeup_granularity_ns
2000000
Displaying Current CPU scheduler and Scaling Governor
Scaling Governor:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand
CPU scheduler:
/sys/block/mtdblock3/queue/scheduler
[noop] anticipatory deadline bfq
Displaying Batt.sh tweakables.----
/proc/sys/vm/swappiness
60
/proc/sys/vm/dirty_expire_centisecs
200
/proc/sys/vm/dirty_writeback_centisecs
500
/proc/sys/vm/dirty_background_ratio
5
/proc/sys/vm/dirty_ratio
10
/proc/sys/vm/vfs_cache_pressure
100
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
710400
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
245000
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
80
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
0
Current charging source: 0=Battery 1=USB 2=AC
/sys/class/power_supply/battery/charging_source
1
Current battery capacity
/sys/class/power_supply/battery/capacity
100
/sys/class/power_supply/battery/health
Good
----Current Battery Temp----
95 F / 35 C
----End of Battery Temp----
----ROM Version----
Linux version 2.6.29-DecaFuctCFS-dirty-2a66c604 ([email protected]) (gcc versio
n 4.4.0 (GCC) ) #2 PREEMPT Mon Sep 6 16:49:41 EDT 2010
----End of ROM Version ----
---CPU Time in each Frequency---
19200 0
122880 0
160000 0
245760 9146
480000 313
528000 24
604800 12
710400 9575
729600 0
748800 0
768000 0
787200 0
806400 0
825600 0
844800 0
864000 0
---End of CPU Time in each Frequency----
burndtjamb said:
Reflashed again, same result.
Code:
sh-3.2# pidof batt.sh
pidof batt.sh
sh-3.2# batt-diag
batt-diag
Collin_ph Battery diagnostic utility
batt-diag -v for verbose diagnostics
Checking if batt.sh service is running
pidof batt.sh:
Checking dependencies. If any dependency is blank the battery tweak may not func
tion and should be disabled
sleep: /system/xbin/sleep
mount: /system/xbin/mount
expr : /system/xbin/expr
log :
Checking tweak files and permissions
Checking batt.sh service
-rwxr-xr-x 1 root shell 7174 Aug 1 2008 /system/bin/batt.sh
Checking batt.conf configuration file
-rwxr-xr-x 1 root shell 411 Aug 1 2008 /system/etc/batt.conf
Checking batt-cfg configuration utility
-rwxr-xr-x 1 root shell 12241 Aug 1 2008 /system/bin/batt-cfg
Checking batt-rm.sh service
-rwxr-xr-x 1 root shell 889 Aug 1 2008 /system/bin/batt-rm.sh
Checking Configuration
----batt.conf file contents----
audio_fix=0
CFStweaks=0
MOUNToptions=1
enabled=1
LEDfix=0
cpu_limiting_method=1
min_freq_on_battery=245000
max_freq_on_battery=691200
min_freq_on_USBpower=245000
max_freq_on_USBpower=691200
min_freq_on_power=245000
max_freq_on_power=691200
polling_interval_on_battery=60
polling_interval_on_power=15
polling_interval_on_USBpower=15
cpu_max_underclock_perc=33
scaling_governor=interactive
cpu_scheduler=deadline
----end of batt.conf----
----Mount points----
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /mnt/asec type tmpfs (rw,mode=755,gid=1000)
/dev/block/mtdblock3 on /system type yaffs2 (rw)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noe
xec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,ioch
arset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,size=0k,mode=000)
/proc/mounts/
cat: can't open '/proc/mounts/': Not a directory
Displaying CFS tweaks.----
/sys/kernel/debug/sched_features
NEW_FAIR_SLEEPERS NORMALIZED_SLEEPER WAKEUP_PREEMPT START_DEBIT AFFINE_WAKEUPS C
ACHE_HOT_BUDDY SYNC_WAKEUPS NO_HRTICK NO_DOUBLE_TICK ASYM_GRAN LB_BIAS LB_WAKEUP
_UPDATE ASYM_EFF_LOAD NO_WAKEUP_OVERLAP LAST_BUDDY
/proc/sys/kernel/sched_latency_ns
10000000
/proc/sys/kernel/sched_min_granularity_ns
4000000
/proc/sys/kernel/sched_wakeup_granularity_ns
2000000
Displaying Current CPU scheduler and Scaling Governor
Scaling Governor:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand
CPU scheduler:
/sys/block/mtdblock3/queue/scheduler
[noop] anticipatory deadline bfq
Displaying Batt.sh tweakables.----
/proc/sys/vm/swappiness
60
/proc/sys/vm/dirty_expire_centisecs
200
/proc/sys/vm/dirty_writeback_centisecs
500
/proc/sys/vm/dirty_background_ratio
5
/proc/sys/vm/dirty_ratio
10
/proc/sys/vm/vfs_cache_pressure
100
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
710400
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
245000
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
80
/sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
0
Current charging source: 0=Battery 1=USB 2=AC
/sys/class/power_supply/battery/charging_source
1
Current battery capacity
/sys/class/power_supply/battery/capacity
100
/sys/class/power_supply/battery/health
Good
----Current Battery Temp----
95 F / 35 C
----End of Battery Temp----
----ROM Version----
Linux version 2.6.29-DecaFuctCFS-dirty-2a66c604 ([email protected]) (gcc versio
n 4.4.0 (GCC) ) #2 PREEMPT Mon Sep 6 16:49:41 EDT 2010
----End of ROM Version ----
---CPU Time in each Frequency---
19200 0
122880 0
160000 0
245760 9146
480000 313
528000 24
604800 12
710400 9575
729600 0
748800 0
768000 0
787200 0
806400 0
825600 0
844800 0
864000 0
---End of CPU Time in each Frequency----
Click to expand...
Click to collapse
Strange. run batt-rm.sh, hit y.
reboot.
then flash it again.
If it persists, I'll go bug hunting; but this seems just erroneous.
Decad3nce said:
Strange. run batt-rm.sh, hit y.
reboot.
then flash it again.
If it persists, I'll go bug hunting; but this seems just erroneous.
Click to expand...
Click to collapse
Code:
sh-3.2# batt-rm.sh
batt-rm.sh
This tool will remove almost all traces of the Battery Tweak
Are you sure that you want to go through with this?[y/n]
y
y
/system/bin/batt-rm.sh: line 15: log: command not found
Technical thread I wrote up about the subject... noob or dev check it out. I hope you find something useful to further your knowledge of Android/Linux
Cheers
http://forum.xda-developers.com/showthread.php?t=2649820
cun7 said:
Technical thread I wrote up about the subject... noob or dev check it out. I hope you find something useful to further your knowledge of Android/Linux
Cheers
http://forum.xda-developers.com/showthread.php?t=2649820
Click to expand...
Click to collapse
Can you please post ALL of your kernel settings (Governor, Schedulers etc) ??
Currently our bootloader is locked so we can only change Default governor and that's it. But as soon as someone finds an exploit or something I'll be trying out your settings.
P.S. Default governor is interactive on AT&T N3
Walter.White said:
Can you please post ALL of your kernel settings (Governor, Schedulers etc) ??
Currently our bootloader is locked so we can only change Default governor and that's it. But as soon as someone finds an exploit or something I'll be trying out your settings.
P.S. Default governor is interactive on AT&T N3
Click to expand...
Click to collapse
First time I've ever seen default be interactive on a device that includes the governor. Interesting to know!
You can change specifics in your /etc/init.qcom.post_boot.sh file as well.... That is where lines are called out for ondemand settings... Switch them there
Sent from another galaxy
thanks for posting here! from what i saw, ondemand was the default governor on my Note 3, but i went ahead and changed it to intereactive, and I also changed the scheduler from row to deadline.... and i feel like i am already noticing a significant difference in battery life. previously my battery would fall from 100 almost instantly after taking it off the charger, but now it seems like more of a steady drip! gonna keep running this way and see how it goes but it does feel a lot better, with seemingly about the same performance.
cun7 said:
Technical thread I wrote up about the subject... noob or dev check it out. I hope you find something useful to further your knowledge of Android/Linux
Cheers
http://forum.xda-developers.com/showthread.php?t=2649820
Click to expand...
Click to collapse
This is my first android device so I'm still learning. But I'm a fast learner so just point me in the right direction.
Code:
product_name=`getprop ro.product.name`
case "$product_name" in
klte*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
esac
timer_rate: 15000
timer_slack: 60000
min_sampling_time: 60000
hispeed_freq: 1728000
go_hispeed_load: 65
Also how do I change my Scheduler to Deadline?? And are there any settings that I need to change for deadline scheduler too??
P.S. I have attached init.qcom.post_boot.sh (just change ending from .pdf to .sh) from ATT N3 Variant. Any help will be appreciated.
Walter.White said:
This is my first android device so I'm still learning. But I'm a fast learner so just point me in the right direction.
Code:
product_name=`getprop ro.product.name`
case "$product_name" in
klte*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
*)
# Change interactive governor parameters
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo "20000 1400000:80000 1500000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo "85 1400000:90 1700000:95" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
;;
esac
timer_rate: 15000
timer_slack: 60000
min_sampling_time: 60000
hispeed_freq: 1728000
go_hispeed_load: 65
Also how do I change my Scheduler to Deadline?? And are there any settings that I need to change for deadline scheduler too??
P.S. I have attached init.qcom.post_boot.sh (just change ending from .pdf to .sh) from ATT N3 Variant. Any help will be appreciated.
Click to expand...
Click to collapse
I'll edit it for you tonight once I get home and send it back to you
Sent from another galaxy
cun7 said:
I'll edit it for you tonight once I get home and send it back to you
Sent from another galaxy
Click to expand...
Click to collapse
Thank you. Two more things.
1. How do I change my default scheduler from cfq to deadline ??
2. How do I change my cache size to 4096 ??
(Is there a way to do it besides using init.d script??)
Walter.White said:
Thank you. Two more things.
1. How do I change my default scheduler from cfq to deadline ??
2. How do I change my cache size to 4096 ??
(Is there a way to do it besides using init.d script??)
Click to expand...
Click to collapse
The only way to change it without using a script is to use an app. I prefer TricksterMod. I like tinkering with scripts every now and again, but it can be a pain to simply have to reboot your device after editing some stuff in init.d or post_boot.sh
Give trickster a shot. I just got home, I'll look at your post boot file and send it back to you. I'll go ahead and add lines in there for setting the read ahead size and scheduler.
cun7 said:
The only way to change it without using a script is to use an app. I prefer TricksterMod. I like tinkering with scripts every now and again, but it can be a pain to simply have to reboot your device after editing some stuff in init.d or post_boot.sh
Give trickster a shot. I just got home, I'll look at your post boot file and send it back to you. I'll go ahead and add lines in there for setting the read ahead size and scheduler.
Click to expand...
Click to collapse
Thanks man. I appreciate it.
cun7 said:
The only way to change it without using a script is to use an app. I prefer TricksterMod. I like tinkering with scripts every now and again, but it can be a pain to simply have to reboot your device after editing some stuff in init.d or post_boot.sh
Give trickster a shot. I just got home, I'll look at your post boot file and send it back to you. I'll go ahead and add lines in there for setting the read ahead size and scheduler.
Click to expand...
Click to collapse
Did you had chance to look at it?
MINI CPU INTEGER BENCHMARK
Article Featured on XDA Portal: http://www.xda-developers.com/android/benchmark-your-cpu-performance-with-mini-cpu-integer-script/
Description
I have made this script today, what It does is performing a small series of integer tests. It uses the "bc" binary that is ported to ARM, to be able to run the benchmark you need to have busybox installed and a rooted phone (or at least ro.secure=0) and of course you need an ADB connection to your phone.
Testing Technique
First sequence is 3x the single thread test:
Code:
( busybox echo '2^2^1' | /system/bin/bc )
( busybox echo '2^2^2' | /system/bin/bc )
( busybox echo '2^2^3' | /system/bin/bc )
( busybox echo '2^2^4' | /system/bin/bc )
( busybox echo '2^2^5' | /system/bin/bc )
( busybox echo '2^2^6' | /system/bin/bc )
( busybox echo '2^2^7' | /system/bin/bc )
( busybox echo '2^2^8' | /system/bin/bc )
( busybox echo '2^2^9' | /system/bin/bc )
( busybox echo '2^2^10' | /system/bin/bc )
( busybox echo '2^2^11' | /system/bin/bc )
( busybox echo '2^2^12' | /system/bin/bc )
( busybox echo '2^2^13' | /system/bin/bc )
( busybox echo '2^2^14' | /system/bin/bc )
( busybox echo '2^2^15' | /system/bin/bc )
( busybox echo '2^2^16' | /system/bin/bc )
( busybox echo '2^2^17' | /system/bin/bc )
( busybox echo '2^2^18' | /system/bin/bc )
After that the multi thread test gets ran 3 times.
Code:
( busybox echo '2^2^1' | /system/bin/bc ) &
( busybox echo '2^2^2' | /system/bin/bc ) &
( busybox echo '2^2^3' | /system/bin/bc ) &
( busybox echo '2^2^4' | /system/bin/bc ) &
( busybox echo '2^2^5' | /system/bin/bc ) &
( busybox echo '2^2^6' | /system/bin/bc ) &
( busybox echo '2^2^7' | /system/bin/bc ) &
( busybox echo '2^2^8' | /system/bin/bc ) &
( busybox echo '2^2^9' | /system/bin/bc ) &
( busybox echo '2^2^10' | /system/bin/bc ) &
( busybox echo '2^2^11' | /system/bin/bc ) &
( busybox echo '2^2^12' | /system/bin/bc ) &
( busybox echo '2^2^13' | /system/bin/bc ) &
( busybox echo '2^2^14' | /system/bin/bc ) &
( busybox echo '2^2^15' | /system/bin/bc ) &
( busybox echo '2^2^16' | /system/bin/bc ) &
( busybox echo '2^2^17' | /system/bin/bc ) &
( busybox echo '2^2^18' | /system/bin/bc )
From the elapsed time of the tests the average will be calculated and added up to create the final score.
The test results are pretty stable, and will only differ slightly from each other if cpu settings remain unchanged
Instructions for Linux:
git clone https://github.com/broodplank/MiniCPUIntegerBenchmark
cd MiniCPUIntegerBenchmark
./score --install
Usage:
Enter './score' to run bench from PC
Enter 'score' in Terminal Emulator on phone to run from device
Instructions for Windows:
Download https://github.com/broodplank/MiniCPUIntegerBenchmark/archive/master.zip
Unpack in some folder
Run score.bat to install files to device
Usage:
Enter 'score' in Terminal Emulator on phone to run from device
Sample output:
Mini CPU Integer benchmark (by broodplank)
Waiting for device (Make sure USB debugging is enabled)
Device with ADB connection been found, continuing
Starting Benchmark
--> CPU single thread integer test
-- First run: 5.77
-- Second run: 5.75
-- Third run: 5.80
- Average: 5.77
--> CPU multi thread integer test
-- First run: 3.87
-- Second run: 4.07
-- Third run: 3.95
- Average: 3.96
- Final score: 9.73 - 'Very nice, your CPU is somewhere near the top models range'
- Device: jflte
- Board: msm8960
- MAX CPU Freq: 1890000
Click to expand...
Click to collapse
The lower the score the better! less time elapsed on tests means faster
As I only know the score of an S4 (which is around 9.75) or an S3 (which is around 16.86), I cannot make a real good indication of what phones actually do score. Please run the script and share your result so I can update the script to make it actually give a fitting reward message
This test is actually very fast compared to most benchmarks. depending on your phone speed of course
Changelog:
v1.0:
- Initial Release
v1.1:
- First attempt in simplifying the code
- Make some cosmetic changes (echo)
- Add comments and use a few linebreaks for better overview
v1.2:
- Add version that can run on phone without PC
- Add batch script for windows users
- Add ADB binaries
sweet thank you for this.
Nexus 5 result
Code:
./score
Mini CPU Integer benchmark (by broodplank)
Waiting for device (Make sure USB debugging is enabled)
Device with ADB connection been found, continuing
Starting Benchmark
--> CPU single thread integer test
-- First run: 4.97
-- Second run: 4.80
-- Third run: 5.02
- Average: 4.93
--> CPU multi thread integer test
-- First run: 5.23
-- Second run: 4.90
-- Third run: 4.75
- Average: 4.96
- Final score: 9.89 - 'Very nice, your CPU is somewhere near the top models range'
- Device: hammerhead
- Board: msm8974
- MAX CPU Freq: 2265600
broodplank1337 said:
MINI CPU INTEGER BENCHMARK (LINUX ONLY)
Installation:
1. Download script and unpack
2. Run "./score --install" to install the bc binary and the 2 tests to your phone
3. Run "./score" to start the benchmark
Click to expand...
Click to collapse
The download zip does not provide a "score-install" file. Could please help me with this?
Thanks
Nice, thanks.
HTC M7 running Carbon nightly.
Code:
Mini CPU Integer benchmark (by broodplank)
Waiting for device (Make sure USB debugging is enabled)
Device with ADB connection been found, continuing
Starting Benchmark
--> CPU single thread integer test
-- First run: 6.12
-- Second run: 6.12
-- Third run: 6.31
- Average: 6.18
--> CPU multi thread integer test
-- First run: 4.39
-- Second run: 4.11
-- Third run: 4.42
- Average: 4.31
- Final score: 10.49 - 'Nice, your CPU speed is above average (first gen quad core)'
- Device: m7
- Board: msm8960
- MAX CPU Freq: 1728000
Another nice script from the bash master .
I love this benchmark coz my phone scores better than S3
Galaxy S plus - 1.4 Ghz x 1 - SlimKat 4.4.4
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thanks for this
Nice to See you again bro
Very nice script, here's the result from my Kindle fire HDX:
Starting Benchmark
--> CPU single thread integer test
-- First run: 4.91
-- Second run: 4.85
-- Third run: 4.90
- Average: 4.89
--> CPU multi thread integer test
-- First run: 3.27
-- Second run: 3.28
-- Third run: 3.26
- Average: 3.27
- Final score: 8.16 - 'Very nice, your CPU is somewhere near the top models range'
- Device: thor
- Board: msm8974
- MAX CPU Freq: 2150400
Click to expand...
Click to collapse
Thank you all for testing, btw, the score measurement is LOWER IS BETTER, not higher because the less time spend on the calculation the better.
Atm, the message you get is not the most accurate. I would like to change that, the current script is this:
Code:
# Show fitting message
if (( $(echo "$TOTALSCORE < 5" | bc -l) )); then
echo "'WOW! Your CPU is blazing fast! Are you sure it's not a PC?'"
fi;
if (( $(echo "$TOTALSCORE > 5 && $TOTALSCORE < 10" | bc -l) )); then
echo "'Very nice, your CPU is somewhere near the top models range'"
fi;
if (( $(echo "$TOTALSCORE > 10 && $TOTALSCORE < 15" | bc -l) )); then
echo "'Nice, your CPU speed is above average (first gen quad core)'"
fi;
if (( $(echo "$TOTALSCORE > 15 && $TOTALSCORE < 20" | bc -l) )); then
echo "'Pretty good, your device is most likely a dual core'"
fi;
if (( $(echo "$TOTALSCORE > 20 && $TOTALSCORE < 25" | bc -l) )); then
echo "'Decent, You probably have one of the first dual cores'"
fi;
if (( $(echo "$TOTALSCORE > 25 && $TOTALSCORE < 30" | bc -l) )); then
echo "'Hmmm, You must be running one of the first smartphones'"
fi;
if (( $(echo "$TOTALSCORE > 30" | bc -l) )); then
echo "'Are you sure you haven't bought an abacus instead of a smartphone?'"
fi;
Please do suggestions for a better "reward message"
Btw I also tested this script on my Octa core 4ghz AMD CPU and it returned 1.37! ^^
Razr HD
This is my Razr HD. I scored better than your S3, which is odd...
Mini CPU Integer benchmark (by broodplank)
Starting Benchmark
--> CPU single thread integer test
-- First run: 7.27
-- Second run: 7.19
-- Third run: 7.21
- Average: 7.22
--> CPU multi thread integer test
-- First run: 5.28
-- Second run: 5.25
-- Third run: 5.18
- Average: 5.24
- Final score: 12.46 - 'Nice, your CPU speed is above average (first gen quad core)'
- Device: moto_msm8960
- Board: msm8960
- MAX CPU Freq: 1512000
Click to expand...
Click to collapse
By the way, I had to edit the score.bat in order to run it (w8.1). "adb" didn't wanted to work from the "files" subfolder, and it wasn't copying all the files ("bc" was not being copied, but the script on the phone asked for it).
I just copied all the files to the root folder add those edits. In case anyone needs it, here is the edited score.bat
@echo off
cls
cd /d %~dp0
echo Installing to phone...
echo.
echo Waiting for usb connection
adb wait-for-device
adb root
adb remount
adb push run /system/bin/run
adb shell "chmod 755 /system/bin/run"
adb push run2 /system/bin/run2
adb shell "chmod 755 /system/bin/run2"
adb push bc /system/bin/bc
adb shell "chmod 755 /system/bin/bc"
adb push score /system/bin/score
adb shell "chmod 755 /system/bin/score"
echo.
echo Done!
echo Execute 'score' from Terminal Emulator on device to start benchmark
daro.brussa said:
This is my Razr HD. I scored better than your S3, which is odd...
By the way, I had to edit the score.bat in order to run it (w8.1). "adb" didn't wanted to work from the "files" subfolder, and it wasn't copying all the files ("bc" was not being copied, but the script on the phone asked for it).
I just copied all the files to the root folder add those edits. In case anyone needs it, here is the edited score.bat
@echo off
cls
cd /d %~dp0
echo Installing to phone...
echo.
echo Waiting for usb connection
adb wait-for-device
adb root
adb remount
adb push run /system/bin/run
adb shell "chmod 755 /system/bin/run"
adb push run2 /system/bin/run2
adb shell "chmod 755 /system/bin/run2"
adb push bc /system/bin/bc
adb shell "chmod 755 /system/bin/bc"
adb push score /system/bin/score
adb shell "chmod 755 /system/bin/score"
echo.
echo Done!
echo Execute 'score' from Terminal Emulator on device to start benchmark
Click to expand...
Click to collapse
The lower the score the better, it's not the higher the score the better. because lower score means less calculation time, thus better.
Anyways, thanks for the adjusted script for windows 8.1, i appreciate that