[KERNEL] *TEST* Undervolt driver for the stock HTC kernel for Nexus One (2.6.32.9) - Nexus One Android Development

Tester with a Nexus One wanted to make sure this works with 2.6.32.9. Please post the output of "cat /proc/undervolt" and messages in dmesg after loading this module.
This kernel module allows you to run any stock HTC Froyo kernel with lowered CPU voltages. Reducing voltage decreases power consumption by the CPU, thus lowering heat and increasing battery life.
INSTALL:
You need root or an unrestricted recovery image (e.g ClockworkMod) to install this. The default settings decrease voltage by 75-100 mV which seems stable on my device (HTC Desire). Just download the attached file and select it from recovery or ROM Manager.
I've built an "update.zip" file for the Nexus One with Linux kernel version 2.6.32.9-27227-g3c98b0d. You can check your kernel version in Settings->About phone->Software information.
Other HTC devices running Froyo are supported. If you have a different device, please give me the full version number and I can add an update.zip for it.
Full details and source are in the original thread in the Desire forum:
[KERNEL] Undervolt driver for the stock HTC kernel for Desire and others (2.6.32.15)

Deleted, didn't see the other link back to the source code

Related

[KERNEL][CWM][Player 5.0][USA]Entropy's Daily Driver, 3/5/2012 (1.2 GHz OC)

Well, the time has come that I think my kernel is ready for public consumption.
THIS IS ONLY FOR THE USA VERSION OF THE GALAXY PLAYER 5.0 (YP-G70). If you have a mechanical home button instead of capacitive buttons at the bottom, do not flash this (rumirand has a kernel for you)! If you have a 4.0, do not flash this (SteveS has a kernel for you)!
Read the first three posts of this thread COMPLETELY before asking questions - if you ask a question that is answered in the first three posts, you WILL be flamed.
I'm continuing my Daily Driver name, even though it isn't as good of a name as it used to be. It is my daily driver - but what kernel dev doesn't use their own kernel as a daily driver? It made more sense in the Infuse days when I was running my own unreleased kernel for months and a few people asked for it. Oh well, I'm lazy - same name for now.
This is going to be maintained in the same manner and spirit as my other Daily Driver releases for the Samsung Infuse and Samsung SGH-I777 (AT&T Galaxy S II) - http://forum.xda-developers.com/showthread.php?t=1212795 and http://forum.xda-developers.com/showthread.php?t=1289460
It is built from sources at https://github.com/Entropy512/linux_kernel_galaxyplayer and initramfs at https://github.com/Entropy512/initramfs_yp-g70
Current features:
coolbho3k's Samsung Sleep of Death patch - allows stable use of screen-off profiles with limits below 800 MHz in SetCPU
netarchy's conservative governor tuning patch - Reduces the polling interval, allowing conservative to ramp up/down faster. Over in I9100 land they're calling this "lionheart" and it's all the rage. (It makes me sad when people won't accept a governor until it's renamed and hyped up way beyond what it is...) As an example, a GSII would take 0.4 seconds to ramp from 200 to 1200 MHz with the default conservative governor, it can go all the way in 0.1 second with this patch.
conservative set to default governor - use SetCPU or a similar app to change it
jhash3
TinyRCU
CIFS and Tunneling modules included
ext4 partition mounting support in kernel and initramfs thanks to rumirand - ghetto Lagfix baby!
CWM 5.0.2.7 based recovery - Mostly tested, seems working, but may have a few bugs still to work out, rumirand helped a lot on this one
Insecure kernel - gives you automatic root in ADB shells
Per-file fsync() disable capability - see "dangerous features" documentation below
Standard bootanimation (/system/media/bootanimation.zip) support
Charginghacks - faster charging at low battery, slightly slower near the end, overall faster charging while trying to minimize battery stress
CPU core voltage control - use SetCPU or a similar app
CPU overclock to 1.2 GHz - use SetCPU or a similar app
Planned features, short-term:
Pull a few other bugfix commits from my other kernels
Clean up CWM implementation
Planned features, mid-term:
Proper Voodoo Lagfix support (Automatic partition conversion instead of manual)
Planned features, long-term:
Overclock beyond 1.2 if people prove they can handle 1.2 with maturity (Infuse community couldn't handle any OC in a responsible manner...)
Features not planned:
Anything that has a high risk of trading off stability for performance, unless it can be completely disabled by default
Alternative governors - They almost always cause wacky behavior in some cases, and they don't offer anything that can't be done with a combo of SetCPU profiles and tuning the conservative governor now that the minimum poll rate has been dropped.
How to flash .tar releases:
Linux/MacOS:
I forgot that Heimdall doesn't like this particular device - you will need to use a Windows virtual machine with USB passthrough support (like VirtualBox) and Odin, or root the device using the zergRush exploit and follow the "rooted device" instructions. (Ambrice has a fixed version of heimdall, but it must be compiled from source. If you know how to do that you don't need tips on how to use it. )
Windows:
Enter download mode - Power off your device completely, hold VolDn, and insert the USB cable
Use Odin - Google it or search these forums for details - try AdamOutler's resurrector thread in this Development forum
Any rooted device:
Extract the zImage from the .tar file of the release. On Linux, it can be the following (which should work in an ADB or Terminal Emulator shell on the Player itself.)
Code:
tar xvf <releasefile>.tar
From a shell with root access (ADB or Terminal Emulator), do the following:
Code:
dd if=zImage of=/dev/block/mmcblk0p11
How to flash .zip releases:
Put it on your sdcard, enter CWM, flash the .zip using CWM
If you do not have CWM, install an older .tar release then flash, or follow the "Any rooted device" instructions above, but extract the zImage from the .zip instead of a .tar
3/5/2012 Release:
Overclocking to 1.2 GHz (use SetCPU or a similar app to enable)
Support for running scripts in /system/etc/init.d
3/3/2012 Release:
Voltage control (no overclock yet, coming next)
1/29/2012 Release:
charginghacks from Infuse: Charging current on a wall adapter raised to 800 mA at lower battery, dropping to 700, then 600 (stock), then 550 (slightly below stock) as battery voltage reaches maximum. This gives overall lower charge times while trying to not stress the battery too much.
Also, final charge termination happens earlier - while this results in slightly less battery capacity per charge, it will help the battery retain capacity over time.
1/23/2012 Release:
Initramfs: Standard bootanimation support. Place a standard bootanimation in /system/media/bootanimation.zip - Note: The "stock" bootup sound still plays.
1/22/2012 Release:
A few bugfixes and power management improvements pulled in from other kernels
Ability to disable per-file fsync() - good for benchmark epeen, potentially dangerous for your data
1/14/2011 Release:
Initial release
FAQ
Q: Why does CWM default to my external SD card for backup/restore/flashing ZIPs?
A: This is the standard for Android devices going forward - internal on /emmc and external on /sdcard
Q: How do I enter CWM?
A: Until ROMs come out that have extended power menu mods: Power off your device, then:
Hold VolUp
Hold Power
Release Power when the SAMSUNG screen appears (continue holding VolUp)
Release VolUp when CWM appears
Q: I'm still not rooted?
As stated in the features, an insecure kernel only provides root in an ADB shell. Either use ADB to push /system/bin/su and /system/app/Superuser.apk and chmod them to the correct permissions, or take the easy way out and flash ChainsDD's Superuser package in CWM - http://androidsu.com/superuser/
Q: I used ROM Manager to do something, and something weird happened/went wrong. Why?
A: ROM Manager has not worked properly on any device I have ever owned. It softbricked any Infuse that had Voodoo Lagfix enabled, and never works properly on the SGH-I777. The only thing I've ever seen it do right was install gapps on CM7 on the I777.
Q: My battery will never charge past 80%, why?
A: The way Samsung estimates state of charge on our devices is extremely primitive and, in general, poor. Instead of a dedicated fuel gauge IC, they have tried to estimate battery directly from voltage with some funky compensation offsets depending on current operating state - the offset for wall charging is so high that it is impossible for the battery to read higher than 80% when on a wall charger unless you're putting the device under heavy load to activate some of the other compensation offsets. Sometimes it seems like the compensation code doesn't "kick in" when plugging in a charger, allowing you to see a higher number, other times it'll get "stuck on" even after removing the charger. The general thing, though, is that any percentage estimates of battery state are WILDLY inaccurate.
Q: Can you implement Voodoo Sound?
A: No - We have the same audio chip as the Galaxy S2 and Galaxy Note (Yamaha MC1N2) - Voodoo Sound requires a Wolfson WM8994.
Documentation on "dangerous" features:
Per-File fsync() disable:
This allows you to disable per-file write forced syncs. (e.g. if an app tries to force a write straight to disk, it'll just go to cache). This achieves the same goal as the modded sqlite hacks seen in tweaks such as USAS, however it can be disabled at runtime.
WARNING: THIS CAN CAUSE DATA LOSS OR CORRUPTION IN A CRASH
To enable, do the following in a terminal, or add it to an init.d script (look at my ondemand script as an example):
Code:
echo "1" > /sys/module/sync/parameters/fsync_disabled
And to disable (return to the default):
Code:
echo "0" > /sys/module/sync/parameters/fsync_disabled
Good for around 200 points of epeen in the database benchmarks in Antutu or 500-600 points of epeen in Quadrant. Real-world benefit: Probably not worth the data integrity risk, but you've got a choice now.
*reserved for whatever the heck I forgot above*
Thanks a ton Entropy512!! Been waiting for this.
Going to have to buy you a six pack via the Donate button!
Congrats Entropy512. I'm really thankful for your cooperation.
Its finally here!! Thanks so much entropy
Nice job entropy! Good to see that there is at least some development going on for these devices. This makes me wish I got a 5.0 instead..but I'm stuck with a 4.0.
Sent from my YP-G1 using Tapatalk
Thank You
I myself along with others appreciate you developing for the Galaxy Player 5.0 it is a great music player and it falls in the Galaxy family its a good device
Sent from my Galaxy Nexus using Xparent Blue Tapatalk
Says we can use Odin...do see put this in a phone or pda slot
Zei said:
Says we can use Odin...do see put this in a phone or pda slot
Click to expand...
Click to collapse
PDA - only modems go in phone I believe.
Just like flashing any other kernel in Odin.
Edit: CRAP I have Heimdall instructions but Heimdall won't work on the Player... I'm so habitually used to Heimdalling...
Would a factory stock image + root + this be good enough to post if done w/ the backup/restore feature?
Zei said:
Says we can use Odin...do see put this in a phone or pda slot
Click to expand...
Click to collapse
Yes when you use odin you will need to put the rom in PDA slot.If yiu use heimdall you will need to extract and flash the files separatly.
I hope this helps.
---------- Post added at 11:53 AM ---------- Previous post was at 11:53 AM ----------
Entropy512 said:
PDA - only modems go in phone I believe.
Just like flashing any other kernel in Odin.
Edit: CRAP I have Heimdall instructions but Heimdall won't work on the Player... I'm so habitually used to Heimdalling...
Click to expand...
Click to collapse
Heimdall does work on the player. I use it.
Hmm... odd, I tried to use it and it gave me some odd errors I've never seen before (I forget what at the moment) and then put me into forced download mode. I know a pit-dump has some rather odd looking results. Maybe if I just try and flash a kernel it will work.
I'll try again later today, and edit the instructions if it works.
I have my Player shut off for most of today - I've been having strange battery drain problems on my GSII for the past week or so, only when at home - and it seems like it started when I got the Player. So I'm shutting it off to see if it actually is affecting my phone.
Edit: Heimdall still isn't working for me
Code:
Heimdall v1.3.1, Copyright (c) 2010-2011, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au
This software is provided free of charge. Copying and redistribution is
encouraged.
If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/
Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...
Checking if protocol is initialised...
Protocol is not initialised.
Initialising protocol...
Handshaking with Loke...
Beginning session...
Session begun with device of type: 0
Downloading device's PIT file...
PIT file download sucessful
Uploading KERNEL
100%
ERROR: Failed to confirm end of file transfer sequence!
KERNEL upload failed!
Ending session...
Rebooting device...
Re-attaching kernel driver...
After I flashed your kernel it won't let me connect to the market, my Wi-Fi is turned on and I connect to the browser just fine but not the market, help?
That's strange - no problems with market connections here. (Edit: Just updated BetterBatteryStats...)
Try rebooting?
Or wait a bit - sometimes the Market just goes down.
Entropy512, I've been studying your github and how you enable ext4 support in the kernel. Could you explain how you did it? I know it has to do with editing "/ arch / arm / configs / yp_g70_usa_defconfig" but I can't find that file in samsung's source or on Steve'S github. And after you do that you just edit the mount points in init.rc, right? I'm asking because I'm gonna try to get ext4 (lagifx) for my 4.0!
Thanks.
P.S. sorry if I'm a noob
klin1344 said:
Entropy512, I've been studying your github and how you enable ext4 support in the kernel. Could you explain how you did it? I know it has to do with editing "/ arch / arm / configs / yp_g70_usa_defconfig" but I can't find that file in samsung's source or on Steve'S github. And after you do that you just edit the mount points in init.rc, right? I'm asking because I'm gonna try to get ext4 (lagifx) for my 4.0!
Thanks.
P.S. sorry if I'm a noob
Click to expand...
Click to collapse
yp_g70_usa_defconfig was copied from venturi_usa_defconfig prior to modifying it - I decided to start maintaining my own defconfig rather than overwriting the original one.
Galaxy Player 4.0 is palladio instead of venturi. SteveS also uses a renamed defconfig though - something like steves_blahblahblah_defconfig
To change things for a 4.0, it would be something like
Code:
make steves_blahblahblahwhateverthisis_defconfig
make menuconfig (enable ext4 support in the menus here)
cp .config arch/arm/configs/steves_blahblahblahwhateverthisis_defconfig
git add arch/arm/configs/steves_blahblahblahwhateverthisis_defconfig
git commit
Entropy512 said:
yp_g70_usa_defconfig was copied from venturi_usa_defconfig prior to modifying it - I decided to start maintaining my own defconfig rather than overwriting the original one.
Galaxy Player 4.0 is palladio instead of venturi. SteveS also uses a renamed defconfig though - something like steves_blahblahblah_defconfig
To change things for a 4.0, it would be something like
Code:
make steves_blahblahblahwhateverthisis_defconfig
make menuconfig (enable ext4 support in the menus here)
cp .config arch/arm/configs/steves_blahblahblahwhateverthisis_defconfig
git add arch/arm/configs/steves_blahblahblahwhateverthisis_defconfig
git commit
Click to expand...
Click to collapse
Cool thanks! Will definitely try it out.

Android kernel default governor...

Hey all - hopefuly this is the correct place for this question. I am developing a custom kernel for the Samsung Replenish baseod off of samsungs open source code. I have thus far gotten the kernel to compile and run just fine on the phone. I have also added the SmartassV2 and Interactive governors. No matter which one i set as default through the phonemodel_defconfig, each time I recompile and load the new kernel, it always default back to OnDemand governor.
I have no problem selecting either of the 2 new governors through SetCPU (and the setting does stick from boot to boot as long as I select "Set at Boot") so I know the governors are properly linked into the kernel. I thought that the kernel would start with the default one I selected, but it does not. Is this how thigs are supposed to operate, or am I missing something. I did update the cpufreq.h file in the include directory.
Any suggestions - is this even the correct place for a post that is this low level.
Thanks!
dmrlook said:
Hey all - hopefuly this is the correct place for this question. I am developing a custom kernel for the Samsung Replenish baseod off of samsungs open source code. I have thus far gotten the kernel to compile and run just fine on the phone. I have also added the SmartassV2 and Interactive governors. No matter which one i set as default through the phonemodel_defconfig, each time I recompile and load the new kernel, it always default back to OnDemand governor.
I have no problem selecting either of the 2 new governors through SetCPU (and the setting does stick from boot to boot as long as I select "Set at Boot") so I know the governors are properly linked into the kernel. I thought that the kernel would start with the default one I selected, but it does not. Is this how thigs are supposed to operate, or am I missing something. I did update the cpufreq.h file in the include directory.
Any suggestions - is this even the correct place for a post that is this low level.
Thanks!
Click to expand...
Click to collapse
As far as i know, cpu scaling governor can also be set by init script in ramdisk and /etc/init.d other than default setting in kernel config. You might need to check if there's any init script that contain a line like :
'write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand '
or
'echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
Those lines will set the cpu scaling governor everytime the phone reboots.
In my device (xperia mini pro), that first line is in init.semc.rc in root folder of ramdisk. It should be different in your device
The second line is usually in a script in init.d folder, but stock rom usually doesn't support init.d, so afaik it only exists in custom rom.
greenAlgae said:
As far as i know, cpu scaling governor can also be set by init script in ramdisk and /etc/init.d other than default setting in kernel config. You might need to check if there's any init script that contain a line like :
'write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand '
or
'echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
Those lines will set the cpu scaling governor everytime the phone reboots.
In my device (xperia mini pro), that first line is in init.semc.rc in root folder of ramdisk. It should be different in your device
The second line is usually in a script in init.d folder, but stock rom usually doesn't support init.d, so afaik it only exists in custom rom.
Click to expand...
Click to collapse
Thanks for the response. the kernel does support init.d (now, stock did not) but there are not scripts in there as of yet. I also went through all the other startup *.rc scriipts and found one that was echoing ondemand into the scaling_governor file. I tried both comment the line out and reflashing new ramdisk, and chaning it to echo smartassV2 and reflashing new ramdisk. In all cases, Ondemand still comes up.
I've also added a script to init.d that echos governors other than ondemand to scaling_givernors, and still, when the phone is booted, ondemand it is. Note that if I echo some other governor to the file at this point, it does change (I imagine this is what setcpu does in the background anyway).
Could the android system system itself be changing it to ondemand?
Thanks for the help!
dmrlook said:
Thanks for the response. the kernel does support init.d (now, stock did not) but there are not scripts in there as of yet. I also went through all the other startup *.rc scriipts and found one that was echoing ondemand into the scaling_governor file. I tried both comment the line out and reflashing new ramdisk, and chaning it to echo smartassV2 and reflashing new ramdisk. In all cases, Ondemand still comes up.
I've also added a script to init.d that echos governors other than ondemand to scaling_givernors, and still, when the phone is booted, ondemand it is. Note that if I echo some other governor to the file at this point, it does change (I imagine this is what setcpu does in the background anyway).
Could the android system system itself be changing it to ondemand?
Thanks for the help!
Click to expand...
Click to collapse
Well, actually I never try to change the default governor from ondemand before. Partly because I compiled my kernel using official/stock kernel source, so there's only those stock governor options and ondemand seems to be the best option. My phone is SE Xperia Mini Pro / sk17i and currently running Freexperia CM7 rom. The kernel provided has very good performance but seems to cause the battery draining too fast for me, so I compiled a 'stock' kernel to use with it.
After your post above, I tried to add more governor options from freexperia kernel source, recompiled the kernel, edit the init script in ramdisk, and flashed it to my phone.
Here's my result:
- the script in init.d doesn't seems to change the default governor. I don't know exactly why. Other script in init.d seems to run just fine, I can set scaling_min_freq and scaling_max_freq with it. I also check the permission, it's rwxr-x-r-x, but it doesn't seem to be executed at boot.
- in every startup, the rom executes the script in /data/local/userinit.sh too, but setting default governor from that script also doesn't succeed.
- only thing that can change the default governor is adding the line 'write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor smartassV2' in 'on boot' section of the init.semc.rc file.
I'm not a developer and i know every rom might be different. So you might need to ask in your rom specific thread, one of the devs might be able to help you there.
Otherwise, you can always set the default governor at boot using app like 'setcpu' or ' No-frills CPU Control'
dmrlook said:
Hey all - hopefuly this is the correct place for this question. I am developing a custom kernel for the Samsung Replenish baseod off of samsungs open source code. I have thus far gotten the kernel to compile and run just fine on the phone. I have also added the SmartassV2 and Interactive governors. No matter which one i set as default through the phonemodel_defconfig, each time I recompile and load the new kernel, it always default back to OnDemand governor.
I have no problem selecting either of the 2 new governors through SetCPU (and the setting does stick from boot to boot as long as I select "Set at Boot") so I know the governors are properly linked into the kernel. I thought that the kernel would start with the default one I selected, but it does not. Is this how thigs are supposed to operate, or am I missing something. I did update the cpufreq.h file in the include directory.
Any suggestions - is this even the correct place for a post that is this low level.
Thanks!
Click to expand...
Click to collapse
today i was looking for a solution like you and watched this post,finally i could solve the problem.Look at the scripts on /system/etc folder, in my case there was a script located there that changed the governor to ondemand,its name init.qcom.post_boot.sh maybe on your device it has other name.
old thread, i know, but im attempting to root a samsung replenish thats running 2.3.6. can anyone help? nothing is working.
EDIT: LOL. i was thinking "this phone is that old...? this is ridiculous that its running a higher form of gingerbread than my 4 month old phone is......" but i was looking at the join date not the post date, and i thought the thread was 3 years old. LOL

[kernel][v3.5] leanKernel: minimalistic kernel (1/28/16)

[kernel][v3.5] leanKernel: minimalistic kernel (1/28/16)
leanKernel is not for everyone.
My philosophy is to keep the kernel footprint as small as possible by trimming as much fat as possible, and at the same time keeping it stable, power efficient, and fast. leanKernel is designed to be a drop in replacement for stock kernel, and so it tries not to deviate too far from stock.
You will find that it's lacking some of the bells and whistles of other custom kernels, so if you like features you came to the wrong thread.
Here's a longer post on what leanKernel is about.
Also folks, please read the FAQ before asking questions.
INSTRUCTIONS
If you like to stay as close to stock as possible: 1) Download and flash the normal leanKernel build here (find the latest zip file) in recovery. 2) Reboot and enjoy better performance and battery life (hopefully). That's it! There's no need to flash stock kernel first, or to wipe caches.
If you like to customize, read through the feature list below, the FAQ (post #2), the changelogs, and optionally the entire thread. Then you'll know what to do.
DOWNLOAD (flash in recovery)
v1.x is for Android 5.0, and v2.x is for Android 5.1
main download
mirror (may need to refresh browser to see latest)
PREREQUISITE
Unlocked bootloader, custom recovery installed
Push bullet channel: imoseyon
FEATURES
custom voltage control - use your favorite app
updated to latest 3.10 Linux
interactiveX - screen_off_maxfreq support (default 2.2Ghz)
sw crypto drivers updated (to use arm NEON instructions) for better encryption/decryption performance. Sequential 180MB/s reads, 60MB/s writes (using dd)
latest Linaro gcc 4.9 toolchain (optimized for a15 - thanks to Christopher83)
fat trimmed and various performance tweaks
f2fs support (updated to latest source from Samsung)
force encryption turned off (changed to encryptable)
overclocked to 2.9ghz (experimental - available as a separate build for now)
underclocked to 223mhz (experimental - available as a separate build for now)
Async Fsync
init.d support
cpu-boost control - enable/disable via lkconfig
lkconfig script for customizing leankernel (open terminal app, become superuser, then type "lkconfig" without quotes)
patched mpdecision to prevent changing min/max freq provided as flashable zip (in util directory)
color control (thanks to @savoca)
charging led support
a lot of unnecessary stuff removed from stock kernel
some components updated to Linux 3.18
random generation optimization including e/frandom support
pc/usb charging with boosted current ~300-400mA
some selinux fixes, selinux is enforced by default - staying true to stock (you can easily disable using lkconfig)
SLUB allocator updated to Linux 3.18
wake gesture control from flar2, modified for leankernel (also disabled in-call)
vibe strength control
much of the code is up to date with latest from CodeAurora
(mostly for devs) /sys/module/selinux/parameters/force_audit sysfs node to audit all/hidden selinux denies.
power aware cpu scheduling
faux sound enable/disable by sysfs (and lkconfig)
wakelock control (smb135x, wlan_rx, msm_hsic and sensor_ind)
leanKernel core control script
user option to prevent mpdecision/msm_thermal from changing min/max frequencies: frequency mitigation preventer
supports kexec for multirom
LKCONFIG
You can use lkconfig script to make custom changes to leanKernel (along with popular apps like Kernel Tweaker and Trickstermod). To run lkconfig, open terminal app, "su" (without quotes) to become superuser, enter, and then type "lkconfig" without quotes, then enter.
Code:
[email protected]:/ $ su
[email protected]:/ # lk
leanKernel configurator
---
0) display current settings
1) cpu frequency control
2) wake gesture control
3) wakelock control
4) charging led
5) rgb/picture control (advanced)
6) rgb/picture control (simple)
7) vibe strength
8) power saving mode for cpu scheduler
9) faux sound control
10) selinux mode
11) min/max freq change prevention
21) check top 10 wake locks (ie. wakeup sources)
please enter a number (or press enter to exit):
CHANGELOG
https://github.com/imoseyon/leanKernel-shamu/wiki/Marshmallow-ChangeLog
Thanks to @guitarshredder87, @Wera750, @akellar, and @grisha1 for testing test builds!
XDA:DevDB Information
Leankernel: Minimalistic Kernel, Kernel for the Nexus 6
Contributors
Imoseyon
Source Code: https://github.com/imoseyon/leanKernel-shamu
Kernel Special Features:
Version Information
Status: Stable
Created 2014-11-26
Last Updated 2016-01-31
FAQ
I'm having trouble waking the phone sometimes. Help!
We haven't really figured out exactly what's causing it - but there seems to be evidence that it's not limited just to leanKernel. One thing to try: if your ROM has a feature that prevents accidental wakeups, disable it!
I can't seem to get min and max freq to stick! What are these mpdecision zip files in the util directory?
* Read this post: http://forum.xda-developers.com/showpost.php?p=58135730&postcount=1474
* Short version: This is actually by design of mpdecision. If you want this behavior to change, I recommend that you 1) flash latest stable leankernel, 2) flash the custom no-freq mpdecision, and then 3) disable cpu-boost via lkconfig. Do not disable mpdecision if you go this route. Also, if you flash ROM, you must re-flash custom mpdecision. To go back to normal, flash the stock mpdecision file.. Launch lkconfig, choose core control, and choose one of the options in core control.
Will flashing leankernel decrypt my phone storage?
If you're already encrypted, then it will stay encrypted after flashing kernel, *until* you format data. Once you format you will stay decrypted until you decide to encrypt again (see below). If you're already decrypted, leanKernel will not force encrypt automatically.
What do I do to encrypt again?
There are several ways to do this. One way (easiest for me at least) is to adb in (or in terminal emulator):
Code:
[email protected]:/ # start encrypt
You will see the phone hot boot and once it comes up you will be encrypted again. Keep in mind that if you want to decrypt again you'll have to wipe.
How do I check the PVS BIN of my cpu?
Code:
[email protected]:/ # cat /proc/cpu/msm_acpu_pvs
The number you get should range between 0 and 15 (inclusive). If you ended up with 15 congratulations. If you ended up with 0, go get it exchanged! Stock frequency/voltage table: http://pastebin.com/ZyGA9Tec
Which kernel control app do you recommend?
When v1.0 gets released it should come with "lkconfig" for tweaking some of the options. Otherwise, I tried Trickster and KernelTweaker, and they both seem to work ok.
What are ondemandX and interactiveX?
ondemandX and interactiveX are very very close to "stock" ondemand and interactive governors, respectively. The only difference is screen_off_maxfreq sysfs support. This means that it gives you the ability to limit phone's max frequency when screen is off. This feature could be effective in reducing battery usage, especially if you have a misbehaving app (or two) that consume cpu cycles while screen is off. The default value is 2265600 - if you change the value to your top speed you're effectively disabling the feature and restoring stock behavior completely. You can use an app like Trickster or Kernel Tweaker to modify screen_off_maxfreq.
HELP! I messed up with lkconfig - how do I go back?
Do not fret. Flash lkconfig_cleaner.zip from the "util" directory.
(If you want to do this manually), reboot the phone into recovery, mount /data, and delete everything in /data/data/leankernel. Once things are back to normal, re-run lkconfig to re-do your settings.
What is cpu-boost?
Read this post: http://forum.xda-developers.com/showpost.php?p=57215289&postcount=535
What is the best RGB setting?
http://forum.xda-developers.com/showpost.php?p=57265483&postcount=620 (old)
http://forum.xda-developers.com/showpost.php?p=59092146&postcount=3017 (new)
What is power aware scheduling?
Read this post: http://forum.xda-developers.com/showpost.php?p=58313978&postcount=1651
I missed your kernel when I switched to N5. Glad to have you here
hmm.. a kernel. since its the first one posted here, im trying it out
Hell yeah. Ready to flash
Sent from my AOSP on Shamu using XDA Free mobile app
If I flash this it will decrypt right cool
digweed4me said:
If I flash this it will decrypt right cool
Click to expand...
Click to collapse
It should not decrypt if you're already encrypted, unless you re-format/wipe. But no guarantees.
Imoseyon said:
It should not decrypt if you're already encrypted, unless you re-format/wipe. But no guarantees.
Click to expand...
Click to collapse
What app should we use to control? I remember you used to have your app right
holy **** Imoseyon. you made my Thunderbolt usable way back when. so glad to see you developing for the N6 now
digweed4me said:
What app should we use to control? I remember you used to have your app right
Click to expand...
Click to collapse
Flashed it and yes decrypted thanks a lot
IMO!! Good to see ya again man. Can't wait to run your work again.
Appreciate it!
digweed4me said:
What app should we use to control? I remember you used to have your app right
Click to expand...
Click to collapse
You mean lkconfig? Yeah that's coming later (along with a whole lot more).. If you're talking about f2fs, you'd want to use custom recovery but TWRP for shamu doesn't support f2fs yet - i had to do everything manually.
Imoseyon said:
It should not decrypt if you're already encrypted, unless you re-format/wipe. But no guarantees.
Click to expand...
Click to collapse
i am still encrypted, and did not decrypt after flashing. so, all worked as it should.
Can we flash on stock ROM or is a custom ROM required?
So let me see if I get this straight: I'm on stock, unlocked bootloader, rooted, and encrypted (as far as I know--I never decrypted), so if I flash this it won't decrypt my device? I was kinda hoping it would.
Secondly, I'm good to flash this with stock ROM? I'm hoping for a bit better battery life.
Thanks devs! I got a feeling development for our device is gonna be NUTS!!
You don't buy a Mustang for the gas mileage.
nycdiplomat said:
Can we flash on stock ROM or is a custom ROM required?
Click to expand...
Click to collapse
I'm on a stock ROM.
pathtologos said:
So let me see if I get this straight: I'm on stock, unlocked bootloader, rooted, and encrypted (as far as I know--I never decrypted), so if I flash this it won't decrypt my device? I was kinda hoping it would.
Secondly, I'm good to flash this with stock ROM? I'm hoping for a bit better battery life.
Thanks devs! I got a feeling development for our device is gonna be NUTS!!
You don't buy a Mustang for the gas mileage.
Click to expand...
Click to collapse
wipe before flashing, youll be decrypted. if you dont wipe, you stay encrpted.
pathtologos said:
So let me see if I get this straight: I'm on stock, unlocked bootloader, rooted, and encrypted (as far as I know--I never decrypted), so if I flash this it won't decrypt my device? I was kinda hoping it would.
Secondly, I'm good to flash this with stock ROM? I'm hoping for a bit better battery life.
Thanks devs! I got a feeling development for our device is gonna be NUTS!!
You don't buy a Mustang for the gas mileage.
Click to expand...
Click to collapse
AFAIK, there's no way to decrypt without having to wipe unfortunately. Going the other way (unencrypted to encrypted) is super easy though, and no data loss.
nycdiplomat said:
Can we flash on stock ROM or is a custom ROM required?
Click to expand...
Click to collapse
im on rastapop, an aosp based custom rom.
simms22 said:
wipe before flashing, youll be decrypted. if you dont wipe, you stay encrpted.
Click to expand...
Click to collapse
Thanks for your quick response. Wipe what tho? Cache, dalvik, and what else? Hope you don't mean all my data.
You don't buy a Mustang for the gas mileage.

How to Improve performance in CPU and GPU

Telegram Group:
{Mod edit: Link removed!}
Low RAM, outdated processors and outdated storage technology are factors that slow Android devices down. Viruses and malware doesn’t do much to improve matters either. Keeping all these factors in mind, limited CPU clock speed is the main reason for Android devices not performing to its fullest. But keep in mind, that this can only be done after you get superuser access for your device. Overclocking your device means forcing your device to perform at its maximum power.
For overclock CPU and GPU need some Requirements
There are a few things that you need to do before overclocking your device:
1) Rooted Android Device
2) Fully Charged Device
3) Backup of your files
*******************************************************
The first thing that you need to do is root your device.
Step 2: After rooting your device, you need to download and install SetCPU for Android users. After you’ve installed it, launch the app and then give it Superuser access.
Step 3: After installing SetCPU, you have to allow the app to scan the available speeds of a processor. After your device has been detected, you have to balance the minimum and maximum speed for your Android CPU switching. Click on 'Set to Boot’ when you feel like the speed of your device is stable.
Step 4: After following the steps above, you will be creating profiles so that you can set terms and conditions when SetCPU should underclock or overclock your processor speed.
Step 5: Taking Battery Charging as an example for a profile, you can create a profile that overclcoks your device while it is being charged. You can have various priorities according to your preferences for each created profile.
There are other apps that you can use to overclock your device.
1. Kernel Adiutor (ROOT)
2. Smartpack kernel manager
3. Franco kernel manager
####### Best Of Luck #######

