Sunday 11 January 2015

Sunday 11 January 2015

Android Kernel Customization

The kernel, in this regard, is extremely customizable. Not only does the manufacturer have to plug in the necessary drivers to get all of the hardware to work correctly, but there are a lot of variables that they need to set. They can mess with all sorts of things, such as:

  • the minimum and maximum frequencies that the CPU can scale up or down to
  • how busy the CPU should be before it enables extra cores that it normally has disabled to save battery
  • the frequency the CPU should boost to whenever it detects touch input (to ensure a smoother wake up)
  • the CPU governor (which determines how quickly it tends to ramp up the frequency or not) that should be used
  • change the voltage of the CPU during all possible frequencies
  • the maximum frequency of the GPU
  • enable USB fast charge (for USB 3.0 ports)
  • configure the I/O scheduler that is used

How A Replacement Kernel Benefits You

That's great and all, but what can a custom kernel do for you? There are many different custom kernels for virtually every Android device in existence, so you'll have a lot of options to choose from. Depending on your needs, you can pick kernels that are optimized for performance, or ones that are optimized for power savings. Others have a good balance of both.

custom_kernel_franco
There are some developers who switch out some drivers with others (for varying reasons), or develop their own patches for problems they identify. A lot of developers also try to include upstream Linux kernel patches, or use their own toolkits for compilation. For example, for my Nexus 5, there's one developer who uses his own toolkit, which includes the latest version of GCC, a Linaro toolchain with optimizations specifically for the CPU architecture used, and maximum optimization flags for the compiler.

Developers can even add some additional features from other kernels that don't officially exist for your device. For example, there are some kernels for the Nexus 5 that include the "double tap to wake" feature that first appeared on the LG G2.

Most of all, a handful of kernels allow you to access the configurable variables yourself, so that you can use the code that the kernel developers release but tweak it to adjust its behavior to your liking. However, you'll want to research some of the options available before you actually start to change values for them. In other words, a custom kernel can provide improvements, extra features, specialization, and extreme configurability.

Where To Find Android Kernels

It's rather easy to find a kernel for your device. Assuming that you have your device rooted and acustom recovery installed, you can browse through the XDA-Developers forum, look in the subforum for your specific device, search through the threads for any that have a [KERNEL] tag in the thread's title, download one that you like, and flash the .zip file via your custom recovery.

custom_kernel_xda
There may also be a sticky thread that may contain a list of popular kernels available for easy searching. Once you've decided on a kernel you'd like to use, just download it (it should be in a .zip file) and flash it using the custom recovery. Be sure to adhere to all instructions that the kernel developer may provide, and any of their instructions would override any of my advice.

No comments:

Post a Comment