[Sprint  Galaxy Note 4 Original Android Development] Dimahnbloe:
V12 turbo charged - Good Job ffolkes

Buckle Up Folks long post coming through.

For those that just want to get strait to the point Skip down to the Bold “Tweaking the governor” section.

This kernel has changed my opinion on what is possible with the note 4 from a fluidity stand point. I always thought that androids weakest points was scrolling performance, general fluidity, and speed, but this kernel along with the Noterized Rom with the Next Launcher 3d shell on top, makes my brothers iphone 6 plus seem sluggish.

I’ve been playing around with the lollipop version of this kernel before ffolkes officially released it (since version 18 and 18a). From my experiences with it, I have discovered the same thing that some of you have probably noticed: if left un-configured, it is painfully sluggish in some aspects but battery life is fantastic.

Unlike a lot of other kernels out there, I don’t believe that this kernel was meant to be left alone (ffolkes, please fee free to correct me if I am wrong on anything written in this post. This is your baby afterall, I am not the artist here). Honestly, there are so many options to tinker with, that it would be shame to simply leave it alone. This baby is a v12, turbo charged monster with a hidden Nitrous boost button just waiting to be pushed.

Some have asked for settings, So I am going to do my best share with you my experiences with tweaking this kernel thus far. Hopefully it will help someone.

A quick disclaimer with reference to my usage habits: I like to Glide. For me, my phone has to feel like the content on the screen is like a puck on an air hockey table or a hovercraft on water. I want no hard stops, as little friction as possible. I am obsessed with flicking things around on my screen and watching it glide to a slow, almost un-inhibited stop. The longer the glide the happier I am. My finger does not stay on the screen for more than half a second but If I do a full flick the content does not stop until 3 to 4 seconds later and it always a slow, gradual descent with no stutter or lag.

To achieve the above effect , 2 things need to happen. The application you are using has to be properly coded and configured, and the kernels governor needs to be tweaked.

Tweaking the applications:

Through my testing, I have found what I feel is a direct relationship between the applications dpi setting and scrolling/panning smoothness. How long it takes items to come to a stop after being panned or scrolled with a flick, seems to be directly related to the dpi. The lower the dpi, the longer the glide. I have narrowed my preference to three specific dpi settings:

345 – My personal favorite – you could set the entire rom dpi to this and get tablet mode for most apps and the text is still legible(to me), I could use this without exposed though you will have to user a different dialer and camera app due scaling issues.

380 – Text is much more legible (most will prefer this mode) and apps also tend to behave with much less stutter.

430 – Good Performance, Text is super legible but not to big but the air hockey glide effect only last about half a second.

Tweaking the governor:

Lets start with the touch-bootster

Sampling rate = 60000

Input Boost Punch Minimum Cores = 4

Input Boost Punch Frequency = 2649

Input boost Punch Cycles = 50

Input boost Up Threshold = 20%

Punch on Every Initial touch = enabled

Punch on All Touch Movements = enabled,

Punch on all S-Pen Movement = enabled,

Level 1 Batter Threshold & Master Switch = Disabled

For most, the above settings alone will remove almost all lag if you are using Noterized Rom or a Variant that uses it as a base ie Hybrid X (heck of a job also tx_dbs_tx). Just to let you know, with these settings, I can get 5 hours of web browsing along with and additional 40 to 60 minutes of web video streaming. If your video content is from the youtube or Netflix app, I can almost double the video streaming time when using Netflix, and almost triple it for google Youtube. I've gotten close to 8 hours of total onscreen time, even when pushing the touch-booster really hard with the above changes only.

To further squash out any lag related to general application load, change the following:

Down threshold While Screen On = 11%

Up Threshold while Screen On = 12%

Smooth Up threshold while screen on = 15%

Fast Scaling Up While Screen On = 4 Steps

Scale Blocking Cycles = Disabled

Scale Up Blocking = Disabled

By now if you still have lag then issue is either application specific, ROM specific, incorrect user settings or failed hardware. But if you still need more power and you don’t want an application to even think about stuttering, then go over to the zzmove hotplug page and change the following

*****Delays*****

Block Up Logic Cycles = Disabled

Stagger Up = unchecked

Block Down cycles = 5 cycles

Stagger Down = checked

*****CPU Core 2****

Up Block Multiplier = 0x(No delay)

Down Block Multiplier = 10x

Up Threshold = 10%

Down Threshold = 9%

Up Frequency Threshold = 422 MHz

Down Frequency Threshold = 345 MHz

*****CPU Core 3****

Up Block Multiplier = 0x(No delay)

Down Block Multiplier = 5x

Up Threshold = 15%

Down Threshold = 14%

Up Frequency Threshold = 652 MHz

Down Frequency Threshold = 576 MHz

*****CPU Core 4****

Up Block Multiplier = 0x(No delay)

Down Block Multiplier = 10x

Up Threshold = 20%

Down Threshold = 19%

Up Frequency Threshold = 806 MHz

Down Frequency Threshold = 729 MHz

God I hope by this point your still not lagging but if you are there the usual kernel lever tweaks that

1. include things like are things like:

2. enabling Dynamic Fsync,

3. disabling Error Correction,

4. Upping the GPU touch boost to 500, (very important for Noterized Rom or other variants that are fully Hardware accelerated(gpu rending forced + hardware acceleration) This is one reason I believe this rom can sometimes eat into batter life pretty quickly.

5. Increasing GPU Laziness to 8

6. Reducting the GPU ramp Up Threshold down to 300

7. Zram, Low Memory Killer, Frandom and all the other settings have pretty good guides out there to tweak accordingly.

Battery Life:

Tweaking battery life has to be done methodically. It should be based on each individually usage habits and should take into account the apps running in the background and available memory (low memory killer and Swapness should help out with this also)

Choose and Good Test Application - To start with I would find and use a good Application validate if there is lag and or stutter. This app should not be one the pushes the note4 to its max limit all the time, unless it is the primary app you use on the phone. Testing with such in app will have you tweaking your system to maximum performance all the time. At that point you could simply leave the settings that I gave you earlier as is and skip the rest this these sections. Those setting will get you maximum performance out of your phone when you need to running your hard-line application and still provide 4 to 5 hours of no screen time when you don't. when tweaked ffolkes version of zzmove can get you on-demand performance governor performance without the wasted power. You could just also switch to the standard performance or on-demand governor.

For the rest of us, when it comes to scrolling I would highly Recommend UC Browser(Can’t Sing it’s praises enough). Don’t just download the latest version. Not all versions are equall when it comes to scrolling performance and lag. I will include an APK in the post or link to their historical archives. There are three that I would recommend:

build dated 01/27/2015 - It is a web page eater. It is quick light and is stutter free if you are using a lollipop rom Based on Noterized. If on Kit-Kat it is not as smooth as the version listed below but still better than chrome, firefox or the Samsung browser, the new versions of dolphin might come close but still a distant second in scrolling performance.

build dated 06/04/2015 - about 5 to 10% slower on than the one above for java script performance but man is scrolling smooth on Noterized. If you guys remember the Old webkit browser on android 4.2.2, This one out does it and makes my brother want know how to get his iphone 6 to work like my Note 4 when it comes to website loading and smoothness. This version also has UC excellent Night mode with transparent background that makes things look even smoother when using dark themed wallpaper and has the added bonus of extending the notes battery life significantly. Keep in mind to achieve this performance, for me takes 345 dpi. 380 and 420 aren't bad either.

build dated 05/15/2015 - honorable mention goes to this build for its superb memory management. No crashes, hangs or forecloses with a variety of content for 2 weeks straight. remains snappy even though phone was never rebooted and memory never cleared. Was my go to until I started us plasma on lollipop and saw that I could have the best of both worlds and went back to the 01/27/build. the bruit force of the input booster will make anything that has a remote chance of being smooth, glide like butter.:D

The uc browser archives:

http://wap.ucweb.com/verlist/english_354/ucbrowser/145?uc_param_str=vepffrbiupla&from=U3-help&plang=

If using a web browser to determine lag and smoothness Desktop Mode mandatory for UC and the following Web Pages:

Yahoo.com – Stutter city because of the continuous loading of content ( you have to scroll for a good while, but once enough content has loaded you will see the limits of your browsers memory handling and allocation. This could also be a good benchmark for your io scheduler , and tcp congestion algorithm of choice.

Youtube.com – Same as above but content is heavier. Good test due to the fact that it will show you when you are not properly optimized, but reward you greatly if you are. You are either in the gutter or you’ve hit a strike.

Espn.com-Highly optimized well written code and template, should be smooth even though the content containers may load slowly. Again good test for tcp congestion. This site will also expose the performance delta between the 01/27 build of UC and the other builds mentioned.

Touch-Booster Battery Life - You need to tweak the touch booster settings to match how you interact with you screen. Some people flick there content always letting it glide and some people keep their fingers on the screen until they get to where they want to go. This alone will change how you optimize the setting for the touch booster to maximize battery life.

Using me for example, the settings listed in the touch-booster tweaks was custom tailored to me. Most of the time, I use my phone for web browsing, reading pdf files, and emails. As stated earlier, to interact with content on my screen, I flick on my screen and expect content to glide for as long as possible. On average, in UC browser (my browser of choice and the smoothest out there for scrolling performance) , even a light flick will last 1 to 2 seconds and if I flick content quickly enough, the content could glide along the screen for as long as 3 full seconds. Therefore I need my Input Punch boost to last 3 seconds just in case.

If My sampling rate is 60ms for the above stated situation, I need 50 cycles(Input boost Punch Cycles ) of the 60ms sampling rate to give me a total cycle time of 3,000ms, which of course we all know equals my 3 seconds. If I am someone who keeps my fingers the screen and rarely flicks then that’s a lot of wasted power for absolutely no reason at all.

To tweak touch-booster for , start with the settings I gave in the first section and reduce “Input Boost Punch Frequency ” until you begin to notice your first hint of lag on the above pages. One you experience lag increase the frequency by 2 steps from that point. Now reduce the number of active cores until you get lag again. Once you get lag, increase the core count by 1. Finally, decrease the power usage caused by the sampling rate by increasing the time between intervals by 5ms at a time. So from 60 to 65, then to 70. Once things start to lag, decrease the interval by 10ms

GPU Battery Life - In addition to the cpu touch-booster tweaks, flokes was even nice enough to include input based boosters for the gpu(freaking awesome by the way dude). He gave us the ability to under-clock the gpu to 166 when not in use (fingers off the screen) but giving us power for 1.5 seconds(hope this duration is tweakable in the future) of up to 800mhz. This is important for a Rom Like Notarized where gpu is doing most of the work all of time. The gpu is in use even for traditionally lite loads such as 2d work. I would recommend lowering the min frequency all the way down to 166 and capping the gpu somewhere between 266 to 300 if you are like and don't game much. if you get lag or stutter/jitter then increase the frequency one step at a time until the lag disappears from your application. You will get so much more mileage from steaming video like Netflix. The Adreno 420 is powerful enough to handle light loads without flexing its muscle, but will flex it anyways if not kept in check.

General Applications Performance and Battery Life - First you need to tweak the main up and down thresh hold for cpu load:

1. Increase the “Up Threshold while Screen On” by 10 until you notice your hint of lag in your application. 2. Once you noticed the lag or stutter decrease the “Up Threshold while Screen On” by units of 2% points until lag goes away.

3. Once you found you optimal number, increase the “Down Threshold while Screen On” number to a number 10 less than the “Up Threshold while Screen On”.

You can follow the same procedure listed above for the hot plug algorithm, Tweaking each individual cores up and down thresholds starting with core number 4. Once optimal threshold is set for core 4, test core 3 in the same manner then core 2. Once thresholds have been optimized, starting with the 4th increase the “Up Frequency Threshold” until you notice lag in your application. One you hit the lag frequency decrease your frequency step by 2 levels and then move on to the next core doing the same thing.

After achieving the optimal hot-plug and frequency thresholds for each core. You can then begin to explore power saving by adjusting the up and Down delays. Starting with Core 4 and working your way down, decrease “Down Block Multiplier ” in increments of 1 until lag is achieved. If no lag is achieved after getting to zero. Then your usage pattern is not effected by this and you can simply disable this feature for that core.

Normally I would not recommend introducing lag but from a power saving standpoint it also might be to your advantage to increase the “Up Block Multiplier ”. Starting with core 4 increase the number slowly until you begin to notice lag with you usage pattern. Do this for each core until you fine the optimal multiplier.

Other Power Tweaks – In my opinion remaining power tweaks can be done without effecting usage by much:

1. Sampling Rate Idle = 500ms – Decrease the number if you notice lag when try to interact with an application after having you finger off the screen for a while. I am not sure but I believe the input booster engine relies on this setting since it does not have a setting listed for poling in the governor(ffolkes correct me if I am wrong). If you notice that applications work great when you touch the screen and poorly when you don’t, you need to decrease the “Sampling Rate Idle Threshold(Frequency)” and/or “Sampling Rate Idle Threshold(load)” until its gone.

2. Sampling Rate Multiplier While Screen Off = 8x – The higher this number, the bigger the sampling interval when the screen is off. I love this feature. It’s given be great talk and music playback time when the screen is off. I don’t do it very much, but if I remember correctly I was getting less then 1 percent battery loss for an hours call with my sister(yeah she’s a talker).

Lastly, In my opinion, a good experience on the phone comes down to three pillars. The Rom it’s running on, the kernel, the Launcher, and then the Web browser. You already know about The Rom (Notarized), The Kernel(Plasma), and the browser Being UC browser. What I have not told you about is the Launcher. If you guys have not Tried Next Launcher 3D. Take it for a spin. If is not only full accelerated but it is full optimized for battery life. Even before I was using Plasma and the touch-booster. It was the only part of my note 4 I had never seen lag. The screen shot look Gimicky but when tweaked to your taste it can do a flat design like the other launchers with all the widgets and icon packs. The only difference is it does not slow down and does not eat your battery. Also no FC's. I am a stickler for smooth and this Launcher with Plasma and Notarized just plane burns.

Told you this was going to belong, but I am done. I would like to finish by Thanking Ffolkes for his hard work. This is not copy and past code folks. I have not even gotten talk about the rest of the settings in this thing like the gestures, multi-button and so on. This guy toils to bring a lot of these things to us. He's not just waiting for linux versions to do his releases. Considering the open source nature of android, I can’t state for sure that this is all his engineering but it sure looks like it. You tell me if you’ve seen this type of attention to detail and code command, in any other kernel. It’s not just him though I think SaintZ93 deserves more than a round of applause for fundamentally changing the base for all or our roms for the better. If Norterized is now base for our custom roms and I will accept no Less than Plasma for the kernel(People will, emulate, wait and see), Then the future looks Golden. Donate people. Think of it as taking the guy out to McDonald’s or for a pint of Beer and some fry’s. We all know he deserves at least that. Hope I am not breaking some type XDA rule with the length of this post.