[Galaxy S 4 General] csec:
This is a simple STARTER REF/GUIDE to kernel features/parameters and everything you need to know about custom kernel goodies. Now that there are a few custom kernels out there for our device, you may want to know about these.

I’d be glad if you could help me complete this guide.

First of all I’d like to thank all kernel guys who put countless hours into this to bring us these kernels/kernel hacks.

Index:

Post 1:

A.1: What you want to know about the CPU/GPU of your device

A.2: MUST KNOW FACTS

B.1: Main Kernel Parameters

B.2: CPU/Governor Adjustments

Post 2:

B.3: Extra Features/Parameters

More Coming Soon!!!

Post 3:

Coming Soon!!!

A.1. What you may want to know about the CPU/GPU of your device:

Galaxy S4 4G/LTE (i9505) features a Qualcomm SnapDragon (600) 1.9GHz Quad Core krait (300) CPU and an Adreno 320 GPU.

A.2. MUST KNOW FACTS:

B.1. Main Kernel Parameters:

OC/UC (As for OverClock/UnderClock):

As you may know, CPU or any other processing unit features a clock frequency. Over/Under Clock simply means raising/decreasing the clock frequency of CPU.

Reason: Why would one need to overclock? Because one needs more processing power. For example if you want to experience smoother gameplay when playing high-graphic games.

Why would we need underclock? Higher processing power demands more battery. So underclocking helps us, reserve more battery. Searching internet and texting don’t need much of processing power. So we can limit the processing power and save battery during low use of our device.

•Note1: OC/UC is not limited to CPU. GPU is also capable of OC/UC.

•Note2: Gamers may not use GPU UC. Limiting GPU processing power impacts significantly on your gaming experience.

•Note3: These apply to both min and max frequency of the CPU. What we said is mainly about the max frequency. Min frequency defines where the CPU frequency can't go below. So by lowering it (not too much) when in low use CPU will stay in lower states, preserving more power. The exact opposite goes for increasing it. The good thing about increasing it is improving performance and snappiness of the device!

UV (As for Undervolt):

Every frequency of a processing unit, demands a certain amount of power to be supplied. Undervolting to put it simple means decreasing the voltage of a certain frequency (or all of them).

Reason: The more voltage CPU/GPU gets, more heat will be generated. So mainly we UV to decrease the generated heat of CPU/GPU.

•Note1: One Frequency needs a certain minimum amount of voltage to perform correctly and the system be stable. Undervolting more than a certain amount of voltage will cause system instability.

•Note2: UV improves battery life by using less power. See this.

•Note3: In most of the kernels you can perform a -50mv UV across the board (means in all frequencies).

CPU Governors:

Frequency scaling is the means by which the Linux kernel dynamically adjusts the CPU frequency based on usage of the device. Governors refer to schemes which dictate to the kernel how it should do these adjustments. (From rootzwiki)

To put it simple, Governors are the way that CPU frequency is adjusted according to the demand of operating system.

Selecting a proper governor for your CPU is crucial to the performance and battery preserving of your device. For example if you are low using your device you may use a more battery friendly governor and if you want to play games you may use a (more power consuming) performance governor.

I/O Schedulers (As for Input/Output):

Input/output (I/O) scheduling is the method that operating systems use to decide which order block I/O operations will be submitted to storage volumes. I/O Scheduling is sometimes called 'disk scheduling'. (From Wikipedia)

To put it simple, Schedulers are the way reading and writing to the SD card is managed.

The same things that is said in the Governors part is applied here, too.

ReadAhead buffer size:

In terms of reading data from SD card, there is a cache which is used as a buffer. The size of that cache is readAhead buffer size. The size has a direct impact on your reading speed of your SD. So giving it a right amount is crucial.

Profiles:

Some kernels let you specify the parameters stated above in different profiles which are based on different usages of the device. In other words, you can have different parameters in some specific device states.

Different profiles can be Screen Off, Call, Music, Charging, etc...

One of the most useful profiles is Screen off.

When screen is off, you don't expect your device to be smooth (!!!) and snappy! Because mainly nothing important is happening when screen is off. So as a profile you can specify different settings for this state.

For example: Screen Off Max CPU can be really a very low number. Max Frequency is 1.89GHz by default, you can go down to 486MHz when the screen is off.

File System “X” R/W (As for Read/Write):

Android by default doesn’t support all the File Systems (What are file systems?! See here). So some kernels may add certain file system R/W. exFAT and NTFS are such file systems.

B.2. CPU/Governor adjustments:

MP-Decision:

Hotplug:

- auto hotplug: Make available the hotplugging for the non-hotplugging governors.

Gentle Fair Sleepers:

Sleeper Fairness is a concept which treats sleeping/waiting tasks as if they were in a run queue. This implies tasks which spend most of the time waiting for an user input and such will get a fair share of CPU when they need it. Disabling Gentle Fair Sleepers could improve UI responsiveness.

IntelliPlug:

Eco Mode:

I quote faux123 here:

Eco Mode mainly turns off two cores of the CPU, and in a way turns your device to a more battery friendly dual core system. optimized settings for dual core operations.

Snake Charmer:

This feature tends to cap the minimum frequency of all cores to the value you set.

- Lock Frequencies: This options prevents other apps to change frequencies.

Adjustments:

Here I will explain some useful adjustments.

- touch_boost_CPU: Specify the frequency of the cores when you touch the screen. Low value results in lags and high value lowers battery life, makes your device experience smooth.

- touch_boost_X_core: Specify if the X core comes online when the screen is touched. More online cores result in smoothness, and lower battery life.

- boost_X_core_on_button: Specify if the X core comes online when the button is pressed.

- sync_extra_cores: Specify if extra cores should be synced with single first core when they come online.

Work in progress, will add more info soon.

thanks and credits to:

ktoonsez - for his great kernel and ktweaker. Here.

faux123 - for his great kernel and app. Here.

droidphile - for his great guide. Here.

PM me if I missed someone.