Tuning System Wide Volume Level

Search This thread

celelivada

Senior Member
Oct 24, 2010
84
14
Zagreb
OK, I will try to go trough the entire datasheet and figure everything out. I will just need a few days for testing and tuning. The bass really depends on the headphones so I tweaked it to my preference and I really like it now, now my phone has atleast some level of quality audio.
 

vincepg13

Senior Member
Jul 23, 2011
961
135
OK, I will try to go trough the entire datasheet and figure everything out. I will just need a few days for testing and tuning. The bass really depends on the headphones so I tweaked it to my preference and I really like it now, now my phone has atleast some level of quality audio.

Sorry I read your posts and I'm a bit confused, are you making beats bassier or just the standard srs the normal sensation comes with?

Sent from my HTC Sensation XE with Beats Audio
 

mudhi

Senior Member
Jul 7, 2010
338
248
54
Taiwan
I'll make a flashable zip, and remove those script to del cache and dalvik cache, they are not needed.

BTW, I've read the entire datasheet, but really there is no option there for tweaking the volume level of front speaker, it is depends on the service or perhaps the htcdialer, have to find it.

The MODE_RING in the file is used when you plugged in your headset, the 0x8E means enable both speaker and and headphone, that's it, notthing else, however the gain control can be changed also.

As I read the datasheet, there is a gain control that may doubled for just a single bit.

The last 2 0x56, 0x0D, 0x56 is for headset stereo gain, 0x0D is for FM tuner stereo gain, that's why in FM headset is 0x8D.
 

celelivada

Senior Member
Oct 24, 2010
84
14
Zagreb
I think that the other, more deep volume settings are in the miniDSP, it hat a lot of settings, but very hard to configure.

Sent from my HTC Sensation Z710e using XDA App
 

Rolando88

Senior Member
Mar 13, 2010
1,814
137
I'll make a flashable zip, and remove those script to del cache and dalvik cache, they are not needed.

BTW, I've read the entire datasheet, but really there is no option there for tweaking the volume level of front speaker, it is depends on the service or perhaps the htcdialer, have to find it.

The MODE_RING in the file is used when you plugged in your headset, the 0x8E means enable both speaker and and headphone, that's it, notthing else, however the gain control can be changed also.

As I read the datasheet, there is a gain control that may doubled for just a single bit.

The last 2 0x56, 0x0D, 0x56 is for headset stereo gain, 0x0D is for FM tuner stereo gain, that's why in FM headset is 0x8D.

thanks mate cant wait to test

Sent from my HTC Sensation Z710e using xda premium
 

mudhi

Senior Member
Jul 7, 2010
338
248
54
Taiwan
I think that the other, more deep volume settings are in the miniDSP, it hat a lot of settings, but very hard to configure.

Sent from my HTC Sensation Z710e using XDA App

I think the biggest issue that people caring about is the voice call volume, the sensation XL's TPA2051 cfg has rev lines, but adding these lines to sensation has no effect, I will just think that the app or the library query this isn't coded to use it. If anyone can find which app or lib query this TPA2051 cfg file, let me know, so that I can mod it to raise the volume.

I'll find it out, but for tonight, I'll goto bed first, :D already figure out something, probably the AIC3254 can set the handset volume higher, this is what I found.

adb shell
cd /system/lib
cat libaudio.so | grep 3254
cat libaudio.so | grep 2051
cat libhtc_acoustic.so | grep 3254
cat libhtc_acoustic.so | grep 2051

have a lot, and it referst to those csv files.
 
Last edited:

PG101

RC-RT Liaison Admin - Devil's Advocate
Staff member
Aug 12, 2008
14,050
15,683
Great find!!! Impact on battery?

And if I change 056 to 05A in the VOICECALL_SPKR string.. you think it will incr the call volume when i am on the speaker?
 
Last edited:

Alganon

Senior Member
Jun 11, 2009
172
20
does changing MODE_PLAYBACK_HEADSET also apply when using a bluetooth headset?
I'd really need that. I can't here a damn thing when using my bluetooth car kit :p
 

celelivada

Senior Member
Oct 24, 2010
84
14
Zagreb
I think that the earpeace is directly powed from the DSP, not through the d-class amp. So the config for that part has to be done there. I looked at the wiring schematic for the earpiece.

Sent from my HTC Sensation Z710e using XDA App
 

celelivada

Senior Member
Oct 24, 2010
84
14
Zagreb
I've been running through the amp datasheet (TPA2051) and I've got everthing there, it is so easy to tweak the audio. I wonder if someone who knows something about Java to make an .apk with sliders to edit these values. Also I found that the 6th register is to control the headphone amplification, 5th is only for the speaker output. Now i I have a muuuch clear understanding of the miniDSP config, which controls all modes and recording volumes including for the earpiece (for calls).
 
  • Like
Reactions: Shagman68

aNYthing24

Senior Member
May 25, 2011
2,909
531
NYC
Going to try it on CM7. Let's see how it goes.

Edit: I think I notice a difference, but it just might be a placebo effect.
 
Last edited:

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.