[MOD/KernelLG2] Enable bootanimations without the negative side effects - Sprint Samsung Galaxy S III

So, you guys may have read and/or applied the fix I posted a few days ago regarding dual cores. Allow me to go into further detail before posting what I believe is a good compromise and hopefully keeps the same battery life improvements.
Well, we all know that Sprint's GS3 (Not sure about other US variants) uses weird boot and shutdown animations. It actually uses the same boot animations as the 2 year old EVO 4G. How outdated! At any rate, in order to achieve these boot and shutdown animations, they use Samsung's qmg format, which requires the files "samsungani" and "samsungpowersoundplay" in /system/bin/ The problem is, samsungani only supports qmg formats so our custom boot animations weren't working. Now, it was posted somewhere that in order to have them work, we needed to rename samsungani to something else, and then rename bootanimation to samsungani. While this sounded like a great plan, it unknowingly produced a bad side effect. I have no idea WHY, but if the samsungani OR samsungpowersoundplay files aren't present or are tampered with (by renaming etc) this causes the dual core functions on the phone to act wonky. Why? Beats me. But they will default to the "performance" governor without you ever knowing and mpdecision would no longer control the second core the way it's supposed to. The second core would either remain on or off depending on how your phone was setup. Unless you were to use a cpu scaling app.to see this, you'd never know what was happening and as a result, battery life took a complete hit.
I have came up with a solution It involves editing the kernel ramdisk to load both bootanimation and samsungani/powersoundplay files. However, I have stripped the samsung files of their ability to control boot sounds and bootanimations, while allowing the original bootanimation file to load bootanimation.zips. This means we can use our custom bootanimation zip files without having terrible battery life with cores that default to performance governors.
It requires a simple edit, but I will also include a flashable kernel with support for it.
Once you extract the kernel ramdisk, open the init.rc file with your editor of choice and navigate to:
Code:
service powersnd /system/bin/samsungpowersoundplay
class main
user media
group system
oneshot
service samsungani /system/bin/samsungani
class main
user graphics
group graphics system
disabled
oneshot
Remove the user and group portions from both and add "disabled" to the samsungpowersoundplay line. They should look like this when done:
Code:
service powersnd /system/bin/samsungpowersoundplay
class main
disabled
oneshot
service samsungani /system/bin/samsungani
class main
disabled
oneshot
Now for the last part, add support for bootanimations by adding this section above the samsungpowersoundplay line "service powersnd /system/bin/samsungpowersoundplay"
Code:
service bootanim /system/bin/bootanimation
class main
user graphics
group graphics
oneshot
When complete, it should look like this:
Code:
service bootanim /system/bin/bootanimation
class main
user graphics
group graphics
oneshot
service powersnd /system/bin/samsungpowersoundplay
class main
disabled
oneshot
service samsungani /system/bin/samsungani
class main
disabled
oneshot
Go ahead and save changes and make your boot.img. You're done!
I've uploade my boot.img with the changes. It also has support for init.d as well as adb shell root and "boot speed plus" which changes the governors to "performance" as the system is booting but will obey anything set in init.qcom.post_boot.sh (which more than likely will be OnDemand, since that's default). So basically, it'll get set back to whatever the default governor in that file is

Nice job Mr.Freeze. A lot of noobs are going to appreciate this haha.

clark44 said:
Nice job Mr.Freeze. A lot of noobs are going to appreciate this haha.
Click to expand...
Click to collapse
I'm not ashamed to raise my hand, thanks Freeza.

I'm going to sound like a broken record, but I am okay with that. You never disappoint. Thanks.

Thank you sir
Sent from my SPH-L710 using xda app-developers app

I flashed the zip & now it is stuck on the android animation. The screen will crt off & when i press the power button the screen comes back on but its still stuck.
I''l wipe the caches & see if that fixes it

CNDow said:
I flashed the zip & now it is stuck on the android animation. The screen will crt off & when i press the power button the screen comes back on but its still stuck.
I''l wipe the caches & see if that fixes it
Click to expand...
Click to collapse
Your bootanimation.zip probably wasn't made properly. You will need to delete it from ADB. Once Android is booted you will have to modify your bootanimation.zip's desc.txt file

freeza said:
Your bootanimation.zip probably wasn't made properly. You will need to delete it from ADB. Once Android is booted you will have to modify your bootanimation.zip's desc.txt file
Click to expand...
Click to collapse
I just flashed the above zip

CNDow said:
I just flashed the above zip
Click to expand...
Click to collapse
What I mean is.......well first, what animation are you seeing upon boot?

freeza said:
What I mean is.......well first, what animation are you seeing upon boot?
Click to expand...
Click to collapse
the small case android with the backward "a"
I've reflashed Phantom 1.6 & all is good now

CNDow said:
the small case android with the backward "a"
I've reflashed Phantom 1.6 & all is good now
Click to expand...
Click to collapse
Yeah, figured that was the problem. That boot animation isn't a standard android one, and was probably made by someone else. But at least you got it working

Hi I have a question before I spend my next few days off muddling around with kernel compilation. Do you know if it is possible to just compile inn support for the conservative governor module?
Sent from my SPH-L710 using Tapatalk 2

Very nice; confirmed some of the things I was looking into.

can we get this kernel upgraded to the latest OTA?
I'm still learning how the Galaxy phones work, i'm coming from years of HTC Evos...
but I believe i'm on LG8 and this kernel seems to be LG2...want custom animations without the battery hit!

Related

[MOD] Enable custom Boot Sounds in CyanogenMod 07/15/2011

