[Galaxy S Advance I9070 Original Android Developmen] cocafe:
OLD VERSION HOW-TO

( Boot time )

CoCore-E boots faster than stock normally.

How to check boottime?

* TWRP kernel boottime is longer(around 8000ms).Because of that big ramdisk!

( Bootanimation )

Put bootanimation.zip in /system/media/.

Recommend you changing the permission to 0666.

If there is no bootanimation.zip,kernel will show you Samsung's.

( CPU governors )

* OnDemand has been patched cpu idle detection

* PegasusQ is taken from SiyahKernel (new version)

* Personaly,I use PegasusQ/OnDemand(Q)/HotPlug

* To be honest,most of custom governors are based on ondemand/interactive

* OndemandQ is a new governor.It will hotplug cpu when screen turns off only.

* If you mind the battery life time,choose HotPlug.It hotplugs cpu frequently.

* Interactive updated to linux-android-3.4 [Thanks!Aditya!]

* Zzmoove is the new version(0.3)

* LulzactiveW used as Lagfree,it wont hotplug cpus

* LulzactiveQ,it will hotplug cpus

( CPU Freqs )

On JB,we cannot tweak min/max scale freqs via apps like SetCPU.

Here is the method.

For example: set 400Mhz as max limited

* When you switch on/off,power saving mode,this tweak will be overrided.

( IO schedulers )

* Default iosched is CFQ

* Personaly.i use SIO

( frandom module )

(5.3+)Use CrossBeeder to enable frandom.

( Deepest sleep state )

Stock deepest is 3.

Now it is 3 by default.

Deepest supported is 5.

To change:

* PegasusQ(hotplug governors) works badly with 5

* OnDemand works well with 5

* Please note that it wont increase the using time but standby time.

* ( 6.0+)Reverted this back to stock(level: 3),in order to fix some rare dead sleeps.

* ( 6.0+)You can add an init.d script to tweak it 4 if you want

To check the cpuidle state:

( exFat sdcard )

In TWRP version kernel,it supports exfat sdcard.

Copy /sbin/libexfat.so to /system/lib

Insert exfat sdcard,use binary /sbin/exfat-fuse to mount

Then tap mount sdcard in system settings to let system know sdcard is mounted

* Create an intit,d script to mount exFat sdcard during startup

( zRAM SWAP )

[zRAM]

zRAM is optimized for Android.

It is not lazy anymore.

Using zRAM will take a little CPU,because it needs to compress/decompress memory.

Recommended compressing about 18% of RAM,about 100mb

Setup disksize first: (example: 96mb= 96×1024×1024)

* Larger size more RAM will be compressed.

* Too large size might make phone lag

Enable:

mkswap /dev/block/zram0
swapon /dev/block/zram0

To check how many does it use:

* You can get other info in its sysfs

[SWAP]

Format/resize your SdCard via computer first.

Enable:

( Init.d script )

Please install busybox in system first

I recommend you install busybox via apps

Create a new folder named 'init.d' in /system/etc

Set the permisson of init.d foler to 0777(rwxrwxrwx) (at least has read and exec permission)

Set the owner to 0.0 (root root)

Put some scripts (any name you like) in init.d folder with permisson 0777 (rwxrwxrwx) (at least has read and exec permission)

Scripts with right permisson will be runned when system boots.

( Charger control )

Please note that this control can damage your battery/phone.

If your battery/phone damaged,read the top of #1 post. :p

Lower current makes the charging longer,but protects battery.

Too high current can burn your battery!

I recommend you that dont set the max limited current over 900mA.

( 6.8- ) See here,6.8+ has used new entries

( 6.8+)

* The control only accepts values like 0, 100, 200 ...

* Set usb current to 0,the phone wont charge in usb port,but transmits data.

To get the charging current:

When you plug charger:

( Charge cycle control )

( 6.8- ONLY) Temporary removed

To increase the recharge times:

(Default: 3)

* 5 is recommended.If you want more recharging.

* This probably can make phone charge deeper,do it once a month if you want.

( USB VBus )

( 6.2+) This can enable the internal vbus power supply for usb devices.

