Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Thread Closed

[Script][All ROMS][AROMA]Suvi Booster Script V4.0 [6 Nov 2013][Profile Support]

OP bsuhas

26th October 2013, 10:10 AM   |  #1  
bsuhas's Avatar
OP Recognized Developer
Thanks Meter: 2,976
 
1,036 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Suvi Booster Script



V4.0 added on 7Nov2013
V3.4 added on 6Nov2013
uninstaller for all versions added on 5Nov2013
V3 added on 5Nov2013
V2.1 added on 2Nov2013
V2 added on 28Oct2013

What is this script?
This is a init.d script which will manage CPU frequencies, governors, IO scheduler, etc. based on the phone state.

Users are free to use this but ROM developers please DO NOT include this in your ROM. Please direct a link to this thread. This will make things at one place


Why I should use this script?
I have observed annoying LAG in many (almost all) 4.2.2 ROMs. I did some investigation and figured out that if we set the proper CPU governor and frequency then the lags are reduced greatly. I am happy with MIUI rom with this script...I feel like 4.1 ROM smoothness.
Click image for larger version

Name:	Screenshot_2013-10-24-08-35-59.jpg
Views:	3964
Size:	25.2 KB
ID:	2350940

Well, this is not a big thing. I can do it easily. What different specialty this script has?
Its not a big thing to set the frequency and governor but if you do it, it will eat your battery a lot. Running your CPU at full speed and both cores active is gonna take battery down very fast. So I thought that what if the settings are applied ONLY WHEN phone is active. When phone is sleeping, go back to default power saving settings. So we will have performance when needed with good battery backup. So I decided to write a init.d script which will manage this.

But, let me declare this - This script is aimed to improve performance. Expect little more battery drain than normal. If you want performance, you have to bear this. Also properly setting governors and frequencies you can minimize the battery impact.

Features:
  • init.d script, no need any app
  • Sets CPU governor and freques depending on phone state - awake or sleeping
  • High performance when you need the phone
  • Battery saver when phone is not in use
  • Configurable settings - choose your favourite configuration with few simple steps
  • Sets ADJ and MINFREE parameters to get good RAM
  • Supports multiple profiles - like setcpu (coming soon)
  • Aroma installer to choose your suitable configuration.(coming soon)

Will this work only on 4.2.2 or other ROMS as well
It will work on any ROM with proper kernel. In fact this can work on any device

Hmm. Ok how to change to my favorite configurations?
This script is configurable to suit your needs without writing single line of 'code'. There is a configuration file ->

/data/SuviBoosterScript/SuviBoosterConfig.sh (for V2.1 nad above)

/system/etc/SuviBoosterConfig (for V2 and below)
Here you can define your favorite governors for each core, scheduler, frequencies when phone is active and sleeping (yes different frequencies can be set), ADJ and MINFREE parameters, read_ahead_kb value, and some other script specific configurations. Open the file you will get it.

Where to downloads?
Your are not allowed to download unless you click on thanks. Attached here

Any pre-requirements?
Yes. You should be running on a kernel which supports the configurations.
init.d support
Recommended to remove any other script from init.d that manages CPU

How do I know whether the script is applied and working?
run the command on adb shell or terminal emulator to read and monitor log file ->

tail -f /data/SuviBoosterScript/SuviBooster.log (for V2.1 and above)

/data/SuviA110Booster.log (for V2 and below)

The command output should change as you awake or sleep the phone.

How bsuhas is going to enhance this?
Yes. I am planning to enhance the script further - adding condition that while charging, everything runs at full speed. some other setting which will make this script eventually a single point of performance boost of all times. You would not need anything else. I am also embedding this script in Suvi Tool.

(*This is not related to Suvi ROM)

Credits:
Inspired from CPU Editor by smokin1337
also to MarkusMcNugen for the idea
XDA
All A110 users and ROM developers
Special thanks to pratik more for MIUI V5 4.2.2 ROM which made me develop this script
Last edited by bsuhas; 7th November 2013 at 07:40 PM.
The Following 152 Users Say Thank You to bsuhas For This Useful Post: [ View ]
26th October 2013, 10:11 AM   |  #2  
bsuhas's Avatar
OP Recognized Developer
Thanks Meter: 2,976
 
1,036 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Logs will be collected in a file -
/data/SuviBoosterScript/SuviBooster.log (for V2.1 and above)

/data/SuviA110Booster.log (for V2 and below)

run the command on adb shell or terminal emulator to read and monitor log file
tail -f /data/SuviBoosterScript/SuviBooster.log (for V2.1 and above)

tail -f /data/SuviA110Booster.log (for V2 and below)

Code:
[26-10-2013 01:50:28 PM] setting /sys/devices/virtual/bdi/7:7/read_ahead_kb = 1024
[26-10-2013 01:50:28 PM] setting /sys/devices/virtual/bdi/default/read_ahead_kb = 1024
[26-10-2013 01:50:28 PM] setting /proc/sys/fs/lease-break-time = 10
[26-10-2013 01:50:28 PM] SuviBooster Script End, background script will continue
[26-10-2013 01:50:28 PM] Waiting for wake
[26-10-2013 01:50:28 PM] Current file size is 4 K
[26-10-2013 01:50:28 PM] setting /sys/devices/system/cpu/cpu1/online = 1
[26-10-2013 01:50:28 PM] Second core is now 1
[26-10-2013 01:50:28 PM] setting /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = performance
[26-10-2013 01:50:28 PM] setting /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = hybrid
[26-10-2013 01:50:38 PM] Waiting for sleep
[26-10-2013 01:51:24 PM] setting /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
[26-10-2013 01:51:24 PM] setting /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 667333
[26-10-2013 01:51:24 PM] setting /sys/devices/system/cpu/cpu1/online = 0
[26-10-2013 01:51:24 PM] Second core is now 0
[26-10-2013 01:51:24 PM] Waiting for wake
[26-10-2013 01:51:28 PM] setting /sys/devices/system/cpu/cpu1/online = 1
[26-10-2013 01:51:28 PM] Second core is now 1
[26-10-2013 01:51:28 PM] setting /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = performance
[26-10-2013 01:51:28 PM] setting /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 1001000
[26-10-2013 01:51:28 PM] setting /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = hybrid
[26-10-2013 01:51:38 PM] Waiting for sleep
Look into this file for troubleshooting. Send me this file if you feel some problem.
Last edited by bsuhas; 1st November 2013 at 09:35 PM.
The Following 21 Users Say Thank You to bsuhas For This Useful Post: [ View ]
26th October 2013, 10:11 AM   |  #3  
bsuhas's Avatar
OP Recognized Developer
Thanks Meter: 2,976
 
1,036 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Configuration guide

The config file has some parameters which you can edit. File is present at
/data/SuviBoosterScript/SuviBoosterConfig.sh (for V2.1 and above)

/system/etc/SuviBoosterConfig (for V2 and below)

or you can edit the file in the zip before flashing.


New folder structure (from V2.1 onward).
/data/SuviBoosterScript/
- SuviBooster.log (log file)
- SuviBoosterConfig.sh (configuration file)
- current_version.txt (current version, do not edit)
- SuviBoosterScriptV2.1.sh (main script engine, do not edit)


#!/system/bin/sh
#Suvi Booster Script config file
#Users are free to use this but ROM developers please DO NOT include this in your ROM
#Dont forget to say thanks to bsuhas here

#The default settings here are suitable for Micromax A110 (which I have) - dual core 1GHz, 512MB RAM
#Please change values if you have any other device

#CPU Core 1 when screen is ON/Awake
GOVERNOR_CPU1="performance"
MAX_FREQ_CPU1="1001000"
MIN_FREQ_CPU1="250250"

#CPU Core 1 when screen is OFF/Sleep
SLEEP_GOVERNOR_CPU1="ondemand"
SLEEP_MAX_FREQ_CPU1="667333"
SLEEP_MIN_FREQ_CPU1="250250"

#Recomended to be "1" for dual core devices however, set to "0" if you don't want the script to turn the second core on/off
#Set to "0" for single core devices
SECOND_CORE_ON_OFF="1"

#CPU Core 2 when screen is ON/Awake
GOVERNOR_CPU2="hybrid"
MAX_FREQ_CPU2="1001000"
MIN_FREQ_CPU2="250250"

#CPU Core 2 when screen is OFF/Sleep
SLEEP_GOVERNOR_CPU2="ondemand"
SLEEP_MAX_FREQ_CPU2="667333"
SLEEP_MIN_FREQ_CPU2="250250"

IO_SCHED="cfq"

#######Advanced properties below. Do not touch if you dont know them######
#Memory mgmt
ADJ_PARAMS="0,1,2,4,7,15"
MINFREE_PARAMS="2048,4096,8192,16384,24576,32768"
READAHEAD_KB="1024"

#Read this file only one time (at boot) (="1") or every time device wakes up (="0")
#Recommended to be "1". If you are trying out different configuration and want it to be applied without reboot then set to "0"
CONFIG_READ_ONE_TIME="1"

#Interval in seconds for script to pause when checking device is awake or sleep.
#This interval will not matter much. Recommended not to change
WAKE_SLEEP_CHECK_INTERVAL="10"
Last edited by bsuhas; 6th November 2013 at 07:01 PM.
The Following 16 Users Say Thank You to bsuhas For This Useful Post: [ View ]
26th October 2013, 10:12 AM   |  #4  
bsuhas's Avatar
OP Recognized Developer
Thanks Meter: 2,976
 
1,036 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Changelog
Suvi Booster Script V4.0 (7Nov2013)
  • AROMA
  • Built in profiles as per your needs, select from Aroma installer
  • New SBS logo
  • Aroma installer is all-in-one place for different profiles and uninstaller -
  • Profiles build-in -
    • Performance & Powersave
    • Hybrid & Powersave
    • Ondemand & Hybrid
    • Ondemand & Powersave
    • Performance & Hybrid
    • Sakuractive & Hybrid
    • Sakuractive & Powersave
  • Fixed sqlite3 binary on MIUI roms (maybe for all?)
  • Support to delete existing init.d tweaks
  • Other tweaks -
  • perfect mount options
  • Kernel VM management
  • Kernel scheduler, less aggressive settings
  • Misc tweaks for battery life
  • EXT4 tweaks - remove journalism
  • Defrags database files
  • Disable normalize sleeper
  • maybe some other ....


Suvi Booster Script V3.4 (6Nov2013)
  • Performance improvements (of script)
  • CPU1 and CPU2 settings are overlapped due to a bug (not in script but its MTK). Hence removed CPU2 governor and frequency settings.
  • 'performace' when awake, 'powersave' when sleep. Improve speed when active and saves battery when sleep.
  • guaranty to boost performance.....

Suvi Booster Script V3 (5Nov2013)
  • Performance improvements (of script)
  • No more background loop. Loop runs in main process.
  • Lags now reduced....(I hope so)
  • CONSIDER_BATTERY_STATUS="0" by default. to improve charging time
  • Sleep governors changed to conservative and powersave for CPU core 1 and 2 respectively - To improve battery life

Suvi Booster Script V2.1 (2Nov2013)
  • New folder structure.
    /data/SuviBoosterScript/
    - SuviBooster.log (log file)
    - SuviBoosterConfig.sh (configuration file)
    - current_version.txt (current version, do not edit)
    - SuviBoosterScriptV2.1.sh (main script engine, do not edit)
  • Re-factored code. More developer friendly
  • Prevents parallel execution. (due to bug in ROM). Script engine will ensure that its only one instance is running.
  • Permission issue fix. Run the script SuviBoosterConfig.sh once as root and then reboot.


Suvi Booster Script V2 (28Oct2013)
  • Added battery intelegence.
    #Consider the battery status in the script. like -
    #When charging, don't apply sleep setting freq and governors.
    #When battery is below 15 (see the BATTERY_MIN_LIMIT below) do not apply awake freq and governors
    #Set it to 0 if you want the script to ignore the battery status

    CONSIDER_BATTERY_STATUS="1"
    #The minimum battery percentage below which the battery saving profile is applied
    BATTERY_MIN_LIMIT="15"
  • Improved read_ahed_kb settings
  • Removed file monior loop. Now log file is cleared every 1000th execution of main loop.
Last edited by bsuhas; 7th November 2013 at 07:44 PM.
The Following 23 Users Say Thank You to bsuhas For This Useful Post: [ View ]
26th October 2013, 10:17 AM   |  #5  
khan_frd2002's Avatar
Senior Member
Flag Dressosa
Thanks Meter: 1,548
 
1,213 posts
Join Date:Joined: Nov 2011
Donate to Me
More
Quote:
Originally Posted by bsuhas

Last one....thanks for patience.

@bsuhas.... Here is My review after Using it 10 mins
I must say it works perfect no lag at all
scrolling is smooth transition is smooth
Great Work Bro

As I know its just beginnings but some suggestions from my side
add some dalvik tweak in script ( as it good for gamers and give more smoothness)
and also try to update the update script so that it will delete all the init.d script which is already there (as i have to delete the init.d tweaks myself before installing)

Other Than All Good.....
Last edited by khan_frd2002; 26th October 2013 at 10:59 AM.
The Following 3 Users Say Thank You to khan_frd2002 For This Useful Post: [ View ]
26th October 2013, 10:28 AM   |  #6  
Senior Member
Flag Hyderabad
Thanks Meter: 396
 
414 posts
Join Date:Joined: Dec 2012
Donate to Me
More
Thumbs up
This is what all 4.2 Roms desperately need... This is what I have suggested to someone who felt 4.2 roms are laggy, i suggested him CPU Tuner app which does the same thing what this script does... It will sure help many roms to show their real power... Thanks Brother!

I will come up with the review soon...
The Following User Says Thank You to sheshuvadrevu For This Useful Post: [ View ]
26th October 2013, 10:37 AM   |  #7  
showstopper1's Avatar
Senior Member
Thanks Meter: 2,052
 
1,343 posts
Join Date:Joined: Nov 2011
More
Flashed juz now,
Noticable changes in smoothness and performance
Will test battery and report soon
Wonderful work @bsuhas
Feeling the power of the script.
Sent from my A110 using xda app-developers app
The Following User Says Thank You to showstopper1 For This Useful Post: [ View ]
26th October 2013, 10:43 AM   |  #8  
Member
Thanks Meter: 17
 
77 posts
Join Date:Joined: May 2013
Thumbs up
Downloading and testing.

Will update the results and output.

Hope this one will change my mind to switch back to 4.1.



---------- Post added at 02:13 PM ---------- Previous post was at 02:12 PM ----------

Downloading and testing.

Will update the results and output.

Hope this one will change my mind to switch back to 4.1.

The Following 3 Users Say Thank You to vinod210383 For This Useful Post: [ View ]
26th October 2013, 11:27 AM   |  #9  
shekhar1986's Avatar
Senior Member
Flag delhi
Thanks Meter: 136
 
228 posts
Join Date:Joined: Aug 2013
More
@bsuhas sir will this conflict with sir andiroxu 3.4.69 kernel .
can i use it on that as PX is already included in that kernel
The Following User Says Thank You to shekhar1986 For This Useful Post: [ View ]
26th October 2013, 11:44 AM   |  #10  
snhykoba's Avatar
Member
Somewhere in the earth
Thanks Meter: 27
 
68 posts
Join Date:Joined: Sep 2013
Sir..
- is this script works on 4.1.x ROMs..
- I am already in andirox 3.4.69. I set hybrid governer and cfg with no frill app.. may I remove setting..
- I am using 300 mob swap ram file with init.D folder.. may I remove this..

The Following User Says Thank You to snhykoba For This Useful Post: [ View ]
Thread Closed Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes