Kernel tweaks to fix stuttering and occasional crashes - T-Mobile Samsung Galaxy S 4

I'm sharing some kernel tweaks that I found to eliminate lag, or micro-stutter to be more precise. Messing around with kernel settings can make your system unstable. It takes some experimenting to come up with a setup that runs without app crashes and reboots. Before I start let me clear a few things up:
- Many people claim that they don't experience lag on their phone. That's really great! Please be considerate of others that might be.
- I'm running CyanogenMod 10.2.0, Faux Kernel jfltetmo-aosp-faux-123-013m and I'm performing tweaks with TricksterMod v2.9.832.
I don't suppose you need to match my setup but if you understand what I'm doing you might be able to tweak your system in a similar manner.
- You might experience faster battery drain with this setup. The priority is on performance and stability.
- Phones can get really hot on a sunny day. It's winter here right now so I can't guarantee this will work well in a very hot environment. If you are experiencing crashes it's likely related to how your phone handles heat.
---------------
1) Lock the clock
I figured out by experimenting that the micro-stutter is caused by the CPU changing it's clock. I don't know why the Krait 600 is taking a time penalty when switching frequencies. This should not be happening and it's certainly not a problem with my Nexus 4 which has an older generation Krait CPU. Locking the CPU to a certain frequency made my experience fluid. I set my clock at 1.5GHz but slower frequencies certainly work well for everyday tasks. Be aware that it takes more power to run faster but the relationship isn't linear. If we take 1.5GHz as a base it would take 10% more power to run at 1.9GHz, it will take 10% less power to run at 1.1GHz and it will take 20% less power to run at 270MHz.
I set the governor to 'interactive'. I tried 'performance' but I couldn't verify that the phone was entering Deep Sleep. With 'interactive' the phone is locked at my set frequency and goes to Deep Sleep when it's not working.
The GPU governor works fine at 'performance'.
{
"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"
}
2) Increase the IO buffer
My IO buffer was set very low for some reason. 1024 or 2048 is recommended. I like the 'row' scheduler the best. 'deadline' is also recommended.
3) Shut off MP-Decisssion.
This is Qualcomm's thermal throttling. It slows down the CPU when it reaches certain temperature. This is a dangerous tweak so proceed at your own risk! What I do to protect my CPU is I shut off 2 cores instead. Most tasks nowadays can run on a single core but 2 cores really help multitasking. 4 cores aren't really needed. In the 'Specific' screen turn OFF MP-Decission and turn ON 'Intelli-Plug'. Then scroll down and press the 'Intelli-Thermal Control' button. Turn it ON, then in "Offline Cores' turn ON cores 2 and 3. The core number here is 0-based. The 'Core Offline Limit' I set at the lower value they had 50deg. I was experiencing crashes at little above 50 degrees. I'm not sure that's normal. To further protect the CPU make sure the Throttling is enabling on all cores.
Under high stress the temperatures raises to 50 degrees but stays there and the system is very stable.
Please feel free to share your results and ideas.

Related

Wakelock & 128Mhz

I don't fully understand what wakelock is, I know it has to do with CPU at minimal usage while screen is off, but that's it.
Alongside that I know some kernels can reach 128MHz, but I've found they only scale to 245Mhz by default.
Could we discuss wakelock issues and scaling, maybe get a better understanding for all?
I'm still looking for feedback, my phone has has 100% awake time lately.
Using spare parts, the numbers just don't compute...partial locks are far less than the system uptime.
You can read a fair amount about wakelocks here: http://geekfor.me/news/facebook-1-3-wakelock/
I'm not saying that facebook is your issue but that's an article I wrote a few months ago when the new facebook update wasn't releasing a wakelock. That has been fixed since then though.
This chart should answer a few of your questions:
{
"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"
}
There are also several screen shots at the bottom that show the commands you can run from ddms (dalvik debug monitor... it's part of the android sdk) to see any current wake locks that are in place on the phone.
FYI your phone will not sleep when it's plugged in, so you can't compare awake and sleep time when you have it plugged in. It also will not sleep after very first boot until you wake it up and then put it to sleep again. If you are having wake time issues then you should start uninstalling applications until it starts sleeping. Or the faster way would be to just do a data wipe and start over and slowly re-install your applications, paying attention to when it stops sleeping.
I know this is brief but I just wanted to give you a place to start looking.
As for 128mhz vs 245mhz... 245 is the lowest the phone can go by default. I honestly don't keep up with the kernel stuff a whole lot but if there is a kernel that is capable of going down to 128mhz then you would need to use an app such as setcpu to allow it to scale that low. In my experience in the past I have had issues on my phone when going below 245mhz. The phone would automatically drop to 19mhz and basically come to a hault. However like I said I haven't done anything dealing with custom kernels in months so I'm sure I'm behind on new changes.
Extremely helpful, thank you so much.
As much as I have many more questions, you've set me in the right direction.
So far I've found after wimax is shut off I get a connection error sourcing from wimax repeatedly.
Still looking into this.

"Force GPU Rendering" in Development options

Hi all,
Noticed the "Force GPU rendering" option under the Developer options which was off by default but is captioned "Use 2D hardware acceleration in applications". Is this advantageous to turn on? The few online resources I've found suggest it could be because it offloads all 2D graphics work onto the GPU instead of CPU. Having turned it on and played a bit I /might/ have noticed some more fluid animation, but could be a placebo effect.
Also, reckon this would have any impact on the battery life? (Desperately looking for ways to make this thing last through a day).
Thanks!
It forces all apps to use the GPU to render themselves instead of using the CPU. This is more efficient and actually does improve the fluidity of the UI. To test it out, download the Twitter App from the marketplace. Try with and without Hardware acceleration. You should notice a definite improvement. My suggestion is to keep this option on. After Apps update themselves to use GPU rendering themselves (it's only one line of XML code) this option will be pointless. The option is already pointless for Google Apps, as they should all be updated already to use GPU rendering.
Sweet. Anyone try running benchmark apps with it on? I'm trying to figure out if the SGSII hardware acceleration played any tricks on their benchmark scores (I've always wondered).
Knew I was noticing some improvement in apps, including Twitter!
I have noticed a couple of apps so far that this option breaks:
Vouchercloud (doesn't display anything on screen)
Tiny Tower (crashes during load)
So beware, if you have this on and some apps crash or display strangely, try turning it off.
I'll be keeping it on unless I need to use one of those two apps though.
Thanks for the full explanation.
Amazing tip, thanks! I loaded Twitter and noticed it was slow, then I remembered reading this thread before (read so many whilst waiting for it to be delivered) and tried it with this option turned on and it was perfectly smooth.
Cheers
rikbrown said:
Knew I was noticing some improvement in apps, including Twitter!
I have noticed a couple of apps so far that this option breaks:
Vouchercloud (doesn't display anything on screen)
Tiny Tower (crashes during load)
So beware, if you have this on and some apps crash or display strangely, try turning it off.
I'll be keeping it on unless I need to use one of those two apps though.
Thanks for the full explanation.
Click to expand...
Click to collapse
That's a perfect example of why they didn't set it to default ON. If developers had actually followed the API there would be no problem but some seem to use a known side-effect of the old rendering model to skip some lines of codes for screen redraws. Google explained this in a Google IO talk.
Without Force Mode:
{
"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"
}
With Force Mode:
Sent from my Galaxy Nexus using Tapatalk
I've noticed also shazam and radiant also break when using the 2D accel option.
Slightly annoying you can't set up a blacklist - but we'll see how quickly these get updated.
Also crashes:
Square
PicSay Pro
Shazam works for me
Perhaps I'll make a new post so that we can compile a list of apps which have trouble when Force GPR rendering is turned on.
For quadrant it seems to be give and take with the option forced on.
This is my Nexus S w/ CM ICS, GlaDOS kernel. Pics captured on 2nd run, after consecutive runs.
You can tell which had 2D hardware rendering forced by the 2D scores on the bottom.
An ongoing list is over at:
http://forum.xda-developers.com/showthread.php?t=1372007

[Q] Why is min frequency changing when I open Faux?

I tried searching but didn't find a question similar to mine.
I flashed slickmod 3.4, 3.6. When I go to SetCpu (or Fauxclock or etc.) it shows both the min and max frequencies at 1.782ghz then 2 seconds later the min frequency jumps down to 384mhz. Every time I open SetCpu (or any similar app) it does this. My question is:
1. Is the min frequency really at 1.782ghz and when I go to SetCpu it goes down for the first time as to trick me?
Also in other roms I experienced this (not min freq being 1.782 though) but the min freq would be on a certain amount and 2 seconds later it would jump to down to a different certain amount right after I open SetCpu or Faux or any other app like this.
Here's the scenario right after I open Fauxclock.
{
"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"
}
And here's 2 seconds later
h1a8 said:
I tried searching but didn't find a question similar to mine.
I flashed slickmod 3.4, 3.6. When I go to SetCpu (or Fauxclock or etc.) it shows both the min and max frequencies at 1.782ghz then 2 seconds later the min frequency jumps down to 384mhz. Every time I open SetCpu (or any similar app) it does this. My question is:
1. Is the min frequency really at 1.782ghz and when I go to SetCpu it goes down for the first time as to trick me?
Also in other roms I experienced this (not min freq being 1.782 though) but the min freq would be on a certain amount and 2 seconds later it would jump to down to a different certain amount right after I open SetCpu or Faux or any other app like this.
Here's the scenario right after I open Fauxclock.
And here's 2 seconds later
Click to expand...
Click to collapse
Yeah that's a bug with pretty much all CPU apps on our phone, happens with system tuner as well. Its just a graphical bug, your min frequency is still what it should be at at all times. To confirm that you can use CPU spy which will show your phone using the correct min frequency
Thanks,
Also how do I fix a governer to stick?
Sometimes I change it to another governer, but when I come back to fauxclock
it changes back to the default governer.
Set on boot, or use a script
h1a8 said:
Thanks,
Also how do I fix a governer to stick?
Sometimes I change it to another governer, but when I come back to fauxclock
it changes back to the default governer.
Click to expand...
Click to collapse
I've never had issues with a governor not sticking. I don't use faux clock though, maybe you should try system tuner. If you're not rebooting the governor change should stick but if you need it to change on boot (like if you reboot your phone a lot) you'll have to have the app set it on boot or modify your post boot script like the poster above me said.

Conservative CPU Governor - Performance mode

Hi Everyone,
I have little experiment about Conservative CPU Governor to get better performance and if anyone of you experienced developers can tell me which settings between these two could give better and smoother UI performance? What do you think?
{
"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"
}
Windforce0511 said:
Hi Everyone,
I have little experiment about Conservative CPU Governor to get better performance and if anyone of you experienced developers can tell me which settings between these two could give better and smoother UI performance? What do you think?
Click to expand...
Click to collapse
http://forum.xda-developers.com/general/general/ref-to-date-guide-cpu-governors-o-t3048957
Very good thread, have a look.
gsstudios said:
CPU Governor tuning guide
This post includes:
- CPU governor parameters
Recommended apps for manipulating kernel values:
1. Kernel Adiutor (Free to tune governor variables)
2. Kernel Adiutor-Mod (Free to tune governor variables)
3. Compatible kernel managers (e.g Stweaks, Synapse, UKM, etc.)
NOTE: If you don't have some of these tunables, you might have an older version of the governor/hotplug driver and/or the kernel maintainer has made modifications to it.
CPU governors
4. CONSERVATIVE
[ PARAMETERS ]
Quote:
Ondemand and conservative have some tunables in common, but with a few extras:
i) freq_step - this describes what percentage steps the cpu freq should be increased and decreased smoothly by. By default the cpu frequency will increase in 5% chunks of your maximum cpu frequency. You can change this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed regardless of its load whilst '100' will, in theory, make
it behave identically to the "ondemand" governor.
ii) down_threshold - same as the 'up_threshold' found for the "ondemand" governor but for the opposite direction. For example when set to its default value of '20' it means that if the CPU usage needs to be below 20% between samples to have the frequency decreased.
Click to expand...
Click to collapse
Click to expand...
Click to collapse

Themes / Apps / Mods Best Kernel toolkit/ Managers for Samsung F62 [ROOT Needed]

So you successfully rooted this epic and only one flagship device Samsung F62 with magisk. Now it's time to alter the CPU of this device so we just need a good and bug less app for modifying the CPU frequency. So here are the two best kernel managers features included.
KERNEL TOOLKIT​Kernel Toolkit​
{
"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"
}
In my personal opinion this is the best kennel toolkit which I use it daily for changing the frequencies according to my needs. It includes information of the CPU and CPU tweaking and input output and power controls and profiles. Beyoncé Dino aware Samsung F 62 device doesn't support tweaking of GPU as of it is not supported in Karnal itself. Weak in CPU to higher frequencies 10 easily overclocked your GPU so that no game will reduce its FPS.
CPU TWEAKING SIMPLIFIED!​Tweaking the CPU in this device is totally supported with this app as you will get features like CPU scheduling small cores big cores.
CPU scaling the first option helps you to change the scaling governor civil changes how the kernel manages the switching frequencies of the CPU.
Tweaking of small cores​Small core minimum is 442 MHz
Small core maximum is 1950 MHz
Tweaking of Big cores​Big core minimum is 507 MHz
Big core maximum is 2400 MHz
I/O Control​
POWER​Comes to power tweaking my device doesn't support enabling and disabling the CPUs. Karnal doesn't support this feature.
SMARTPACK -KERNEL MANAGER​SmartPack-Kernel Manager​
CPU TWEAKING SIMPLIFIED AGAIN!​Tweaking the CPU in this device is totally supported with this app as you will get features like CPU scheduling small cores big cores.
CPU scaling the first option helps you to change the scaling governor civil changes how the kernel manages the switching frequencies of the CPU.
So this smart bank Karnal toolkit manager supports variety of features and their overall statistics device memory inputs.
Supports the tweaking of the small, big, middle core!​
BATTERY TAB​
LOW MEMORY KILLER TAB​
VIRTUAL MEMORY TAB​
ENTROPY TAB​
SCRIPT MANAGER​
BUILD.PROP EDITOR​
SO THESE ARE THE TWO BEST EDITORS AND MANAGERS FOR SAMSUNG F 62 AS THESE MANAGERS ARE WORKING LIKE A CHARM.​I hope you guys understand these two apps.​Do reply below for ROOTING guide.​​
Out of curiosity for everybody that has already rooted are you able to check the following:
1. Possible to disable the power hungry Mongoose cores completely? This is a major source of power drain when not gaming
2. What are the default cpu and gpu governors and their respective governor tunable settings? Please post screenshots from a kernel manager
3. Can you disable schedUtil governor and allow cores to be switched off keeping only the power sipping A55 cores on?
4. How much is your active drain per hour? 10-15%/hour and standby drain per hour? Losing 5-10% every night or do you use greenify etc?
5. Please post your battery usage stats with general use SOT you achieve using GSam or Better Battery Stats which shows deep sleep stats

Categories

Resources