But the phone still cannot recognize our usb devices now.

You can use it for fun,like charging for other deivces, using usb fan...

* Say 0 to VOTG to disable

* Plug yoru cable first,then enable it

( PRCMU Clock Module )

Experimental feature!

Thanks Aditya for this module framework

It is at your own risk if this causes unstable issues.

To get the help texts:

To check all available clock rates:

To tweak the b2r2_clk:

* B2R2 is the video accelerator in our platform

* It will be enabled when play videos

* It can work at 399360000 stably.

To tweak the dma_clk:

* DMA stands for Direct Memory Access

* It can work at this clock rate stably

Important: Dont tweak sdmmcclk.

( Real charged notification )

Well,please let me call it notification.

To be honest,it needs to check manually.

( 6.8-) Old versions,please check here

* You can use Rootexplorer to view these files in /sys/kernel/abb-chargalg

* When it says "First eoc reached",then the UI should show you charged 100%

But it is not the real full charged.

* When it says the real EOC reached,unplug the charger.

* When you are charging and doing a reboot will reset the counter.

* According to my experiments,it needs 1-2 hours to charge to real full after it shows you 100%

( ABBamp audio [sound control] )

Please note that listening to too high volume music over 1 hour or more can damage your ears.

Too high volume can make your speakers/headset overload or damage them.

( 6.8-) Old versions,please see here

Credit: Aditya(Adi_Pat)

First,why do i call it `AMP`?

Because most of our tweaks are about gain(volume)

Our codec is simple,It doesnt have any hardware EQ (although i want...)

ABBamp sysfs entries are in:

* Use RootExplorer to view this folder,there are lots files

Tweaks will take effects immediately!

Most tweaks will accept inputs like "enable","disable" (no quotes)...

So,say "enable" to enable this tweak,then this tweak will apply the value stored/inputed

View(cat) these files,most of them will give you useful infomation about this tweak

They will show you the volume in dB of gain

`cd` to /sys/kernel/abb-codec first then do echos,will be more convenient for you

[AnaGain3] (Headset analog gain path):

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 15) Lower value,higher volume (default: 0[+4dB])

[HsLDigGain] (Headset left digital path gain)

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 15) Lower value,higher volume (default: 4[+4dB])

[HsRDigGain] (Headset right digital path gain)

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 15) Lower value,higher volume (default: 4[+4dB])

Headset Volume Table:

* If set up digital path +4dB,analog gain +4dB,the result will get over +8dB

[HsLowPow] (Headset driver low power mode)

This lowpow mode is enabled by device normally.

If you want high performance audio instead of LPA(low power audio),

You can disable it.

Enable tweaks:

Disable tweaks:

To tweak the mode (0: disable LP mode, 1: enable LP mode)

[HsDacLowPow] (Headset DAC low power mode)

DAC is Digital-to-Analong Converter.

This lowpow mode is enabled by device normally.

Enable tweaks:

Disable tweaks:

To tweak the mode (0: disable LP mode, 1: enable LP mode)

[HsHpEn] (Headset high pass filter)

This high pass filter is disabled by device normally.

Enable this can reduce some sub-nosie of audio.

Enable tweaks:

Disable tweaks:

To tweak the mode (0: disable highpass filter, 1: enable highpass filter)

Besides,the file anaconf1 will shows you the status of LPA

[ClassDHPG] (ClassD high-pass gain)

ClassD is a kind of amplifier.

According to the documents,our ClassDs only relate to Handsfree(speaker).

This can increase the high frequences sound of speaker

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 10) higher value,higher gain (default: 10[Max gain])

[ClassDDithWGain]

Gain control for the white component of dithering filter

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 10) higher value,higher gain (default: 10[Max gain])

[ADDigGain2]

This is the audio path of mic2(phone mic,not headset mic)

This tweak will enable automatically when mic2 is enabled by device

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 63) lower value,higher gain (default: 04[+15dB], max: 00[+31dB])

[EarDigGainb]

This is the digtal gain of earpiece

Enable tweaks:

Disable tweaks:

Gain control: (min:0 ,max: 15) lower value,higher gain (default: 4[+4dB])

