|
Please note that listening to too high volume music over 1 hour or more can damage your ears.
Too high volume can make your external speakers/headset overload or damage them.
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 doesn't have any hardware EQ (although i want...)
ABBamp sysfs entries are in:
Quote:
/sys/kernel/abb-codec
* Use RootExplorer to view this folder,there are lots files
Tweaks will take effects immediately!
Most tweaks will accept inputs like "on", "off" (no quotes)...
So, say "on" 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.
::: In 7.0+, all enable/disable commands have changed to on/off :::
[AnaGain3] (Headset analog gain path):
Enable tweaks:
echo on > /sys/kernel/abb-codec/anagain3
Disable tweaks:
echo off > /sys/kernel/abb-codec/anagain3
Gain control: (min:0 ,max: 15) Lower value,higher volume (default: 0[+4dB])
echo left=?? > /sys/kernel/abb-codec/anagain3
echo right=?? > /sys/kernel/abb-codec/anagain3
Write both left and right channels:
echo gain=?? > /sys/kernel/abb-codec/anagain3
[HsLDigGain] (Headset left digital path gain)
Enable tweaks:
echo on > /sys/kernel/abb-codec/hsldiggain
Disable tweaks:
echo off > /sys/kernel/abb-codec/hsldiggain
Gain control: (min:0 ,max: 15) Lower value,higher volume (default: 4[+4dB])
echo gain=?? > /sys/kernel/abb-codec/hsldiggain
[HsRDigGain] (Headset right digital path gain)
Enable tweaks:
echo on > /sys/kernel/abb-codec/hsrdiggain
Disable tweaks:
echo off > /sys/kernel/abb-codec/hsrdiggain
Gain control: (min:0 ,max: 15) Lower value,higher volume (default: 4[+4dB])
echo gain=?? > /sys/kernel/abb-codec/hsrdiggain
Headset Volume Table:
value | volume
0.......+8dB (maximum)
1.......+7dB
2.......+6dB
3.......+5dB
4.......+4dB (tweaks default)
5.......+3dB
6.......+2dB
7.......+1dB
8.......+0dB (device default)
>=9....mute
* 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:
echo on > /sys/kernel/abb-codec/hslowpow
Disable tweaks:
echo off > /sys/kernel/abb-codec/hslowpow
To tweak the mode (0: disable LP mode, 1: enable LP mode)
echo mode=? > /sys/kernel/abb-codec/hslowpow
[HsDacLowPow] (Headset DAC low power mode)
DAC is Digital-to-Analong Converter.
This lowpow mode is enabled by device normally.
Enable tweaks:
echo on > /sys/kernel/abb-codec/hsdaclowpow
Disable tweaks:
echo off > /sys/kernel/abb-codec/hsdaclowpow
To tweak the mode (0: disable LP mode, 1: enable LP mode)
echo mode=? > /sys/kernel/abb-codec/hsdaclowpow
[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:
echo on > /sys/kernel/abb-codec/hshpen
Disable tweaks:
echo off > /sys/kernel/abb-codec/hshpen
To tweak the mode (0: disable highpass filter, 1: enable highpass filter)
echo mode=? > /sys/kernel/abb-codec/hshepen
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:
echo on > /sys/kernel/abb-codec/classdhpg
Disable tweaks:
echo off > /sys/kernel/abb-codec/classdhgp
Gain control: (min:0 ,max: 10) higher value,higher gain (default: 10[Max gain])
echo gain=?? > /sys/kernel/abb-codec/classdhpg
[ClassDDithWGain]
Gain control for the white component of dithering filter
Enable tweaks:
echo on > /sys/kernel/abb-codec/classdwg
Disable tweaks:
echo off > /sys/kernel/abb-codec/classdwp
Gain control: (min:0 ,max: 10) higher value,higher gain (default: 10[Max gain])
echo gain=?? > /sys/kernel/abb-codec/classdwg
[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:
echo on > /sys/kernel/abb-codec/addiggain2
Disable tweaks:
echo off > /sys/kernel/abb-codec/addiggain2
Gain control: (min:0 ,max: 63) lower value, higher gain (default: [+6dB], max: 00[+31dB])
echo gain=?? > /sys/kernel/abb-codec/addiggain2
[EarDigGain]
This is the digtal gain of earpiece
Enable tweaks:
echo on > /sys/kernel/abb-codec/eardiggain
Disable tweaks:
echo off > /sys/kernel/abb-codec/eardiggain
Gain control: (min:0 ,max: 15) lower value,higher gain (default: 4[+4dB])
echo gain=?? > /sys/kernel/abb-codec/classdwg
* 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
Quote:
[7] EnShortPWD
0: Automatic switch off on short circuit detection is disabled
1: Automatic switch off on short circuit detection is enabled
[6] EarShortDis
0: Short circuit detection on Ear driver enabled
1: Short circuit detection on Ear driver disabled
[5] HsShortDis
0: Short circuit detection on HsL and HsR drivers enabled
1: Short circuit detection on HsL and HsR drivers disabled
[4] HsPullDEn
0: HsL and HsR outputs are in high impedance
1: HsL and HsR outputs are pulled down to ground
[2] HsOscEn (ABBamp enables it by default)
0: The HS drivers use the system clock
1: The HS drivers use a local oscillator (system clock absent: analog path only)
[1] HsFadDis
0: All intermediate steps are applied between two programmed gains (fading)
1: Gain on HS is applied immediately
[0] HsZcdDis
0: HS gain changes on signal zero cross (unless time-out occurs)
1: HS gain is changed without zero cross control
echo ?? ?? > /sys/kernel/abb-codec/shortcir
* 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
[AnaConf4]
This interface controls the enables of analog path
We can use it to disable Speaker in kernel level.
So that you don't have to use the "mute all sound" in system settings,
Because, "mute all sound" will also mute Earpiece, which is inconvenient for us in calls.
Command format: Check anaconf4 first, This interface is a bit different from others:
echo [Index] [Disable?] > anaconf4
To Disable Speaker:
echo 5 1 > anaconf4
To Enable Speaker:
echo 5 0 > anaconf4
[Headset Charge Pump]
echo 0 > chargepump to use fixed 1.8V supply.
echo 1 > chargepump to use dynamic voltage supply, lower power cost.
[Lower-power Audio Mode]
echo on > lpa_mode to enable LPA mode
echo vape=0x?? > lpa_mode to adjust Vape voltage used in LPA mode
[Experts!]:
This method can work on any ab850x codec platform!
cd /d/asoc/U*/ab*
Play music,reduce the volume.
Now we are going to edit the codec registers.
echo REG VAL > codec_reg
E.G:
AnaGain3:
echo 0x16 0x00 > codec_reg
HsDigGain: (left/right channel)
echo 0x4F 0x00 > codec_reg
echo 0x50 0x00 > codec_reg
Disable all lowpow mode:
echo 0x04 0x00 > codec_reg
* These hacks will restore when codec power off. |