Enable Custom Boot Sounds
First make sure you are running a cyanogenmod based rom, i have only tested on CM7, but i believe the capability exists in CM6 as well.
Flash from recovery:
http://www.mediafire.com/?4cr7aa4lg51y8pc
BUSYBOX REQUIRED - if you dont have a proper busybox install (like cm7) this can sometimes fail. if you experience issues, mount system rw before running the script.
Zip contains the default "DROID" sound, to replace with your own see below.
Instructions:
1) Flash from recovery over current rom
2) reboot phone
Once you have flashed this you will also have some new commands in terminal or adb:
enablebootsound - enables boot sound if enable from recovery was unsuccesful
bootsoundtoggle - turns bootsound on or off
newbootsound - copies /sdcard/android_audio.mp3 as new boot sound
newbootanim - copies /sdcard/bootanimation.zip as new bootanimation.
Feel free to post your custom sounds in this thread. i'll try and keep the first post updated.
Once again - to set custom sound or animation place them on root of sdcard named appropriately i.e. 'bootanimation.zip' and 'android_audio.mp3'
Enjoy.
bootsound enable script by mrdaviso modified by me for compatibility and to eliminate double runs, from a tutorial posted by spiicytuna
Very cool idea and a very nice implementation. I had a media force close as soon as the phone finished turning on, but then again I was using a 5mb mp3. Also as soon as I did "newbootsound", the selected song started playing. Other then that everything works exactly as you described . Ill post some logs up tomorrow. Thanks!
Nice work. I always thought this had to be done by fixing the links in /system/bin/bootanimation
Sent from my HTC Vision using XDA Premium App
I'm always changing my animations and will now be changing bootsounds....so I hope you don't mind, I made a small change to /system/bin/bootsound
Its now
#!/system/bin/sh
bprop=/system/build.prop
play=$(cat $bprop | egrep -c -i -o ro.config.play.bootsound=1)
if [ "$play" = "1" ]; then
stagefright -a -o /system/media/*.ogg
stagefright -a -o /system/media/*.mp3
fi
exit 0
Sent from my HTC Vision using XDA Premium App
Doesn't work on PyroMod.
----------------------------------------
Never mind. A wipe and a few reflashes later and I got it working right.
In CM7 RC2, remember to type "su" before typing enablebootsound...
It works! great add-on to cm7, u tha man!
EdWRX said:
In CM7 RC2, remember to type "su" before typing enablebootsound...
It works! great add-on to cm7, u tha man!
Click to expand...
Click to collapse
In Terminal Emulator period you need to type su (to gain root access) before typing any of the commands.
I'm running CM 6.1.1 and it worked great..only thing is the boot audio cuts out about 5 seconds before my animation ends (and it's not the audio clip..it's 30seconds long)..is there any way to increase the length of this?
In case you wanna add to the OP, this is from enablebootsound.
#I just made this into a script this was from a post on XDA by spiicytuna
#http://forum.xda-developers.com/showpost.php?p=8274824&postcount=2
#Please give the credit to him not me.
Sent from my HTC Vision using XDA Premium App
only thing is the boot audio cuts out about 5 seconds before my animation ends (and it's not the audio clip..it's 30seconds long)..is there any way to increase the length of this?[/QUOTE]
I have the same problem. Any suggestions? I might have to wipe, but I don't want to unless I have to xD
Sent from my HTC Vision using XDA Premium App
this sounds so awesome, but im a super noob when it comes to other things that isnt just flashing something and bam its there.......
Simer03 said:
this sounds so awesome, but im a super noob when it comes to other things that isnt just flashing something and bam its there.......
Click to expand...
Click to collapse
EDIT no terminal required now
Already have the perfect start sound. Android Hell wave from Portal. Other good ones would be "Hello friend" and "Amusing Fact" from Portal.
when i run enablebootsound after su and reboot...it loop....
but i get into recovery and press fix permissions ..it sound DRIOD...
well done!
I was able to get this working on my evo shift cm7 nightly rom, great work!
update:
http://www.mediafire.com/download.php?dxjcc9cyhzyalz3
if you have already flashed and used the previous version, this one is of no use to you.
The only modification is after flashing when you are rebooting you will see your splash screen for a few seconds, then your device will reboot and continue like normal. ONE REBOOT is normal. after this reboot the boot sound will automatically play. so for you self proclaimed super noobs, all you do is flash and reboot. once again after flashing your device will boot to splash screen for a few seconds then reboot and greet you with your animation and the default android sound.
see OP for changing the sound.
If you can, why not build an app that lets you change your sound? Something similar to Root Tools by Rummler. You can swap boot-animations easily with that app, granted you can only change from the ones he has. There are 24 of them.
sounds like a good idea. I would use an App to do this. Shouldn't be too hard, as right now I use gscripts to do most of my changing/testing.
This will never be released as an app by me. Script only. a few commands in terminal should be easy enough, and it isn't a customization suite, it's just to enable the boot sound, the ability to change was an after thought and is a simple few lines.
mejorguille said:
Very cool idea and a very nice implementation. I had a media force close as soon as the phone finished turning on, but then again I was using a 5mb mp3. Also as soon as I did "newbootsound", the selected song started playing. Other then that everything works exactly as you described . Ill post some logs up tomorrow. Thanks!
Click to expand...
Click to collapse
I know how to get the clip to play all the way through. I got it on mine. Not sure if there are any side effects, but perhaps you would like to test it out? If so, please send me your clip.
@ amazinglarry311
Do you think this will cause any side effects? I dont know much, but I like to tinker and learn
If you remove the line that tells it to stop playing the boot audio
this
Code:
on property:dev.bootcomplete=1
stop bootsound
from
/etc/init.local.rc
so it now looks like this
Code:
# CyanogenMod Extras
# Compcache - handle at boot
service compcache /system/bin/handle_compcache
user root
group root
oneshot
###Bootsound - Safe to Delete: Start ###
service bootsound /system/bin/bootsound
user media
group audio
disabled
oneshot
on property:init.svc.bootanim=running # to correct timin
start bootsound
### Bootsound - Safe to Delete: End ###
As long as the audio clip doesn't exceed boot time, than you should be good.
If the clip is longer, it will continue to play, until its finished...which no one probably wants.
If anyone wants to give it a shot, just backup your file, and edit it... or use the attached file. Its not zipped, just remove the .zip from the filename.
Thanks.

[SCRIPT] Random Boot Animations

Introduction
Here's a repackage and repost of my modified Random Boot Animation script. This was originally conceived by Nighthound many moons ago and was long abandoned. I picked it up and modified it for my Kang-o-rama ROM and the Optimus 2x.
And here it is for you Galaxy Nexus pleasure!​
What it Does
There are various apps out there that can achieve the same result but this is a simple script that uses a random number generator to swap in a random boot animation each time you boot. The script runs one just before the animation and never again until you boot the next time.
You can have any number of animations that will randomise and you can also set a flag to have just one run without needing to delete the others.​
How it Works
The script executes on startup, generates a random number, assigns this number to a boot animation stored in /data/local/bootanimations/, copies that animation to /data/local/bootanimation.zip and let's Android take over from there. Android will automatically prefer /data/local/bootanimation.zip to the one stored by your ROM in /system/media/.
You just put any valid boot animation in /data/local/bootanimations/ - calling it what you wish - and the script will do the rest. You should not try and call all of your boot animations "bootanimation.zip" - you need to give them a unique name.​
Installation
Upon installing the script will automatically back up any custom animation you have in /data/local/ to /data/local/bootanimations/CustomAnimBackup.zip and this animation will be among those randomly selected.
Download one of the files below
Flash from recovery
Reboot and enjoy
Hit 'Thanks' below
System Requirements
This script will run on any custom Galaxy Nexus ROM with init.d support (which is most).​
Notice
Some boot animations are distributed within another zip archive. You need to extract the bootanimation.zip file from that archive and rename it before you put it in the bootanimations directory.​
Downloads
Update 08 July 2014
The script, in install.zip format has been attached to this post.​
Single Animation Flag
If you want to view a single animation only you can do so without moving or changing any of the other files.
Simply Create a file called "bootanimation.use" in /data/local/bootanimations/. In this file place a single line with the filename of the boot animation you want to use. For example:
Code:
CustomAnimBackup.zip
When you want to revert to random animations again delete "bootanimation.use" from the directory.​
Oh this is very cool! Will test it out shortly. Thanks.
I rather enjoy bootanimations. Thank you for this lovely script!
This script will run on any custom Galaxy Nexus ROM with init.d support (which is most).
Click to expand...
Click to collapse
Does this mean it doesn't work on rooted stock?
zombieflanders said:
Does this mean it doesn't work on rooted stock?
Click to expand...
Click to collapse
Correct. You need a custom kernel at minimum and a /system/etc/init.d/ directory.
djmcnz said:
Correct. You need a custom kernel at minimum and a /system/etc/init.d/ directory.
Click to expand...
Click to collapse
I'm on bigxie build 8 and Franco kernel - and this didn't work for me
I flashed the zip with animations and nothing seem to have happened
dhruvraj said:
I'm on bigxie build 8 and Franco kernel - and this didn't work for me
I flashed the zip with animations and nothing seem to have happened
Click to expand...
Click to collapse
That's odd. It does log what's happening at boot, know how to get a logcat?
djmcnz said:
That's odd. It does log what's happening at boot, know how to get a logcat?
Click to expand...
Click to collapse
Don't but would love to know. Some app? Script? Or cmd on terminal emulator?
Sent from my Galaxy Nexus using XDA App
dhruvraj said:
Don't but would love to know. Some app? Script? Or cmd on terminal emulator?
Sent from my Galaxy Nexus using XDA App
Click to expand...
Click to collapse
Via adb, it's quite easy:
adb logcat > log.txt
Will save the log to log.txt
Turn phone off, plug in, type command, start phone, wait till boot completes, ctrl+c to stop logging. Attach file here.
Remember to boot a few time first, just to make sure you're not getting random animations.
Thanks a lot mate!
Its attached
Also attached, are the screenshots (available at http://forum.xda-developers.com/showthread.php?t=1446531) that I am having a seperate problem with, not sure if you would know but just checking with you.
My screen is all screwed up when it boots, if I stop the launcher and restart it seems to be okay though. Any pointers to what it could be because (if it is glaringly visible in the log file) ?
dhruvraj said:
Thanks a lot mate!
Its attached
Also attached, are the screenshots (available at http://forum.xda-developers.com/showthread.php?t=1446531) that I am having a seperate problem with, not sure if you would know but just checking with you.
My screen is all screwed up when it boots, if I stop the launcher and restart it seems to be okay though. Any pointers to what it could be because (if it is glaringly visible in the log file) ?
Click to expand...
Click to collapse
Okay, it doesn't look like your ROM executes init.d scripts... which is required.
Is it this ROM: http://forum.xda-developers.com/showthread.php?t=1372376
If so that one's a little too close to stock... if you want to run a stock ROM that has init.d support I suggest a free MCR (MoDaCo) ROM.
Can't help with the crazy display sorry...
Very interested in this, but have a scrub question... so all I do is download then flash through cwm and I 'm all set?
Sent from my LTE GNex
Lizard King said:
Very interested in this, but have a scrub question... so all I do is download then flash through cwm and I 'm all set?
Sent from my LTE GNex
Click to expand...
Click to collapse
Correct as long as you're running a custom rom with init.d support.
If not, it will do no damage, it just won't work.
Just flashed... works flawlessly... awesome mod
Sent from my LTE GNex
I'm ok AOKP Milestone2 with franco kernal #12. works great! genius!
gaetawoo said:
I'm ok AOKP Milestone2 with franco kernal #12. works great! genius!
Click to expand...
Click to collapse
I'm on the same ROM and kernal and having difficulty with the script. Did you just copy the animation file to just /data/local/bootanimations or to /system/media as well?
- I ran the script
- Copied the few bootanimations I downloaded to /data/local/bootanimations
- Rebooted
- Black screen
raniosman said:
I'm on the same ROM and kernal and having difficulty with the script. Did you just copy the animation file to just /data/local/bootanimations or to /system/media as well?
- I ran the script
- Copied the few bootanimations I downloaded to /data/local/bootanimations
- Rebooted
- Black screen
Click to expand...
Click to collapse
When you say you "ran" the script, do you mean you flashed it in CWM? Hope so.
Other than that your steps are correct... nothing needs to go in /system/
The script logs to logcat... if you can get a boot logcat I can tell you if it's initiating.
djmcnz said:
When you say you "ran" the script, do you mean you flashed it in CWM? Hope so.
Other than that your steps are correct... nothing needs to go in /system/
The script logs to logcat... if you can get a boot logcat I can tell you if it's initiating.
Click to expand...
Click to collapse
Yea, I meant ran it on CWM. Phone is rooted and has the CWM recovery. Using AOKP Milestone2 custom rom with the franco kernal #12
But all I get is a blank black screen after the 'Google' word until the phone reaches the lock screen. None of the bootanimations are loading.
Trying it with the bootanimations:
ITCrowd, DoctorWho, and TheRoosevelt-Sharp-ICS
raniosman said:
Yea, I meant ran it on CWM. Phone is rooted and has the CWM recovery. Using AOKP Milestone2 custom rom with the franco kernal #12
But all I get is a blank black screen after the 'Google' word until the phone reaches the lock screen. None of the bootanimations are loading.
Trying it with the bootanimations:
ITCrowd, DoctorWho, and TheRoosevelt-Sharp-ICS
Click to expand...
Click to collapse
Okay, I'll need a log really to see what's happening... perhaps it's permissions on the /data/local/bootanimations directory.
if you can do this:
Code:
adb logcat > boot.log
From phone off all the way to home screen and attach it here I can look at it for you.
raniosman said:
Yea, I meant ran it on CWM. Phone is rooted and has the CWM recovery. Using AOKP Milestone2 custom rom with the franco kernal #12
But all I get is a blank black screen after the 'Google' word until the phone reaches the lock screen. None of the bootanimations are loading.
Trying it with the bootanimations:
ITCrowd, DoctorWho, and TheRoosevelt-Sharp-ICS
Click to expand...
Click to collapse
See my comment above as well but I have a question... did you create the /data/local/bootanimation directory yourself?
If so, delete it (copy the contents elsewhere temporarily) and reboot the phone. If the directory is re-created the script is firing. Then copy the files back in a reboot... that will fix any problems with the permissions that exist.
If the dir is not re-created automatically I'll need the log.

[Script] Hollyname CM7 Build.prop Tweaks

Basically what this does is add a bunch of properties commonly added or adjusted in the build.prop that just makes everything better. I put this together to serve two purposes. The first is that although there are a few custom CM7 build.prop files floating around I never liked the idea of continuously using an old build.prop over what is now a multitude up updates and variants. A, because it shows incorrect or outdated information and B, maybe something new has been added or has been found to work better that will be missed by just swapping the file out. Before putting this together I found myself spending more time then I would have liked in notepad++ adding and adjusting lines in the build.prop after an upgrade or anytime after a system wipe. Second is that I think my Kindle runs pretty dam smooth in comparison to friends and family members who often ask if I can make their Kindle perform more like mine so not only does a script at boot save the time of editing all their build.prop files I would like to think these values and additions work well. Had originally planned on adding these to an init.d script I’m working on but can’t figure out a way that by including a line already present in the build.prop does not result in me needing to boot into recovery and swap out the script by mounting system. I’m sure ill figure it out but until then this method works just fine. Also trying to figure a way of making this script trick the market into thinking the device is a Galaxy Tab. Not there yet but pretty sure it can be done. Anyhow enough with my justification for the need of yet another set of build.prop tweaks for CM7.
Almost forgot, This is of curse at your own risk and I am not responsible for any damage done to anything you own.
Instructions
Download Hollyname Script and place on SD-Card
http://www.mediafire.com/?z964ni67vuy2nea
Install Script Manager from the Market
Open Script Manager and Select Hollyname Script
Select SU, Boot & Save
Reboot
One of the other nice things about using this method to apply these tweaks is that they are not permanently added to the build.prop and can be removed by either deleting the script from the SD Card or UN-selecting Boot in script manager.
If not sure everything was done correctly run “getprop” in either ADB or a Terminal and all current properties will be displayed. The list should include the properties below.
List of Tweaks Include,
debug.sf.hw 1
wifi.supplicant_scan_interval 180
dalvik.vm.heapsize 64m
persist.sys.ui.hw 1
ro.max.fling_velocity 12000
ro.min.fling_velocity 8000
ro.ril.disable.power.collapse 1
pm.sleep_mode 2
windowsmgr.max_events_per_sec 150
ro.media.enc.jpeg.quality 90
media.stagefright.enable-player true
media.stagefright.enable-meta true
media.stagefright.enable-scan true
media.stagefright.enable-http true
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
ro.kernel.android.checkjni 0
ro.kernel.checkjni 0
debug.performance.tuning 1
video.accelerate.hw 1
dalvik.vm.dexopt-flags m=v,o=y
persist.adb.notify 0
Some irrelevant entries
Thank you. Unless your Kindle Fire has a camera and GSM radio you might rethink the following four items, as their inclusion does not inspire confidence:
ro.media.enc.jpeg.quality 90
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
If you have such a device, can I have it?
Sent
chairshot215 said:
Had originally planned on adding these to an init.d script I’m working on but can’t figure out a way that by including a line already present in the build.prop does not result in me needing to boot into recovery and swap out the script by mounting system. I’m sure ill figure it out but until then this method works just fine.
Click to expand...
Click to collapse
Here's one way to do it in an init.d script:
busybox sed -i 's|windowsmgr.max_events_per_sec=.*|windowsmgr.max_events_per_sec=150|' /system/build.prop
busybox sed -i 's|wifi.supplicant_scan_interval = .*|wifi.supplicant_scan_interval = 300|' /system/build.prop
You might also find ease in making a .txt file with your edits ready to copy and paste into your build.prop file after a new flash. You might save yourself some hassle this way. Don't worry about doubling up on entries; the last instance of a value will override the previous instance. So, while your build.prop might have:
wifi.supplicant_scan_interval=60
something.use.situation.fun=7
wifi.supplicant_scan_interval=300
300 will win. Doesn't it always?
Sent from my mind using magic
manchucka said:
Thank you. Unless your Kindle Fire has a camera and GSM radio you might rethink the following four items, as their inclusion does not inspire confidence:
ro.media.enc.jpeg.quality 90
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
If you have such a device, can I have it?
Sent
Click to expand...
Click to collapse
Sorry, thought "ro.media.enc.jpeg.quality 90" was the value for displaying a Jpeg and not actually taking the image. Never mind, checked a few sites and this line does pertain to displaying images and not taking them. The other 3 I usually use with my phone and always see them together when looking at other scripts so figured the worst including them all could do is that they would just not do anything. Should probably just remove them anyhow if for no other reason than to avoid sarcastic alpha smart person in the room comments like "If you have such a device, can I have it?” It's a good one though as far as those kind of comments go, gave me a laugh anyway. Still don't understand why their inclusion would be any cause for concern?
Thanks for this though, I think I see what I may have been doing wrong.
manchucka said:
Here's one way to do it in an init.d script:
busybox sed -i 's|windowsmgr.max_events_per_sec=.*|windowsmgr.max_events_per_sec=150|' /system/build.prop
Click to expand...
Click to collapse
You might also find ease in making a .txt file with your edits ready to copy and paste into your build.prop file after a new flash.[/QUOTE said:
This is what I had been doing previously but then also had a few other Tweaks I have been using in an init.d script and had originally just planned on adding these to that script. Either way I just figured I could learn something new and at the same time avoid the need of having to paste in the lines as after each new flash the script would still be on the sd-card and script manager would apply the values with out needing to do anything extra after flashing. At least I had thought it was a good idea.
Click to expand...
Click to collapse

[Tweak][V2.4] Extend your Battery Life - init.d, build.prop and everything

(To any visitors to this thread,
Please Rate this thread based on your reading and tweaks that I provided. If the rate is too low, that means I'm doing a bad job in here! If the rate goes down below 4 stars, I'll stop providing these tweaks! So, please excuse me. Please don't rate this thread with the only reason that I do not provide the tweaks for your rom, which you are using! I'm using my own time for this just like lots of other users. Only the thing that makes me more happy and get focused on this would be your rates and 'thanks' on this thread)
** All the information in here is for informational purpose only. I'm getting lots of new requests and great feedbacks but I can't handle everything. Please don't ask me to do anything. If anything is causing a boot loop or force closing in here, I'll drop those contents. But be sure that any other rom users beside of rooted Stock ICS, don't try this and don't ask me to do anything.
Please don't post your battery life in here if it's not from the Stock ICS. This is not a place to show-up or for any competition. This is a place to show-up the battery life before and after the tweaks.
Currently supporting ROMS - Any sfhub's rom, any Calk's Rom, any Agat's rom, VeNuM_ICE_Rom_RL5.0, MIJJz BLEND ICS, AnaKonda Rom ICS, etc....
Now flashable zip files are available at http://forum.xda-developers.com/showthread.php?p=26201865#post26201865
*Note* Please read the second post also for quick install guide, Q/A, progress report, issues and change logs.
Maybe some of you already know that I was working on the tweaks to extend the battery life. In here, all the information is based on my experimental test and its result. Personally I spent lots of time for this stuff and to get the longest battery life. So, if you believe this information is not helpful, please don't blame me and don't even think about trying these tweaks.
But if you want to give it a shot, I would be more than happy to help you to get the better result.
Rule of thumb: Do it with your own risk and don't ask me to buy you a beer because you're doing it. But, if you like this info and/or you see any longer battery life of your phone, please don't hesitate saying 'thank you' and/or consider to buy me a beer.
I'm ok with not leaving any comments and just taking this tweak and recommendation but don't use this info in any other places with 'copy and paste' style.
OK. Now let's get started.
1. Who needs this tweak?
2. What do you need?
3. How to run init.d scripts?
4. what's in init.d scripts?
5. build.prop tweaks
6. Additional tweaks on your phone
7. Startups
8. Closing comments
1. Who needs this tweak?
If you are a heavy user or gamer, this place wouldn't be a right place for you. In here, I'm only focusing on extending battery life and keep it longer without recharging it under our daily usage.
Because it's really hard to save the battery during the screen on (awake status), I'm only focused on the battery savings during the screen is off or sleep (lazy) status. I've seen lots of battery drains during the stand-by mode and I tested lots of things to save the battery during this time frame.
Actually this was my first project working on this phone because I was never able to use my phone more than one day without recharging it before I started this project. In my location, almost everything is not good - so weak radio signal, 3G/4G is not enough to get the fast data speed.
Somehow, wifi is the biggest consumer of battery drain.
Guess what? I had to find out some way to extend my battery life.
I believe the information in here would be very helpful for the person who
keeps phone offline most of time
lives in bad signal area
reasonably think battery life is more important than performance (the performance with this tweak is still good but not best)
do not believe in battery saver apps
wants to experience the best battery life!
2. What do you need?
Most importantly your phone
init.d support (startup scripts during the boot)
Smanager if your kernel does not support init.d or install-recovery.sh
file editor like root explorer
root access, busybox (rooted phone)
init.d scripts and build.prop files (download)
3. How to run init.d script?
I've already posted one thread in here - http://forum.xda-developers.com/showthread.php?t=1610741 (thanks for the people who already left great feedbacks)
From there, you will find out how you can get the init.d script support during the boot and how to test whether it's working or not. If you don't have the Kernel that is not supporting init.d script or install-recovery.sh during the boot, you can also use the SManager tool to run the scripts in here during the boot.
4. what's in init.d scripts?
4.1 cpufreq_governor
21cpufreq_governor script sets the governor that contorls the CPU's thresholds and sampling_rates. I choosed ondemand governor and some values are changed from Calk's original script (big thanks to Calkulin and he provided some init.d scripts on his FD02 tweaked rom).
4.2 cpufreq_screenstate_scaling
31cpufreq_screenstate_scaling script defines the governor values and decides the actions based on the phone's state - conservative, ondeman, lazy, awake, sleep modes. I've changed lots of values from Calk's original script to save more battery power thru this script. As indicated in Calk's original thread for FD02, this script would not run if you have already installed some CPU control apps something like OC Widget, Quick Clock, SETCPU, and Android OC.
For both cpufreq_governor and cpufreq_screenstate_scaling scripts, I had to stay with maximum 1GHz CPU speed and it couldn't go down below 1GHZ because if it goes not below 1GHz, some of the apps could be force closed, frozen, or even you can see the random reboot. Especially, stock camera app and some other camera apps had issues running under 1GHz CPU speed (facebook camera, FX Camera Zoom). If you don't care about the camera apps and want to save more battery, then we can set up maximum CPU speed to 800 MHz and I had no issues with that except the camera apps. With 800 MHz setting, I saw more battery saving and battery life, but I'm not posting that script in here.
4.3 tweaks_kobridge
41tweaks_kobridge script has almost everything in it to improve the network speed, sdcard tweaks, other battery saving tweaks, VM management, Kernel, wifi tweaks, etc. For some of the values in here, there are some overlaps with build.prop tweaks. So, if you do not apply the tweaks to the build.prop file, many tweaks would still work.
4.4 zipalign
zipalign is an archive alignment tool introduced first time with 1.6 Android SDK (software development kit). It optimizes the way an Android application package (APK) is packaged. Doing so enables the Android operating system to interact with the application more efficiently, and hence has the potential to make the application and overall the whole system much faster. Execution time is minimized for zipaligned applications, resulting is lesser amount of RAM consumption when running the APK.
If less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.
4.5 Wifi Sleep Wait timer
In my original version of this tweak, it was required to manually insert the table row to use this tweak. But it's fixed and now you can use this tweak without manually handling the database.
What this tweak does is, it controls the time until wifi sleeps after the screen turned off. By default, it's 15 minutes. So, even you turned off the screen, by default, phone will wait for 15 minutes and then turn off the wifi. By using this tweak, you will have the control over wifi idle time until wifi sleeps.
5. build.prop tweaks
build.prop file is created while you flash the rom and /system folder will be totally replaced by your new rom. So, don't expect your tweak would be there forever even after you flashed a new rom (Every Rom format the /system partition before it's installed). If you have your own customized tweaks, then make backup those tweaks before you apply the new rom. After flashing new rom, those tweaks won't be there.
The file list needs to be backed up -
/system/etc/init.d folder and it's contents
/system/build.prop
/system/etc/install-recovery.sh (if it's there)
/system/etc/gps.conf (if you have GPS tweak)
Basically build.prop file defines lots of system values related to phone settings and those values are loaded to phone during the boot.
Because build.prop is created by rom, it holds some current rom's build related information. So, if you want to keep this file up to dated, whenever you flash the new rom, take the new build.prop file and compare it with this tweaked file.
Update the current rom's build.prop file based on your comparison -
1. don't update/replace any ro.build.xxxx and ro.product.xxx items
2. for any all other items, replace the lines with the items in tweaked file.
By doing above steps, I believe you've started already getting lots of battery savings. But there're some more critical things that could affect your phone's battery life. The below section is not directly related to init.d and build.prop tweaks but it's important as much as tweaks!
6. Additional tweaks on your phone
I've worked on this part so long time since I've started using ICS ROM. I also tried almost every battery saver apps but didn't get any better result using my own method because sometimes there are lots of overheads using it (I'm trying to avoid describing any individual app's pros and cons in here and just provide you the better way to configure your phone).
Currently I'm on FD26 rooted stock rom/modem/kernel. So, all the information in here is based on this rom but it's not limited to any specific phone or build. You could probably use it in anywhere.
1. Wifi
Some of you understand that wifi is faster than 3G and use less battery than 3G. You also say that 4G is the biggest monster consuming lots of battery. But that would be true and false.
Sometimes, wifi uses lots of battery to get the faster speed and keep the connection.
My suggestion is turning off wifi connection when you are in the area where wifi is not available and keep the 3G turned on. But if you are in the area where the wifi is available and connected, then you don't need to turn off the wifi.
Based on my and JC's test, turning on wifi (if you are connected to wifi), keeping wifi turned on during the standby or sleep mode does not affect the battery life a lot.
2. 3G
Keeping 3G turned on is a good habit. Because it covers wifi and 4G whenever those are not available. 3G uses battery a lot less than wifi and 4G.
Howto keep it on: setting -> more -> mobile networks -> check 3G DATA
3. 4G
Just like wifi, minimize turning on 4G network. This use a lot of battery if you are in the bad reception area. If the signal strength is really good, then it would be probably ok keeping 4G turned on. In some cases, 4G would be the only solution to watch the movies, streaming videos when the wifi is not available.
Based on my limited test, using 4G in good reception area is much better than using wifi with low/weak signal.
4. Call option
Mark checkbox for Turn on proximity sensor for your convenience even there would be a little battery drain. But if you are a heavy talker, then I recommend to uncheck this option.
5. Sound
Lower the sound/vibration level within the acceptable range for you. There would be some differences on battery behavior by turning off or on of sound/vibration. But I don't want to recommend anything in here because I don't want you to lose any incoming calls/messages/etc.
6. Display
Automatic brightness should be fine in most cases. It's really related to screen on time battery consumption. I don't want to deal with this option at this time.
Pulse notification light, display battery percentage - turn it on or off based on your preference. Battery consumption by turning on these options would be minimal. I saw that some people said that they recommend to turning off the 'pulse notification light'. But I don't agree with that. One blinking LED light almost does not use any battery!
display timeout - I set it with highest value provided. After using the phone, I manually press the power button to go to sleep mode. With short timeout value, I have to keep press the button or screen to keep the screen on. I don't like this method.
Turn on 'Auto adjust screen power'.
7. Power saving mode
I always keep this option off because I do not want to lose anything because of low battery. I would rather change the numbers in my tweak (battery profile 2 in scaling tweak).
8. Account and sync
Most of time, I keep this option turned off. This would be one of the battery eating monster. I would rather individually sync the apps whenever I need it or from the actual apps.
9. Battery
when you charge the battery and phone shows that 100% charged, unplug the cable few seconds and plug-in again to charger. Repeat this couple of times and your battery would be really fully charged. Many times, even phone shows 100% charged, it could be the minimum 100% range. Actually, there's some voltage allowed and considered as 100% charge. But by maximizing the voltage during the charge, your battery life could be extended.
10. Motion
Turn off this option if you don't need this.
11. email
If possible, turn off the option that pushing email immediately. Instead, put the retrieval interval as long as you can. Based on my test, it could extend your battery life as maximum as couple of hours. In my case, I put the 2 hours interval. By doing this, your phone is much easier to enter the 'deep sleep' mode.
7. Startups
For me, I don't allow the apps automatically start during the boot as much as possible. If it's the system app and critical app for the phone's normal operation, then you have to allow those startups but otherwise, you can disable the startup apps based on your test.
For this, I usually use Rom Toolbox and/or System Tuner Pro. These apps allow us to enable or disable the startup apps.
For any apps like I don't use frequently or at all, I disable the apps from the 'event' (rom toolbox) or startups (system tuner pro). Once you disable the startups, you may need some test to see what happens when you manually launch the apps. If your app does not start normally, then go back and enable the event again.
There's also one more battery eating moster - widgets (currently doing some experimental test on it)
Regardless of widgets are in foreground screen or just stays in widgets folder, almost same amount of battery could be used by widgets to make it upto dated and refresh the connections, etc.
So, if you don't need the widget or don't use, go to (from Rom Toolbox) Auto Start Manager -> Applications -> select app you want to check -> it will show that widget updating is enabled or not. If it's enabled and you don't want it, just disable it. Then the app is not going to use that specific widget and actually widget will disappear from widgets folder.
8. Closing comments
Thanks for reading my guide and tweaks. I hope everyone of you found some useful information in here.
I'm not perfect just like you. So, there could be some wrong information. If you find anything like that, please let me know.
Again,
Do it with your own risk and don't ask me to buy you a beer because you're doing it. But, if you like this info and/or you see any longer battery life of your phone, please don't hesitate saying 'thank you' and/or consider to buy me a beer.
I'm ok with not leaving any comments and just taking this tweak and recommendation but don't use this info in any other places with 'copy and paste' style.
What's in attachment:
all_in_here.zip First version of tweaks. build.prop is based on FD26.
70wifiSleepWait_kobridge.zip Tweak to handle the wifi lag time before sleep. Wifi will be turned on 10 seconds after the screen turned off. To make this tweak work, you will need sqlite3 and some manual task. Check here http://forum.xda-developers.com/showthread.php?t=1630792
FE07stock_build.prop.zip This is a build.prop file tweaked based on stock kernel FE07. This file would not work on other Roms but stock. You can use this on other stock based kernel but some information about the phone would be incorrectly displayed at settings > About phone. So, use the right version of build.prop. For any other Roms/Kernels, you can just keep your build.prop if you do not find any tweaked build.prop based on your kernel/rom.
init.d.v2b.zip Including CPU tweaks, additional tweaks, and wifi idle (lag) time tweak. Set to max cpu speed to 1Ghz on awake, max 500Mhz during the sleep. Fast and lots of power savings during the sleep mode.
init.dv2b2.zip Same as init.d.v2b scripts except some more CPU tweak changes. Same Max awake and sleep speed. Targeting more power save but no result yet. Experimental tweaks (you may experience a little slowness of phone with these tweaks).
Tweaked-FE10-build.prop.zip This is a tweaked Stock FE10 build.prop. This file would not work on other Roms but stock. Directly under /system folder and permission set to 644. Other init.d tweaks don't need to be changed.
zipalign.zip Two files included. zipalign goes to /system/xbin, permission 755, move the file if it's not there. 11zipalign goes to /system/etc/init.d. permission 755. If there is any apk files those are not zip aligned, this tweak will automatically align the apk files for better performance and battery savings.
zipalign.v3.1.zip 11zipalign modified a little to confirm the temporary APK file removal. If temporary APK is not deleted, it will be shown in log file and Temporary APK will be removed during the next boot.
init.d.v2.4.zip Complete set of init.d scripts. 41tweaks_other tweak changed a lot based on sysctl and fixed one error. 21&31cpufreq tweaks were also changed more aggressively. 11 & 70 are same. In the zip file, included sqlite3, busybox, zipalign executables in case you don't have it.
70wifiSleepWait_kobridge.v2.zip Check the section 4.5 from OP. Now this tweak works without any manual database handling.
Quick guide about how to install these tweaks :
Because many people asked me how to run these tweaks, I spent sometime to give you the quick instruction. To follow this instruction, you will need the following files downloaded and available at your sdcard.
Pre-requisite:
1. init.d scripts (able to download from op section). Download the zip file and unzip it. Save the files into your sdcard.
2. build.prop file (able to download from op section).
3. sqlite3 executable (just in case you want to use the tweak that updating wifi idle time before sleep). where to download and how to use it is here - http://forum.xda-developers.com/showthread.php?t=1630792
4. Get the install-recovery.sh from here if you are on the stock kernel (not repacked) - http://forum.xda-developers.com/showthread.php?t=1610741
If you have sfhub's auto root tool, then run the option 'E' to install the init.d support installed on your phone. Actually his tool will install the install-recovery.sh. (I assume that you've already have busybox installed, otherwise, you can download it too from above link)
Backup:
Do the backup for the following files -
1. /system/etc/init.d files - if there's any existing init.d scripts then back it up.
2. /system/build.prop - backup this file also for just in case
Now you are ready to start, follow these steps:
1. copy downloaded init.d script into /system/etc/init.d folder. If the init.d folder is not there, create the folder 'init.d' under /system/etc. Be sure that init.d folder permission should be 'rwxr_xr_x' (755). For the copied init.d scripts, check the permissions and changed it to same 755 (if it's not like that). If there's any script that you don't want to run during the boot, then change the permission to 'rw_r__r__' (644).
2. copy the install-recovery.sh file to /system/etc folder (only if you are on stock kernel or you've never installed sfhub's auto root tool (option 'E'). Change the permission to 'r_xr_x___' (550).
3. copy build.prop file to /system folder. Change the permission to 'rw_r__r__' (644).
4. Additional steps if you don't have sqlite3 or busybox.
copy the files to /system/xbin folder. permission 755.
5. You are done now. Reboot the phone.
How to verify that the script is running - the easiest way would be checking the Maximum CPU speed and SD tweaks applied to your phone. If you have any tool like Rom Toolbox (Pro) or System Tuner (Pro), then goto the options that showing CPU or SDcard (SD Boost), it will show the different values if you did not applied the tweaks previously.
Hope this help!
[Q/A]
On which Rom/Kernel this tweak is going to work?
The tweaks in here is mainly for the stock based ICS roms/Kernels only.
Any sfhub's rom, any Calk's Rom, any Agat's rom, VeNuM_ICE_Rom_RL5.0, MIJJz BLEND ICS, AnaKonda Rom ICS, etc....
init.d tweak files can be used for some other roms but it's not tested from my side. build.prop tweak is also mainly for stock roms and based on specific kernel version. If the kernel is upgraded, then you will need a different build.prop.
Can I try it on different rom and kernel?
Before applying the tweaks, make sure that you have the nandroid backup first and try it. If the phone is stuck on boot screen, you may need to flash your rom again thru the odin or CWM recovery.
(usually incorrect edit on build.prop file could cause a freezing on boot screen. So be sure that you know how to edit build.prop)
Does build.prop support different ROMs except the stock?
Basically, my answer is no. To make the build.prop working on different ROM, it needs to be modified based on your rom and kernel. Currently I have a few versions supporting stock rom and kernel - check the progress report and change log for any updates. For any other Roms, please check the same area also.
Progress report:
4/29/12 10:50 pm US EST I'm adding three more screenshots.
screenshot#4 : Lasting More than 21 hours and battery still left 52%
#5: showing screen-on statistics. In here, on battery time was reset somehow. But actual time is 21+ hours (same on screenshot #4,5,6)
#6: It shows which apps were running during the sleep mode and screen was off. If you wonder which apps are running when the phone is on sleep/deep sleep mode, you can check the apps thru this kind of tool (battery monitor widget). If you want to save more battery, you can change the options from each apps if it provides a such kind of options.
4/30/12 My first full battery cycle test was ended up with about 40 hours until battery capacity reaches to 30%. During my test, I found some apps were still running during the sleep mode and those were using lots of battery. In my case, some of those apps were touchdown (email), Kakao talk (sns), and facebook apps. In many cases, we are not able to control the method how the application run in foreground and background. Some apps provides us how to sync and when to sync but there are still lots of chances for those apps for the improvement at least in the perspective of battery consumption.
5/1/12 The second version tweak is coming soon -> done.
5/2/12 WiFi issue resolved. http://forum.xda-developers.com/showthread.php?t=1630792 and added one more tweak file. Before applying this file, read the attached thread first. You won't be disappointed.
5/4/12 Tested battery consumption with wifi turned on 24x7 (like JC's snapshot somewhere in this thread). Not bad at all. #7 snapshot shows that. About 19 hours and still 63% remaining (with on screen 30m, voice call 2m, lots of snapshots, lots of emails (100+), some SNS). Added snapshots #8 & 9.
5/5/12 Big Thanks to TeamERA and team member who converted build.prop for each Kernels. TeamERA provided build.prop files based on different Kernels(Roms). Check out the post #88.
Supported Kernel: AOKP CM9a3 (tested) CNA FD26 MIUI. For FD26, I've checked the items and values on it. There's some items sequence change made comparing build.prop in here and minor values changes - post #94.
So anyone who had issues on boot screen with build.prop that I posted, now you can try build.prop tweak based on your current rom.
5/6/12 GB Kernel Test - Blazer 4.1 EL29 - Not able to change the CPU frequencies and frequency change is causing phone freezing during the sleep & wakeup. No way to change this by init.d script so far. Only the way would be using Tegrak or System Tuner Pro tools. I tried System Tuner Pro and set the conservative governor (underclock to 1GHz) as on boot instead of init.d option. Working like a charm and no freezing yet.
Update: since applied, 19 hours and 70% of battery remaining. For more info, post your questions. Related post: http://forum.xda-developers.com/showthread.php?t=1625299&page=11 post #107.
5/8/12 Added FE07 Stock based tweaked build.prop. Only for Stock FE07 based Kennels.
5/9/12 Two more zip files added. init.d.v2b - moderate CPU tweaks. init.dv2b2 - agressive CPU tweaks (could save more battery).
5/10/12 Added AOKP FE07 version of build.prop at post #156.
http://forum.xda-developers.com/showpost.php?p=25907510&postcount=156
5/14/12 zipalign tweak added
5/16/12 wifiSleepWait tweak improved. Check the section 4.5 from OP. Now this tweak works without any manual database handling.
5/17/12 Now supporting flashable zip files. You may get customized flashable zip files based on your rom. Check out - http://forum.xda-developers.com/showthread.php?t=1658471
Issue Log:
5/1/12 a. It seems like changing the Wi-Fi option to 'Never' and pm.sleep_mode to 1 does not work. My previous test based on the 3G turned on always and minimized turning on wifi. Now I'm testing wi-fi options but status shows that wifi is turned on always. Checking more details... Checked with wifi fixer but wifi still does not sleep. Started removing anything related wifi, but no luck yet. Spending several hours but no luck. Going to test on fresh installed stock rom/kernel.
Status: Resolved. http://forum.xda-developers.com/showthread.php?t=1630792
b. AOKP Rom users or custom Kernel users - Do not sue these tweaks. Basically I cannot help any issues on AOKP because I'm not a user of AOKP. So far, it's known that 31tweak file is causing a boot loop on Samsung logo screen.
Change log:
4/29/12 41tweaks_kobridge tweak updated. changed value setprop pm.sleep_mode to sync with build.prop.
4/30/12 lcd_density value changed back to default 240. It's my mistake uploading the file based on my configuration and forgot to change it back to default. Thanks to TeamERA for findings. If anything else found, more updates will be added to build.prop.
Thanks again to TeamERA. He found another one - "In your kobridgetweaks script you have ring delay at 1000, and in build.prop 0, it should be 0". Updated attached zip file.
5/2/12 New wifi idle tweak init.d file attached (only for the update of existing table)
5/4/12 Added 11 email section.
5/6/12 Wrong link in wifi section corrected.
5/8/12 Build.prop created based on FE07. Rearranged tweaked items based on Stock sequence. Removed duplicates.
5/9/12 uploaded updated init.d scripts. CPU tweaks changed to deal with only ondemand governor. Fixed few errors on 41tweaks. Currently it's a beta version because very few times, I saw that wifi was not automatically reconnected after the sleep. I confirmed that it's the stock rom issue and it's not coming from the tweaks in here.
5/14/12 zipalign tweak updated to confirm the removal of temporary APK files.
5/15/12 Improvement on 41Tweaks_other tweak file (more tweaks based on sysctl). Fixed on error from previous file. 21&31 CPU tweak files were changed more aggressively.
5/16/12 70wifiSleepWait_kobridge version2 tweak uploaded.
I am basically running everything exactly as you mentioned with one exception... the wifi while I am asleep. I generally lose between 2 and 5% over eight hours but I am right next to the router. I never thought to try turning it off and letting the 3g sleep take care of things but I will definitely give it a shot since we are basically on the same page with sync, screen time out, etc. I do also have auto brightness off and slide across status bar to adjust but that wouldn't make an enormous difference. Also inverted apps really seem to get me on average an extra hour or so of screen on time. Very thorough info. I need to consider running my CPU at 1000 Max as well
Edit..all FD26 setup with init.d added by sfhub's auroroot option E
Sent from my SPH-D710 using Xparent Blue Tapatalk 2
JohnCorleone said:
I am basically running everything exactly as you mentioned with one exception... the wifi while I am asleep. I generally lose between 2 and 5% over eight hours but I am right next to the router. I never thought to try turning it off and letting the 3g sleep take care of things but I will definitely give it a shot since we are basically on the same page with sync, screen time out, etc. I do also have auto brightness off and slide across status bar to adjust but that wouldn't make an enormous difference. Also inverted apps really seem to get me on average an extra hour or so of screen on time. Very thorough info. I need to consider running my CPU at 1000 Max as well
Edit..all FD26 setup with init.d added by sfhub's auroroot option E
Sent from my SPH-D710 using Xparent Blue Tapatalk 2
Click to expand...
Click to collapse
Thanks John for the input! The easiest way to adding init.d support is adding his script (recovery-install.sh) into /system/etc folder with permission 550. recovery-install.sh is available thru my linked thread (just in case you don't have it).
Again thanks for trying and let me know your findings!
BTW the script is install-recovery.sh (not recovery-install.sh) I think you had it right in some sections but reversed it in others.
Also since we last discussed I made some improvements to the script. It is now compatible with other apps which like to use install-recovery.sh to get their stuff done like link2sd. The installer in Auto Root will move the existing install-recovery.sh to install-recovery-orig.sh and the install-recovery.sh (init.d version) will call install-recovery-orig.sh (if present) after it is done. The uninstaller will reverse the process.
Also install-recovery.sh will now defer to init.d support in the kernel regardless of which .rc file it was added to in the kernel. Previously it only looked in init.rc but I saw some repacked kernels were adding support in different .rc files (they also removed install-recovery.sh support from their .rc file, so it might be a moot point because install-recovery.sh might never get called)
Thanks kobridge. I think this script is just what I've been looking for and I'm going to give it a run.
sfhub, somewhat off topic, but continuing with kobridge's related thread, How to run init.d scripts on boot, how come chmod 755 is not expressed rwx-rx-rx instead of -rwxr-xr-x? Seems more logical to me.
sfhub said:
BTW the script is install-recovery.sh (not recovery-install.sh) I think you had it right in some sections but reversed it in others.
Also since we last discussed I made some improvements to the script. It is now compatible with other apps which like to use install-recovery.sh to get their stuff done like link2sd. The installer in Auto Root will move the existing install-recovery.sh to install-recovery-orig.sh and the install-recovery.sh (init.d version) will call install-recovery-orig.sh (if present) after it is done. The uninstaller will reverse the process.
Also install-recovery.sh will now defer to init.d support in the kernel regardless of which .rc file it was added to in the kernel. Previously it only looked in init.rc but I saw some repacked kernels were adding support in different .rc files (they also removed install-recovery.sh support from their .rc file, so it might be a moot point because install-recovery.sh might never get called)
Click to expand...
Click to collapse
Thanks so much sfhub!
It seems like I stayed too many nights awake. I corrected one place saying recovery-install.sh to install-recovery.sh.
Now I'm downloading your auto root package again and let me also correct the information accordingly.
RustedRoot said:
Thanks kobridge. I think this script is just what I've been looking for and I'm going to give it a run.
sfhub, somewhat off topic, but continuing with kobridge's related thread, How to run init.d scripts on boot, how come chmod 755 is not expressed rwx-rx-rx instead of -rwxr-xr-x? Seems more logical to me.
Click to expand...
Click to collapse
It's always rwxrwxrwx order.
rwx (read write execute) -> 4 + 2 + 1 -> 7
rw_ -> 4 + 2 + 0 -> 6
r_x -> 4 + 0 + 1 -> 5
r__ -> 4 + 0 + 0 -> 4
the second bit is always for w (write) permission. So, the order -rx is not possible.
Some basic binary calculation and permission related info:
The permission is consist of 9 bits for user, group, and other (each user group holds 3 bits).
With binary expression, it would be same
111 (user) 111 (group) 111 (other)
For first bit represent the read permision and the second is for write, third one is for execute.
so 755 equals in binary expression 111 101 101 (= rwxr_xr_x)
Thanks for the info kobridge, I still have not figured out why wifi causes a partial wake lock on ICS. But it plays much better with GB. Ive tested this also.
Sent from my SPH-D710 using xda premium
So these can be applied to gingerbread right?
Sent from my SPH-D710 using Tapatalk 2
Can we use this on aokp?
Transmission sent from my slim n trim Galaxy S II.
kobridge said:
It's always rwxrwxrwx order.
rwx (read write execute) -> 4 + 2 + 1 -> 7
rw_ -> 4 + 2 + 0 -> 6
r_x -> 4 + 0 + 1 -> 5
r__ -> 4 + 0 + 0 -> 4
the second bit is always for w (write) permission. So, the order -rx is not possible.
Some basic binary calculation and permission related info:
The permission is consist of 9 bits for user, group, and other (each user group holds 3 bits).
With binary expression, it would be same
111 (user) 111 (group) 111 (other)
For first bit represent the read permision and the second is for write, third one is for execute.
so 755 equals in binary expression 111 101 101 (= rwxr_xr_x)
Click to expand...
Click to collapse
Gotcha, with thanks.
Sent from my SPH-D710 using XDA
Pheno.menon said:
Can we use this on aokp?
Transmission sent from my slim n trim Galaxy S II.
Click to expand...
Click to collapse
It's not been tested on aokp. If the kernel is same, then there are high chances that this tweak would run. But, all the paths on this tweak needs to be verified and tested.
If someone want to run this from AOKP, please try it with scripting tool like SManager first before putting it into init.d folder.
Unfortunately, I don't use AOKP rom yet. Only the way, I can do the test would be downloading the rom and verifying the zip file manually. But if the kernel is different, then I couldn't do that because I don't know the command difference on AOKP rom.
TeamERA said:
Thanks for the info kobridge, I still have not figured out why wifi causes a partial wake lock on ICS. But it plays much better with GB. Ive tested this also.
Sent from my SPH-D710 using xda premium
Click to expand...
Click to collapse
To properly answer your question, we may need the kernel source to check the mechanism.
There are couple of options locking wifi (I think you already know about this, right?)
Sleep Modes: (pm.sleep_mode=)
This is supposedly for topaz/rhodium that I found on the xda wiki:
* '4' will do "wait for interrupt", no change in arm11's clock or voltage
* '3' will do "wait for interrupt and ramp clock", the arm11's clock is lowered to 20MHz instead of 300-500, and voltage is lowered too.
* '2' will do "app sleep", arm11 is still on, but put into low power mode (registers are still saved)
* '1' and '0' will totally power off the arm11 (so we have to restore registers and things ourself), don't know the differences between them
pm.sleep_mode=0 -> Power Collapse Suspend
pm.sleep_mode=1 -> Power Collapse (Provides best power savings)
pm.sleep_mode=2 -> Apps Sleep
pm.sleep_mode=3 -> Slow Clock and Wait for Interrupt
pm.sleep_mode=4 -> Wait for Interrupt
(http://forum.xda-developers.com/showpost.php?p=17680020&postcount=9)
The similar function is also provided by settings > wifi > menu > advanced > Keep wi-fi on during sleep options. There are three options, Always, Only when plugged in, and never.
If you set up above values in somewhere, partial wake up lock would be dependent on the values you've chosen. Aslo, if there is any application which is configured to use wifi for communication, you may also need to check the application if it's causing partial wakeup lock.
It seems like there's something needs to be tested from your side.
FYI, I set the pm.sleep_mode value to 1 in my tweak and build.prop.
Update: I just added some more screenshots on post #2. Check out screenshot #6 and comments on that.
sfhub said:
BTW the script is install-recovery.sh (not recovery-install.sh) I think you had it right in some sections but reversed it in others.
Also since we last discussed I made some improvements to the script. It is now compatible with other apps which like to use install-recovery.sh to get their stuff done like link2sd. The installer in Auto Root will move the existing install-recovery.sh to install-recovery-orig.sh and the install-recovery.sh (init.d version) will call install-recovery-orig.sh (if present) after it is done. The uninstaller will reverse the process.
Also install-recovery.sh will now defer to init.d support in the kernel regardless of which .rc file it was added to in the kernel. Previously it only looked in init.rc but I saw some repacked kernels were adding support in different .rc files (they also removed install-recovery.sh support from their .rc file, so it might be a moot point because install-recovery.sh might never get called)
Click to expand...
Click to collapse
Updated my thread based on your information! http://forum.xda-developers.com/showthread.php?p=25120392#post25120392
Thanks sfhub!
Updated info :
4/29/12 sfhub improved his auto root tool to support some other kernels, those are enabling init.d through different .xc files.
Stock kernels and some repacked kernels are supporting init.d scripts through init.xc and/or install-recovery.sh but some other repacked kernels are supporting init.d scripts running through different .xc files. So, sfhub made some modification on his script. Because he's adding a new install-recovery.sh file into /system/etc folder, if there's a existing install-recovery.sh file at the same location, the existing install-recovery.sh file will be replaced by his previous version of Auto Root Tool. To prevent the replacing existing install-recovery.sh file with his same named install-recovery.sh file which supports the init.d scripts, his tool now creates a copy of old file and create a new one. Old install-recovery.sh file will be named as install-recovery-orig.sh.
If you are enabling the init.d support by running his tool, be sure that the existing install-recovery.sh file was not created by his old Auto root tool nor you manually created it following this guide. If the file is the one you created by sfhub's tool or my guide in here, be sure that you remove the old file manually before you run his new Auto Root Tool. Otherwise, the init.d scripts would run twice whenever you reboot your phone.
If you just want to simply enable init.d support without using sfhub's tool, then download the new-install-recovery.zip file from my second post and unzip it. Like I explained above, if there's any existing install-recovery.sh file and it's not related to init.d support, then rename it to install-recovery-orig.sh and move the unzipped file to same directory (/system/etc). Assign the file permission 550 (r_xr_x___). New install-recovry.sh file will execute the init.d scripts (if it's there) and old install-recovery-orig.sh (if it's there) during the boot.
kobridge said:
If you are enabling the init.d support by running his tool, be sure that the existing install-recovery.sh file was not created by his old Auto root tool nor you manually created it following this guide. If the file is the one you created by sfhub's tool or my guide in here, be sure that you remove the old file manually before you run his new Auto Root Tool. Otherwise, the init.d scripts would run twice whenever you reboot your phone.
Click to expand...
Click to collapse
BTW the installer in Auto Root checks to see if the existing install-recovery.sh is the one that adds init.d support. If it is, it just overwrites it. Only if the existing install-recovery.sh has nothing to do with init.d support does it move it to install-recovery-orig.sh. The way it detects whether the existing install-recovery.sh is used for init.d support is the presence of the BusyboxBin string, which is the shell variable used to define the busybox location used by the script. The chances some arbitrary install-recovery.sh script defines that string is very low (but not zero)
So bottom line if Auto Root is working properly, it shouldn't be necessary to remove your existing init.d install-recovery.sh script as it will not cause a situation where init.d is run twice.
Also I forgot to mention that some people wanted to run init.d but didn't have busybox installed. I didn't want to clobber busybox for people that have installed it, so basically just had the init.d install-recovery.sh use /system/xbin/busybox-initd (which gets copied into place by the auto root installer) This makes it easier (more symmetrical) to remove init.d support and associated busybox-initd without worrying about who installed busybox to start with.
For the "new-install-recovery.zip" you should do a symlink from busybox-initd to busybox
Code:
su
cd /system/xbin
ln -s busybox busybox-initd
kobridge said:
It's not been tested on aokp. If the kernel is same, then there are high chances that this tweak would run. But, all the paths on this tweak needs to be verified and tested.
If someone want to run this from AOKP, please try it with scripting tool like SManager first before putting it into init.d folder.
Unfortunately, I don't use AOKP rom yet. Only the way, I can do the test would be downloading the rom and verifying the zip file manually. But if the kernel is different, then I couldn't do that because I don't know the command difference on AOKP rom.
Click to expand...
Click to collapse
didn't work for me. had to Odin a kernel and reflash. not sure which script as I tried all from the OP. tomorrow I can figure it out which.
anyway to delete init.d scripts via Odin if it fails to boot? I end up odining el26, wiping, and reflashing. :/
EDIT:
oops. I used the sh script.
want me to post the included fd26 aosp kernel from aokp?
gershee said:
didn't work for me. had to Odin a kernel and reflash. not sure which script as I tried all from the OP. tomorrow I can figure it out which.
anyway to delete init.d scripts via Odin if it fails to boot? I end up odining el26, wiping, and reflashing. :/
EDIT:
oops. I used the sh script.
want me to post the included fd26 aosp kernel from aokp?
Click to expand...
Click to collapse
Do you think aosp kernel works on stock rom? If it is, then I think I can make some test.
If init.d fails on boot, and boot screen is stuck on Samsung logo, then we would flash the rom again. Flashing kernel would not help because it does not delete the system partition. Once after the rom is flashed, do the nandroid recovery that you made before the init.d test.
kobridge said:
snip
Click to expand...
Click to collapse
Just curious if you are experiencing any Sleep of Death using the CPU screenstate settings you have, specifically enabling a powersave as the sleep governor with a cpu freq range of 200-500. A very common issue on the ICS builds so far is setting the max freq below 1ghz can cause Sleep of Death where the device will not wake from sleep and must be rebooted.
odub303 said:
Just curious if you are experiencing any Sleep of Death using the CPU screenstate settings you have, specifically enabling a powersave as the sleep governor with a cpu freq range of 200-500. A very common issue on the ICS builds so far is setting the max freq below 1ghz can cause Sleep of Death where the device will not wake from sleep and must be rebooted.
Click to expand...
Click to collapse
And I was curious if the undervolt or underclock have triggered any 4g reboots for you. A few of my friends were getting them on earlier ICS ROM and I had them delete the undervolt script and they stopped. Some people's phones just handle that stuff better than others though
Sent from my Nexus S 4G using Xparent Blue Tapatalk 2

[Script] {APP} CPU Sleeper, The Battery Saver Mod! 07/12/2012 Release 2.1

App Version:
CPU Sleeper
~Free to all XDA Memebers
~ Must Be Rooted to use App
What is it?
Its a fairly simple App that will put CPU 1/2/3 OFFLINE when the screen turns off. Once the screen comes back on, it will allow CPU 1/2/3 back ONLINE.
How does it work?
Since we have Dual & Quad core CPUs, we have a CPU 0 and a CPU 1/2/3, core 0/1/2/3, while the screen is off we really only need to have 1 core active "CPU0", this App will make sure CPU 1/2/3 shuts off while the screen is off, then resumes normal usage when the screen comes back on.
Compatibility?
Works with any Dual Core & Quad Core Devices!
~ICS
~Gingerbread
Battery Saving?
Battery savings all depends on Usage & idle times.
App Download: CPUSleep.apk
Credits:
Handlerexploit for co-creation of this wonderful App.
Script Version!
Code:
This time I present to you a script that will in theory (and so far for me, in reality) save us some battery without having to risk our hardware with undervolting! I present to you...
[B]CPU Sleeper[/B]
[QUOTE]Honestly the Script can be made to work with any Dual Core / Quad Core! The Only Problem is you need to be Rooted!
~ Currently the issue with CM9, is that the boot becomes incomplete while in init.d folder without Modification to the sysinit..
~ however, with any rooted device you can download the script & continue to use it via a script manager app on every boot.
~ With the Script Manager App, this script virtually can run on any Multi-Processor CPU
Hope that clears things Up,
~~Eugene[/QUOTE]
[U]What is it?[/U]
Its a fairly simple script that will put CPU 1 OFFLINE when the screen turns off. Once the screen comes back on, it will allow CPU 1 back ONLINE.
[U]How does it work?[/U]
Since we have dual core CPUs, we have a CPU 0 and a CPU 1, core 1 and core 2, while the screen is off we really only need to have 1 core active, this script will make sure CPU 1 shuts off while the screen is off, then resumes normal usage when the screen comes back on.
[B][COLOR="red"]WARNING! READ THIS![/COLOR][/B]
This script relies on init.d OR script manager! CM9, for some reason, tends to run this at the exact same time it runs some other script (I forget atm which) and it will clash, causing no boot! CM9 users MUST use the script manager version install! Flex Reaper appears to work fine with it as init.d. I strongly urge you to use the script manager version of this, NOT the flashable version. Always make a nandroid backup before modifying the system, including this!
[U][COLOR="Red"]Instructions[/COLOR][/U]
Available in 2 versions, script only version which you can place wherever you want and run however you want, or a CWM/TWRP flashable zip that will place the file for you in /system/etc/init.d and set permissions.
[I]Version 1: Flashable[/I]
Same as any of my flashable releases, I did most of the work for you!
Make a full backup
Download to external SD card
Install from SD card
Pick the cpu sleeper zip file
it'll be almost instant
reboot
Shouldn't be any need to clear caches or anything like that.
[I]Version 2: Script only[/I]
This can be run in 2 ways, via init.d support, or via script manager. Both are pretty similar, and can be done a number of ways, however this is the basis of how.
[U]Init.d supported kernel:[/U]
Make a backup!
Download the script file, making sure no extensions get added onto the file. Copy the file to /system/etc/init.d and set the permissions to the following:
XOX
XOX
XOX
Once done, reboot the system, and it will take effect when your system is finished rebooting.
[U]Script Manager[/U]
This method is probably the better method, and should work with any kernel/ROM. Download the script file, making sure no file extensions get added, and copy it to /system/etc. Set the file permissions to:
XOX
XOX
XOX
Once done, load up script manager, select browse as root (if it isn't already set from the crossix mod method in the guide) then browse to /system/etc and select the script file S98cpu_sleep, then select ROOT and BOOT options. After this is set, reboot system.
[U]What do I do if I can't boot after using this?[/U]
You made that backup, right? Ok, then here is what you do.
Hold the power button until the tablet powers off
Press and hold the volume down button, next to the screen lock switch
Press and hold Power (while holding volume down)
Once the recover kernel message comes up, release the buttons
In CWM go to advanced, mounts, mount system, then format system
In TWRP, go to wipe, then wipe system
In CWM go to restore, advanced restore, restore ONLY system
In TWRP select restore, then uncheck all so ONLY system is checked
After restoring system, wipe cache and dalvik cache, then reboot system.
System should boot normally.
[B]Downloads[/B]
Available in 2 versions, script only version which you can place wherever you want and run however you want, or a CWM/TWRP flashable zip that will place the file for you in /system/etc/init.d and set permissions.
Dual Core:
Download: [COLOR="Red"]Script Only - Recommend Install via Script Manager App[/COLOR]
[URL="http://d-h.st/N1N"]CPU Sleeper script only[/URL]
Quad Core:
Download: [COLOR="Red"]Script Only - Recommend Install via Script Manager App[/COLOR]
[url=http://www66.zippyshare.com/v/9249467/file.html]cpusleep[/url]
Thanks to [COLOR="DarkGreen"]pio_masaki[/COLOR] for rewriting the OP
Interesting, I'll give this a go. Will report back in a bit.
Nice, will check it out.
Thanks Guys,
It's been Confirmed working Perfect for all Dual / Quad Core Device!
Thanks Eugene! Are we allowed to include these in our Roms?
Sent from my SPH-L710 using Tapatalk 2
clark44 said:
Thanks Eugene! Are we allowed to include these in our Roms?
Sent from my SPH-L710 using Tapatalk 2
Click to expand...
Click to collapse
Probably wouldn't be much use until we get a kernel with init.d support, unless we already have one.
Very interesting will give this a go
PhantomHacker said:
Probably wouldn't be much use until we get a kernel with init.d support, unless we already have one.
Click to expand...
Click to collapse
My Rom has It
Sent from my SPH-L710 using Tapatalk 2
If I post it, it's cool to use.... Credit is nice, but not required!
That's what open source is about correct
~Enjoy
eugene373 said:
If I post it, it's cool to use.... Credit is nice, but not required!
That's what open source is about correct
~Enjoy
Click to expand...
Click to collapse
That's right I will give credit and link to this thread! Thanks Eugene!
Sent from my SPH-L710 using Tapatalk 2
eugene373 said:
If I post it, it's cool to use.... Credit is nice, but not required!
That's what open source is about correct
~Enjoy
Click to expand...
Click to collapse
Indeed it is, though some people get cranky about it.
Will this script still work correctly if i have a setcpu profile to downclock when the screen is off?
Sent from my SPH-L710 using Tapatalk 2
I wouldn't use a script like that.
1) This phone already sleeps like a champ.
2) The script looks like it may interfere with samsung's way of handling the second core.
Soon as I saw Eugene I flashed it lol Seems to be running nice, hope to see battery savings. Every little bit helps haha
Sent from my SPH-L710 using xda premium
just want to be sure, i can flash the flashable version to my sprint sgsiii correct?
The_Real_D/\SH said:
just want to be sure, i can flash the flashable version to my sprint sgsiii correct?
Click to expand...
Click to collapse
Yes
Sent from my SPH-L710 using xda premium
Deleted.....
Installed your script (prior to all this drama)
I have to say I'm very impressed. Before if I forgot to plug my phone in at night I would wake up and it would be down to about %10-15 by morning. I forgot to plug it in today and found I was only down 5%.
I'd say I'm happy with the results and wanted to say thanks!
jchap2k said:
Installed your script (prior to all this drama)
I have to say I'm very impressed. Before if I forgot to plug my phone in at night I would wake up and it would be down to about %10-15 by morning. I forgot to plug it in today and found I was only down 5%.
I'd say I'm happy with the results and wanted to say thanks!
Click to expand...
Click to collapse
thank you, the script does work very well & it's so simple I can see how people would think it doesn't work...
However, this isn't the case & it works awesome...
Funny how a little script can make life better...
PS.
I turned this into an App also.
Is there any way to check if the script is running?
Sent from my SPH-L710 using xda premium

Categories

Resources