* It uses the same path of HsLDigGain,please check the volume table of HsLDigGain

* +8 dB might crash the sound of earpiece

[ShortCirConf]

This is a misc tweak

View shortcir this file first

* The first ?? the slot of each option,the second ?? stands for the value to write to this slot

* View shortcir this file,you will get it ;)

[Experts!]:

This method can work on any ab850x codec platform!

Play music,reduce the volume.

Now we are going to edit the codec registers.

E.G:

AnaGain3:

HsDigGain: (left/right channel)

Disable all lowpow mode:

* These hacks will restore when codec power off.

( Touch Booster control )

What is touch booster?

It can jump the cpufreqs(in fact,not only cpufreqs) to high value when you touch to improve the experience of touching.

Disabling this can save some power.

( 6.2+) I renamed the module parameters names

To disable: (default: enable)

To change the boost freq: (default: 400000, stock: 800000) (Vaild: 200000,400000,800000,1000000)

* I reduced this to get a balance between performance and battery.

* If you feel lagged,set it 800000

To disable DDR/APE requests:

( Touch Params control )

Touch sensitivity control has been enhanced.

You can tweak threshold,blen and movfilter parameters now!

Choose the control to enable: (all disabled by default)

Tweak params: (for example:)

* Changes will apply when screen powers on/off

* You can check these params which read from memory via command 'su -c dmesg | grep TSP'

* Lower threshold,higher touch sensitivity

* Recommend you tweaking threshold/movefilter only

( 6.2+) I added more params now. And here are the meanings of params

I saw I9100 guys liked to tweak movhysti this param.

If you want to tweak,set it 2(min) ~ 15(stock).

( Touch Auto Calibration )

I noticed some touch screen hardware issues.

When you touch left bottom corner(x<50 y>750) for many times at the same time,

This corner will lost responses for touching!!!

So the solution is that adding auto calibration when your touches reach the threshold

To disable: (enabled by default)

To tweak the calibration threshold:

* (xxx -> how many times edge-touch to start calibration)

To adjust the area of edge-touch detection:

( Fsync control )

( 6.8-) See here,fsync control has been updated in 6.8+

( 6.8+)

Get current status:

FSYNC modes:

Disable FSYNC:

* Disabling fsync can improve io performace,

but it can make the data which hasnt been written lose when a sudden poweroff comes.

* Disabling fsync or enabling dyn_fsync will make param driver fail to store data

That means your "reboot recovery" will fail.

Enable Dynamic FSYNC:

* Dynamic fsync will sync all buffers when screen turns off,

* If there is a heavy io load,the screen might get stuck for seconds.

* This is an experimental feature.

( S6E63M0 Color Filters )

( 6.0+) You can tweak the color here.In fact,you are tweaking gamma.

Change DIR first:

* Or: cd /sys/devices/pri*

There are three files named filter_X

For example,we tweak the red color here

* RGB default values are 24(R) 8(G) 36(B)

* Valid values range from 0 to 255

* Recommend you tweak it slightly

If you want to reset the settings:

( 6.8-):

( 6.8+):

Besides,you can add an init.d script to apply them during pre-boot.

( S6E63M0 Gamma Tuner )

Read gamma table first: (This table will change according to brightness)

If you want to tweak single value in gamma table:

* The ?? is the register of gamma table

* The 0x?? stands for the value in hex you want (0 ~ 255)

To reset the tweaks:

( 6.8-):

( 6.8+):

[Experts]:

If you want to tweak whole gamma table:

* %x stands for hex value of each register in gamma table ( 03, 05, 07 ... 41, 43 )

( 6.8-)

* Say 0 to /sys/module/display_s6e63m0/parameters/gamma_table_req then change the brightness to revert gamma table

( 6.8+):

* echo reset > gamma_table[/QUOTE]

( S6E63M0 Brightness(illumination) )

( 6.8+)

The folder contains tweaks:

Let me clear the panel for you:

The brightness of our panel is depends on gamma

The gamma is depends of illumination value

We have 26 levels of gamma,means we have 26 slots of illuminations too

So the brightness in system like 1 and 6 are the same brightness in kernel driver(converted),

Because 1 and 6 are in the same gamma level.

Check the file gamma_table to see,the gamma valeus are the same

Unlocked brightness:

In non power saving mode,

we allowed 255 brightness uses the maximum gamma level(25) in kernel driver

In power saving mode,

The maximum brightness can be set is around 230(not 255).

illumination:

This can control this brightness of panel

You can write any value to it,maximum proper illumination is 300

To disable tweaks:

* The minmum illumination panel supports is 1

* Illumination 0 and 3 has color issue!

illumination_table:

View this file first,there are 26 slots

Current: [??] ??? Shows you which index is using

The index0 is the minimum brightness(namely in power saving mode).

You can tweak every level of illuminations now.

Tweak index0 can modify the dimming brightness of system

For example:

Tweak index0 illumination:

* 0 is the index

* 10 is the value

* If you are in power saving mode now,the brightness will change!

ulow_brightness:

To use the lowest brightness of our panel in night

To disable:

::: Sorry,i write this in a hurry,if you dont get it,ask in thread please. Anyway,to tweak is to see!!:::

( Mali GPU )

Mali debug level

Disabling can speed up a bit

* Higher level,more messages will be printed in dmesg,system will slow down

Mali L2 max reads control: (Stock:28kb,Default:48kb(max))

* Some values will slow down graphics

* If not sure,keep default

Mali PM sampling rate: (Default: 1000ms)

Mali PP scheduler tweaks: (Default: disable)

* Enabling this,Some places will over ahead,choose by your self

Mali Utilization sampling rate: (Stock:500ms,Default:1000ms)

How often report a mali utilization.

* Keep this default if unsure.

Mali Utilization control

(Default: low_to_high 192 high_to_low 64)

This probably will relate to the smoothness.

Our driver will report a mali utilization frequently.

This utilization(range: 0~255) means the load of mali.

If utilization is bigger than low_to_high,driver will request higher hardware performance(highest APE/DDR OPP).

If utilization is smaller than high_to_low,the driver will store the requested OPP(uses low OPP).

OPP can be understood as freq simply.

To check mali utilization values:

Then you will see the utilization it reports.

When it says SIGNAL_HIGH,it will request highest OPP.

When it says SIGNAL_LOW,it will request lowest OPP.

Press Ctrl+C to stop printing.

In my Temple Run,it seldom reaches low_to_high(192).

That means you can reduce low_to_high to trigger higher OPP requirement.

For smoothness and less powersaving:

Set low_to_high between 100-192.

( TCP congestions )

Supported:

To check all the available options:

To change to other option:

* I use veno,recommended veno

* In fact,every congestion is disigned for different environments.

* Google to learn more!

( EGL Driver )

To use Mali hardware egl driver only:

Edit /system/lib/egl.cfg

To

Then remove libGLES_android.so

* Recommend to backup these files

* In case it cannot boot,use TWRP file manager to recover changes

* According to my feelings: after disabling sw egl driver,UI is faster

( Service Mode )

In dialer, type:

Secret code:*#197328640*# (service mode)

Secret code:*#9900*# (SysDump)

In SysDump:

Disable fastdormancy might help 3G standby time (Depends on your mobile base station)

* Google to learn more

RAM DUMP is a debugger.Most of us wont use it.So disable it. (Tap it,every tap will make a reboot,until it shows you "Disable....",then tap disable,it is disabled)

Keep RAM Dump default mode,namely,Enable/AUTO

* Google to learn more about secret code

( Logcat )

( 6.8-) See here

( 6.8+) We support to load logger mode at early init now!

Just create a new file(empty file) named logger in /data

When this file exists,kernel will load logger.ko for you automatically

Member [MENTION=5093942]KINGbabasula[/MENTION] made a flashable zip to enable logger

( CRT off-screen effect )

Thanks frapeti for porting this.His thread

You need to enable fbearlysuspend control first.

* frapeti recommended 350ms

Almost tweaks will be restored to default after reboots.

So you can make your tweaks as init.d scripts to apply them when boots. :laugh::laugh::laugh: