Smartass CPU Governor on Droid 2 - Droid 2 Android Development

So I was investigating loadable kernel modules on the Droid 2 this weekend. One of the modules I tried loading was the smartass governor module and to my surprise it worked. From what I can tell it appears to be working with no problems.
The module itself is from a Milestone Cyanogen ROM. Given how close the Milestone is to the Droid 1 and how close the Droid 1 is to the Droid 2 it seemed like a safe try to see if it would load.
Requirements:
You must be rooted. This really should go without saying but I'm trying to cover all the bases here.
You must have busybox installed.
You must be able to boot into clockwork recovery.
I've tried this on Fission ROM but since we can't change the kernel on the Droid 2 this will probably work on any other Droid 2 ROM. D2G users, YMMV.
NOTICE: By installing this you assume any and all risk for what might happen to your phone. I am not responsible if this mod causes your phone to stop working, catch fire, steal your significant other, and/or hijack a plane. Basically I haven't had any issues but that is not a guarantee that you won't have any issues.
Attached is the update.zip. Boot into clockwork recovery and choose this zip to install. Once you reboot you'll be using the smartass governor.

So what has this done for your battery life?

Anecdotally I believe my battery life has improved. With the ondemand governor and data and wifi off I've seen my battery drop 10% in a night. With the smartass governor under the same conditions my battery appears to be the same. Now given that Motorola phones report the battery in just 10% increments my totally non-scientific analysis might end up being nothing.
Really you'd have to try it yourself and determine if things are better. From what I've read online the smartass governor is better at conserving battery than ondemand but it really depends on how you use your phone.

Download circle battery widget from the market. Its free and somehow it reports 1% increments. I have been using it for a while now and it seems to be spot on.
Sent from my DROID2 using Tapatalk

It just guesses

Well, there is a way to get an accurate battery reading. Reading /sys/devices/platform/cpcap_battery/power_supply/battery/charge_counter will give you the battery level in 1% increments. However, the system reads from /sys/devices/platform/cpcap_battery/power_supply/battery/capacity which provides the bounded 10% increments. Some widgets, Minimalistic Text for example, will read from charge_counter on Moto devices.
Ideally a kernel module could be written that changes what is written out to capacity so the entire system could take advantage of 1% battery increments. If I had the time I would take a crack at it, but it's been awhile since I've done any C coding.

Looks interesting. I'll wait until a little more feedback is given before I try it. How is the performance after the install?

I'm guessing you have to sbf to go back?

tbaker077 said:
How is the performance after the install?
Click to expand...
Click to collapse
No different than using the ondemand governor. Smartass takes a clever approach to CPU scaling: instead of polling CPU usage like ondemand it detects when the phone comes out of sleep and sets a timer to go off in two ticks. Once that timer goes off it looks at CPU usage and scales if needed. What does all this mean? Well, if you turn on your phone to quickly check the time and then turn it back off the smartass governor will never ramp up the clockspeed. So far after a few days of light usage I've been quite pleased.
rtfield said:
I'm guessing you have to sbf to go back?
Click to expand...
Click to collapse
Nope. If you want to revert just chmod 644 /etc/startup/smartass.sh and reboot.

Sweet
Thanks

I wonder if they could modify this to work with the new gingerbread kernel.
I know when I had an HTC Eris, Conap used a smartass gov on his kernel and it was awesome.

So I took a shot and flashed the smartass governor a second ago on my GB d2, and seems to be working just fine. I'll report later with battery stats and anything else i notice.

Spitemare said:
Well, there is a way to get an accurate battery reading. Reading /sys/devices/platform/cpcap_battery/power_supply/battery/charge_counter will give you the battery level in 1% increments. However, the system reads from /sys/devices/platform/cpcap_battery/power_supply/battery/capacity which provides the bounded 10% increments. Some widgets, Minimalistic Text for example, will read from charge_counter on Moto devices.
Ideally a kernel module could be written that changes what is written out to capacity so the entire system could take advantage of 1% battery increments. If I had the time I would take a crack at it, but it's been awhile since I've done any C coding.
Click to expand...
Click to collapse
I took a look at this and found some stuff that might be encouraging.
Here is the source for the battery driver. Line 397 reads as such:
Code:
val->intval = sply->batt_state.capacity;
If line 397 is changed to this
Code:
val->intval = sply->batt_state.batt_capacity_one;
then battery level should be reported in 1% increments. I've posted the updated driver code here.
The problem is the gorram encrypted bootloader. It's not easily possible to swap a built-in hardware driver with a compiled module. If someone with more Linux kernel experience than I wants to take a crack at it then by all means...

Do we really need busybox to uses this?

tbaker077 said:
Do we really need busybox to uses this?
Click to expand...
Click to collapse
Busybox's insmod is a little more robust then the insmod that's on the Droid 2. You can try editing the file /etc/startup/smartass.sh to remove the references to busybox and see if it works; I just stuck with busybox since that was what worked for me when building this thing. I'd try it myself but I can't at the moment.
I'm running an experiment now to see how long this governor will take me. I charged my phone to 100% last night (really 100% and not just to when the charging light went off) and turned it off. I turned it on this morning and will let the phone run until 5% battery is left. At that time I'll take a screenshot showing how long the system has been up. A few guidelines:
ROM is Fission 2.6.1 which of course means Froyo. I've been thinking about switching to the leaked Gingerbread ROM but I've decided to wait a little longer
Data must remain on. I usually turn data off when I'm not using it but to get results closer to worst case I'll keep data on. The only time it will go off is when I turn on Wi-Fi at home.
No turning off the phone at any time nor plugging it in. I guess I'm going to be using Dropbox a lot during this to transfer files but I don't want to reset the time since plugged in at all.
No overclocking, underclocking, or undervolting. Clockspeed and voltage are stock.
Usage will be light to moderate. I tend to use my phones for calls, chats, and web browsing. I'll throw in some YouTube videos and maybe download Angry Birds.
No apps that try to maximize battery life. That means no SetCPU, Tasker, Superpower, etc. This is supposed to be about how well the smartass governor does for battery life.
Again, once I reach 5% I'll try to take a screenshot of how long the phone went without being recharged.

Spitemare said:
I took a look at this and found some stuff that might be encouraging.
The problem is the gorram encrypted bootloader. It's not easily possible to swap a built-in hardware driver with a compiled module. If someone with more Linux kernel experience than I wants to take a crack at it then by all means...
Click to expand...
Click to collapse
Is this difficult to swap in simply because of the nature of what we'd be switching out, or does the eFuse chip and whatever other protection play a role here? I would try compiling your modified code and putting it on my device, except I'm afraid there will be some protective measure or something like that would brick my phone if I try. That and the fact that I have no idea what libraries and stuff I would compile this against.

So unfortunately my phone rebooted halfway into the experiment so there is no screenshot for you all. I will say my phone made it just under 36 hours (6:30 Friday to 18:15 Saturday) on this governor. With some moderate internet browsing and way too many YouTube videos I'm quite happy with the outcome using this governor.
ZaneKaminski said:
Is this difficult to swap in simply because of the nature of what we'd be switching out, or does the eFuse chip and whatever other protection play a role here? I would try compiling your modified code and putting it on my device, except I'm afraid there will be some protective measure or something like that would brick my phone if I try. That and the fact that I have no idea what libraries and stuff I would compile this against.
Click to expand...
Click to collapse
I've already compiled the modified module and tried to load it. The phone just prevents it from loading since the hardware interrupts are already bound to the compiled in driver.
eFuse doesn't prevent new kernel modules from being loaded. Since a kernel module can alter almost anything not being able to change the kernel isn't too much of a problem. What a kernel module can't really do, however, is change device drivers. There's not a really clean way to unload a device driver module since it binds to hardware interrupts and you can't really unbind that once the phone is up and running. If you want to replace a device driver with an alternate module you have to load the module before the original module is loaded sometime during the boot process. With compiled in device drivers though that's not really possible.
Basically we're in a situation where we need to load an alternate version of the device driver in module form before the compiled in device driver binds to the hardware interrupts. That would take some sort of ramdisk containing the altered driver module and we can't do that with eFuse.
The other option would be to write a module that hijacks calls to the particular function in the device driver and replaces that call with an alternative. That's got loads of problems though and is potentially dangerous. It would take someone with a lot more kernel experience than I have to write such a thing.

I installed this and didn't see any improvement in battery life until I ran
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
It said it was still ondemand. I checked scaling_available_governors and smartass was not in there, so I went ahead and installed the zip again... still doesn't work.
I went ahead and took a look at /etc/startup/smartass.sh. The permissions were right, so I ran /etc/startup/smartass.sh. I then checked /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor and it was set to smartass.
Can anyone shed some light on why this script is not running on boot? I'm running the leaked Motorola Gingerbread ROM if that makes a difference.
Spitemare said:
The other option would be to write a module that hijacks calls to the particular function in the device driver and replaces that call with an alternative. That's got loads of problems though and is potentially dangerous. It would take someone with a lot more kernel experience than I have to write such a thing.
Click to expand...
Click to collapse
I see. I'm guessing the way to hijack said calls would be through directly modifying memory, right? That definitely is not something that sounds easy to do.

I tried running smartass.sh through an init.d script... still nothing. I actually had to make the /etc/init.d/ directory, so I figured that init.d scripts aren't supported on the Motorola Gingerbread rom... strange. I'll look for somewhere else where I can run stuff on startup.

Look for /etc/install_recovery.sh. That file is run by /init.rc if it exists. It's how the overclock stuff gets loaded on Fission. What the update.zip does is back up that file if it exists and then append /etc/startup/smartass.sh to the end. Just add the following to the end of /etc/install_recovery.sh if the update.zip doesn't add it:
Code:
/etc/startup/smartass.sh

Related

[GUIDE][UPDATE] Try the battery tweak with Myn's RLS3!

Battery tweak can be found HERE:http://www.mediafire.com/?xmjdd797f6v2m90
Tweak can only be used with No HAVS kernels (recommended kernels below)
What is the battery tweak exactly? More information in this thread:http://forum.xda-developers.com/showthread.php?t=810940
The intended scope of this thread is for people having trouble with Ksoft consuming too much CPU resources
DO NOT USE WITH SETCPU!
Ksoftirq is something in the kernel that manages requests to the CPU. That means some device in your system is sending the processor a slew of IRQs so that the softirqd for your processor is being consistenly woken up, which ends up using most of your CPU cycles, thus sucking your battery life and performance. As indicated before, anything with a "K" in front of it is referring to the kernel. A kernel is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components).
When the ksoftirq is using such a high percentage of CPU, it is causing your CPU to work harder and doing two things that we dont' want; taking away from performance and draining the battery.
As it stands now, we know that depending on what kernel you're using it is going to determine whether or not you have that problem in the tweak. We know that it is not an app that is sending processes to the CPU that is causing the problem.
Don't fret if you read through this thread (http://forum.xda-developers.com/showthread.php?t=810940) and flash 1 of the 2 kernels known to work and it still shows ~30%, you're probably just not doing it right. You cannot simply just flash a new kernel, because as said before, the kernel is the link between software(battery tweak) and hardware. Therefore you must have the new kernel in place, then go about flashing the battery tweak. That way it is installed properly by the proper kernel.
As of now, there are 2 known kernels compatible with this tweak:
STOCK HTC 11 kernel, modded: http://www.mediafire.com/?i7u103j9xqnaw3s
Netarchy NoHAVS kernel: http://forum.xda-developers.com/showthread.php?t=719763
**Scroll down and you will see NoHAVS kernel by request, I have had better luck and amazing battery life with Netarchy's kernel
Instructions:
1. Open terminal emulator, type su. You will be prompted that you have gained superuser access
2. Type batt-cfg, then press 1 and then enter when dialog comes up about having root access
3. Choose option 4 to Disable battery tweak, then 9 to save changes and exit
4. Type batt-rm.sh, follow directions to remove tweak (It will tell you to choose y/n, choose "y"
5. Reboot your phone into recovery and install new kernel from zip. When that is finished, install battery tweak.
**It is ESSENTIAL that you follow these first 5 steps in order or I promise you that you will have the same ksoft issue over and over again**
6. When you reboot your phone, go into terminal emulator and type su again.
7. After gaining root access, type batt-cfg. Choose option 1 and save changes and exit.
8. Make sure that phone is unplugged from computer/wall! This is very important, having the phone plugged in will not show the ksoft process so you will not know whether it is still a problem or not.
9. Type top "-m 5 -n 1"(without quotes) This will show you your top CPU processes. You should see no abnormally high percentages for system or ksoft particularly. What percentage you see can depend on your current battery life when you run this test. Make sure that your phone is not plugged in when running the test! Also, take note of your battery life.
Tweak Will stick after reboot. You do not need to re-enable it.
If you install system monitor, you will be able to monitor the cpu level. When I am not touching the screen of my phone, it shows 245mhz. When I start moving the screen or etc, it hikes up a little bit. This shows that the tweak is working properly.
I have gotten incredible battery life out of this with very heavy usage(facebook, texting, phone calls, gps, pandora, running command prompts, etc).
Until something new comes around that I am sure will give me equally as good or better performance and battery life, I will not be switching ROMS/kernels EVER!
ROM: Myn's Warm 2.2
Kernel: Netarchy NoHAVS
Sidenote- I have just as good of performance and speed as I did while having CM6 with Snap7.6&turbo enabled, so don't think that you are sacrificing any performance.
Hope this clears up everything for everyone!
UPDATE-
There has been much debate as to whether or not this tweak works or not. I should have been more clear in the original post. Ksoft is still a necessary process, however, when I said that the purpose was to elimate the "ksoft problem" I was meaning that it should not be detectable by the CPU when you run the "top -m 5 -n 1" command. Neotelos_com made a very good point that is necessary to understand this tweak, "ALSO, this tweak lowers the CPU speed as the battery drains, so within the first hour you will notice the most battery drain." This means a few different things:
-Depending of the charge of your battery when you run the top 5 command, you will see different percentages of ksoft. For example, if I run the top 5 command right now, my battery is at 30% and ksoft doesn't even register at all. Assuming that I charge my battery full and run the top 5 command in the morning when my battery is fully charged, it will register as a process. Ksoft in the low ~20% is completely normal with a full charge. IT WILL BECOME LESS LESS AS THE BATTERY DRAINS.
-I have been toying with this in the very little free time that I have had the past couple days and have also discovered a few other things. Programs like Ultimate Juice, Juice Defender, and Tasker used in coherence with the battery tweak will improve a already great mod to give you significantly more battery life than before. the main reason being that 90% of the time your cell stanby is what is draining your battery the most. Those programs will turn off your mobile network when you are not using it saving a TON of battery power.
I will be posting screenshots at the conclusion of my testing either late tomorrow night or wednesday around 12ET. I want to be able to provide everyone with the info that they need to be able to get the best life out of your battery possible.
Contributions:
intheb0x
Neotelos_com
Myn
Developers of battery tweak
So, is seeing ksoftirqd in step 9 bad?
Techrocket9 said:
So, is seeing ksoftirqd in step 9 bad?
Click to expand...
Click to collapse
It depends what percentage of CPU it is using; in my experience it had been 20+ percent every time when I had the problem.
Is this good or bad? I would guess bad if i'm reading it right.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Changed Screen Shot. Keyboard was hiding results
nugzo said:
Is this good or bad?
Click to expand...
Click to collapse
Try exiting out and then do it again. Mine showed up but still showed ksoft.
Sent from my PC36100 using XDA App
when you say incredible battery life...how many hours are we talking about
Using this with SetCPU = fail?
freeza said:
Using this with SetCPU = fail?
Click to expand...
Click to collapse
Yes, do not use this with SetCPU. It is unnecessary and will cause conflict as both are going to be scaling your CPU.
jhoffy22 said:
It depends what percentage of CPU it is using; in my experience it had been 20+ percent every time when I had the problem.
Click to expand...
Click to collapse
I just uninstalled, followed directions to the T again with netarchies no havs, this time 37%. Hmmm not working for me.
flam253 said:
when you say incredible battery life...how many hours are we talking about
Click to expand...
Click to collapse
It will be different for everyone based on usage, quality of service in your area(how hard your phone is working to give you good service), and a number of other things. I can't tell you exactly how many hours but I can tell you this...after configuring this battery tweak correctly, battery life has nearly doubled. It's only been one day, but to this point I am extremely satisfied and never looking back. I will report further on this in the future and provide screen shots of my battery usage and Juice Plotter graphs.
nugzo said:
I just uninstalled, followed directions to the T again with netarchies no havs, this time 37%. Hmmm not working for me.
Click to expand...
Click to collapse
What ROM are you using?
OK for clarity are we suppose to have one of those kernels installed before following the instructions or only during step 5?
JaiCameron said:
OK for clarity are we suppose to have one of those kernels installed before following the instructions or only during step 5?
Click to expand...
Click to collapse
It doesn't matter what kernel you have originally, just make sure that before you flash the battery tweak you have it completely disabled and removed and use one of the two suggested kernels when you reflash the tweak.
Im getting "batt-cfg: not found"
JaiCameron said:
Im getting "batt-cfg: not found"
Click to expand...
Click to collapse
You must not have the battery tweak flashed. You need to go to the forum and find the original thread of the collin_ph battery tweak and get the zip file and flash that separately and after flashing the kernel.
Sorry, this was a quick write up and I left out some information for people who weren't familiar with what the battery tweak is exactly.
Mine still shows ksoft.
Sent from my PC36100 using XDA App
heres the post to the updated one FOR THE ERIS, NOT the evo, BUT it has more features, and the creator is in the thread, lots of info about different settings, how things work and so on..
http://forum.xda-developers.com/showthread.php?t=784089
i think i found out all the bugs from this tweak, there may be more, but i think through about a week and a half through my own trial and error, ive found out everything and whats going on. If working correctly (NO KSOFT), you can achieve great battery life.
hopefully the coder from that thread will update the battery tweak we use to include the temperature mod, since my phone overheats and could really benefit from that feature.
if you wanna be more customized, i recommend choosing option 3 and setting it up your way.
heres what i set.
i left it on underclock
i left the governor alone
i also chose deadline instead of noop.
Min cpu- 245000
max cpu 768000
for polling, instead of 60, i used 120 and instead of 15 i used 30,
then when it gets to cpu usage when battery is low, i choose 28 instead of 33.
you can change these numbers to your choosing, but with these above, i noticed no performance issues and everything seemed normal, just with extra battery life.
but with all our heads together, we can work everything out and get this tweak perfect...
Not working. Myn 2.2 netarchy noHAVS kernel. Showing 28% k...irq
Sent from my PC36100 using Tapatalk
What % should cpu be at to determine if the tweak works or not?
JaiCameron said:
What % should cpu be at to determine if the tweak works or not?
Click to expand...
Click to collapse
Go into terminal, run "top -m 5 -n 1" (without the quotes) and if you system says anything more than 20% the tweak is not working correctly.

[DEV-Info] Learning about SBC charging

I just ran across this info and just wanted to share it and gather others opinions...
Posted by Ziggy471 in Android Development
"For those that don’t know me personally, I work for the government on special projects, and we’ll just leave it at that. However, in the course of normal work, we talked in depth to a National Lab in regards to batteries. One of the discussions was charging. I can’t post the actual info I got from them, however, here is a good stand in:
This is an except from here:
No trickle charge is applied because lithium-ion is unable to absorb overcharge. A continuous trickle charge above 4.05V/cell would causes plating of metallic lithium that could lead to instabilities and compromise safety. Instead, a brief topping charge is provided to compensate for the small self-discharge the battery and its protective circuit consume. … Typically, the charge kicks in when the open terminal voltage drops to 4.05V/cell and turns off at a high 4.20V/cell.
There is a whole lot more info on that site, but I’ll sum up the excerpt, if you continually charge a Lithium Ion battery, it will degrade, and worst case explode, but hey, at least it looks cool when it does.
Just don’t end up like others have, for example, a Chinese man who took his phone off the charger, put it in his pocket, and then it exploded. To read a little more about that, check out EnGadget, if you want to see the phone, Tech-Ex. Here’s another one, no one was killed, but it burst into flames, over on PCWorld.
I’m not sure if those were good factory batteries or the cheap Chinese knock offs, but either way, if you decide to assume the risk, that’s your decision. However, my decision is NOT to hack the battery code.
I hope this explains why I have not or WILL NOT modify the battery code."
This was already discussed in the thread regarding the SBC kernel, which is what Ziggy is referring to.
The maker of that kernel stated simply this: You can't overcharge a battery that's being used. The phone is sucking power while the charger is charging it.
Also, it's a type of trickle charging. When it reaches a certain voltage, it stops charging. This kernel will never "overcharge" the battery and the talk about this is getting old. Either use the kernel or don't. I, being a user of that kernel for about a month now, have had absolutely no problems. I pick my phone up and it's as cool as room temperature.
Don't mean to sound rude, but that's what it looks like. It just gets old people not reading the first post of that SBC kernel thread where he answers questions like this and discusses that overcharging won't happen.
Will this damage my battery?
This charging method doesnt damage the batteries at all. It shouldnt. Because our batteries dont even charge up to 4.2V without the tweak. They charge up to 4.2V the first charge, then drop all the way down to 4.08V or something and then does these weird short burst chargers to 4.1-4.125V. Thats why there's the rapid drop in the morning. Because your voltage is actually at 4.125V and that's not 100%. So with this tweak, the charger keeps charging until you're at 4.2V (or the maximum voltage your battery can get to) and then it trickle chargers while at that voltage. The charger itself never turns off. Thats not a bad thing. Because as you reach your actual voltage, the mA decreases. Which is why our phones will never be damaged. You ever want to know why its really easy to charge from 50-80% but the charge from 90-100% seems to take so long? Its because from 50% the mA going into the phone is in the 600's. Once it reaches 90%, the mA is around 150 and once it reaches 95% you're looking at 90mA. The phone when absolutely idle uses anywhere from 60-120mA, even when on the charger. So charging from 90% to 100% takes longer becaus the mA going into the phone isnt always higher than the mA you're losing. This is the same with charging past 100%. As you leave the phone on the charger with this tweak, you're mA will decrease from 50mA all the way down to 2mA overnight. But on the charger you're losing about 30-60mA already, so you'll never overcharge the battery, in best case scenarios, you'll just maintain the voltage of 4.2 or around 4.2V.
Click to expand...
Click to collapse
Thanks for making it a little more clear to me
Anytime bro. Try the kernel out. You'll seriously be surprised at how much longer your battery last. I never go a full charge without at least reaching 20 hours unplugged. Performance doesn't suffer either. I use the 4.1.9.1 CFS More Aggressive version because I have an 0003 Evo and 4.1.9.1 is the latest stable kernel that Netarchy made that has this SBC mod incorporated.
i have 0003 as well and im currently testing out "SBC for Netarchy's CFS More Aggressive 4.2.1" do you think 4.1.9.1 would be better?
I had better battery on the 4.1.9.1. I personally prefer to use a kernel that's labeled as stable than use one that's labeled as beta. Since the kernel is the lowest level of the software, I'd rather it be as stable as possible. I get Quadrant scores in the 1200, but don't rely on that. Benchmarking is useless. All my hardware works and I have no performance deficits. I also use a modified-by-me version of Ziggy's kernel tweaks to help save even more battery. See how 4.2.1 does for you and then try 4.1.9.1 and see which one feels better.
I was actually looking for a kernel that someone has complied that included ziggys tweaks plus have the SBC, I would love to try what you have modified your self could you post it?
BAttitude7689 said:
I was actually looking for a kernel that someone has complied that included ziggys tweaks plus have the SBC, I would love to try what you have modified your self could you post it?
Click to expand...
Click to collapse
Sure. It's attached. Just flash in recovery. Here's what it's set to...
Screen ON
Min: 245
Max: 998
Governor: Ondemand
Powersave_bias: 100
Up_threshold: 99
Screen OFF
Min: 245
Max: 652
Governor: Ondemand
Powersave_bias: 500
Up_threshold: 99
These settings seem to work perfect for me. Giving the CPU enough speed for idle tasks while sleeping without sucking too much battery. When the screen is on, I rarely ever see my CPU get to 998. Highest I usually see is 921, which is good.
***EDIT: I had some requests on instructions on how to remove this. Maybe it's not your cup of tea or you just prefer SetCPU. So, below are the instructions to do just that.
1. You should have ADB and all that good stuff. If you do, open up a CMD prompt and navigate to your ADB folder.
2. Type: adb remount. You should see "remount successful." If not, then type: adb shell. Then type: mount -o rw,remount -t yaffs2 /dev/block/mtdblock4 /system. If you know a shorter way of remounting, do so.
3. You should still be in adb shell, so type: cd /system/etc
4. Type: rm sysctl.conf
5. You should have no errors. Now, type: cd /init.d
6. Type: rm 90screenstate_scaling
7. Type: rm 90sysctl
8. You should have no errors with both of those. Now, to finish the "uninstallation," type: reboot
9. Your phone should reboot and will no longer be scaled by that script.
10. ???
11. Profit!
***EDIT 2: I've posted instructions on changing this scaling script as well. If you'd like to do that, then click HERE.
nothing to see here...move along
are those preset with the kernel tweaks? or do you use SetCPU? currently I have using setcpu
Screen ON:
Max:1075
Min:245
Governor: Conservative
Screen OFF:
Max:245
Min: 245
Governor: Powersave
and i think my battery is pretty decent,
Yes. Those are preset in the kernel tweaks I attached. You don't need SetCPU as this script pretty much changes everything the SetCPU app does but only does it for screen on or screen off which is what I wish SetCPU would do, but doesn't.
I only use max 998 because it doesn't make sense to want to save battery but then overclock the CPU which causes more battery drain.
Also, the 4.1.9.1 kernel only offers 3 governors. Ondemand, conservative, and performance. I use ondemand because it responds to power demand faster but, unlike conservative, doesn't lower the frequency as fast which isn't a big deal.
raiden89 said:
Yes. Those are preset in the kernel tweaks I attached. You don't need SetCPU as this script pretty much changes everything the SetCPU app does but only does it for screen on or screen off which is what I wish SetCPU would do, but doesn't.
I only use max 998 because it doesn't make sense to want to save battery but then overclock the CPU which causes more battery drain.
Also, the 4.1.9.1 kernel only offers 3 governors. Ondemand, conservative, and performance. I use ondemand because it responds to power demand faster but, unlike conservative, doesn't lower the frequency as fast which isn't a big deal.
Click to expand...
Click to collapse
well i know its either battery or performance in a sense.... but i kinda want my cake and eat it too, which plenty of people here want as well. I want a decent battery life but i do want performance thats the only reason for the overclock....
Sure. To each their own. I'm not going to modify and re-post custom versions as that's not what I'm here for. I'll provide what I've done and nothing more. However, I'll tell you how you can modify it yourself.
1. Get Android Terminal Emulator by Jack Palevich from the Market. This is the one I use and the one I can give you exact steps for how to use.
2. Open it and type: su then allow it to use SuperUser
3. Type: mount -o,rw remount -t yaffs2 /dev/block/mtdblock4 /system
(There's a shorter way of doing this in Terminal but I can't remember it at the moment. If you know a shorter way to remount in read/write, do so.)
4. Type: cd /system/etc/init.d
5. Type: nano 90screenstate_scaling
6. Use the directional keys to navigate to the max CPU freq and change it to the frequency you want as long as you know the right increment. What you had with SetCPU will work just fine. Be careful when using backspace not to bump the enter key or it'll mess up the alignment with everything. If you do, just keep hitting the back button and start back at step 3.
7. Press the menu key and go to preferences. Set your control key to something you can hold down. I use the volume down button.
8. Go back to the terminal screen, press menu and hit "Toggle Soft Keyboard."
9. Hold down the control key you just set in step 6 and press X on the keyboard and then press enter to save the file and enter again to save it as the current file name.
10. Reboot your phone.
11. ???
12. PROFIT!!!
thanks for the lesson, i appreciated that
Sure thing. I'm sure a lot of people will benefit from this. If only I had a working Paypal.
raiden89 said:
Sure. To each their own. I'm not going to modify and re-post custom versions as that's not what I'm here for. I'll provide what I've done and nothing more. However, I'll tell you how you can modify it yourself.
1. Get Android Terminal Emulator by Jack Palevich from the Market. This is the one I use and the one I can give you exact steps for how to use.
2. Open it and type: mount -o,rw remount -t yaffs2 /dev/block/mtdblock4 /system
(There's a shorter way of doing this in Terminal but I can't remember it at the moment. If you know a shorter way to remount in read/write, do so.)
3. Type: cd /system/etc/init.d
4. Type: nano 90screenstate_scaling
5. Use the directional keys to navigate to the max CPU freq and change it to the frequency you want as long as you know the right increment. What you had with SetCPU will work just fine. Be careful when using backspace not to bump the enter key or it'll mess up the alignment with everything. If you do, just keep hitting the back button and start back at step 3.
6. Press the menu key and go to preferences. Set your control key to something you can hold down. I use the volume down button.
7. Go back to the terminal screen, press menu and hit "Toggle Soft Keyboard."
8. Hold down the control key you just set in step 6 and press X on the keyboard and then press enter to save the file and enter again to save it as the current file name.
9. Reboot your phone.
10. ???
11. PROFIT!!!
Click to expand...
Click to collapse
on step 4, it tells me
"nano: permission denied"
Love the kernels Zig, but ya don't need to be a secret government employee to understand li-ion batteries. Just check here for some info:
http://batteryuniversity.com/index.php/learn/article/charging_lithium_ion_batteries
Any battery charging is safe, as long as it doesn't charge over 4.2v
http://forum.xda-developers.com/showpost.php?p=10374600&postcount=3599
It's been forever and a day since I have used setcpu for anything besides verifying governors/frequencies.
I was using tasker to switch governors before I added smartass to htc #15. Smartass is the best governor I have used so far and I have used them all.
Init scripts that change cpu parameters run on a constant loop always checking to see if the phone state has changed from screen on to screen off and vice versa. It's automated but at the cost of extra cpu load (minimal and negligible but some people notice the littlest things about their device) it's better just to let an app like setcpu catch the broadcast event when the screen state is changed.
The kernel number (#5) is simply the number of times I have compiled this kernel. It is HTC #15 from source with SBC (courtesy of ms) and smartass added.
BAttitude7689 said:
on step 4, it tells me
"nano: permission denied"
Click to expand...
Click to collapse
D'OH! I forgot a step. When you open Terminal Emulator, type: su and hit enter. Then continue to remount in read/write, etc.
I think it goes without saying, but if you're using a cheap battery, you probally shouldn't use an SBC kernel.

[Q] Want to undervolt CM10. KT747 kernel not working?

I wanted to undervolt my CPU a bit to hopefully get a better battery life. Especially now that I've gotten a tablet (Nexus 7, so nothing to sneeze at) I'm using my phone as a Android device a little less and most of my gaming on it allows for some very low CPU speeds anyway. So to that end, if I can squeeze a little more out of it, it seems like a good idea. I've already taken a LOT of other steps, including minimizing the number of things running all the time (it's actually a little annoying how often things stay running in the background that I just don't need, so Android Assistant is now one of my favorite tools, though I wish its "quick boost" widget and the automatic selections in the process list could stop more apps) and I've even removed a lot of the built in things that run all the time that I don't want like live wallpapers (I really don't understand why it likes to run even if you're not actually using a live wallpaper) and DSP Manager (I want the sound to be unmodifed anyway) among many others. I use SetCPU to set the CPU lower under normal operation with the conservative governor and to even set it extremely low when the screen is off with the powersave governor. WiFi and mobile data stay off when I'm at work and often even at home. Overall battery life is generally quite good, but sometimes it's still going down faster than it really should even just idle with the screen off. If I could just squeeze a little bit more out of it I'd be a lot happier. Plus it also can get fairly hot despite the underclocking on those occasions I do play a game thanks in no small part to the fact that I'm having to use an Otterbox on it (which means not one, not two, but THREE layers of insulation on the back side when Samsung pretty much designed it with one in mind. More heat escapes through the glass at the front than the rear and that's saying something given that glass is a pretty strong insulator... Otterbox truly needs to design these with some sort of thermally conductive material or something.) I don't know that undervolting would help a lot with either since I probably can't go down by much, but it most certainly can't hurt...
Ok, so I grabbed the KT747 kernel for the Verizon SGS3 from here (I got the AOSP Jellybean version, not Touchwiz) and tried to install it using the update function in ClockworkMod then cleared the cache partition and Dalvik cache both immediately after. The moment I hit reboot, the phone got stuck on a black screen or shut off (I couldn't exactly tell which.) I didn't find a convenient CM10 kernel alone, so had to basically just put the full CM10 update which of course was a bit inconvenient since I had to redo a lot of stuff. Is that the incorrect way to install it? So far everywhere I've looked everyone just skips over the part about the actual install process -- they just say to install it. Given that it's distributed as a ZIP complete with the normal stuff one would see in a recovery update ZIP I assumed that was the appropriate way (and it did say it was successful and all.) Well, I've read in that thread and others that sometimes it just doesn't work with some phones, so my assumption is that was the case here, but just in case if I've installed it wrong it would help to try doing it right, lol.
Is there any other kernel I should try with CM10? I don't need any special features (definitely no Voodoo sound or whatever -- again, I like the sound being unmodified anyway) beyond the normal stuff other than the ability to undervolt the CPU by a bit. I'd like to do the undervolting with SetCPU if I could as it overall suits me best of the tools I've tried and even has a "safe mode" ZIP file that can be installed as if it were an update in the recovery menu that would stop it from doing its thing if something goes wrong, thus making it safe even to use the set on boot option (though I suspect that with my current underclocking the CPU will remain stable until I push it at any reasonable undervolt level.) Or am I maybe even missing something and CM10 actually has the ability built in that I just haven't found anywhere? I see options to set the CPU min/max, governor and I/O, but nothing about things like voltage (or overclocking for that matter, where I assume such settings would probably lie.) From my understanding, the fact that SetCPU lacks even a tab for voltage control on here means that it thinks the kernel doesn't support it though.
EDIT: Oops, forgot to mention, but I did do "fix permissions" after clearing both types of cache. Also, the system is definitely on when it just goes black. When I press the power button I get the power LED on green indicating that the battery is nearly full and the hardware button backlights come on.
You're correct on assuming that since SetCPU doesn't have the tab the kernel doesn't support it. Try leankernel. It's what I always run. I don't have the URL handy but it's on rootzwiki. It has a TW and AOSP version so obviously make sure you grab the right one.
Ok, something's odd here. I tried the LeanKernel for Verizon (lk_aosp_jb_vzw-v1.9.zip from http://rootzwiki.com/topic/32286-kernel-aosp-jb-leankernel-minimalistic-kernel-v19-111012/ -- or, more accurately, from what I believe is his official page at http://imoseyon.host4droid.com/s3/#!/view=details/lang=en/sort=na) and again the same thing. Just a black screen. I can get the lights to come on behind the bottom hardware buttons, but it's not working right. It seems it DOES boot up enough to where I can connect with adb thank goodness (I had to pull the battery twice before I thought to see what would happen) and get a shell, so I tried running lkconfig and setting it to not undervolt by default (I don't really understand why so many kernels under/overvolt/clock by default when you can so easily mess with those things via software after it's actually up and running) but even after another reboot or two it still didn't work. Again, I cleared BOTH caches and ran fix permissions after installing the kernel from the zip file. Also, I'm trying TWRP now instead of ClockworkMod as it seems to be quite a lot better (touch interface in the free version, ability to choose WHAT to backup so I don't have to backup data every time -- which is really handy since I lack the free space to backup data and always have to wait for CWM to error out -- and a bunch of other nice little things) and I'm getting the same problem with it.
I even tried waiting a while in case it was doing the "Android is upgrading" thing where I guess it's basically just rebuilding the Dalvik cache, but the screen still wouldn't come on at any point after that even after another reboot. It's worth noting that the adb shell it gave me went straight to root (eg a # sign on the prompt) whereas under a normal bootup it should be at user level first requiring me to run su to get root. Am I just missing something or what?

[UPDATE:04/02/13] Optimized Samsung battery driver

UPDATE:
It seems that something not related to this driver relies on the old wakelock and it's now causing some partial wakelocks and causing some failed attemps to suspend:
Code:
PM: Device power.0 failed to suspend late: error -11
Restore the old module if you think your battery life is worse than before.
You can do that by flashing your favourite kernel, your current ROM or restoring the backuped module as explained here below.
I'll see if I can solve the problem.
_______________
I did some changes to decrease samsung-battery wakelock total time doing some optimizations, getting good results.
Ideally, the changes I made would save some battery, but I didn't properly verify this.
What I'm sure about is that samsung-battery wakelock total time is now very low, which means less time spent awake when the screen is off.
BetterBatteryStats screenshot after 3 and a half hours of use: 2 seconds of total time for samsung-battery. Not bad considering that the fixed duration of a single wakelock request was 3 seconds.
The driver had never been directly built into the kernel (EDIT: Adi_Pat did it in his kernel, read the notes below), we had always used a module, so you don't need to change kernel or ROM in order to use this, it shouldn't matter which ROM you are on as long as it's a CyanogenMod (9+) based ROM. You just need to flash the zip attached, which will replace the module in /system.
Flashing this on stock ROMs won't do anything.
If you can't see the battery percentage after you've flashed the zip attached, it simply means that the module is not working as it should and you need to restore the original one.
A backup is automatically created after the flash, you can find it in:
Code:
/sdcard/backup-battery/m-d-y-H.M.S/samsung_battery.ko
To restore it, simply copy samsung-battery.ko in /system/lib/modules/ overwriting the existing one, set its permission to 644 and then reboot.
There's a backup copy for each flash you made, each copy is in a different subdirectory. The name of the subdirectory is the time and date of the flash.
Or more simply reflash the ROM or restore a CWM backup.
I've tested the changes for some time, but I can't guarantee everything is working correctly. Flash at your own risk.
Source code:
battery-monitor: minimize awake time
battery-monitor: make polling timer deferrable
battery-monitor: don't use boot_complete flag
battery-monitor: add wakelock...
Notes:
A reflash of this zip could be required after flashing custom kernels.
I had to add an additional wakelock (samsung-battery-charge), but it's only used when charging the battery. It behaves as the old samsung-battery wakelock.
I looked around and I can say that Adi_Pat's SIRI kernel is the only incompatible kernel. The driver is inbuilt and my module will be ignored. Flashing this zip won't do anything, you need to rebuild the kernel with the above changes.
loSconosciuto said:
A reflash of this zip could be required after flashing custom kernels.
Click to expand...
Click to collapse
Maybe i should try this but sir what do you mean by this? You mean a custom kernel for CM is required before flashing this? Cant we flash this with the stock lets say CM10 kernel?
marshygeek said:
Maybe i should try this but sir what do you mean by this? You mean a custom kernel for CM is required before flashing this? Cant we flash this with the stock lets say CM10 kernel?
Click to expand...
Click to collapse
What my zip does is to replace a kernel module located in /system.
Custom kernels usually include modules in their flashable zips, so if you first flash my zip and then a custom kernel, my modified samsung-battery.ko will be overwritten.
Custom kernels are not required for this. They could actually be incompatible with this module (to know whether it's working or not, read the OP), but in that case you can restore the original module as written above.
Ohhhh hahaha. I've read again today, i was confused a while ago. LOL. That was a dumb question of mine. Sorry. Ok ill try and feedback after few cycles.
---------- Post added at 09:22 PM ---------- Previous post was at 09:11 PM ----------
loSconosciuto, can you check what ive noticed before. I was on Alpha 3 and im using BetterBatteryStats. I just tried freezing the Calendar sync and Contacts sync. I dont know if its just my mind saying or it was really a lucky try and i got INSTANT noticeable battery performance for the whole cycle.
Flashed! So far so good....
Sent from my Samsung Galaxy SL on CyanogenMod 9 !
Flashing it now. Will report back with impressions in the morning. Will check night time battery drop. CM10A4, crackersizer! kernel.(1200-300, Smartassv2,NOOP)
EDIT: First impressions, night time battery drop was 30 % as compared to usual 50-60 % in my case. Also due to some network issues the testing was halted. Will report back when i get a couple of battery cycles done with this tweak.
EDIT: Testing halted as installed the SIRI kernel of adi!!!
Did anyone try this with Siri Kernel v2?
Does it work correctly?
Thanks!
BachuArg said:
Did anyone try this with Siri Kernel v2?
Does it work correctly?
Thanks!
Click to expand...
Click to collapse
Mate, the OP said it doesn't work on Siri Kernel. I doesn't know about Siri Kernel v.2 but I think it's not a bright idea.
Sent from Galaxy SL Powered by JellyBam
BachuArg said:
Did anyone try this with Siri Kernel v2?
Does it work correctly?
Thanks!
Click to expand...
Click to collapse
adi pas insert the module to siri kernel v2
loSconosciuto said:
I did some changes to decrease samsung-battery wakelock total time doing some optimizations, getting good results.
Ideally, the changes I made would save some battery, but I didn't properly verify this.
What I'm sure about is that samsung-battery wakelock total time is now very low, which means less time spent awake when the screen is off.
BetterBatteryStats screenshot after 3 and a half hours of use: 2 seconds of total time for samsung-battery. Not bad considering that the fixed duration of a single wakelock request was 3 seconds.
The driver had never been directly built into the kernel (EDIT: Adi_Pat did it in his kernel, read the notes below), we had always used a module, so you don't need to change kernel or ROM in order to use this, it shouldn't matter which ROM you are on as long as it's a CyanogenMod (9+) based ROM. You just need to flash the zip attached, which will replace the module in /system.
Flashing this on stock ROMs won't do anything.
If you can't see the battery percentage after you've flashed the zip attached, it simply means that the module is not working as it should and you need to restore the original one.
A backup is automatically created after the flash, you can find it in:
Code:
/sdcard/backup-battery/m-d-y-H.M.S/samsung_battery.ko
To restore it, simply copy samsung-battery.ko in /system/lib/modules/ overwriting the existing one, set its permission to 644 and then reboot.
There's a backup copy for each flash you made, each copy is in a different subdirectory. The name of the subdirectory is the time and date of the flash.
Or more simply reflash the ROM or restore a CWM backup.
I've tested the changes for some time, but I can't guarantee everything is working correctly. Flash at your own risk.
Source code:
battery-monitor: minimize awake time
battery-monitor: make polling timer deferrable
battery-monitor: don't use boot_complete flag
battery-monitor: add wakelock...
Notes:
A reflash of this zip could be required after flashing custom kernels.
I had to add an additional wakelock (samsung-battery-charge), but it's only used when charging the battery. It behaves as the old samsung-battery wakelock.
I looked around and I can say that Adi_Pat's SIRI kernel is the only incompatible kernel. The driver is inbuilt and my module will be ignored. Flashing this zip won't do anything, you need to rebuild the kernel with the above changes.
Click to expand...
Click to collapse
I have one question. What is normal discharging time of battery,moderate use,stand by n normal use what so ever .As i saw in my case it wont lost more than 4 hour of continues use of net both wen i was on stock rom and after custom rom.
Sent from my GT-i9003 using xda premium
loSconosciuto said:
I did some changes to decrease samsung-battery wakelock total time doing some optimizations, getting good results.
Ideally, the changes I made would save some battery, but I didn't properly verify this.
What I'm sure about is that samsung-battery wakelock total time is now very low, which means less time spent awake when the screen is off.
BetterBatteryStats screenshot after 3 and a half hours of use: 2 seconds of total time for samsung-battery. Not bad considering that the fixed duration of a single wakelock request was 3 seconds.
...
Click to expand...
Click to collapse
Question: Are you referring to this line if you talk about the standard wakelock length of 3 seconds? Because I would think that this actually means that the wakelock length is 3*HZ with HZ=1/128 s (see config entry), resulting in 0.0234375 s. This, in turn, gives roughly 2.8125 s of battery monitor wakelock every hour if the system wakes up every 30 s. Am I wrong?
Anyway, your patch is very cool and should result in improved standby times
XDA_Bam said:
Question: Are you referring to this line if you talk about the standard wakelock length of 3 seconds?
Click to expand...
Click to collapse
Yes.
XDA_Bam said:
Because I would think that this actually means that the wakelock length is 3*HZ with HZ=1/128 s (see config entry), resulting in 0.0234375 s. This, in turn, gives roughly 2.8125 s of battery monitor wakelock every hour if the system wakes up every 30 s. Am I wrong?
Anyway, your patch is very cool and should result in improved standby times
Click to expand...
Click to collapse
That's what I thought too, but then, I can't remember why, I opened wakelock.c to verify this.
This is what conveinced me that the they are 3 seconds. See how timeout is converted when it's printed.
With timeout=3*HZ, the result of that operation should be 3.000.
Because I'm lazy, instead of reading the rest of the code I looked for commented piece of code on the internet and found few examples that confirmed my hypothesis. Here two examples I've just found: 1, 2.
I've also tried something. I plugged in the phone, waited for "samsung-battery-charge", unplugged it and got this in /proc/wakelocks
Code:
name [COLOR="Blue"][B]count[/B][/COLOR] expire_count wake_count active_since [B][COLOR="Red"]total_time[/COLOR][/B] sleep_time max_time last_change
"samsung-battery-charge" [COLOR="Blue"][B]1[/B][/COLOR] 1 0 0 [B][COLOR="Red"]2988677920[/COLOR][/B] 825195313 2988677920 957372533720
I assume those are nanoseconds: 2988677920 ns = 2.989 s.
I'm still not sure of this, because it doesn't make so much sense to me, I mean, what's the purpose of this?
By the way the battery is checked more often than I thought, sometimes I have even less than a second of interval between two checks. Not a big deal with this patch .
You can easly see how often the battery is checked with:
Code:
dmesg | grep "monitor BATT"
loSconosciuto said:
Yes.
That's what I thought too, but then, I can't remember why, I opened wakelock.c to verify this.
This is what conveinced me that the they are 3 seconds. See how timeout is converted when it's printed.
With timeout=3*HZ, the result of that operation should be 3.000.
Because I'm lazy, instead of reading the rest of the code I looked for commented piece of code on the internet and found few examples that confirmed my hypothesis. Here two examples I've just found: 1, 2.
I've also tried something. I plugged in the phone, waited for "samsung-battery-charge", unplugged it and got this in /proc/wakelocks
Code:
name [COLOR="Blue"][B]count[/B][/COLOR] expire_count wake_count active_since [B][COLOR="Red"]total_time[/COLOR][/B] sleep_time max_time last_change
"samsung-battery-charge" [COLOR="Blue"][B]1[/B][/COLOR] 1 0 0 [B][COLOR="Red"]2988677920[/COLOR][/B] 825195313 2988677920 957372533720
I assume those are nanoseconds: 2988677920 ns = 2.989 s.
I'm still not sure of this, because it doesn't make so much sense to me, I mean, what's the purpose of this?
By the way the battery is checked more often than I thought, sometimes I have even less than a second of interval between two checks. Not a big deal with this patch .
You can easly see how often the battery is checked with:
Code:
dmesg | grep "monitor BATT"
Click to expand...
Click to collapse
Ahhh, I think I got it, thanks! The kernel expects all time values in jiffies. Therefore, X*HZ gives you the value of X seconds converted to jiffies (and HZ actually is 128, not 1/128).
Re: Optimized Samsung battery driver [CM]
If you can't see the battery percentage after you've flashed the zip attached, it simply means that the module is not working as it should and you need to restore the original one.
Excuse me what do u mean by battery percentage here i flashed zip now how will i know it is working? Thanks alot
Sent from my GT-i9003 using xda premium
Re: Optimized Samsung battery driver [CM]
Just set permission
Sent from my GT-I9003 using xda premium
I sadly discovered, not so much time ago, that this module is making "Android System" use more battery than normal. At first I thought it was a roughly made app, but I then found that the problem is this module.
From my kernel logs I can see that sometimes when the device tries to enter into deep sleep right after it woke up, it can't because there's something blocking the process (I don't know what yet) and it has to try again before it succeeds. This is causing increasing the number of alarms (Partial wakelocks in BBS) and the saved time is not as much as I hoped.
I don't think the problem is in this module, because the same thing happens when the module is not loaded. I'd say is something which normally would require a wakelock, but not in our case because of the omnipresent samsung-battery (correct me if I'm wrong). I did some changes here and there, but the resulting driver is not so different from the original one, so, for the moment, if you think your battery is worse than before (the mentioned problem was pretty random on my device) just restore the original module as explained in the first post.
I'll maybe look better into that when I'll have some time and in case I'll discover something, I'll let you know.
latief.makhdoomi said:
If you can't see the battery percentage after you've flashed the zip attached, it simply means that the module is not working as it should and you need to restore the original one.
Excuse me what do u mean by battery percentage here i flashed zip now how will i know it is working? Thanks alot
Click to expand...
Click to collapse
Sorry for the late reply. To check if it's working, just look for samsung-battery-charge inside /proc/wakelocks. If it's there, it's working (plug and unplug your phone if you can't see it immediately).
With "can't see the battery percentage" I meant that you can't see how much battery is left: instead of the usual icon you have the battery icon with an exclamation point in it and you can't see the percentage from the settings.
hi losconoscuit i got a problem,when my phone screen is off or in standby mode am getting IM messages late i mean in watsapp or any IM messages are delivered to me late or at time wen i unlock my screen at least 10 mints late is it related to wake lock or anything else .please help.
Sent from my GT-i9003 using xda premium
latief.makhdoomi said:
hi losconoscuit i got a problem,when my phone screen is off or in standby mode am getting IM messages late i mean in watsapp or any IM messages are delivered to me late or at time wen i unlock my screen at least 10 mints late is it related to wake lock or anything else .please help.
Sent from my GT-i9003 using xda premium
Click to expand...
Click to collapse
Which rom/kernel are you on? Maybe something to do with the new sync bug workaround...
Sent from my Samsung Galaxy SL on CyanogenMod 9 !
Ehndroix ROM with Dhiru's kernel
Sent from my GT-i9003 using xda premium

*ROOT ONLY* Honor 5X Marsmallow battery tweak.

Im not responsible for any behavior like the Note 7, if its explodes while applying the tweak its not my fault!
This tweak will edit a simple file so that the minimum cores get decreased and we wont get unnecessary battery drain
ROOT ONLY!
Manual Guide:
1. Make sure your device has root acces,
2. Install Root Browser from the playstore.
3. Open the app and navigate to > sys/devices/system/cpu/cpu0/core_ctl
4. Search for the file min_cpus make sure the permissions are set to rw-r-r (it showsup under the file name).
5. Open min_cpus and change the number '4' to '0', This will say to the CPU that a minimal of 1 cpu core is needed to be active instead of 4 all the time.
6. Save the file and navigate back to > sys/devices/system/cpu/cpu0/core_ctl and change the permissions back to r-r-r.
7. Your device will still run 'smooth' and safe some battery! You have to apply this every single reboot or need to make a init.d script and make it run every single reboot..
You can also use the provided script in the "Attached Files" section. If you use a script runner you dont have to follow the Manual guide everytime you boot.
Share what you think, any feedback is appreciated!
Thanks, so i did the steps 1 to 6, and the contents of that folder disappear, is that normal? I restart the phone and the files appear and i did the same steps the files disappear again.
danino22000 said:
Thanks, so i did the steps 1 to 6, and the contents of that folder disappear, is that normal? I restart the phone and the files appear and i did the same steps the files disappear again.
Click to expand...
Click to collapse
What content? Im not sure what you mean..
Demian3112 said:
What content? Im not sure what you mean..
Click to expand...
Click to collapse
The files inside core_ctl folder disappear.
danino22000 said:
The files inside core_ctl folder disappear.
Click to expand...
Click to collapse
It shouldnt what device do you have Kiw l21? MM or LP? Open kernel adiutor or something else and see how the cores behave make sure battery settings is on Performance. Not much what i can do other wise..
Kiw l24 MM last update from honor UK support page. For example in kernel adiutor if i want to change the min frequency to 200mhz or any other, the settings won't apply, it return to the original frequency after few secs.
SOT ?? @Demian3112
danino22000 said:
Kiw l24 MM last update from honor UK support page. For example in kernel adiutor if i want to change the min frequency to 200mhz or any other, the settings won't apply, it return to the original frequency after few secs.
Click to expand...
Click to collapse
You cant set big cluster. For small cluster go to sys/devices/system/cpu/cpu4/cpufreq/ and look for min freq set permissions to rw-r-r open it change value 800000 to 200000 save it change permissions back to r-r-r
kartrikpal said:
SOT ?? @Demian3112
Click to expand...
Click to collapse
Havent measured. I safe about 3-8% in an hour doing the same stuff youtube, google, whatsapp and facebook etc. It really depends on what you are doing.
Little cluster runs idle 800mhz with the tweak 200mhz
Big cluster has 8 cores active all the time, with this tweak 0 in idle/simple tasks. It only enables when needed
Just try it out yourself. If you dont like it remove kernal adiutor restart device and tweaks are undone
doesn't seem like little clusters settings are sticking in Kernel aduiter. When changes to 200mhz, it automatically get changed back to 800mhz min
halfacannoli said:
doesn't seem like little clusters settings are sticking in Kernel aduiter. When changes to 200mhz, it automatically get changed back to 800mhz min
Click to expand...
Click to collapse
Make site battery manager is on performance.. i dont Have this issue and i Just upgrades to B330
Demian3112 said:
Make site battery manager is on performance.. i dont Have this issue and i Just upgrades to B330
Click to expand...
Click to collapse
Thanks for the fast response. However, that did not work for me initially. I was able to resolve the issue and it looks like I was able to set the frequency for the big cores as well. As a preface, I have the L24 and updated to MM EMUI 4 through the zip that was found on the hihonor UK website. After the update I did a factory reset. I am just letting you know because some of things you described didn't work while other things did.
What did work was setting the Mincpu to 0, so that when idle only 1 core is running. This worked great, so thanks for that! However, in Kernel Aduiter, I had to set the governor to Interactive for it to use the other Big cores when I am using the phone. If I set it to ondemand, the other 3 big cores does not activate, only core 1 is used along with the 4 little cores.
What did not work per your instructions were setting the min frequencies for the little cores. Yes, I changed the Power option to performance, but every time I exited the kernel auditer, it would revert back to a min frequency of 800mhz.
After tinkering with the phone for a couple of days, I was able to set the min frequency to 200mhz for BOTH big cores and little cores and it seems that both settings are sticking. Throughout the 2 days, I did many changes so I have yet to narrow it down to what changes I did that made both changes stick. When I have some time I will try to reproduce the results and post on how I got it to work. I would also like to give it a few days to make sure that the changes stick.
---------- Post added at 10:22 PM ---------- Previous post was at 10:13 PM ----------
danino22000 said:
The files inside core_ctl folder disappear.
Click to expand...
Click to collapse
it disappears because permission was changed to r-r-r which is read only. change permission to include w (write) and execute, and you'll see it again
halfacannoli said:
doesn't seem like little clusters settings are sticking in Kernel aduiter. When changes to 200mhz, it automatically get changed back to 800mhz min
Click to expand...
Click to collapse
Got to battery manager and set it to performance.
Can someone make an script to keep this installed upon boot? Thanks.
Robertleehadley said:
Can someone make an script to keep this installed upon boot? Thanks.
Click to expand...
Click to collapse
If i have time i will do it!
Nice tweak on changing 4 to 0 at min_cpus but Root Browser (w/Root and Grant) refused to save it so i used X-plore by Michal Baclk Version: 3.86.02 Build Date: 7/16/16 and it took perfectly!
Thanks for the other kernel adjustments too.
anyone ever make that bat file?
And has anyone tried setting CPU4 the same way as suggested for CPU0? By default, it is set to 1.
I'm also a little concerned I may not have understood the directions properly...
From what I read, it looks like you are ignoring the large cores and only modifying the little ones? Am I understanding that correctly?
And why can't we just tick the 'use this on boot' in kernel aduitor? Why does it need to be reset upon every boot? I mean, we are doing these steps with ROOT access, are we not? Shouldn't the file stay modified? I am quite confused... but very eager to get more battery life out of this... was shocked to see that all 8 cores are always on... and my device NEVER hit deep sleep or any of the slower frequencies all day!
No wonder I can drop to 85% within an hour. Sheesh... this blows.
Ok, I played with it some more...
Looks like Root access has nothing to do with modifying that file. Yes, you need root to modify it... but it never stays changed after a reboot. This tells me that this area must be a hardware toggle area. Meaning, there's some place with the default value stored, and is loaded from there to this location during boot.
I did my best to follow all these steps.
upon reboot, every single thing I put in is lost. Kernel Aduitor seems to lose my settings even if I check 'apply on boot'.
furthermore, all 8 cores are still on.
True, I *do* now see that all the big cores aren't *always* on... but it isn't very different from before doing these steps (at least now I can see a core or 2 shutoff for all of about a tenth of a second)
The little cores... they looked like they took the settings the best... until I closed Kernel Aduitor and reopened it... all the settings reverted.
Yep, waiting with anticipation for some guru who is best at putting something together to set all those freq.'s and such that will apply all of them and keep settings.
Very useful battery mod if it can be made to apply and hold up after restarts.
Yes the hotplug drivers and govenors change it back this is something within the kernal thst you cant edit without needing to flash another rom.. Im on CM13 and batttery has improved quite a bit.. Just give it a try its my daily driver now and its smooth as hell..
Demian3112 said:
Yes the hotplug drivers and govenors change it back this is something within the kernal thst you cant edit without needing to flash another rom.. Im on CM13 and batttery has improved quite a bit.. Just give it a try its my daily driver now and its smooth as hell..
Click to expand...
Click to collapse
Without or before flashing a better ROM, did this item ever get worked out whether by another way to make settings stick or a Huawei small update? Thanks for any advice.
Sent from my MT2L03 using Tapatalk

Categories

Resources