FORUMS
Remove All Ads from XDA

[TWEAK][A120][Alpha]Super battery tweaks

2,754 posts
Thanks Meter: 9,702
 
By Umang96, Recognized Developer / Themer on 30th October 2014, 12:37 PM
Post Reply Email Thread
Please read the whole thing before deciding or asking any questions !!

This is a little script written by me to tweak the default cpu governer (hotplug) for MT6582 devices, currently tested only on A120, this script is actually programmed to set cpu power saving bias, number of cores online, and some more more attributes of our hotplug governer

Warning - flash on your own risk, i'm not responsible for any bad thing !!
Warning - this is only tested on A120 right now !!
Warning - only works on stock kitkat and cleankat for A120 !!
Warning - do give me credits if you include this in your rom !!


There are 7 different levels of power saving from 1 - 7 !!

Code:
Lvl	        BIAS        CORES
1	        150	        4
2	        250	        4
3	        150	        3
4	        250	        3
5	        100	        2
6	        250	        2
You just have to flash any level and reboot !!

The higher level you flash, the more battery you save !!

Flash level 0 to get max perfomance with no battery saving !!

Attached Files
File Type: zip Lvl_0_battery.zip - [Click for QR Code] (592.0 KB, 3009 views)
File Type: zip Lvl_1_battery.zip - [Click for QR Code] (592.0 KB, 2617 views)
File Type: zip Lvl_2_battery.zip - [Click for QR Code] (592.0 KB, 841 views)
File Type: zip Lvl_3_battery.zip - [Click for QR Code] (592.0 KB, 678 views)
File Type: zip Lvl_4_battery.zip - [Click for QR Code] (592.0 KB, 909 views)
File Type: zip Lvl_5_battery.zip - [Click for QR Code] (592.0 KB, 1244 views)
File Type: zip Lvl_6_battery.zip - [Click for QR Code] (592.0 KB, 1382 views)
File Type: zip Lvl_7_battery.zip - [Click for QR Code] (592.0 KB, 3387 views)
The Following 8 Users Say Thank You to Umang96 For This Useful Post: [ View ]
 
 
30th October 2014, 02:25 PM |#2  
mr-illusionist's Avatar
Senior Member
Flag Chandigarh
Thanks Meter: 664
 
More
Well done brother. Now i can flash levels according to my need. There's a hell loads of difference in battery after flashing higher levels. Keep up the good work. You always come up with something remarkable.
The Following 2 Users Say Thank You to mr-illusionist For This Useful Post: [ View ] Gift mr-illusionist Ad-Free
31st October 2014, 02:36 AM |#3  
eyesfortech's Avatar
Member
Thanks Meter: 31
 
Donate to Me
More
Thumbs up Let us collaborate
Hi Mate,

I will message you on FB and will give you an update.
31st October 2014, 05:29 AM |#4  
eyesfortech's Avatar
Member
Thanks Meter: 31
 
Donate to Me
More
Update on script
Hi @umangleekha,

Again nice job

But I have a suggestion (you can opt to take it or not). As you have mentioned the Level 0 is the stock value so you recommend us to install it whenever we want to revert. However there are a few of us who have already tweaked the values of what your script intends to change. And curious people like me would want to try your script as well. So to make things a little bit flexible and friendly, I did a little modification on your script and an uninstaller so that people can revert back to their previous settings.

I Pm'd you the scripts so you can decide if you want to update your set of installers. The uninstaller will can be applied to any of the Level installer they used.

Here's a little bit explanation of how it works, I am taking Level 6 for example:

Updated scipt
Code:
#!/system/bin/sh
#hotplug governer tweaks_umangleekha

#variables
up_threshold=/sys/devices/system/cpu/cpufreq/hotplug/up_threshold
cpu_up_threshold=/sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold
sampling_rate=/sys/devices/system/cpu/cpufreq/hotplug/sampling_rate
cpu_down_differential=/sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential
down_differential=/sys/devices/system/cpu/cpufreq/hotplug/down_differential
powersave_bias=/sys/devices/system/cpu/cpufreq/hotplug/powersave_bias
sampling_rate_min=/sys/devices/system/cpu/cpufreq/hotplug/sampling_rate_min
cpu_num_limit=/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit

hotplugbak=/data/hotplug
hotpluglog=/data/hotplug.log

rm -f $hotpluglog
touch $hotpluglog

if [ -s $hotplugbak ] ; then
	echo "hotplug original values were stored." | tee -a $hotpluglog;
else
	touch $hotplugbak;
	echo "#!/system/bin/sh" | tee -a $hotplugbak;
	echo "# This contains the original values" | tee -a $hotpluglog;
	echo "" | tee -a $hotplugbak;
	echo "hotplug will run the first time..." | tee -a $hotpluglog;
	#creating a backup first
	echo "echo $( cat $up_threshold ) > $up_threshold" | tee -a $hotplugbak;
	echo "echo $( cat $cpu_up_threshold ) > $cpu_up_threshold" | tee -a $hotplugbak;
	echo "echo $( cat $sampling_rate ) > $sampling_rate" | tee -a $hotplugbak;
	echo "echo $( cat $cpu_down_differential ) > $cpu_down_differential" | tee -a $hotplugbak;
	echo "echo $( cat $down_differential ) > $down_differential" | tee -a $hotplugbak;
	echo "echo $( cat $powersave_bias ) > $powersave_bias" | tee -a $hotplugbak;
	echo "echo $( cat $sampling_rate_min ) > $sampling_rate_min" | tee -a $hotplugbak;
	echo "echo $( cat $cpu_num_limit ) > $sampling_rate_min" | tee -a $hotplugbak;
fi;

# applying hotplug now
echo 95 > $up_threshold
echo 95 > $cpu_up_threshold
echo 40000 > $sampling_rate
echo 1 > $cpu_down_differential
echo 1 > $down_differential
echo 250 > $powersave_bias
echo 40000 > $sampling_rate_min
echo 2 > $cpu_num_limit
What it does is it will create a backup named "hotplug" inside /data directory. And this will not be changed and will be done once (check the IF statement). And if the backup is already there, the first IF will be bypassed and it will proceed to the changes you need. If the backup is not there, it will create the backup first. Basically that's going to be your installer.

For the Uninstaller

So the script is pretty straightforward, it will delete the existing hotplug from the init.d and then execute the shell script which was previously backed up from the installer.

Code:
#!/system/bin/sh
#
#  This will revert all the changes made by the battery tweak from Umang Leekha
##################################################################################

# Let us start

#mounting /system
mount -o rw,remount /system
mount -o rw,remount /data

# Deleting the hotplug
rm -rf /system/etc/init.d/hotplug;
/system/bin/sh /data/hotplug;

# Updating the correct permission
chmod 777 /system/etc/init.d/*
I hope this helps and more power!
The Following 2 Users Say Thank You to eyesfortech For This Useful Post: [ View ] Gift eyesfortech Ad-Free
31st October 2014, 05:50 AM |#5  
Umang96's Avatar
OP Recognized Developer / Themer
Flag New Delhi
Thanks Meter: 9,702
 
Donate to Me
More
Thanks, i'll consider your ideas in V2
31st October 2014, 08:19 AM |#6  
Umang96's Avatar
OP Recognized Developer / Themer
Flag New Delhi
Thanks Meter: 9,702
 
Donate to Me
More
Here are the results, using my Lvl5 Super battery tweak, i'm a modeate user, brightness 22%, wifi on almost everytime when screen is on, crome and whatsapp, also one football app, played piano tiles for 15mins, it's just my first test with my tweaks, i'll release level 7 and will reach 6hrs screen time soon
Attached Thumbnails
Click image for larger version

Name:	IMG_20141031_123401.jpg
Views:	1079
Size:	74.4 KB
ID:	2992513   Click image for larger version

Name:	Screenshot_2014-10-31-12-30-53.png
Views:	1070
Size:	69.4 KB
ID:	2992514   Click image for larger version

Name:	Screenshot_2014-10-31-12-29-43.png
Views:	1108
Size:	80.3 KB
ID:	2992515  
The Following 3 Users Say Thank You to Umang96 For This Useful Post: [ View ]
31st October 2014, 03:12 PM |#7  
SaffatBokul's Avatar
Senior Member
Flag Dhaka
Thanks Meter: 97
 
More
umang bro, put them all inside another zip and upload it. It's annoying to download one tweak at a time. thanks !
3rd November 2014, 08:57 AM |#8  
mr-illusionist's Avatar
Senior Member
Flag Chandigarh
Thanks Meter: 664
 
More
Results after moderate usage. thanks brother, i got around 7 hours on screen.
Attached Thumbnails
Click image for larger version

Name:	uploadfromtaptalk1415005043536.png
Views:	522
Size:	97.7 KB
ID:	2996983   Click image for larger version

Name:	uploadfromtaptalk1415005053013.png
Views:	520
Size:	85.2 KB
ID:	2996984   Click image for larger version

Name:	uploadfromtaptalk1415005060702.png
Views:	534
Size:	77.1 KB
ID:	2996985   Click image for larger version

Name:	uploadfromtaptalk1415005067720.png
Views:	463
Size:	75.8 KB
ID:	2996986  
The Following 2 Users Say Thank You to mr-illusionist For This Useful Post: [ View ] Gift mr-illusionist Ad-Free
8th November 2014, 03:18 AM |#9  
Pranay_619's Avatar
Junior Member
Flag Darbhanga
Thanks Meter: 0
 
More
Hey dev i flashed the level7 zip on my unite2 with ur cleankat v2.9 rom bt after flasbibg when i chekedout the battery stat i was shocked.it was 89% charged bt saying only 6 mins backup left why so bro tell me whats the problem.! Help

Sent from my Micromax A106 using xda app-developers app
19th November 2014, 03:18 AM |#10  
eyesfortech's Avatar
Member
Thanks Meter: 31
 
Donate to Me
More
I think you will need to recalibrate your battery dude. There are apps in Google Playstore which you can use.
19th November 2014, 04:30 AM |#11  
eyesfortech's Avatar
Member
Thanks Meter: 31
 
Donate to Me
More
Hey Umang,

So you have now Level 7 with powersave_bias=0, cpu_num_limit=2 and assigned scaling_max_freq=1040000 for all the cores, what's the effect of these changes?
Post Reply Subscribe to Thread

Tags
micromax-a120, unite-2

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes