Hello guys!
This script is originally come from the Juwe11 ramscript but its far more advanced now, so i decided that make an own thread for this.
This script is an init.d script for our O2X but working with many other phones too. Working with every ROM what is supported init scripts. However optimized and working best with the ironkernel because some option is based on this kernel ramhack. Its working any other kernels too but may be need to adjusted some parameters.
The script started the configuration options:
1)
SMODE
if this set to on the script will be change many parameters in the proc filesystem, otherwise not however some part of the script is unaffected of this!
2)
LMKMODE and LMKVAL
lowmemorykiller and basic memory management tweak
if the LMKMODE value is on the basic_mem_tweak procedure will called.
if the LMKMODE is on then the LMKVAL define the lowmemorykiller mode.
you can change this static values:
def: stock values 2048,3072,4096,6144,7168,8192 (CM7)
std: standard values 1536,3072,4096,7680,8960,10240 (recommended for low memory models <256MB)
opt: optimum values 1536,2048,4096,10240,12800,15360 (recommended for the most)
str: strict values 1536,2048,4096,15360,17920,20480 (best for heavy multitasking)
aggr: aggressive values 1536,3072,4096,21000,23000,25000 (our O2X will handle this without problem)
extr: extreme values 1536,3072,4096,38400,40960,43520 (recommended for heavy HD games)
ult: ultimate values 1536,3072,4096,51200,57600,64000 (use with caution! only for high-end devices!)
or you can use the 'auto' values.
lowmemorykiller auto management is depend on the total memory size. if you are using stock rom then this value set to aggressive by automatic because the freeing the memory is important.
if you are familiar with ironkernel and using some of the ramhack version then this value is more softer then the total memory is increasing (more memory dont need so strong garbage collection)
lowmemorykiller parameters intact when the SMODE is off
3)
NETTWEAKS
its affected the tcp/ip procs and some kernel parameters. helping that the phone network will working faster and better
network parameters intact when the SMODE is off
4)
VMTWEAKS, COMPCACHE, CS_SIZE, CS_RATIO, INTERVAL
this part is the memory management
vmtweaks will disable normalized sleeper and change many values in the /proc/sys/vm.
vm parameters intact when SMODE is off
COMPCACHE will enable the compcache (i know CM7 supported this but its not working some case if you are using the cm settings menu)
CS_SIZE determine the compcache memory size. im using only the zram device for the compressed memory, this dont making any swap file on the block devices.
if CS_SIZE is set to auto then you can define the CS_RATIO. this parameter define the amount of the total memory what can be used as compcache. so in this case the compcache size is changed dynamically. its make sense when you are using the ramhack ironkernel
INTERVAL define that the period of the force cache drop. if you are using compcache it can be helped avoid that the phone become laggy after a while.
5)
MTWEAKS and SCHEDULER
MTWEAKS procedure will remount every partition with noatime,nodiratime,commit=180,noauto_da_alloc
and adjust many parameter what is related to the block devices
SCHEDULER will define the default io scheduler (its bfq by default, like in many kernels)
this script is working alone, dont need any other tweak script. every modifycation logged to /cache/tweaklog.txt in human readable format
this script will not gain extra point in any benchmark (maybe a little) if you want this you need to overlock your phone. remember that.
you can install with the cwm installer or simply copy the 90tweak file for the /system/etc/init.d/ and change the perms to 777
the required files in the attachment or in my sig
nice work!
use your script for 2 months, but somehow never created / cache / tweaklog.tht
can change the path to / sdcard / tweaklog.tht
20l + HP RC9 + pp9
20l + fps 0.2a
Great, thanks a lot!
Inviato con il P990 DjangoManouche!
PAIIITET said:
use your script for 2 months, but somehow never created / cache / tweaklog.tht
can change the path to / sdcard / tweaklog.tht
20l + HP RC9 + pp9
20l + fps 0.2a
Click to expand...
Click to collapse
sdcard is unaccessible while the init process, thats why im using the cache partition. its a small log file and recreated at every reboot.
and the name is tweaklog.txt
Can is use this with V6 supercharger?
norbee007 said:
Can is use this with V6 supercharger?
Click to expand...
Click to collapse
i dont recommended that.
vadonka said:
i dont recommended that.
Click to expand...
Click to collapse
Why not man ? With CM9 SK3 it's not so bad...
Simply because supercharger overwrite some tweak of this script
Inviato con il mio P990 DjangoManouche!
carburano said:
Simply because supercharger overwrite some tweak of this script
Inviato con il mio P990 DjangoManouche!
Click to expand...
Click to collapse
Eh ok buon uomo
But it's very fast with V6SC - Param 8
I'm testing it in latest ICS and it sounds good.
There'll an update of Vodonka's scrip for ICS roms too ?!
i cant find a tweaklog.txt either.
any ideas?
Little question... This script, when flashed from CWM,
works in ICS roms ?
PYCON said:
Little question... This script, when flashed from CWM,
works in ICS roms ?
Click to expand...
Click to collapse
no
dont use with the ics, its interfered many things.
will this work on stock V20q?
Related
======
Preface
======
The script is actually Base on Juwe11's RAM script
which you can found here... http://forum.xda-developers.com/showthread.php?t=1111145
==========
Main Content
==========
The adj value of his script is a bit too tight for Our O2X...
so the Launcher is killed quite often if many apps opened in the background.
Here's the adj value changes I made, originally, Juwe11's values are..
"0,1,2,4,6,15" and I change it to, "0,1,2,7,8,9"
the forth value is for HIDDEN_APP_MIN_ADJ, which including the Launcher (I'm using LauncherPro) belongs to this category when you open some foreground application.
the default android value for this is also 7, and I find the OOM value for Launcher is 6 usually... so Juwe11's "4" will lead to our Launcher being Killed, keep it at 7, never tried to have mine killed yet.
The last 2 vaule just make sure the last category EMPTY_APP_ADJ is kill earlier than the previous..
About the minfree vaule...
I change it to "1536,3072,4096,7680,8960,10240" which actually the same values of "Moderate preset" of autokiller
which is enough to ensure most RAM being use before killing for faster task switching...
=====
Credit
=====
!! Credit goes to Juwe11 for his mighty RAM script~ !!
Backup your RAMscript and remove it to somewhere before install this...
install via CWM, it will put the script into your /etc/inti.d/ that's it, boot and try
i just installed it,
i will let u know what are the results,
u are correct, the original script kills the launcher and apps specially XDA
will try this configuration on auto killer memory seems good m8 to set it to moderate
shpapy said:
i just installed it,
i will let u know what are the results,
u are correct, the original script kills the launcher and apps specially XDA
Click to expand...
Click to collapse
I'm not sure if other Launcher would have a different OOM value~
I have Autokiller memory optimizer which I paid before...so I can view OOM value easily..
But with this Script... I guess really no task killer needed for our 2X already.
antec123 said:
will try this configuration on auto killer memory seems good m8 to set it to moderate
Click to expand...
Click to collapse
so, just edit the minfree value according to the values inside AutoKiller if you find some other setting suits you more
but about the adj value... I guess that part is already good enough
now I find my phone already got around 60-90 free RAM at any time...
Multiple games running at the background while web browsing...
and the Browser usually got a higher OOM, which tends to kill earlier than Games..
it is reasonable.. as the WEB you can load again with the same URL..
while the game got killed, you lost the state... android is doing it's work nicely I guess.
best memory managment script i have tryed is v6supercharger http://forum.xda-developers.com/showthread.php?t=991276
I think its the best of the best.
orlox said:
best memory managment script i have tryed is v6supercharger http://forum.xda-developers.com/showthread.php?t=991276
I think its the best of the best.
Click to expand...
Click to collapse
I tried both V6 and Juwe11's before...
and I manage to be patient enough to follow step by steps...
for installing so many things... and it just put a script in init.d at the end...
And I found it do not contain adj value in it, so I come back to Juwe11's
but anyway, this is your choice...
thanks for that script
just a quick question
would this script also work on a sgs2, running oxygen aosp stock rom?
pa.pn2 said:
thanks for that script
just a quick question
would this script also work on a sgs2, running oxygen aosp stock rom?
Click to expand...
Click to collapse
same as Original Juwe11's version.
it was suppose to work on any ROM which support init.d
but the values may need some tweaking accordingly.
squide said:
I'm not sure if other Launcher would have a different OOM value~
I have Autokiller memory optimizer which I paid before...so I can view OOM value easily..
But with this Script... I guess really no task killer needed for our 2X already.
Click to expand...
Click to collapse
Sorry to let you down. But the results are the same......
Sent from my LG-P990 using XDA App
squide said:
I tried both V6 and Juwe11's before...
and I manage to be patient enough to follow step by steps...
for installing so many things... and it just put a script in init.d at the end...
And I found it do not contain adj value in it, so I come back to Juwe11's
but anyway, this is your choice...
Click to expand...
Click to collapse
adj values are in /data/SuperChargerAdj while minfree values are in /data/SuperChargerMinfree.
it's just a script in init.d at the end, you only need to follow it step by step...
squide said:
so, just edit the minfree value according to the values inside AutoKiller if you find some other setting suits you more
but about the adj value... I guess that part is already good enough
now I find my phone already got around 60-90 free RAM at any time...
Multiple games running at the background while web browsing...
and the Browser usually got a higher OOM, which tends to kill earlier than Games..
it is reasonable.. as the WEB you can load again with the same URL..
while the game got killed, you lost the state... android is doing it's work nicely I guess.
Click to expand...
Click to collapse
i set the preset to moderate and get about 126-128mb on free ram pretty impressive and the stock browser don't get close so quickly nice! i use v10e ESA and neoblaze kernel
Works on CM7?
_Vegas said:
Works on CM7?
Click to expand...
Click to collapse
it should work on all ROM supporting init.d
in case you don't like it, go to /etc/init.d to remove the script and reboot.
it wont modify your file system..
it just override some system value on boot.
if you removes the script.. your phone would back to the state before you install this.
so, just try see if u like, if not, delete it, reboot, that's it.
Works really nicely on CM7 nightly.
Sent from my Optimus 2X
Bit of a Dumb question but my phone still has the Stock rom and doesn't have the init.d Folder
if I created /system/etc/init.d and copied the script into that would this work?
waynefox said:
Bit of a Dumb question but my phone still has the Stock rom and doesn't have the init.d Folder
if I created /system/etc/init.d and copied the script into that would this work?
Click to expand...
Click to collapse
Sorry, no. You need a custom rom of some sort to get init.d support.
TrymHansen said:
Sorry, no. You need a custom rom of some sort to get init.d support.
Click to expand...
Click to collapse
You need a Custom Kernel supporting init.d to be more accurate.
and NeoBlaze is a good one to try with.
if you really need to keep your stock ROM..
First of all you still need to root your phone
Install ROM manager from market
flash the Clockworkmod via ROM manager
install NeoBlaze Kernel, then you're ready.
if warranty is your concern, take a look to the Nvflash thread..
O2X is ALMOST unbrickable, almost.
squide said:
You need a Custom Kernel supporting init.d to be more accurate.
and NeoBlaze is a good one to try with.
if you really need to keep your stock ROM..
First of all you still need to root your phone
Install ROM manager from market
flash the Clockworkmod via ROM manager
install NeoBlaze Kernel, then you're ready.
Click to expand...
Click to collapse
I'm pretty sure that won't work. You need ROM-support as well. (A Ramdisk script which starts the init.d. thing to be even more accurate.) Feel free to prove me wrong.
TrymHansen said:
I'm pretty sure that won't work. You need ROM-support as well. (A Ramdisk script which starts the init.d. thing to be even more accurate.) Feel free to prove me wrong.
Click to expand...
Click to collapse
Ramdisk is a part of the kernel, so if you bung a kernel that supports init.d on (any) rom it'll run what's in there assuming it's eXecutable.
You can do it on the stock rom even, as long as you have a init.d kernel (and create the entries in ../etc/init.d/).
Although I can't "prove" this to you at the moment...
Upon request from fellow member ascariz on the smartassV2 governor, I've compiled intellidemand module for Arc 4.0.3 stock kernel.
Since the firmware I use is the Arc S one (ICS 4.0.3) - I believe this module will also work for Arc S.
To fully configure / install the module, please check this page for a similar module I did for X10 back in the days - page.
Some things are different, but if you want to hand customize all possible parameters after phone starts up, the path to check is
Code:
/sys/devices/system/cpu/cpu0/cpufreq
Download:
Use it at your own risk!
cpufreq_intellidemand_arc_ics.zip
Enjoy!
Awesome. Not trying to be greedy but can we have BoostedAssV2 too ? xD
viulian said:
Upon request from fellow member ascariz on the smartassV2 governor, I've compiled intellidemand module for Arc 4.0.3 stock kernel.
Since the firmware I use is the Arc S one (ICS 4.0.3) - I believe this module will also work for Arc S.
To fully configure / install the module, please check this page for a similar module I did for X10 back in the days - page.
Some things are different, but if you want to hand customize all possible parameters after phone starts up, the path to check is
Code:
/sys/devices/system/cpu/cpu0/cpufreq
Download:
Use it at your own risk!
cpufreq_intellidemand_arc_ics.zip
Enjoy!
Click to expand...
Click to collapse
OMG. you really do it?! tq mate!
After a day of testing, I'm switching back to smartassV2.
With smartassV2:
a) the time in state shows me about 16-17% at 1Ghz, and the others at 122MHz. Intermediate frequences are rarely used.
b) battery was about 40% at the end of the day with my usage (4 email accounts doing sync at 15 minutes - I'm not using push, but k9 connects) - also half of the day in an area where 3G signal is weak and phone swiches back and forth.
With intellidemand:
a) the time in state is 6% for 1GHz which might look better in comparison with smartassV2.
BUT:
b) the phone is sluggish and you can feel it needs a bit of time (1 second ?) to pick up speed, UI animations are choppy.
c) it does make use of the intermediate frequencies - but battery was about 20% when I got home, identical usage as previous day with smartassV2.
In both cases, screen was always kept at 25%.
Now my conclusion is that:
a) intermediate (but high) frequencies have similar battery usage as maximum frequency.
b) spending more time in an intermediate frequency makes things slower to finish and thus, based on point a) drains battery more.
Also, the code of intellidemand is more complex (.ko size is +20Kb more) as opposed to smartassV2 - and thus I guess it also takes more time (energy) to compute the correct frequency. In itself, a complex algorithm to compute the next state takes its toll.
smartassV2 does perform better with my usage pattern - and I'm curious why this governor is claimed to be advanced I mean algorithmically it surely is, but phone is more sluggish + more battery drain (not significant, but about 20% in my basic, 1 day test).
I will focus my attention on other *ass governors
flashable intellidemand. auto load on startup. all credit to viulian.
ascariz said:
flashable intellidemand. auto load on startup. all credit to viulian.
Click to expand...
Click to collapse
Can you make a flashable smartassv2 too ?
Dark Fable said:
Can you make a flashable smartassv2 too ?
Click to expand...
Click to collapse
errr...im not a module compiler like viulian. honestly, i dunno. but to make it autoload on boot & flashable, yes, as long as i have that .ko file.
ascariz said:
errr...im not a module compiler like viulian. honestly, i dunno. but to make it autoload on boot & flashable, yes, as long as i have that .ko file.
Click to expand...
Click to collapse
The .ko was already made by viulian, here ya go.
Dark Fable said:
The .ko was already made by viulian, here ya go.
Click to expand...
Click to collapse
this is intellidemand and smartassv2 modules that you can load in 2 way.
1) for those who use stock kernel that not support init.d, use script manager to load MODULELOADER script at start up. after flash, browse at system/etc/init.d folder and you will find the script.
2) for those who use kernel with init.d supported (e.g. Cobrato kernel), do nothing. just flash it and you ready to go.
ascariz said:
this is intellidemand and smartassv2 modules that you can load in 2 way.
1) for those who use stock kernel that not support init.d, use script manager to load MODULELOADER script at start up. after flash, browse at system/etc/init.d folder and you will find the script.
2) for those who use kernel with init.d supported (e.g. Cobrato kernel), do nothing. just flash it and you ready to go.
Click to expand...
Click to collapse
Doesn't work man. :/ The new governors aren't showing up in No Frills CPU..using Cobrato's kernel.
First you must use the stock kernel from Sony's official 4.0.3 release for Arc S (even if having the Arc).
Any other kernel will not work ... (or very slim chances to work).
Second, please check using Module Loader app (but only activate the boot time loading of the module after you are sure the things work).
viulian said:
First you must use the stock kernel from Sony's official 4.0.3 release for Arc S (even if having the Arc).
Any other kernel will not work ... (or very slim chances to work).
Second, please check using Module Loader app (but only activate the boot time loading of the module after you are sure the things work).
Click to expand...
Click to collapse
I have the ARC S lol, and Cobrato's kernel is Stock 4.0.3 kernel with init.d support.
http://forum.xda-developers.com/showthread.php?t=1591279
Hmm...I thought you didnt have to use module loader for the flashable zips ? :/ Because the module loader shows 'Starting modules...' in the middle of any game (Like Temple Run) and it begins to lag horribly, this pisses my friends off. I want to show them how great a phone Arc/S is. :/
Ok, if it has the same version number then it will load the modules ok (as well as having the same binary kernel image).
I think the OS kills Module Loader to regain some memory, then starts it back when memory level gets better (kills it when game / heavy app starts, then as memory becomes available, it starts it back). But Module Loader has a bug and when started also loads the modules
Another solution is to use Script Manager ( http://www.androidsoftware.us/Applications/Script-Manager.html ) to run a script at boot (a small script that just do the insmod).
Hope it helps...
viulian said:
Ok, if it has the same version number then it will load the modules ok (as well as having the same binary kernel image).
I think the OS kills Module Loader to regain some memory, then starts it back when memory level gets better (kills it when game / heavy app starts, then as memory becomes available, it starts it back). But Module Loader has a bug and when started also loads the modules
Another solution is to use Script Manager ( http://www.androidsoftware.us/Applications/Script-Manager.html ) to run a script at boot (a small script that just do the insmod).
Hope it helps...
Click to expand...
Click to collapse
Thank you for your quick response. [: I know about script manager, can you please provide me with the script to use with it for the modules and a how to ? If not too much trouble that is.
Nvm, got it, thanks.
Dark Fable said:
Doesn't work man. :/ The new governors aren't showing up in No Frills CPU..using Cobrato's kernel.
Click to expand...
Click to collapse
err...it should work man..i used JJ hybrid rom, and the modules shows up in the rom control..maybe you should try app other than no frills..
I want to know how to create different types of init.d scripts
Right now I need a LMK init.d script, so that I won't lose values on each reboot while using CM10.2
Shiningb said:
I want to know how to create different types of init.d scripts
Right now I need a LMK init.d script, so that I won't lose values on each reboot while using CM10.2
Click to expand...
Click to collapse
I think the best way it to search XDA. For example, I have no idea how to do it. :angel:
@Shiningb
Code:
echo '2048,3584,20736,24064,27136,30464' > /sys/module/lowmemorykiller/parameters/minfree
You can also use supercharger script to change your minfree values.
EDIT : Sorry quoted the wrong person.
So I just modify those values to:
4mb 8mb 16mb 32mb 48mb and 64mb
Which is the moderate values of OMNI, right??
I always modify my LMK values with Super Manager, these values work with cm only, using it on stock will result in super laggy performance...
If i remember right, is 48mb for CM and Omni.
Powered by CM10.2
Development Goals:
- stability
- energy savings due to more efficient ARM algorithms
- strictly no overclocking unless approved by the manufacturer or my source base integrates it (also, even if my source base integrates it, expect no support for it)
- no undervolting as well unless the manufacturer approves it since it's relatively pointless IMHO...
- all improvements should require MINIMAL user interaction (e.g. you don't need to do anything except flash the kernel or at the very least use SetCPU or the like to set fixed options)
- stability
*note: FAQ is at the 3rd post
20151018_20XX:
- some ramdisk cleanups for single image
- enabled KSM and ZRAM swapping for increased memory flexibility
20151015_15XX:
- added in partial resume support for *hopefully* better battery life
- tweak cubic algorithm just in case it's needed
20151003_20XX:
- added F2FS support (refer to 3rd post for MANUAL instructions on how to convert a partition to F2FS)
20151001_10XX:
- uploaded to personal site with updated compiler
20150922_16XX:
- tons of commits to improve power efficiency...just go to my GitHub...
20150831_19XX:
- added FIOPS IO scheduler and set it as default
- set FS options NOATIME and NODIRATIME always
- use 4k kernel stacks to save memory
20150815_18XX:
- first release for "back-to-basics" kernel
- turned off a ton of debugging options to improve performance
20150726_17XX:
- upgraded compiler
20150723_00XX:
- fixed bootloop while charging
20150702_23XX:
- modified ramdisk to support wifi properly on v2 of LeeDroid's Urbane port
20150623_22XX:
- more backports for improved efficiency
- changed kernel compression to XZ to make it even smaller
- limited maximum CPU frequency to 1Ghz to lower power consumption for multi version since mpdecision keeps on using max frequency too much
20150621_21XX:
- additional IPI reduction commits
- changed kernel compression to LZMA to make it smaller
20150620_17XX:
- reverted partial resume studies (seems to cause slowdowns somewhere but might also cause slightly more battery consumption)
- comment some printouts which are annoying
- kernel IPI improvements
20150617_23XX:
- minor improvements to reduce CPU load
- WiFi tweak
- rendering optimizations
20150612_08XX:
- added new feature for users of Urbane ROM which *might* also fix the bootup problem
20150611_09XX:
- added new image, wifi.multi.boot.img, which is multicore and with built-in wifi support so no need to flash Tasssadar's MOD when you upgrade the kernel (from an already modded ROM or from Urbane port)
***IF YOUR ROM IS NOT YET MODDED, DON'T USE THE WIFI.MULTI RELEASE SINCE IT MIGHT CAUSE AN ERROR WHEN YOU RUN TASSSADAR'S UPDATE ZIP***
20150607_09XX:
- back to usual local version tag
- rebased to newly released 5.1.1 Lenok branch on AOSP with some additions from Bass branch for WiFi throughput and energy saving
20150602_23XX:
- compiled using GCC 5.1
- special local version tag
20150602_08XX:
- modified panel to disable partial update since it seems to cause problems with current code (i.e. it disabled burn-in protection)
- special local version tag
20150531_18XX:
- removed a useless setting in the ramdisk which might cause increased CPU utilization thus less battery life
20150531_15XX:
- just added a new flashable image, multi-core for those who want...strictly for testing for now...I won't be responsible if your device explodes or burns off your wrist or something...
20150531_08XX:
- modified configuration with changes in Bass
- imported clock change for WiFi from Bass
20150530_08XX:
- has WiFi driver built-in waiting for ROM builders or modders to take advantage of
*we have WiFi here!
- first release for 5.1.1 based on Bass (Urbane) kernel source that was just released
20150503_16XX:
- rolled back previous changed as it increased battery consumption
20150423_23XX:
- ported one of my Kindle Fire modification which I just remembered could impact performance extremely well
- still has SELinux enabled as stock ROM doesn't play well with it disabled
20150412_21XX:
- numerous backports from linux 4.0 for timer, scheduler and ARM
20150411_21XX:
- numerous backports from linux 4.0 for timer, mutex and slub functionality performance improvements
20150411_19XX:
- tweaked kernel settings according to imoseyon's findings
20150410_18XX:
- timer optimization
20150409_00XX:
- merged Motorola's lowmemorykiller tree modification
- merged latest modifications to ondemand governor
20150402_07XX:
- uses updated Linaro toolchain
- integrated 5.0.2 changes in the kernel level (previous change was on the ramdisk level)
- some performance improvement commits
20150220_23XX:
- integrated changes for 5.0.2
*since changes were minimal, this might still work for 5.0.1...do that at your own risk though...
20150129_22XX:
- cherry-picked a patch for fixing the randomly occuring kernel BUG OOPS in smp_send_reschedule
20150127_22XX:
- fully tickless kernel
- adjust compiler tweaks even further
- reduce panel power consumption
20150117_18XX:
- updated my compiler with 15.01 Linaro gcc release source
- tweaked more compiler flags for maximum performance
20150112_22XX:
- first release with 2 kernels for single and dual core by default setup
- first release using my own compiler
- additional compiler flag optimizations
- merged NVidia power efficiency patches together with a scheduler optimization
20150103_18XX:
- enabled 2 cores and set to ondemand with maximum frequency limited to 800Mhz
- added several improvements from arter97's G Watch repo namely ARM instruction conversion to bx from mov pc, definition of L1 and L2 cache size for better compiler instruction generation and binder mutex change to real time for surfaceflinger improvement (in layman's term: graphics rendering improvement)
20141221_18XX:
- use compile time constants when possible for jiffies conversion
- several BT and i2c voltage tweaks to lower power consumption
20141217_00XX:
- same features as before only for Lollipop
20141206_07XX:
- enabled partial frame updates to hopefully improve screen power consumption
*not sure though since it might actually need ROM backing to work
20141203_17XX:
- added some filesystem optimizations
- compiled using Linaro 4.9.3
20141130_14XX:
- initial public release
- uses Linaro 4.9.2 for compilation
- enable use of UDIV/SDIV ARM instructions
- build-in byte-swap function
- memutils optimizations
- memcopy and string libraries now use glibc implementations
- optimized copy_page functions for ARM
Disclaimer:
Flash at your own risk.
You can find my other kernels at:
http://intersectraven.net/kernels
GitHub is at:
XDA:DevDB Information
intersectRaven's G Watch R Kernel, Kernel for the LG G Watch R
Contributors
intersectRaven
Kernel Special Features:
Version Information
Status: Stable
Created 2015-02-22
Last Updated 2015-02-22
Special Thanks To:
DooMLoRD - some patches I integrated are from his repo
faux123 - some patches I integrated are from his repo
arter97 - some patches I integrated are from his repo
imoseyon - kernel tweaks
lion567 - F2FS enabled TWRP recovery in 3rd post
Other devs I neglected to mention.
FAQ:
1.) How do I flash this on my device?
Use the "fastboot flash boot" command since I don't really have the time to support creation of a recovery flashable file. Optionally, you could also use the "fastboot boot" command to use the boot image temporarily which will reset to stock after a restart.
*also, this device does not have a custom recovery *YET* as of the time of this thread's creation
2.) How do I return to stock kernel?
Use the "fastboot flash boot" command using the stock boot image I provided in another thread here.
3.) Will you be releasing frequent updates?
Right now I don't see anything else needed to improve this kernel as I am quite satisfied with it. You could post suggestions BUT they must have MINIMAL USER INTERACTION or will only seek to enable editing of certain values.
4.) How do you verify that it flashed correctly?
Well, if it booted after fastboot showed the "writing" dialog, then it should be ok already. If you're ultra paranoid that maybe fastboot is lying to you or the NSA doesn't want you to know that it didn't overwrite the stock kernel which contains their secret spy stuff that wants to know how frequently you exercise you could enter the ff. command through adb:
cat /proc/version
and the kernel should show #7 and intersectRaven there together with the date that the kernel was compiled which is what I use to indicate the release.
5.) I see two files at the link above. What should I flash?
In the site you'll see single.boot.img, dual.boot.img, multi.boot.img and wifi.multi.boot.img. This indicates how many cores are enabled by default upon boot and if it's wifi ROM ready. If you're a heavy user, you might want to go with dual.boot.img so that you have 2 cores available or maybe multi.boot.img so that it'll adjust to at most 4 cores WHEN NEEDED. If you just use your watch for notifications and want maximum power savings, use single.boot.img.
6.) What about the wifi.multi.boot.img?
This is mainly for an ALREADY MODDED ROM (by Tasssadar) OR the URBANE ROM. With this, when you flash you won't need to rerun the update.zip provided by Tasssadar. Again, ONLY RUN THIS ON AN ALREADY MODDED ROM. If you flash this then run Tasssadar's Mod, you WILL encounter errors.
6.) If I flash the single boot image am I stuck forever with just one core being enabled?
No. If your watch is rooted, you can enable a core (even all 4 if you wish) through adb. The boot images are merely separated for bootup default convenience.
7.) How do you enable WiFi?
Go here.
8.) How do you convert a partition to F2FS?
a.) Download the mkfs.f2fs file here.
b.) Download a custom recovery somewhere and boot it.
c.) Push mkfs.f2fs somewhere. (tested on /sbin directory)
adb push mkfs.f2fs /sbin/
d.) In adb, issue a mount command to find the partition you wish to format.
*note, you can only format cache and userdata partitions and IF you choose to format the userdata, that's equivalent to a factory reset
adb -> mount
e.) Issue the ff. command replacing the X part with the partition you wish to format:
mkfs.f2fs -l X
e.g. mkfs.f2fs -l cache /dev/block/mmcblk0p20
f.) Reboot.
OR use this modified TWRP by lion567!
Reserved 3
I see you disabled secure booting, any idea how to get this device rooted? I made a kernel myself and disabled secure booting but I can't seem to figure out the root shell part, I pushed su to /data/local/tmp and set permissions but I still cant move it to system/bin..... frustrating
tonu42 said:
I see you disabled secure booting, any idea how to get this device rooted? I made a kernel myself and disabled secure booting but I can't seem to figure out the root shell part, I pushed su to /data/local/tmp and set permissions but I still cant move it to system/bin..... frustrating
Click to expand...
Click to collapse
I didn't disable secure boot I only replaced the kernel with my own. The ramdisk is exactly the same with stock. As for rooting, it's a bit tricky now due to SELinux being enabled. You could try disabling SELinux but that isn't really recommended. Also, I don't think modifying the system partition is good practice. You could just put it in the ramdisk so that it's recognized immediately as being "inside". I'll try and look into it further when I have time. I'm still looking at the battery consumption of my latest kernel for a few days so I can't modify until then.
What do you mean by putting it in the ramdisk so its "inside"? I tried to do something like that with rootsh but it didn't work. Also when I unmkbootimg'ed your kernel it had stuff from dory, isn't dory the regular lg g watch? We are lenok? I know a lot of the stuff is the same, the main goal I want to do is root so I can increase the vibration motor, but if I can't accomplish root easily I will be forced to make my own custom system.img with the modified values...... that would be a pain to be able to share it.
tonu42 said:
What do you mean by putting it in the ramdisk so its "inside"? I tried to do something like that with rootsh but it didn't work. Also when I unmkbootimg'ed your kernel it had stuff from dory, isn't dory the regular lg g watch? We are lenok? I know a lot of the stuff is the same, the main goal I want to do is root so I can increase the vibration motor, but if I can't accomplish root easily I will be forced to make my own custom system.img with the modified values...... that would be a pain to be able to share it.
Click to expand...
Click to collapse
Are you pertaining to the ramdisk or the kernel? I double-checked the ramdisk and there isn't any dory in there. As for the kernel, I used the lenok_defconfig so I don't really know if there is dory in there as well although they are derivatives so might be. I read your post in the other thread and it doesn't really need root to modify. You just need to give the user permission to those parameters so it can be changed through adb.
intersectRaven said:
Are you pertaining to the ramdisk or the kernel? I double-checked the ramdisk and there isn't any dory in there. As for the kernel, I used the lenok_defconfig so I don't really know if there is dory in there as well although they are derivatives so might be. I read your post in the other thread and it doesn't really need root to modify. You just need to give the user permission to those parameters so it can be changed through adb.
Click to expand...
Click to collapse
If only I knew how . Do I gotta edit init.d?
intersectRaven said:
. As for rooting, it's a bit tricky now due to SELinux being enabled.
Click to expand...
Click to collapse
so... we dont have root never? :S
i ll flash ur kernel, thanks!
tonu42 said:
If only I knew how . Do I gotta edit init.d?
Click to expand...
Click to collapse
I think the last time I did that I edited something in ueventd or something and not init.d although you could do that also. I'll have to check on what's the current best practice as I don't really like editing the ramdisk too much.
9ain said:
so... we dont have root never? :S
i ll flash ur kernel, thanks!
Click to expand...
Click to collapse
We'll have root eventually as more devs get the R but as of this time, no root yet!
*Personally, I don't get the point of rooting the watch as it's got huge limitations (battery, screen, controls, etc.) that I don't see the point...but that's me...
intersectRaven said:
I think the last time I did that I edited something in ueventd or something and not init.d although you could do that also. I'll have to check on what's the current best practice as I don't really like editing the ramdisk too much.
We'll have root eventually as more devs get the R but as of this time, no root yet!
*Personally, I don't get the point of rooting the watch as it's got huge limitations (battery, screen, controls, etc.) that I don't see the point...but that's me...
Click to expand...
Click to collapse
i want to change dpi
I want to change the vibration strength and duration!
Gesendet von meinem SM-N9005 mit Tapatalk
cybermungo said:
I want to change the vibration strength and duration!
Gesendet von meinem SM-N9005 mit Tapatalk
Click to expand...
Click to collapse
its the same thing xD
9ain said:
its the same thing xD
Click to expand...
Click to collapse
Ah ok...
Gesendet von meinem SM-N9005 mit Tapatalk
cybermungo said:
Ah ok...
Gesendet von meinem SM-N9005 mit Tapatalk
Click to expand...
Click to collapse
No its not, strength and duration are two totally different setting files and methods in the kernel driver. It also has braking_ms which is the gap you notice in between vibrations.
tonu42 said:
No its not, strength and duration are two totally different setting files and methods in the kernel driver. It also has braking_ms which is the gap you notice in between vibrations.
Click to expand...
Click to collapse
The duration is what causes the motor to accelerate more and be more strength.... more duration=more strength (Until maximum possible).
/sys/class/timed_output/vibrator/amp
/sys/class/timed_output/vibrator/driving_ms
this is the files to change (we need root)
9ain said:
The duration is what causes the motor to accelerate more and be more strength.... more duration=more strength (Until maximum possible).
/sys/class/timed_output/vibrator/amp
/sys/class/timed_output/vibrator/driving_ms
this is the files to change (we need root)
Click to expand...
Click to collapse
You listed two files. Go look in the kernel and look at the driver. Amp is related to the gain and the gain is in mV i believe. Of course increasing the duration will also make it feel stronger so increasing both helps.
9ain said:
The duration is what causes the motor to accelerate more and be more strength.... more duration=more strength (Until maximum possible).
/sys/class/timed_output/vibrator/amp
/sys/class/timed_output/vibrator/driving_ms
this is the files to change (we need root)
Click to expand...
Click to collapse
I looked at doing this but it seems SELinux is going crazy and not recognizing attempts to override the sysfs protection so we either really need root, disable SELinux altogether (don't like), or set it in the kernel (no user override which I don't think people like).
tonu42 said:
You listed two files. Go look in the kernel and look at the driver. Amp is related to the gain and the gain is in mV i believe. Of course increasing the duration will also make it feel stronger so increasing both helps.
Click to expand...
Click to collapse
Yep it's in mV with a range of 0 - 100.
My ADB cant find the watch. My thought is that it is because computer cant find drivers to the watch when I connect it. Where can I find usb-drivers for my watch?
TLDR: in Oct 2016, the patch has been merged into official Cyanogenmod / Lineage kernel sources: https://github.com/LineageOS/androi...mmit/0e899ff2828df771b524dc52f19f29c0c5cd5842
-------------------------------------------------------------------------
There has been much discussion on UI freezes / lags with CM13 on the Droid 4 in another thread which turned out to be related to some quarrel between Android lowmemorykiller (LMK), ZRAM and kswapd direct reclaim...
As a workaround, increasing extra_free_kbytes (to 75000 in my case) turned out to reduce lags a great deal. (This can be done e.g. with Kernel Adiutor Mod)
Now, I made a small kernel patch adapted from 3.4 kernel which makes LMK account for swap memory, i.e. LMK does only consider memory pages as free which won't require swapping:
Code:
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 86d5195..d4e4513 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -34,6 +34,7 @@
#include <linux/mm.h>
#include <linux/oom.h>
#include <linux/sched.h>
+#include <linux/swap.h>
#include <linux/notifier.h>
static uint32_t lowmem_debug_level = 2;
@@ -90,7 +91,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
int selected_tasksize = 0;
int selected_oom_adj;
int array_size = ARRAY_SIZE(lowmem_adj);
- int other_free = global_page_state(NR_FREE_PAGES);
+ int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
int other_file = global_page_state(NR_FILE_PAGES) -
global_page_state(NR_SHMEM);
If you want to try, just flash the following zip file via safestrap recovery over existing CM13 (both - kernel and ramdisk.img - are included): cm13_lmkpatch_v1.zip
I am not sure yet, if extra_free_kbytes can be reduced now (seemingly not, I'm still at 75000), nor if LMK watermarks can be lowered (maybe yes, I have set it to Kernel Adiutor's Agressive Profile)....
....but I'm very much interested in your findings!
If this turns out to be an improvement, I'll commit a change request to review.cyanogenmod.org
Seems that I was wrong with extra_free_kbytes and LMK watermarks for the patched kernel...
...just leave extra_free_kbytes at stock settings in the first place and maybe try Kernel Adiutor aggressive profile for LMK with empty app watermark increased to 256MB.
Also, I have another gem for you: 3.0 kernel with LMK optimizations adapted from https://github.com/XperiaSTE/android_kernel_sony_u8500/ and https://gitlab.com/k2wl/g2_kernel/
Download:
cm13_lmkpatch_v2.zip (first try)
cm13_lmkpatch_v2.1.zip (added some fixes from https://gitlab.com/k2wl/g2_kernel/commits/kitkat-mr1-rel-razrm)
...this one runs even smoother!
I have extra_free_kbytes = 16000 and LMK watermarks @ Kernel Adiutor aggressive profile and there is plenty of free RAM (around 200MB) and the phone seems to have much less trouble with running several heavy apps in parallel!
Thanks. Great job! The phone's much more responsive now, almost as on stock JB. But could this patch be integrated with Swap SDCard and undervolt mods?
rabinhood said:
Thanks. Great job! The phone's much more responsive now, almost as on stock JB. But could this patch be integrated with Swap SDCard and undervolt mods?
Click to expand...
Click to collapse
...of course. Just wait a couple of days to give us some more time for testing and optimization, I will then commit the patch to official Cyanogenmod and @joojoobee666 will integrate it into his UV kernel.
I'd also like to have more feedback from other users.
My current configuration with cm13_lmkpatch_v2.1 is:
- extra_free_kbytes = 32000 (keeping more free RAM for ZRAM decompression)
- LMK watermarks: Kernel Aduitor medium with empty app = 160MB.
Thanks. I just set 'aggresive' profile and extra_free_kbytes=16000, as you suggested before, but I'll try other settings too.
[edit]
I've found that with your patch, D4 is much, much smoother, even without Kernel Adiutor tweaks.
u.b.o.o.t said:
...of course. Just wait a couple of days to give us some more time for testing and optimization, I will then commit the patch to official Cyanogenmod and @joojoobee666 will integrate it into his UV kernel.
I'd also like to have more feedback from other users.
My current configuration with cm13_lmkpatch_v2.1 is:
- extra_free_kbytes = 32000 (keeping more free RAM for ZRAM decompression)
- LMK watermarks: Kernel Aduitor medium with empty app = 160MB.
Click to expand...
Click to collapse
Hi,
Your custom kernel and ramdisk caused my RAZR to boot endlessly. I tried the custom kernel with the default ramdisk, and the default kernel with the custom ramdisk. Both didn't work.
Bobcus Leper said:
Your custom kernel and ramdisk caused my RAZR to boot endlessly. I tried the custom kernel with the default ramdisk, and the default kernel with the custom ramdisk. Both didn't work.
Click to expand...
Click to collapse
Sorry for that but.... my kernel is for the Droid 4, only... I don't know anything about the RAZR... same hardware / device tree?
Seems that @joojoobee666 has included some magic into his builds which make it work for RAZR and Droid4 simultaneously...
But wait - in a couple of days, there should be a RAZR kernel with lmk optimizations for you to play with: http://forum.xda-developers.com/showpost.php?p=68904722&postcount=221
Hi folks,
I created a new kernel with some further optimizations.
...credits go to Motorola people at https://gitlab.com/k2wl/g2_kernel
In particular, I merged the following patches:
https://gitlab.com/k2wl/g2_kernel/commit/22d990a58fc17b3f0155e15eb2dc3efa037bea1c
https://gitlab.com/k2wl/g2_kernel/commit/7093310c60c972387b5a375ac3b407e2b04f591e
https://gitlab.com/k2wl/g2_kernel/commit/04c5d59093fa8148e9caf48c5c8b8a3f7a4db159
https://gitlab.com/k2wl/g2_kernel/commit/39eaf73c50d34287ef3c79a2b00d977655c1ceeb
https://gitlab.com/k2wl/g2_kernel/commit/dabca8deb03554f8da8d4f88774b02f004ad99c7
I also incorporated a small change from Wiko Sunny kernel which includes swapped pages when calculating the memory currently used by a process.
Download (Droid 4 only!): cm13_lmkpatch_v2.2.zip
Now, we need some further testing and I'd like to have your feedback regarding which values for extra_free_kbytes and LMK watermarks are optimal for you.
Thanks. Now I wanted to ask one, maybe silly, question. I've just installed your v2.2 mod, but since I'm really in need of traditional/normal sdcard access, I flashed SDCard-swap mod afterwards. So right now I'm using 'kernel' file from your mod, and 'ramdisk.img' from the other. Everything seems normal, and I have a feeling my D4 runs smoother than without your mod. Is it enough to flash only 'kernel' file to improve lags, or do I have some speed delusions caused by placebo effect?
The ramdisk contains kernel modules which must match the kernel. For some time I was working on a patch that also touches some core functionality of the kernel. In such a case, kernel modules & ramdisk is affected too. But I did not include these changes yet.
Hence, there should not be any incompatibility between my kernel and official CM13.0 ramdisk at the moment.
u.b.o.o.t said:
- LMK watermarks: Kernel Aduitor medium with empty app = 160MB.
Click to expand...
Click to collapse
Works really well with 2.2, thank you for this! Even without changing anything in Adiutor, the phone already responds a lot better than before. :victory:
I didn't touch extra_free_kbytes, though. Increasing it to 32000 makes starting up apps considerably slower. The default of 6075 is fine for me.
You're right - with latest patch, increasing extra_free_kbytes does not seem to be necessary anymore.
Also, lowering LMK watermarks seems reasonible now, which allows more apps to stay in memory. I'm currently using medium profile with empty app at 128MB.
what da hellllll
y dis fone so fast now? lol
good job, uboot.
gonna put it through its paces tomorrow during work hours.
<3
I folks!
There are now 2 versions of my patch which I'd like to evaluate / get feedback from you:
1.) ANDROID_LMK_PARAM_AUTO_TUNE enabled. This is the one you already know: cm13_lmkpatch_v2.2.zip It contains (among others) the following changes by Motorola people:
https://gitlab.com/k2wl/g2_kernel/commit/22d990a58fc17b3f0155e15eb2dc3efa037bea1c
https://gitlab.com/k2wl/g2_kernel/commit/7093310c60c972387b5a375ac3b407e2b04f591e
2.) ANDROID_LMK_PARAM_AUTO_TUNE disabled. This is what I commited to Cyanogenmod code review and what has just been integrated by @joojoobee666 into his OC kernel. It is closer to Google's official kernel sources. Droid4 owners may as well flash this one, which is based on official cm-13.0: cm13_lmkpatch_v2.3.zip
@u.b.o.o.t
I just flashed new kernel by joojoobee666. Think that overall performance is better but big apps are still causing troubles. Browser, settings etc seems to be opening faster. Good job! :good:
Currently I'm using these settings: LMK medium profile with empty app at 128MB and and extra_free_kbytes=16000.
I guess that newest kernels by joojoobee666 has cm13_lmkpatch_v2.3.zip built in?
Flash-A-Holic said:
@u.b.o.o.t
I just flashed new kernel by joojoobee666. Think that overall performance is better but big apps are still causing troubles. Browser, settings etc seems to be opening faster. Good job! :good:
Click to expand...
Click to collapse
better than cm13_lmkpatch_v2.2.zip or better than previous OC kernel?
Flash-A-Holic said:
Currently I'm using these settings: LMK medium profile with empty app at 128MB and and extra_free_kbytes=16000.
I guess that newest kernels by joojoobee666 has cm13_lmkpatch_v2.3.zip built in?
Click to expand...
Click to collapse
Yes, exactly.
Yesterday I had some annoying lags with incoming call with lmkpatch_v2.3, empty app watermark at 128MB and extra_free_kbytes=8000. Increasing to 16000 seemed to help a bit, but I'm now back at v2.2 with lmk auto tuning enabled.
I will keep that now for a couple of days of testing...
PS: with stock lmk watermarks, there should be less trouble, but more app killing, and what I'm trying here is to find the sweet spot between maximum performance and minimum lmk kills / app restarts.
u.b.o.o.t said:
better than cm13_lmkpatch_v2.2.zip or better than previous OC kernel?
Click to expand...
Click to collapse
Better than previous OC kernel with Kernel Adiutor tweaks (extra_free_kbytes 75000, LMK agressive profile).
Does anyone of you guys have increased battery drain with one of my lmk patches?
I'm facing SUSPEND_BACKOFF kernel wakelocks (https://github.com/asksven/BetterBatteryStats-Knowledge-Base/wiki/suspend_backoff) preventing the device from going deep asleep and it seems this occures as soon as Wifi has been switched on and off...
EDIT: it's not my patches' fault... having the same issues with standard cm13 kernel...
Do you have any guesses what kernel parameters provide the smoothest operation? I'm using aggresive LMK policy, min free kbytes and extra free kbytes 10000, and Z-RAM 200 MB. Definitely my phone's smoother than only with Your latest patch, but that's only my feeling. Do you know any objective means to measure performance gain? Maybe some benchmarks? Considering battery use, I found no striking changes. I believe stock JB kernel was better in terms of energy use, but IMHO the difference is only slighty visible.
I'm still evaluating but at the moment I'm most confident with 2.2 patch with min_free_kbytes, extra_free_kbytes, and zram at stock settings and lmk profile = aggressive.
Patch 2.3 as well as @joojoobee666's current build have lmk autotuning disabled and seem to require extra_free_kbytes=16000...32000.
But I won't touch min_free_kbytes - there are too many implications / side effects.