Tuning System Wide Volume Level

Search This thread

Bharath9590

Senior Member
Apr 4, 2012
77
25
Please help

Can you make this work on Sense 4.0 ordroid ROMs....it would be of great help...
Thanks in advance...
 

Ronin2009

Member
Apr 27, 2009
33
7
Thanks

Works great on ARHD 6.6.4 XE, can notice the difference. keep up the great work. :)
 
Last edited:

indnracn2

Senior Member
Apr 29, 2007
59
0
hey guys so i have sensation xe revelution 6.6.4 ICS rom flashed using 4ext. do not have S-off but have unlocked bootloader and have root. I tried to flash via 4ext but for some reason always get "SoundBoostForSensationICS.zip finding update (that goes fine) opening update (that goes fine) then comes the error " cant open sdcard\SoundBoostForSensationICS.zip (bad). I re downloaded the package same thing. then installation aborted. Any ideas?
 

Sensation-al!

Senior Member
Aug 16, 2011
415
59
Just flash in recovery?

Sent from outer space 3000 years in the future (with my now extremely outdated, but still freaking awesome, HTC Sensation Z710e)
 

linj

Senior Member
Oct 16, 2005
126
9
California
works, but I sometimes crashes

This should work in any ROM (Sense 3.5, 3.6, 4.0, AOSP, AOKP, MIUI, whatever), as it only changes a few CSV files that every system will refer to. These values will determine the volume level that is sent to the chip in hardware, so it is consistent across all Sensations.

This should also not affect the stability of anything--your crashes are unrelated!

Just flash in recovery?

Sent from outer space 3000 years in the future (with my now extremely outdated, but still freaking awesome, HTC Sensation Z710e)

Yes. :)

Also, thanks Mudhi; this works amazingly well, and is the first thing I flash after any other ROM. :)
 

liquidx

Senior Member
Mar 9, 2010
170
5
Can anybody provive a zip with the original values of the sensation, please?

And what is the difference between TPA2051_CFG.csv and TPA2051_CFG_XC.csv?
Is it sufficient to change the values in the file TPA2051_CFG_XC.csv?
 
Last edited:

02CWRX

Senior Member
Sep 2, 2010
300
54
So, correct me if I'm looking at this wrong, but here's what I see.

It looks like the focus should possibly be on registers 4, 5, and 6 because they seem to be what configures the three inputs (Mono, Stereo 1, and Stereo 2). It also looks like bits 0-4 consistently are what control the output gain on all three of those registers. Bits 5, 6, and 7 on register 4 are also what set the input mode configuration it looks like, and from what I can tell, we are using mode 6 by default.

Assuming that is true, we can look at bits 7 and 0-4 on register 5, the tech sheet says these configure the class-D amp gain (for modes 1, 3, 5 and 6) and the volume control gain. So, following the tech sheet, we could set bits 7 and 0-4 to a different value to bump the gain for any of the outputs listed - I think.

So, if we assume that is correct, that means that the stock value of 0x55 defines the class-D amp to +6 db, and the volume control gain to +8 db gain over zero for a total of +14 db gain. Following the same thinking, the 0x59 defines the class-D amp to +6 db and the volume control to +12 db gain over zero for a total of +18 db gain. This makes sense because the 0x59 is used on the speaker, and the 0x55 is used on the headset.

Now, since bit 7 on register 5 is set logic low, that means we are only using the +6 db gain level from the class-D amp, and since the volume control only runs up to +18 db, that means we are limited at +24 db gain overall - unless we try with logic high on bit 7 for the class-D amp. If we set that bit to logic high, it should bump the gain to the +12 gain level. This would add an extra bump in gain on top of however bits 0-4 are configured.

Assuming all this is correct, if we wanted to keep the same overall gain of +18, but use the +12 db gain range of the class-D amp to go from +24 of maximum range to +30, we would configure it to 0xD3 (UNTESTED THEORY). That should be +12 db class-d, +6 db volume control, for a total of +18 db. In theory, this would sound the exact same as stock, but would allow us more head room if we maxed out the volume control gain at +18 db and still didn't have the volume we wanted.

Now that I've rambled all that (which may or may not be correct), it seems like it shouldn't be TOO hard to figure out where the regular old headset speaker is hiding in all that hex numbering, then bumping the gain for it however we need to.

EDIT - The part I'm also not sure about is why are there 3 config files, and which one is normally in use? Also, does anyone know if the changes to the text file are "real time", or do they require a reboot each time? I might be willing to experiment a little if I knew that.
 
Last edited:

ArcticFox

Senior Member
Mar 8, 2006
146
19
I've read through this thread and I don't have a clue what I'm doing.

All I want to do is boost the ringtone volume as I'm partially deaf, I've tried Volume+ but it doesn't seem to make much difference.

Which values do I need to edit to make ringtones louder?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 72
    As I making a beats mod for sense 3.5, found interesting file TPA2051_CFG.csv and TPA2051_CFG_XC.csv, the first one should be the template and the second one is the working i2c command file for various system volume, search google for TPA2051, is the amplifier which uses i2c interface, I don't know what exactly i2c is, maybe electronic engineers can explain. Comparing XE and normal sensation's, giving only one difference value, see below in blue, that is the playback_headset max amplified value, XE is 55, sensation is 50, that's why the later you hear a lower volume, tweak it to 56 or maybe higher to here boom-boom-boom, pong-pong-pong, ping-ping-ping effect! :D

    For ICS, get the files from my beats mod.

    Do not tweak other values except you know exactly what you are doing, there are many of them are gain control, just one bit of them could doubled the gain and may damage your speaker. The datasheet has all the descriptions of these registers of I2C interface.

    0x55 seems to be the largest value that the stock htc headset and beats headset can tolerate, 0x59 seems to be the largest value that the speaker can tolerate. For both, the largest volume value is 0x5F.

    This should also applies to any other htc devices as long as there is a file similar to this, this is sensation's TPA2051_CFG_XC.csvf ile, if you are using other device, just use that file of your device.

    ================================================
    SoundBoostForGB&ICS.zip
    This work for both GB & ICS, without enable the AGC, enabling AGC making music sounds not so good, values for headset is default of XE ROM (0x55), and speaker is (0x59)

    #TPA2051 PYDLE_20111027_1Voutput_ON_55_OFF_4F,,,,,,,,,
    #mode/kind/i2c_cmds[7],,,,,,,,,
    #kind = 0:spk, kind = 1:HEADSET, kind = 2:ring ,kind = 3:rev,kin=4 : 0ff,,,,,
    0,4,0x00,0x90,0x00,0x00,0x00,0x00,0x00,#TPA2051_MODE_OFF
    1,0,0x00,0x82,0x00,0x07,0xCD,0x59,0x0D,#TPA2051_MODE_PLAYBACK_SPKR
    2,1,0x00,0x8C,0x20,0x57,0xCD,0x55,0x0D,#TPA2051_MODE_PLAYBACK_HEADSET
    3,2,0x00,0x8E,0x20,0x57,0xCD,0x16,0xCD,#TPA2051_MODE_RING
    4,0,0x00,0x82,0x00,0x07,0xCD,0x59,0x0D,#TPA2051_MODE_VOICECALL_SPKR
    5,1,0x00,0x8C,0x20,0x57,0xCD,0x55,0x0D,#TPA2051_MODE_VOICECALL_HEADSET
    6,0,0x00,0x82,0x00,0x07,0xCD,0x59,0x0D,#TPA2051_MODE_FM_SPKR
    7,1,0x00,0x8C,0x20,0x57,0xCD,0x0B,0x8D,#TPA2051_MODE_FM_HEADSET
    8,3,0x00,0x8C,0x20,0x57,0xCD,0x55,0x0D,#TPA2051_MODE_PLAYBACK_rev
    9,3,0x00,0x8C,0x20,0x57,0xCD,0x55,0x0D,#TPA2051_MODE_VOICECALL_rev
    10,4,0x00,0x8C,0x20,0x57,0xCD,0x55,0x0D,#TPA2051_MODE_PLAYBACK_HEADSET_BEATS_ON
    11,5,0x00,0x8C,0x20,0x57,0xCD,0x4F,0x0D,#TPA2051_MODE_PLAYBACK_HEADSET_BEATS_OFF
    4
    There are other gain controls, or even the AGC, automatic gain control, I'll post it after some trying, as it is possible to damage your speaker, the datasheet has very brief explanation, but techy, I just need to recover some knowledge in school 3 decades ago. :D

    I wrote this down as I reading the datasheet, for the reference myself and in case anyone wants to tweak a lot more, here is what I got in the datasheet, just search TPA2051 for the datasheet pdf.

    Let say this line
    1,0,0x00,0x82,0x00,0x07,0xCD,0x56,0x0D,#TPA2051_MODE_PLAYBACK_SPKR

    the first column is the index, the second is type as you see in the remarks, these are reference of I don't know, maybe kernel, library or service.

    3 ~ 9 columns are the 7 hex registers (0~6) values which is sent to TPA2051.

    reg0: 0x00 = don't bother it, since they all are zero.

    reg1: 0x82 = Amplifier Control Register, it tells which limiter to use (speaker or headphone), and enable or disable AGC, and enable/disable headphone L/R and/or speaker. 0x82 means use speaker limiter.

    In the datasheet - attack time (gain decrease), release time (gain increase).

    reg2: 0x00 = Attack Time and Speaker Limiter Control Register, it is zero, the meaning is no gain decrease and speaker limited to 2.6Vpeak, so don't touch this, make it 0x01 ~ 0x07 will damage your speaker. This is default and so assumes it is a 2.6V speaker.

    reg3: 0x07 = Release Time and Headphone Limiter Level Control Register, this has set release time to 0 hence no gain increase, and 7 is the low 3 bit for head phone limiter which = 111 largest and with reg6 setting of headphone gain of 000 = -12DB, and so it is limited to 0.325V.

    reg4: 0xCD = Mode / Mono Input Volume Control Register, it was related to the wiring, since it is fixed, and so the value should also fixed.

    stero input 1 is from audio source, the codec, should be the AIC3254???
    stero input 2 is from source FM tuner.

    reg5: 0x56 = Stereo Input 1 / Output Gain Control Register, it was set to use headphone gain of 0DB regardless of the secondary heaphone gain of reg6 high 3 bits, and low 5 bits are volume control for input 1. -66DB ~ +18DB.

    reg6: 0x0D = Stereo Input 2 / Headphone Gain Control Register, high 3 bits are secondary headphone gain, but disable in reg5 thus only 5 low bits are used for control stereo input 2. The range is 0x00~0x1F.

    Now the interesting thing is enable the AUTOMATIC GAIN CONTROL in the datasheet and which isn't enabled, or probably tweaking the stereo in of ? line could probably increase the front speaker.

    Maybe celelivada understand more about these, anyway I'll just try and try, hoping not to burn the speaker. :D
    2
    it should work, didnt check it but it has ti have this cofig file. It says in the first post, I used ES file manager, and enabled the root access feature and browsed to the file specified and chenged the 2 values.

    ---------- Post added 15th December 2011 at 12:25 AM ---------- Previous post was 14th December 2011 at 11:48 PM ----------

    I found the AIC3254_reg_dualmiccx file and after a loooong review of the datasheet from texas instruments, it seems that the video recording clipping can also be fixed this way. I found that in the:
    A17,VideoRecord_IMIC,SET,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w
    ,,REGISTER,0x00,0x34,0x36,0x37,0x39,0x3B,0x3C,0x00,0x51,0x52,0x53,0x54,0x00,0x0E,0x0F,0x09,0x12,0x13
    ,,VALUE,0x01,0x20,0x02,0x20,0x02,0x58,0x58,0x00,0x00,0x88,0x00,0x00,0x01,0x02,0x02,0x3F,0x03,0x03

    you can change 83 and 84 memory bank (0x53 and 0x54) to control the volume. 0000 0000 is default in the datasheet, which is 0dB.To lower the gain you have to write a negative digital number in those registers eg. 1111 1111 is a gain of -0dB.
    1
    i2c is a in-circuit protocol for comunicating. Thats the protocol the chips and memory banks use to transfer and address data. It is based on a serial connection. I dont know if any of that helps but just wanted to share that info. Now for a question, how to apply and what are the compatable ROMs?
    1
    So can we flash the one in the post? Just the sensation one?

    Sent from my HTC Sensation using xda premium

    I don't know. I edited manually cuz those contained beats entries. Maybe the system will ignore them or maybe you'll have problems. Make a nand and try it. Either way, you should always make a backup before messing with system files.