Loading ...
Linux/Kernel Tweaking ~ Team-DomPop Style

Linux/Kernel Tweaking ~ Team-DomPop Style

I wanted to make sure I got this here, before I forgot what I did to make these awesome tweaks.  They should be pretty universal, so long as you can make the edits to the kernels ramdisk.  (See your kernel provider for permission and details).  I’m going to break this up into sections to make it easier for me to read.

GOALS

My goals for this were pretty simple.

  1. Low Level Configuration
  2. Faster Boot Time
  3. Device Performance Enhancement
  4. Boot Process Specific Firing of Scripts

CODE

default.prop

Once you have your kernel torn apart, open the file default.prop and add these tweaks in, normally you would put these in your devices build.prop file, however, I want things my way so…

# kevp75 Default Tweaks
# Rendering Tweaks
debug.composition.type=c2d
debug.egl.hw=1
debug.enabletr=true
debug.overlayui.enable=1
debug.qctwa.preservebuf=1
debug.performance.tuning=1
debug.sf.hw=1
dev.pm.dyn_samplingrate=1
hw3d.force=1
ro.config.disable.hw_accel=false
ro.fb.mode=1
ro.sf.compbypass.enable=0
ro.vold.umsdirtyratio=20
persist.sys.composition.type=c2d
persist.sys.ui.hw=1
video.accelerate.hw=1

# Enable GPU Acceleration
debug.sf.hw=1
video.accelerate.hw=1
debug.performance.tuning=1
persist.sys.composition.type=gpu
debug.qc.hardware=true
debug.qctwa.statusbar=1
debug.qctwa.preservebuf=1
debug.egl.profiler=1
debug.egl.hw=1
debug.composition.type=gpu
hw3d.force=1
ro.product.gpu.driver=1
persist.sys.use_16bpp_alpha=1 
persist.sampling_profiler=0
hwui.render_dirty_regions=false
hwui.disable_vsync=true

# Saves some battery without reducing performances
wifi.supplicant_scan_interval=497
pm.sleep_mode=1
power.saving.mode=1
ro.ril.disable.power.collapse=0
ro.vold.umsdirtyratio=20

# Battery save 
pm.sleep_mode=1 
ro.ril.disable.power.collapse=0 
profiler.force_disable_err_rpt=1 
profiler.force_disable_ulog=1 
dalvik.vm.checkjni=false 
dalvik.vm.execution-mode=int:jit
ro.ril.power_collapse=1
power_supply.wakeup=enable
ro.mot.eri.losalert.delay=1000
ro.config.hw_fast_dormancy=1
ro.config.hw_power_saving=1

# Misc Tweaks (enables ADB service)
persist.service.adb.enable=1

# Sensor Sleep Control
ro.ril.sensor.sleep.control=1

# Device will boot faster
ro.config.hw_fast_dormancy=1
ro.config.hw_quickpoweron=true
persist.sys.shutdown.mode=hibernate
persist.radio.tdscdma_present=1

# Reduce dial-out time
ro.telephony.call_ring.delay=0

# Allow purge of wp-content to free more ram
persist.sys.purgeable_wp-content=1

# More free ram and apps load faster
dalvik.vm.dexopt-flags=m=y

# More RAM
persist.service.pcsync.enable=0 
persist.service.lgospd.enable=0

# Increase general Performance
debug.performance.tuning=1

# Increase some Performance
ro.secure=0
persist.sys.use_16bpp_alpha=1
ro.product.gpu.driver=1
ro.min.fling_velocity=8000

# Reduce the black screen time of the proximity sensor
ro.lge.proximity.delay=15
mot.proximity.delay=15
ro.ril.enable.amr.wideband=1

# TOUCH
touch.presure.scale=0.001

# Better Scrolling responsiveness and speed
windowsmgr.max_events_per_sec=150
ro.max.fling_velocity=15000
ro.min.fling_velocity=8000
ro.min_pointer_dur=8

# Smoothens UI
persist.service.lgospd.enable=0
persist.service.pcsync.enable=0
ro.ril.enable.a52=1
ro.ril.enable.a53=0

# Increase camera's photo and video recording quality
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
ro.media.enc.hprof.vid.fps=65

# Better Flashlight intensity and camera-flash quality
ro.media.capture.flash=led
ro.media.capture.flashMinV=3300000
ro.media.capture.torchIntensity=40
ro.media.capture.flashIntensity=70
ro.media.capture.maxres=8m
ro.media.capture.fast.fps=4
ro.media.capture.slow.fps=120
ro.media.panorama.defres=3264x1840
ro.media.panorama.frameres=1280x720
ro.camcorder.videoModes=true
ro.media.enc.hprof.vid.fps=65

# Increase the volume steps in-call
ro.config.vc_call_steps=20

# Better call voice quality.
ro.ril.enable.amr.wideband=1

# Force launcher into memory
ro.HOME_APP_ADJ=1

# Disable Bytecode Verification
dalvik.vm.verify-bytecode=false
dalvik.vm.dexopt-flags=m=y,v=n,o=v

# Improves Camera & Video Results
ro.media.panorama.defres=3264x1840
ro.media.panorama.frameres=1280x720
ro.camcorder.videoModes=true
ime_extend_row_keyboard=true
ime_onehand_keyboard=true
ime_split_keyboard=true
ime_vibration_pattern=0:60

# Increase jpg quality to 100%
ro.media.enc.jpeg.quality=100

# Disable Error reporting and logs
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1

# Disable Sending Usage Data
ro.config.nocheckin=1

# Fix some application issues (FC)
ro.kernel.android.checkjni=0

# MMS APN retry timer set to 2 sec( if SMS/MMS couldn`t be sent, it retries after 2 instead of 5 seconds)
ro.gsm.2nd_data_retry_config=max/_retries=3, 2000, 2000, 2000

# Miscellaneous Tweaks for performance
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_wp-content=1 
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000

# Better internet browsing & download speed
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.hspa=6144,87380,524288,6144,163 84,262144
net.tcp.buffersize.lte=524288,1048576,2097152,5242 88,1048576,2097152
net.tcp.buffersize.hsdpa=6144,87380,1048576,6144,8 7380,1048576
net.tcp.buffersize.evdo_b=6144,87380,1048576,6144, 87380,1048576

# Smoother video streaming and tweak media
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
media.stagefright.enable-record=true

# 3G signal and speed tweaks
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=7
ro.ril.hsdpa.category=10
ro.ril.enable.a52=1
ro.ril.set.mtu1472=1
persist.cust.tel.eons=1
ro.config.hw_fast_dormancy=1

# GOOGLE DNS
net.dns1=8.8.8.8
net.dns2=8.8.4.4
net.rmnet0.dns1=8.8.8.8
net.rmnet0.dns2=8.8.4.4
net.ppp0.dns1=8.8.8.8
net.ppp0.dns2=8.8.4.4
net.wlan0.dns1=8.8.8.8
net.wlan0.dns2=8.8.4.4
net.eth0.dns1=8.8.8.8
net.eth0.dns2=8.8.4.4
net.gprs.dns1=8.8.8.8
net.gprs.dns2=8.8.4.4

# CRT
persist.sys.screen_off=crt
persist.sys.screen_on=none

# Support For IPV4 and IPV6
persist.telephony.support.ipv6=1
persist.telephony.support.ipv4=1

#
ro.com.google.locationfeatures=1
ro.com.google.networklocation=1
htc.audio.alt.enable=0
htc.audio.hac.enable=0

# Wireless Tweaks
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.route.flush=1
net.ipv4.tcp_ecn=0
net.ipv4.tcp_fack=1
net.ipv4.tcp_mem=187000 187000 187000
net.ipv4.tcp_moderate_rcvbuf=1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_rfc1337=1
net.ipv4.tcp_rmem=4096 39000 187000
net.ipv4.tcp_sack=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_wmem=4096 39000 18700
wifi.supplicant_scan_interval=180

# Video Acceleration Enabled And HW debugging
video.accelerate.hw=1
debug.sf.hw=1
debug.performance.tuning=1
debug.egl.profiler=1 # Measure rendering time in adb shell dumpsys gfxinfo
debug.egl.hw=1
debug.composition.type=gpu # Disable hardware overlays and use GPU for screen compositing

# Disable logcat
logcat.live=disable

# Better image quality, lower performance.
persist.sys.use_dithering=1

#Multiwindow
persist.splitwindow.support_all=true

# MMS APN retry timer set to 2 sec( if SMS/MMS couldn`t be sent, it retries after 2 instead of 5 seconds)
ro.gsm.2nd_data_retry_config=max/_retries=3, 2000, 2000, 2000

# Flag Tuner
ENFORCE_PROCESS_LIMIT=false
MAX_SERVICE_INACTIVITY=false
MIN_HIDDEN_APPS=false
MAX_HIDDEN_APPS=false
CONTENT_APP_IDLE_OFFSET=false
EMPTY_APP_IDLE_OFFSET=false
MAX_ACTIVITIES=false
ACTIVITY_INACTIVITY_RESET_TIME=false
MAX_RECENT_TASKS=false
MIN_RECENT_TASKS=false
APP_SWITCH_DELAY_TIME=false
MAX_PROCESSES=false
PROC_START_TIMEOUT=false
CPU_MIN_CHECK_DURATION=false
GC_TIMEOUT=false
SERVICE_TIMEOUT=false
MIN_CRASH_INTERVAL=false

# MultiTasking Tweaks
ro.config.dha_empty_max=36
ro.config.dha_cached_max=12
ro.config.dha_th_rate=2.3
ro.config.dha_lmk_scale=0.545
ro.config.sdha_apps_bg_max=70
ro.config.sdha_apps_bg_min=8
ro.config.oomminfree_high=7628,9768,11909,14515,16655,20469

#Disable Scrolling Cache For Faster Scrolling
persist.sys.scrollingcache=3

### ViPER4Android
lpa.decode=false
lpa.releaselock=false
lpa.use-stagefright=false
tunnel.decode=false

launcher.force_enable_rotation=true
fw.max_users=10
fw.show_multiuserui=1

init.rc

Here comes the fun stuff.  This is where things can get real screwy, so be real careful what you do in here.  Open the file init.rc and add in the sections I specify below, exactly where I specify them…

import /init.dp.rc # Add this line at the top of the file, right under the last existing import
on early-init
    # Overclock just a tad, through booting boot, also set min scaling and govenor
    # I use Lean Kernel as my base which allows the overclocking
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 2726400
    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 2726400
    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq 2726400
    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq 2726400
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 2496000
    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 2496000
    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 2496000
    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 2496000
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "performance"
    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "performance"
    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "performance"
    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "performance"

    # At bottom of this put
    setprop dp.early_init.done 1
on init

    # At bottom put this:
    setprop dp.init.done 1
on late-init

    # At the bottom put this line
    setprop dp.late_init.done 1
on post-fs

    # At bottom
    setprop dp.post_fs.done 1
on post-fs-data

    # At bottom
    setprop dp.post_fs_data.done 1
on boot

    # Above the line class_start core put
    setprop dp.boot.done 1

What do these all do?  Well, right now all they do is create a new property at each stage of the boot process for the kernel.  Please google the boot process if you need more information.

init.dp.rc

This is a new file (that we added to init.rc above).   Create it now, and put in the following code

# Check Properties
on property:dp.early_init.done=1
	start dp_early_init
	start dpu_early_init

on property:dp.init.done=1
	start dp_init
	start dpu_init

on property:dp.late_init.done=1
	start dp_late_init
	start dpu_late_init

on property:dp.post_fs.done=1
	start dp_post_fs
	start dpu_post_fs

on property:dp.post_fs_data.done=1
	start dp_post_fs_data
	start dpu_post_fs_data

on property:dp.boot.done=1
	start dp_boot
	start dpu_boot

on property:sys.boot_completed=1
    start dp_post_boot
    start dpu_post_boot

# DP User Services
service dpu_early_init /sbin/bash /data/dp_scripts/onearlyinit.sh
	user root
	disabled
	oneshot

service dpu_init /sbin/bash /data/dp_scripts/oninit.sh
	user root
	disabled
	oneshot

service dpu_late_init /sbin/bash /data/dp_scripts/onlateinit.sh
	user root
	disabled
	oneshot

service dpu_post_fs /sbin/bash /data/dp_scripts/onpostfs.sh
	user root
	disabled
	oneshot
	
service dpu_post_fs_data /sbin/bash /data/dp_scripts/onpostfsdata.sh
	user root
	disabled
	oneshot
	
service dpu_boot /sbin/bash /data/dp_scripts/onboot.sh
	user root
	disabled
	oneshot
	
service dpu_post_boot /sbin/bash /data/dp_scripts/onpostboot.sh
	class late_start
	user root
	disabled
	oneshot

# DP Services
service dp_early_init /sbin/bash /sbin/0/onearlyinit.sh
	user root
	disabled
	oneshot

service dp_init /sbin/bash /sbin/0/oninit.sh
	user root
	disabled
	oneshot

service dp_late_init /sbin/bash /sbin/0/onlateinit.sh
	user root
	disabled
	oneshot

service dp_post_fs /sbin/bash /sbin/0/onpostfs.sh
	user root
	disabled
	oneshot
	
service dp_post_fs_data /sbin/bash /sbin/0/onpostfsdata.sh
	user root
	disabled
	oneshot
	
service dp_boot /sbin/bash /sbin/0/onboot.sh
	user root
	disabled
	oneshot
	
service dp_post_boot /sbin/bash /sbin/0/onpostboot.sh
	class late_start
	user root
	disabled
	oneshot

This will check for each set property during the boot process and start the services specified.  As you can see, I have 2 sets of services.  1 is specifically sitting in the /sbin/0/ folder of the ramdisk.  These scripts are the ones that will configure our kernel.   The second I added in to allow the users a level of tweaking outside the normal init.d scripts.  These all fire at the specified points in the kernel boot process.   Rather than posting the files, grab the attached zip file, and see for yourself what I have done. 🙂   I have also included the files above for those that cannot follow directions 😛

MEGA: Download Now

~ Happy Tweaking!