Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Bastaerd
Old
(Last edited by Bastaerd; 28th July 2012 at 10:05 PM.)
#1  
Bastaerd's Avatar
Senior Member - OP
Thanks Meter 265
Posts: 850
Join Date: Aug 2011
Location: Amsterdam

 
DONATE TO ME
Default [MOD] Tweaked Ondemand V1.0.2 [28/07/12]

What this does:
This mod sets your CPU governor to ondemand instead of the default interactive.

Why?
While it gives a smooth UI performance interactive eats battery like crazy because it maxes out all cores quickly. Ondemand is better because it scales according to demand, hence ondemand

Requirements:
A rom with init.d support, eg Androwook, Virtuous Prime.

Code:
I am not responsible for anything that happens to your Sensation eg. bricking! 
Aka if you flash this mod, you are the one responsible if sh!t hits the fan!
Versions:
Agressive: http://db.tt/RUDrE4XW
MD5: 449542013c1a9ad46218e6772d2ac368
Balanced: http://db.tt/VD07FafX
MD5: c14902fcc49c9b8d255c8696d3ad22af
[i]Battery: http://db.tt/NQ00J5y7
MD5: 120dff5e6b8211f0a4974227536196dd

Comments and feedback are hugely appriciated!
If you like it, don't forget to thank me.

Changelog:
  • 28/07/12: added a line to the installer script which sets the right permissions for the init.d script (thanks Striatum_bdr) + some cosmetic stuff
  • 19/07/12: fixed wrong permissions (thanks Parastie)
  • 17/07/12: initial versions released
HTC Sensation (Z710e):
ROM: Albino's CM 10.1 with modded kernel
Recovery: TWRP 2.5.0
HBOOT: 1.27.1011
The Following 5 Users Say Thank You to Bastaerd For This Useful Post: [ Click to Expand ]
 
Bastaerd
Old
(Last edited by Bastaerd; 21st July 2012 at 10:30 AM.)
#2  
Bastaerd's Avatar
Senior Member - OP
Thanks Meter 265
Posts: 850
Join Date: Aug 2011
Location: Amsterdam

 
DONATE TO ME
What has been modified?
In /sys/devices/system/cpu/cpufreq/ondemand there are the following parameters/variables with the following values:
  • ignore_nice_load (TFP default: 0; Agressive: 0; Balanced: 1; Battery: 1)
  • io_is_busy (TFP default: 0; Agressive: 1; Balanced: 1; Battery: 1)
  • powersave_bias (TFP default: 0; Agressive: 0; Balanced: 0; Battery: 0)
  • sampling_down_factor (TFP default: 1; Agressive: 1; Balanced: 2; Battery: 4)
  • sampling_rate (TFP default: 300000; Agressive: 30000; Balanced: 50000; Battery: 100000)
  • sampling_rate_min (TFP default: 30000; Agressive: 3000; Balanced: 5000; Battery: 1000)
  • up_threshold (TFP default: 95; Agressive: 85; Balanced: 90; Battery: 95)

What do the variables/parameters do?
  • ignore_nice_load: Setting to 1 causes governor to ignore load resulted by nice processes while making scaling decisions. Nice processes are the one i/o scheduler refers to as low priority process. UNIT: Boolean 1 or 0
  • io_is_busy: Setting to 1 causes treating i/o wait time as CPU busy time. To improve performance of heavy applications, set this to 1. UNIT: Boolean 1 or 0
  • powersave_bias: The powersave_bias parameter modifies the behavior of the ondemand governor to save more power by reducing the target frequency by a specified percentage. By default, (powersave_bias = 0), the ondemand governor selects the minimum processor frequency that can still complete a workload with minimal idle time. Doing so should result in the highest performance to power efficiency ratio. In some cases, you might prefer a greater emphasis on power efficiency than performance. In this case, set the powersave_bias parameter to a value between 1 and 1000 to reduce the target frequency by one-thousandth of that value. For example, set powersave_bias to 100 for a one-tenth reduction in target frequency. In this case, if the governor chooses a target frequency of 2 GHz (with powersave_bias = 100), the governor instead will request 1.8GHz – a one-tenth reduction. If 1.8 GHz is an exact match with an available hardware frequency (listed in the scaling_available_freq parameter), the processor is set to this frequency. If 1.8 GHz is not available, the processor fluctuates between the closest available upper and lower frequencies for an average frequency of 1.8 GHz. UNIT: Positive Integer
  • sampling_down_factor: Acts as a multiplier to sampling interval for re-evaluating the load when CPU is truly busy and is on highest clock frequency (policy max). Setting to 1 makes no difference and causes CPU to immediately scale down from highest frequency. Sampling down factor is not valid for lower frequencies and low load conditions. Note that CPU is scaled up to max frequency when max_load_freq is greater than up_threshold*current frequency. Max_load_freq is an arbitrary frequency calculated as the maximum of load_frequencies. Load_frequency is an arbitrary frequency which describes the frequency the device theoretically needs to handle 100% load, calculated as load*average_frequency. UNIT: Positive Integer
  • sampling_rate: Measured in uS and actual meaning being Sampling Interval, this factor is used to determine how often the governor should poll for CPU usage in terms of frequency and load percentage to make scaling decisions - either scale CPU Up or scale it Down. UNIT: Miscroseconds
  • sampling_rate_min: sampling_rate_(min|max) - This is minimum and maximum sampling rates available that you may set 'sampling_rate' to. UNIT: Miscroseconds
  • up_threshold: Measured as percentage, this is the load on CPU at which governor scales CPU Up. Lower value - early scale up, and vice-verse. UNIT: Percentage

How to check if the ondemand mod has been loaded correctly?
If you have flashed this mod then there should be a script called 20-cpu_governor in /system/etc/init.d.
To check if the script get's executed you can use 2 methods: root explorer app or terminal app.
  • Root explorer eg. ES File Explorer: go to /sys/devices/system/cpu/cpufreq/ondemand and open one of the changed values listed in the 2nd post to verify it has been changed form the stock default.
  • Terminal emulator: In your favourite terminal app eg. Terminal Emulator "cat" one of the values to see if it has been changed. Eg. cat /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate.
HTC Sensation (Z710e):
ROM: Albino's CM 10.1 with modded kernel
Recovery: TWRP 2.5.0
HBOOT: 1.27.1011
The Following 2 Users Say Thank You to Bastaerd For This Useful Post: [ Click to Expand ]
 
Bastaerd
Old
#3  
Bastaerd's Avatar
Senior Member - OP
Thanks Meter 265
Posts: 850
Join Date: Aug 2011
Location: Amsterdam

 
DONATE TO ME
And one more to be safe
HTC Sensation (Z710e):
ROM: Albino's CM 10.1 with modded kernel
Recovery: TWRP 2.5.0
HBOOT: 1.27.1011
The Following User Says Thank You to Bastaerd For This Useful Post: [ Click to Expand ]
 
Parastie
Old
#4  
Senior Member
Thanks Meter 92
Posts: 787
Join Date: Apr 2010
Location: Lodz, Poland

 
DONATE TO ME
Can you post what each setting is instead of just the flash files? I can change the settings myself easily enough, I'm more curious as to what you're using. I've got a pretty good setup going at the moment. Battery life seems okay, but we'll see over time.

sampling_rate: 30000
up_threshold: 75
sampling_down_factor: 2

Everything else is stock from Androwookie.
Give me a thanks! It's like Karma!

Devices:
Sony Xperia Ion l28at sim unlocked/bootloader sadly locked by AT&T.
Asus Transformer Prime Wookied Out.
HTC Desire with CM10.1! (RETIRED)
(If you have a prime, you're doing yourself a disservice by NOT unlocking.)
Google Users! Make sure you're using dual authentication. Especially if you have credit cards with Google.
 
Bastaerd
Old
#5  
Bastaerd's Avatar
Senior Member - OP
Thanks Meter 265
Posts: 850
Join Date: Aug 2011
Location: Amsterdam

 
DONATE TO ME
Quote:
Originally Posted by Parastie View Post
Can you post what each setting is instead of just the flash files? I can change the settings myself easily enough, I'm more curious as to what you're using. I've got a pretty good setup going at the moment. Battery life seems okay, but we'll see over time.

sampling_rate: 30000
up_threshold: 75
sampling_down_factor: 2

Everything else is stock from Androwookie.
Will update the 2nd post with that information.
HTC Sensation (Z710e):
ROM: Albino's CM 10.1 with modded kernel
Recovery: TWRP 2.5.0
HBOOT: 1.27.1011
The Following User Says Thank You to Bastaerd For This Useful Post: [ Click to Expand ]
 
Gage_Hero
Old
#6  
Senior Member
Thanks Meter 112
Posts: 848
Join Date: Jul 2010
Default Flashing

Just curious, if you flash one file then decide to flash a different one, can you just flash overtop or should a guy be doing a nand restore first?
Telus Galaxy S3
Hairybean 64GB Sandisk Ultra
I/O Boost - Data2SD 28GB FAT32 - 31GB EXT4
it's unlocked an no I don't regret it.....
Join dropbox you get 2 gb free I get an extra 250 mb @Dropbox. 2GB account is free! http://db.tt/BCnlmj2R
 
Bastaerd
Old
#7  
Bastaerd's Avatar
Senior Member - OP
Thanks Meter 265
Posts: 850
Join Date: Aug 2011
Location: Amsterdam

 
DONATE TO ME
Quote:
Originally Posted by Gage_Hero View Post
Just curious, if you flash one file then decide to flash a different one, can you just flash overtop or should a guy be doing a nand restore first?
You can flash it on top, did it myself a couple of times
HTC Sensation (Z710e):
ROM: Albino's CM 10.1 with modded kernel
Recovery: TWRP 2.5.0
HBOOT: 1.27.1011
 
Parastie
Old
#8  
Senior Member
Thanks Meter 92
Posts: 787
Join Date: Apr 2010
Location: Lodz, Poland

 
DONATE TO ME
Well I just had a random reboot coming out of lockscreen with my ondemand settings. Not sure if there's anything I can do about it though.
Give me a thanks! It's like Karma!

Devices:
Sony Xperia Ion l28at sim unlocked/bootloader sadly locked by AT&T.
Asus Transformer Prime Wookied Out.
HTC Desire with CM10.1! (RETIRED)
(If you have a prime, you're doing yourself a disservice by NOT unlocking.)
Google Users! Make sure you're using dual authentication. Especially if you have credit cards with Google.
 
Bastaerd
Old
#9  
Bastaerd's Avatar
Senior Member - OP
Thanks Meter 265
Posts: 850
Join Date: Aug 2011
Location: Amsterdam

 
DONATE TO ME
Quote:
Originally Posted by Parastie View Post
Well I just had a random reboot coming out of lockscreen with my ondemand settings. Not sure if there's anything I can do about it though.
Never had a reboot with my modified settings. You are running Androwook, am I right?
I'm running Virtous Prime with _motley latest alpha 3.0.7.10 (not the lite kernel).
HTC Sensation (Z710e):
ROM: Albino's CM 10.1 with modded kernel
Recovery: TWRP 2.5.0
HBOOT: 1.27.1011
 
Parastie
Old
#10  
Senior Member
Thanks Meter 92
Posts: 787
Join Date: Apr 2010
Location: Lodz, Poland

 
DONATE TO ME
Quote:
Originally Posted by Bastaerd View Post
Never had a reboot with my modified settings. You are running Androwook, am I right?
I'm running Virtous Prime with _motley latest alpha 3.0.7.10 (not the lite kernel).
Yup, running Androwook with 3.0.5 but I didn't do a full wipe so it could just be a corrupted program. How is 3.0.7 treating you?
Give me a thanks! It's like Karma!

Devices:
Sony Xperia Ion l28at sim unlocked/bootloader sadly locked by AT&T.
Asus Transformer Prime Wookied Out.
HTC Desire with CM10.1! (RETIRED)
(If you have a prime, you're doing yourself a disservice by NOT unlocking.)
Google Users! Make sure you're using dual authentication. Especially if you have credit cards with Google.

 
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...