Development [Kernel][GKI][05.03.2023][Android 13] Kirisakura 1.0.3 for Sony Xperia 1 IV aka "Nagara"

Kirisakura-Kernel for the Sony Xperia 1 IV
Hello everyone,
To keep it short: Here is Kirisakura- GKI - Kernel for the Sony Xperia 1 IV aka Nagara. Nagara is the internal codename for this years development platform of Sony Mark IV devices.
I would appreciate if everybody that flashes the kernel, reads at least once through this opening post and the following ones.
Kirisakura - Kernel is designed to bring a handful of beneficial features to the device, while ensuring excellent performance and smoothness to get you safely through the day!
If you expect a custom kernel to magically improve your devices battery life manifold and this is your only priority then this might not be the right place for you.
There´s also a cpu-battery saver mode that cuts back the CPU max- freqs, but without the disadvantages like delayed notifications from built into the system user-space power-saving modes.
If that got your curious, I welcome you to continue reading if you´re still interested!
Now lets continue with a list of features in the next paragraph!
Main Features:
- Based on kernel/common 5.10.149
- compiled with Clang 12.0.5
- CPU-Battery saver to be able to restrict max cpufreqs on the fly, without enabling powersaving modes that might cause missed notifications (see second post)
- SSG IO scheduler for reduced overhead and less CPU cycles (more lightweight and android optimized)
- Power saving workingqueues enabled by default
- Change various drivers to use power efficient workingqueues. This compliments EAS in general
- implement LRNG (thanks @arter97, see arter kernel OP for more info )
- Enable support for TTL spoofing
- wakelock blocker with the ability to block any wakelocks (dangerous, use with caution)
- please read [URL="https://arstechnica.com/gadgets/2018/08/p-is-for-power-how-google-tests-tracks-and-improves-android-battery-life/"]this for further info
- f2fs improvments for better efficiency
- scheduler improvements
- psi fixes
- Flashing the kernel will keep root!
- Flashable via EXKM, FKM or TWRP (if available) on a rooted system!
Flashing Guide, Download and Changelog
Requirements:
- unlocked Bootloader
- USB-Debugging in developer options enabled
- latest adb and fastboot binaries
- working adb and fastboot environment
- magisk root
- a backup of stock boot.img or your magisk patched boot.img in case you want to go back to stock.
How to flash the Kernel:
1. Download the latest kernel.zip and make sure you have properly updated to the latest matching Firmware (check the feature list for the current firmware the source is based on). When there´s an OTA update for the Sony Xperia 1 IV it takes Sony a while to release the source code for the new OS and me a while to build a new kernel. If you don´t want to face any issues, wait until I either release an updated kernel or give green light because there were no kernel changes.
If you want to be sure there are no issues, always make sure to run the firmware the kernel is built for!
If you feel adventurous and try in advance, make sure you have a backup ready!
2. Flash the kernel.zip via latest TWRP (if available), EXKM or FKM app and do a full reboot.
3. Reboot and profit.
DOWNLOAD:
Download is located always in this folder, or attached to the release posts in case AFH is wonky.
https://www.androidfilehost.com/?w=files&flid=335705
Important: Read after Download
Please take a look at the second post after flashing the kernel!
Changelog:
Android 12
1.0.0 Initial Release
Android 13
1.0.0 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-87711541
1.0.1 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-87945391
1.0.3 https://forum.xda-developers.com/t/...-xperia-1-iv-aka-nagara.4480653/post-88241223
Donations:
Donations are not mandatory but very welcome if you want to support development or just buy me a coffee/tea
If you like my work: http://paypal.me/freak07
Credits:
Sony for the development device, giving me the opportunity to create this project!
@osm0sis for all his work, including the ak3 installer!
@tbalden for being the best HTC, Pixel, OnePlus and now Asus wingman!
@LeeDroid and @mwilky for their awesome roms and work I used on multiple devices!
@Captain_Throwback for all the mentoring and guidance!
@Eliminater74 for bringing me into the game and the Inspiration
@nathanchance for his upstream guidance and assistance
@RenderBroken for helping me out
@flar2 for all his work
@joshuous for all the help he provided to me in the past!
@arter97 for giving me advice
@kdrag0n for his help and advices!
@topjohnwu for magisk!
Source Code: https://github.com/freak07/Kirisakura_GKI_Nagara
F.A.Q:
Question: Is root preserved when flashing this kernel?
Answer: Yes, the AnyKernel.zip will detect root and keep it.
Question: Safetynet does not pass on my phone since I unlocked the phone, why is this so?
Answer: Google introduced hardware backed attestation recently. Unfortunately the old kernel tricks to still get safetynet passing won´t work. Instead you will have to rely on some magisk modules. Short guide in post #4 below.
Question: How do I return back to stock or another kernel.
Answer: Extract boot.img from the matching firmware you are on (you can do so by using this tool or similar ones found on XDA and when googling around) and flash via fastboot. If you want to keep root flash back the magisk_patched_boot.img. Or dirty flash your rom and re-root.
Question: Why is having Magisk installed mandatory for this kernel?
Answer: The kernel uses a ramdisk overlay to apply some settings after boot. If you are not rooted these settings will not get applied and you miss some of the optimizations.
Question: How to report bugs properly?
Answer: Have a look at post #3 in the linked thread. The linked guide is a pretty good starting point.
Before reporting any bug make sure you´re running on a stock configuration. That´s means you´re not using any mods, tweaks in kernel managers or other root tweaks , magisk modules, scripts or other modifications that alter various functions like sound mods, data traffic, sleeping behaviour, scheduler, magical battery tweaks etc.
Try to describe the issue as detailed as possible! Give your exact setup, like rom, magisk version, kernel version.
Is the issue reproducible? Does it happen frequently?
Provide logs, otherwise debugging is a lot harder. If you can already reproduce the issue and provide logs it greatly limits the amount of time I have to spent until I figure out how to reproduce it.
Feature Documentation:
Here´s a brief documentation about some of the features included in the kernel that can be changed as the user desires.
They can be accessed via either terminal, scripts or for example EXKM manager ( tools -> user settings).
CPU-Frequency Limiting:
Another option is CPU-Freq Limiting. You can now limit the CPU frequency to a few different levels with a sysfs interface. Original implementation is from @tbalden, I only changed it to be accessible via traditional root methods.
Main Switch:
sys/module/cpufreq/parameters/batterysaver
Set this option to "1" to enable the feature
Max-Frequency Selection (Input boosts, such as scrolling boost or app launching boosts will still apply, if touch boost restriction is not set to 1)
sys/module/cpufreq/parameters/batterysaver_level
Set this to "1" to restrict the max CPU-Freqs to 1,6GHZ/1,9GHZ/2,22GHZ (Little Cluster/Big Cluster/Prime Core)
Set this to "2" to restrict the max CPU-Freqs to 1,4GHZ/1,6GHZ/1,8GHZ (Little Cluster/Big Cluster/Prime Core)
Set this to "3" to restrict the max CPU-Freqs to 1,1GHZ/1,1GHZ/1,1GHZ (Little Cluster/Big Cluster/Prime Core)
Touch-Boost Restriction
sys/module/cpufreq/parameters/batterysaver_touch limiting
Set this to "1" to restrict the powerhal from boosting over the limit defined in batterysaver_level
Set this to "0" to allow the powerhal to boost above the values defined in batterysaver_level, but only during interaction with the Phone!
Screenshots:
View attachment 5309899View attachment 5309901View attachment 5309903
This is for example very useful during gaming to prevent additional heat, if not the highest performance from the CPU is required. Check if the game is running fine on level 1 or 2, and you´ll notice much less heat. Powerdraw will be reduced as well.
Another very useful trick while doing video calls or long extended navigation sessions with google maps to preserve battery or keep the phone from heating. Especially during summer if the ambient temperatures are high.
This is a very easy way to preserve battery or reduce heat without toggling the battery save mode in settings as that restricts background data usage, which can lead to delayed notifications.
How to pass Safetynet after unlocking the bootloader
With the introduction of hardware backed safetynet attestation, passing safetynet has become a lot more complicated.
Some probably remember a while ago, flashing a kernel that forced some flags was enough to pass it. However these days are gone.
Below is a short guide how to pass safetynet on phones that are flagged to use HW attestation (such as the ROG 5).
1. Make sure you´re running latest magisk canary.
2. In Magisk Manager enable both zygisk and deny list.
4. Download the latest Universal Safety Net Fix from @kdrag0n ´s github for zygisk cand flash it in Magisk Manager. Reboot.
5. Profit
Oh, my God! thank you so much for making the IV kernel
am I right to assume that CPU frequency limiting can help the phone not overheat when taking photos?
You are Awesome
tomatoketchup said:
am I right to assume that CPU frequency limiting can help the phone not overheat when taking photos?
Click to expand...
Click to collapse
yes. it should at least slow down the heat buildup. that´s the main goal behind it.
please note that 4k 120fps recording or other demanding tasks might not work without stutters if CPU gets restricted too much.
Apart from app loading times, if the usage is not super demanding level 3 works without major stutters in the UI on 120fps refresh rate.
htcmage said:
Oh, my God! thank you so much for making the IV kernel
Click to expand...
Click to collapse
Thaiban said:
You are Awesome
Click to expand...
Click to collapse
Freak07 said:
yes. it should at least slow down the heat buildup. that´s the main goal behind it.
please note that 4k 120fps recording or other demanding tasks might not work without stutters if CPU gets restricted too much.
Apart from app loading times, if the usage is not super demanding level 3 works without major stutters in the UI on 120fps refresh rate.
Click to expand...
Click to collapse
excellent <3, I don't need 4K 120fps recording I actually only do 1080p 24 because I like stabilization. so going to flash 64.0.A.8.25 and this kernel after that. million thanks!
It's a small amount, but I donated it, thank you always
htcmage said:
It's a small amount, but I donated it, thank you always
Click to expand...
Click to collapse
Thank you very much! I greatly appreciate it.
Hahaha... Hello my good friend @Freak07. Didn't know you were into Sony as well.
@Freak07 can you port it to xperia pro i ?
Developer, I have a question
If I use my work profile (shelter or island apk) I can't get into the settings menu I get a popup stating that the system UI is shutting down, maybe it's kernel related?
Should I uninstall Uperf before flashing?
Also thanks for this excellent work.
great work!Thx
to those who flashed, how is battery live ?
ist compüatible with latest sony update?
Would be interested to know, if it supports the old android kernels feature to emulate CD and DVD. Its a feature that DriveDroid needs to emulate a bootable DVD drive from an *.ISO hosted from an android device over USB. it was present in my older devices until XZ1 Compact and i was able to boot my pc off from a iso file hosted on my android device. It was much convinient than using silly PXE boot over eth0
No more update ?
Mrxyzl said:
No more update ?
Click to expand...
Click to collapse
OP will update when new Kernel sources are released and he has time. Mentioned in the first post.

Categories

Resources