hello and welcome to this video. today i’dlike to give you an introduction into custom kernels on android devices and a quick overviewof what you can tweak and modify in order to get your best settings. first of all iassume that you are already rooted and know how to flash custom kernels. if that’s notthe case, please use google or look at some links in the description of this video whichwill provide the necessary information.
Android devices, if you don’t know what a kernel is, it isthe bridge between hardware and software. it tells the software how to interact withthe hardware. without a kernel, no device would even work. stock kernels don’t giveyou much options. they simply work. mostly they just try to give you performance withoutany big battery optimizations. its main goal
is a smooth device which does not limit thehardware capabilities in any way. as an average user you can’t do anything wrong with it.your super flagship device is fast and smooth like you wanted it to be. even if you arewilling to sacrifice performance, you can’t change much on stock kernels. i believe becausebeginners could mess up settings to get good battery life and complain about their flagshipdevice being super slow and then send it back to the manufacturer because they are unsatisfiedeven though it’s their own fault as they messed everything up. moreover, 2 days ofusage sounds great, but if you have super quad core smartphone which never uses all4 cores in order to achieve good battery life, you feel ripped off. so it’s better formanufacturers to keep an eye on performance
than battery life.luckily, there are custom kernels which will give you more control over your kernel. thereare two types: caf (code aurora repository) and aosp (android open source project). cafis based on qualcomms source code which is a hardware manufacturer you might have heardof. almost all non-nexus device are running a caf kernel. google’s aosp kernel is oftenbased on caf at the beginning and then modified for the android version or nexus devices.you can say caf features better performance and optimizations while aosp has the newestand latest patches from the latest android version. good kernels try to get the bestof both and merge certain patches from caf and aosp to get the best experience possible.now we got the most important information.
let’s talk about getting a freaking customkernel. firstly, you have to choose the right kernel. very often, especially for nexus devices,there are a lot of custom kernels out there that you can use. not everyone is capableof everything. i’d say that there are 3 types: personalized ones which a developerhas developed for himself, but shared with the community, close to stock and highly customizableones. which one to use comes down to your preference. read what this particular kernelis all about and then decide. furthermore, not every kernel is compatiblewith every rom. when there is a boot.img file inside a flashable zip it might not be compatiblewith the rom’s ramdisk. this means that your device will not completely boot, butget stuck at the bootlogo right before displaying
the lockscreen. this is why there is anykernel.anykernel takes the original kernel’s ramdisk and needed files, extracts or modifies itand then merges it with the custom kernel so all needed files for the custom kernelto work are taken from the original stock kernel of the rom which should work all thetime. this makes a kernel compatible with almost every android version and rom. that’sthe reason why custom kernels should only be flashed after dirty flashing the systemto prevent bugs by using files from custom kernel a in custom kernel b.mostly a kernel will try to balance performance and battery life. it is impossible to increasebattery life without decreasing performance, otherwise it would be implemented right away.there are a few which will sacrifice performance
for battery life and vise versa. again: normallya kernel is balanced and can be tweaked to focus on battery life or performance by theuser. performance should be limited to a certain level which will not make you notice any lags,performance issues or fps drops to get the best battery life without feeling like havinga $50 phone in your hands. let’s move on to the cpu clock. there isthe minimum and maximum cpu clock. by increasing the minimum clock, your device will alwaysbe very fast, but will also drain more battery while the cpu isn’t used at all. even whenidling it will act like it’s under heavy load so keeping this at stock is recommended.if possible, even use the lowest possible clock speed as a lower clock will also runat a lower voltage which gives you huge battery
savings as the lowest clock speed might beon number 1 of all used clocks besides the boost clock, which i will explain later, andthe max clock speed. by increasing the maximum cpu clock, which cannot be done on every kernel,the cpu won’t stay as long on the max frequency as before, but will also drain more batteryin this short period of time. as mobile devices are very difficult to cool, i’d recommendnot overclocking the cpu and to stay at stock clocks. especially if you’re not very intothis topic, you might overheat or damage your device permanently as opposed to underclockingwhich doesn’t pose a threat to the hardware. on pcs it’s a different story as fans andwater coolers can easily handle the cpu’s temperature when overclocked. to summarize:set the minimum frequency as low as possible
and keep the maximum frequency at stock.now to the governor: the governor decides when a cpu core should be clocked at a higherfrequency. when doing nothing, it should be at the lowest frequency, but if you’re usingyour device it needs a higher clock to process data. in theory the clock should only be ashigh as needed and not higher, which results in a higher battery drain, or lower, whichresults in a slower performance. the most important ones are: interactive whichis used very often as it’s a very balanced governor which clocks very high in a shorttime, but also goes back fast, then there is conservative which will not clock veryhigh unless there is a high cpu load for a longer period of time and powersave or performancewhich will either stay at the minimum clock
or stay at the maximum clock almost all thetime. very often interactive or conservative is the best option, but be aware that eachkernel can tweak its governors so “interactive†on kernel a doesn’t have to be the sameas on kernel b. moreover, some kernels feature their own governors with special names like“interactivex†or something like that. now to cpu voltage: in order to save a fewpercentages of your precious battery and to decrease heat output, you can underclock yourcpu. how low you can go depends on the device and the cpu binning. to sum up binning youhave to imagine that not every cpu is the same. some are of higher quality and someof lower. in desktop cpus some might be low-end and the others might be professional oneseven when they share no differences in production.
however, in mobile devices you’ll neverknow what you get. higher cpu binning values will allow you to undervolt more without becomingunstable. when undervolting your cpu, the worst thingthat can happen is a reboot, which will happen as the cpu crashes as it doesn’t get enoughpower. the worst thing that should happen is that you lose some of your recent data,like data not stored on your flash storage, but still in ram for example a note that youdid not save yet, but it will not harm your hardware. doing the opposite called overvoltingmight decrease the life span of your cpu and make it get a lot hotter than it is intendedto be. overvolting is often required for overclocking to give the cpu enough power. however, overvoltingshould be avoided if you are not familiar
with this.to find out your cpu binning, type “dmesg | grep pvs†in a terminal (i’ll post the command in thedescription). the higher the number is, the lower voltages your cpu can run at. normallypeople undervolt from 25mv up to 100mv. you should try lowering the voltage by 5mv anduse a cpu benchmark app or use your device for a couple of hours. if it reboots, tryincreasing the value. if not, decrease it until you hit that critical value and usea voltage which is 5mv higher than the not working one. you could do this for every frequency,but i would just change the global voltage so that every clock speed is undervolted withthe same value. this makes things a lot easier. please note: never ever set voltage settingsto apply on boot without using your device
at least a few hours. otherwise your devicemight crash on boot up because of the low voltage and without getting to the kernelapp to modify this, you will have to manually delete these settings or reflash everything.please be aware of that! now to hotplugging. on a multi-core devicekeeping every core online even when not needed drains the battery as hell. so hotpluggingallows to disable a core when not used and enable it or plug it in when needed. it issomehow like the cpu clocks but with cores. in theory it would be perfect if for examplea second core only comes online when the first core is under max load and cannot give youmore performance. the second core should be disabled again when the first core can handlethe load alone. as the system has to think
a short period of time if it needs more cores,slight lags can appear when having very few cores online all the time. to save some batterylife, you can make a quad core system dual core all the time so 2 cores will never beplugged in and used. for performance you just can enable all 4 cores and never unplug anyof them. when disabling the hotplugging driver completely on your multi-core device, it willrun as a single-core which is often as bad as setting the max clock to the lowest frequency.i’ll explain why later. for hotplugging there are a lot of driverslike mpdecision, intelli hotplug, zen dicision and mako developed by francisco franco. eachhas its own settings and can be tweaked with a compatible kernel app. very often you willsee a slider called “load threshold†which
controls when a new core should be pluggedin for example at 80% load and if lower as 20% the new core should be disabled again.sometimes you can even only allow a certain number of cores to stay active while in standby.also there is cpu boost or touch boost. this will automatically increase the cpu clockwhen you touch the screen of your device so the cpu has enough power to provide a smoothexperience when you interact with it and not only staring at the screen. a higher cpu boostclock will provide a smoother experience. a lower one might save some battery, but youmight notice performance drops when scrolling or zooming. you can also tweak the millisecondsit needs to clock the cpu higher and even how long it will wait after you stopped touchingyour screen before going to a lower clock
speed. you can experiment with these settings,but stock ones are often the best. next up is i/o. this handles the in and outputof the ram or storage. it should prioritize important tasks or apps and give them enoughresources to work fast and efficient. while a balanced i/o scheduler like “cfq†whichgives every process the same resources looks good and might look very fair, it might giveunimportant apps resources which others desperately need. another famous one is “deadlineâ€which is almost a realtime scheduler (for noobs this means it is very good), but whenthere is too much data, some processes might get lost as the limit is reached. the mostrecommended one is called “fiops†and is intended for flash storage which everysmartphone has. moreover, there is the read-ahead
size which varies from device to device. normallya higher size is like 2048kb is very good to give sd cards and other storage devicesa bit of cache to give better performance. sometimes you’ll also have krait c-states.these are the states which a cpu can go to. c0 means instant wake up. the higher the number,the deeper the sleep is. there is also c1, c2 and c3. people say that only disablingc2 will save some battery, but i would keep all enabled.one advanced kernels you might even be able to change the dirty background ratio or dirtyratio or even swappiness and vfs cache pressure. these settings determine when data will bemoved from ram to a cache or swap disk or even written to the device’s storage. themore free ram your device has, the more can
be stored in order to prevent the system fromwriting data from ram to the swap disk every minute. however, it will store more data inthe ram when possible which not every device is capable of, especially when only havinga low amount. these settings are very advanced and can also be left at stock.now to the gpu. recent devices only have one gpu core so hotplugging is not a huge topicthere. if you’re never gaming or using a video editor app you can try setting its maxfrequency to a low setting to save battery. keeping the minimum frequency as low as possibleis also recommended. i would not really change the gpu governor, but of course you can alsoexperiment a bit with this setting. keep in mind that for example the powersave governorwill lock your gpu to the lowest clock speed
which can result in low fps while gaming.i would always change the governor when gaming and change it back when normally using yourdevice. this needs some effort, but can improve battery life.finally there is also the tcp congestion control. it doesn’t have any impact on battery life.the most recommended ones are westwood, reno and cubic, while i would definitely use westwoodas it gives you the best download/upload performance and the lowest latency. having a bad algorithmcan result in slower download and upload speeds and a higher latency. the algorithm triesto fully use the network capabilities without needing to send data twice as data got lostor not transferred for example because the algorithm is sending more data than the networkis capable of.
last but not least you have features likethermal control or temperature throttle in order to set the heat limit for the cpu. whenthis limit is reached, your cpu will automatically use lower clock speeds to prevent overheating.this can be set to any temperature you prefer, but shouldn’t be too low or too high asyou would get slow performance all the time as the temperature is reached or too hightemperatures which could harm your device. moreover, you can tweak the colours of yourscreen to get the colder display of the iphone or a perfect 6500k temperature with naturalcolours. some kernels even give you the ability to block certain kernel wakelocks which keepthe device awake, but are almost completely useless. there might even be some more features,but that depends on the kernel. don’t forget
that not every kernel has every mentionedfeature. i just tried to explain as much option as i could to give you a quick overview ofwhat you can tweak and what a certain option will change.in the end i would advise you to keep things balanced. locking the cpu to the lowest clockmight make the cpu drain almost no battery at all, but at the same time it will drainthe battery longer as it needs more time. not even the cpu might take longer, but yourscreen will also be active for a longer period of time. think of this: when opening an appthe cpu might consume a lot of power for a second, but then you can use the app, finishthe task and put your device into standby. if it is locked to a very low clock it mighttake 15 seconds to open the app up and even
longer to finish the task. moreover, the longerit takes for a task to finish, the longer the screen will stay active. you’ve mightprevented the cpu from draining your battery, but the screen was activated for a longertime which drained as much or even more battery than it would have when the cpu did its jobwith more power. please be aware that you need a good kernelmanager app in order to change all of these settings. i can recommend synapse, kerneladiutor, franco kernel app or faux kernel manager. also ex kernel manager is a goodchoice. each has its own settings and not every one might be compatible with your kernel.just check on the kernel’s page to get the recommended kernel manager app or try differentapps. please note that you shouldn’t use
2 kernel manager apps at the same time withapply on boot options activated for the same options. this could result in weird settingsas both apps will try to change the same option on bootup. so when using multiple kernel managerapps know which settings are applied on which app.i hope i could give you an overview of what a kernel is all about and how you can modifyit for your own needs. there is no perfect kernel and there are not perfect settingsout there. for a good battery life you have to decide for yourself how much of performanceyou want to give up without getting annoyed. i would play around a bit and even use googleto get a good starting point for your device/kernel combination.please be warned: i am not responsible for
anything you do to your device. this videois only intended to give you some basic information on custom kernels and its settings. for moreinformation please use google or xda developers.
of course you can also ask questions in thecomments below. like this video if you liked it, dislike itif you had no idea what i’m talking about or leave a comment if you have anything toshare or ask. please subscribe if you like my videos as every subscription really makesmy day!