[Hero CDMA Android Development] AspenTree:
Kifno's HeroC Universal Scripts v2.0.1

PLEASE READ THE ENTIRE FIRST POST BEFORE POSTING

THE CREDITING/PERMISSION ISSUE IS DONE AND OVER WITH EVER SINCE THE V1.x THREAD SO PLEASE NO MORE POST ABOUT THAT, OR YOU WILL BE REPORTED TO A MOD! ALSO I DID NOT JUST COMPILE A BUNCH OF MODS TOGETHER! IF YOU READ THE CREDITS YOU'LL SEE I ASKED TO USE THEIR IDEAS AND I IMPROVED THEM AND INCLUDED THEM ALONGSIDE MY WORK! SO PLEASE NO POST ABOUT I HAVEN'T DONE ANYTHING BECAUSE IT IS OFFENSIVE TO ME WHEN I KNOW I HAVE DONE EVERYTHING IN THIS SCRIPT FOR OUR HEROES, FROM MY CUSTOM VALUES TO THE IMPROVEMENTS OF OTHERS IDEAS OF WHICH I HAVE CREDITED AND GOT PERMISSION FROM AND SUBMITTED MY IMPROVED VERSION TO.

Thanks

- Kifno​

What did I do?

- Read change log

My Explanation for the tweaks/scripts

Yes these are the tweaks I apply. They are what I think are the best
values for the file(s). Now I'll go into detail as to what each file is and why I set
a new value for it. If you don't like my opinion as to why my new value is
better please explain in a positive manner why you think so or just well...
then, no offense but just keep it to yourself. If you can't say anything
that is constructive POSITIVE critism without using language that could lead to
an argument/provakative language then please don't post here. Now on to the
explanations.

[B]Kernel Tweaks:[/B]

This specifies a period of time that the kernel gives a process that is holding a
file lease. After it has sent a signal to that process notifying, it that another
process is waiting to pen the file. In simpler terms this means that the kernel
has given the process a set amount of time it can hold a file after another
process has notifying it that it wants the file. The deafult had the time higher. I
set it lower. Although it doesn't make much of a difference, ever millionth of a
second counts :D

[CODE]/proc/sys/fs/lease-break-time

This enables cfq compatibility with older kernel models. This results in better

performance, for example more smoothness in apps and the launcher :D

/proc/sys/kernel/sched_compat_yield

This value has to correspond with the file-max value so this is raised according

to the value of the file-max. Why did I raise the file-max? Keep reading silly :p

/proc/sys/kernel/ngroup_max

Disables some annoying cfs scheduler feature (which is why I don't use the cfs

scheduler in my tweak, I use the noop scheduler) whic increase the UI's

performace just a bit.

/proc/sys/kernel/sched_features

Sets the maximum number of file-handles that the android kernel will put aside

for other use, share, or put in memory for other use. Usually increasing this

value is a good thing compared to the default value. Which in our case, it was.

If our kernels had an inode file we'd want the value of that to be 2-3 times as

much as the file max. Its a good tweaking rule I thought I'd let you know just

in case you're on linux ;)

/proc/sys/fs/file-max

This is the max percentage of active processes that can be filled with dirty

pages before the pdflush begins writing them :D This MAY OR MAY NOT be the

default value for most kernels, but just in case it isn't I set it anyway. Why?

Becuase I want to make sure that if the dirty pages is about 19MB - 40MB of

our RAM, that pdflush begins writing :D

/proc/sys/vm/dirty_background_ratio

How agressively memory is "swapped" between disk and swap space.

/proc/sys/vm/swappiness

Lowering this is a good thing if on a system with slow I/O speeds between the

disk. But if this is lowered too much the I/O will get "constapated" and just

slow the phone down.

/proc/sys/vm/dirty_expire_centisecs

Doesn't do much but messing with the pdflush's timing of things. Little improvement but everything adds up :D

/proc/sys/vm/dirty_writeback_centisecs

Management of the phone's processes by setting a max amount of memory the

phone allows for dirty pages before stopping the processes writing.

/proc/sys/vm/dirty_ratio

Sets kernel priority for getting/releasing inodes and dentry cache files.

Higher = getting inodes and dentry cache files back more quickly

Lower = releasing inodes and dentry cache files a bit more quickly :D

/proc/sys/vm/vfs_cache_pressure

Changes the govenor depending on screen state :D

$*GOV

Changed timeslice lenght for better performance when using the phone, and

bettery battery when you aren't using the phone (screen off).

/proc/sys/kernel/sched_latency_ns
/proc/sys/kernel/sched_min_granularity_ns
/proc/sys/kernel/sched_wakeup_granularity_ns

Cpu frequencies. Pretty simple to explain :D

/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

Amount of time before the interactive governor decides to change the cpu

speed.

/sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time

This is how often the kernel changes the frequency.

/sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate

This is the max rate at which the kernel can change frequencies.

/sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate_max

Thi is teh min rate at which the kernel can change frequencies.

/sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate_min

Average CPU usage from kernel's sampling rates which help it determine

wheather or not it should increase the CPU frequency.

/sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold

This is what I use to find the battery percentage for the battery percentage

profile.

$capacity

This is what I use to find the temperature for the temperature profile.

$temp

Determines if phone is sleep or awake for screen state profile

$sleeping/$awake

This is the amount of power that was given towards wifi. I just upped the

amount a bit :D BETTER WIFI WOOHOO :D

/sys/module/acpuclock_arm11/parameters/pwrc_khz
/sys/module/acpuclock_arm11/parameters/wfi_khz

I/O Scheduler Tweaks:

IMO the noop scheduler is better for our read and write speeds. Simple as that.

And what more than a better scheduler for read and write speeds to go along

with the sd card speed tweaks? :D

echo noop > /sys/block/*/queue/scheduler

Set so that the phone's process, ram, or any other request won't get out of

order. This improves the performance because it helps our internal drive and

extral drive (if using apps2sd or data2ext or data2sd). How think of it as

organizing the request a little bit better than the default value :D This is more

of a being safe thing in fact, but also a little extra performance didn't hurt

anyone did it?

/sys/block/mmcblk0/queue/nr_requests

Network Tweaks:

These change the DNS server to 0.0.0.0 which in fact helped my mobile data

speeds go up by about 50-100kbps :D This DNS server was better than

google's or opendns (but I've always had problems with opendns). Though

google's dns server came close to being the better of the three this DNS server

was the best after being tested many times :D

nameserver 0.0.0.0 /etc/resolv.conf

The following are the combination of strings and values that I played with in the

beginning days of this tweak so configure our network speeds. It took about 6

hours of testing to come up with the best combination for the heroc :D And like

I've asked and I've said about at least 20x when asked, exactly how is our

CDMA network affected by these values when they aren't even meant for it?

They just do, now shh and enjoy your better 3G speeds :D But seriously ask

someone in the networking field or someone who works for sprint but is into

rooting androids (so you won't get into trouble because of hacking their data

tower speeds they give out to our herocs :D). I did and it has something to do

data towers, I can't explain exactly how because once I heard that I was so

excited I just stopped listening as well :D

ro.ril.hsxpa=2
ro.ril.gprsclass=8
ro.ril.hep=1
ro.ril.hsdpa.category=24
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=3
wifi.supplicant_scan_interval=20

How frequently the keepalive probes are sent out is determined by tcp_keepalive_intvl This is value is dependent upon

tcp_keepalive_probes

as well, which determines how many probes are sent out. This determines the time not to kill the connection. I lowered this value so connections will be killed faster.

tcp_keepalive_intvl

tcp_keepalive_probes

Time to hold sockets, which I lowered.

tcp_fin_timeout

Socket receive buffer. Increased to increase sockets received from network.

rmem_default

Socket send buffer. Increased to increase sockets sent to the network.

wmem_default

Maximum socket receive buffer. Increased to increase the total amount of sockets we can receive from the network.

rmem_max

Maximum socket send buffer. Increased to increase the total amount of sockets we can send to the network.

wmem_max

Memory Tweaks:

This is the tweak I used to configure our internal task killer. I had to experiment

with this a lot becaue certain values made music playback very choppy when

the screen was in sleep mode. But at last these are the values I came up with

to keep our free ram high while not interfering with everyday usage too much :D

echo "3072,6144,9216,21000,23000,25000" > /sys/module/lowmemorykiller/parameters/minfree

SD Card Tweaks:

This is the cache of the sd card. This was set to 128 so I bumped it up to 1024. Other values may be better for your phone and it's sd card but this is the

most compatible across the board. Still a performance increase but just not the

optimal value. Why? Because all heros are different as well as that plust the sd

card everyone is using :D

read_ahead_kb

[/CODE]

Requirements:

- Rooted HTC Hero CDMA

- Kernel w/ Interactive, Smartass, Conservative, Powersave, Ondemand, and Performace Governors (Grab deca kernel and compile from source if not using cyanogenmod based roms, or use sobe's kernel)

ATTENTION​

DO NOT, I REPEAT, DO NOT USE SETCPU/OVERCLOCKWIDGET/COLLIN_PH/DECA'S BATTERY TWEAK, OR ANY BATTERY TWEAKING/CPU OVERLOCKING UTILITIES/SCRIPTS WITH THIS MOD!!!!!! WARNING USE THIS MOD AT YOUR OWN RISK!!! I TAKE NO RESPONSIBILITY FOR WHAT HAPPENS TO YOUR PHONE IF SOMETHING GOES WRONG! ALTHOUGH IF SOMETHING DOES HAPPEN I WILL HELP YOU AS MUCH AS POSSIBLE!!!

INSTRUCTIONS

Installing Instructions (Recovery Menu):

Difficulty: Easy

Reboot Recovery

Download and Flash Kifno's Universal HeroC Script

REMOVED UNTIL RELEASE OF V3.0.0 SOMETHINGS WERE BROKEN IN ROMS WITH THIS RELEASE.....IF YOU HAVE V2.0.1 DON'T USE IT WAIT UNTIL V3.0.0

- THANKS

Wipe cache, and dalvik-cache

Reboot into system

Enjoy :D

Removal Instructions (Recovery Menu):

Difficulty: Easy

Download the removal zip for latest version

Get It Here

Reboot Recovery

Flash it

Reboot

TESTED AND SUCCESSFUL ON

- Cyanogenmod 7.0.2

- NfiniteFX's Stock Rom

- LiquidSense 2.1.1

- Kifno's 2.1 Sense Roms

- Aosp Gingerbread

- GingerSense/Rock Steady

- Aosp Froyo

- CM6.1

TESTED AND

SOMETIMES

FAILED (BOOTLOOP/LAGGING) ON...

NOTE: If lagging with latency tweak builds, use the no latency tweak builds.

- Works on Every Rom

Change Log

4/27
- ALL BY KIFNO!!!!!!!
- Documentation for my opinion of what all my tweaks/scripts do. (I say opinion because I may or may not be correct for all of my explanations. If I am wrong please let me know, so that I can correct it so that others will not learn false information).
- setCPU, collin_ph, overclockwidget, CM7's cpu settings, or any other battery tweak/cpu overclocking utility, REPLACEMENT. This is not to be used with any of those utilities while using this or you will encounter many problems.
- mobile network and wifi speed boost ranging anywhere from 175%-400% speed gains. The percentage amount increased is determined by many other factors (the data tower in your area, your phones condition, the wifi connection, etc)
- Smoother UI
- More Free RAM
- Memory Settings Optimizer
- Any kernel tweak-er
- DroidX Market Tweak COMING SOON
- GPU Composition instead of MDP Composition
- Extended Battery Life and/or Increased Performance as a result of the tweaks and my battery tweak/cpu overclocking utility replacement script
- Tweaked the I/O

5/2

- removed some junk
- made network speeds a bit more stable
- fixed the problem were my 98kiftweaks wasn't writing the values correctly (sd card cache fix improvement & io tweaks)
- adjustments to kifCPU so that there will be longer battery life :D
- added a removal and backup script

Donations

I want everyone who is has ever donated, or has thought of donating me or anyone else to know this. XDA is a place for everyone to learn, teach, and share their work and new findings for android. Donations are not a right on XDA they are a privilege. Donations were allowed for XDA members to give and receive as a way for someone who really appreciates the original poster's work and is a way for the donor to show their thanks by doing more than pressing the thanks button. This is something that the original poster should appreciate and follow up with a PM as a thanks for their thanks, and use that as a notification, that they should keep up the good work and they're doing good things for XDA. Again recieving donations is not a right it is a privilege, that the original poster shouldn't abuse by asking for donations but instead appreciate when recieved. Asking for donations is not right and it is looked down upon on XDA because it goes against the meaning of what XDA is all about. This is something I want everyone to understand before even thinking of donating to me or anyone else or when given a donation. Don't donate because the original poster comes off as asking for money, instead if you choose to donate, donate out of showing more appreciation for another's work and as more of a way to show that you care for their work. I want everyone to understand that.

- Kifno

Credits:

unCoRrUpTeD

Made base of the script when he converted the v0.9 build.prop edits in to a script.

brainmaster

SD Card cache

IDEA

. I improved it.

farmatito

IDEA

for I/O scheduler tweaks. I improved them for our heroes.

montalbert

MOST

of the network tweaks. I just changed the values so that it'd be optimal for our heroes.

FloHimself

Screen state

IDEA

for kifCPU

​