This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV320AIC3104: The microphone recording gain is too low.

Part Number: TLV320AIC3104

Tool/software:

HI TI , 

The gain is too low during microphone recording. If there is obvious background noise after turning on AGC.

I would like to ask if there are any other configurations for increasing the microphone gain.

I use the following command to call for microphone recording, and only the AMICL channel is needed.

tinymix set "AGC Switch" 0 0

tinymix set "ADC HPF Cut-off" 1 1

tinymix set "Left Line Mixer PGAL Bypass Switch" 1

tinymix set "Left HP Mixer PGAL Bypass Switch" 1

tinymix set "Left Line1L Mux" 1

tinymix set "Left PGA Mixer Line1L Switch" 1

tinymix set "Right Line Mixer PGAR Bypass Switch" 0

tinymix set "Right HP Mixer PGAR Bypass Switch" 0

tinymix set "Right Line1R Mux" 0

tinymix set "Right PGA Mixer Line1R Switch" 0

tinycap /home/sunrise/cap.wav -D 0 -d 0 -p 320 -n 3 -r 48000 -b 16 -c 2


  • The following are the recording files with AGC enabled and disabled respectively.

    The following are the register data during recording after disabling AGC:

    No size specified (using byte-data access)
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 00 00 91 20 1e 00 0a 00 00 00 81 50 00 00 20    ...? ?.?...?P.. 
    10: 20 ff ff 84 78 78 78 78 78 c6 00 fe 00 00 fe 00     ..?xxxxx?.?..?.
    20: 00 00 00 00 c0 00 00 00 40 00 00 a6 a6 2f af af    ....?...@..??/??
    30: 00 00 00 0f 2f 2f af 00 00 00 0f 00 00 00 2f 2f    ...?//?...?...//
    40: af 0c 00 00 00 2f 2f af 0c 2f 2f af 2f 2f af 08    ??...//??//?//??
    50: 2f af af 00 00 00 0b 00 00 00 2f 2f af 08 14 08    /??...?...//????
    60: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00    ......?.........
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    80: 00 00 00 91 20 1e 00 0a 00 00 00 81 50 00 00 20    ...? ?.?...?P.. 
    90: 20 ff ff 84 78 78 78 78 78 c6 00 fe 00 00 fe 00     ..?xxxxx?.?..?.
    a0: 00 00 00 00 c0 00 00 00 40 00 00 a6 a6 2f af af    ....?...@..??/??
    b0: 00 00 00 0f 2f 2f af 00 00 00 0f 00 00 00 2f 2f    ...?//?...?...//
    c0: af 0c 00 00 00 2f 2f af 0c 2f 2f af 2f 2f af 08    ??...//??//?//??
    d0: 2f af af 00 00 00 0b 00 00 00 2f 2f af 08 14 08    /??...?...//????
    e0: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00    ......?.........
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    

  • Hi Wenzel,

    Thanks. Our expert for this is out of office and will return on Monday to follow up with you.

    Thanks,
    Jeff McPherson

  • 1. I modified the value of adc gain (reg: 0x0f) to 75 and turned off AGC. The recording volume has improved, but at the same time, the background noise has also increased.

    2. When this value is increased further, the recording becomes muted.

  • Hi Wenzel,

    Mir should be able to respond by Tuesday

  • Hi Wenzel,

    I looked at your audio files, and we can see that the AGC boosts the audio by a lot!

    First, see if you can place the microphone closer to the subject you are recording to try to increase the microphone signal to noise ratio. Then, to further increase the gain but try to cut off the noise, you can turn on the AGC, and the AGC has a noise gate setting which if you set the gate at the average dB level that you see is the difference between the signal you want versus the background noise, it will turn off the extra gain on the noise. The settings for that are in registers 26-28 for the left AGC.

    I don't know what you mean by the value increasing mutes the recording - the max PGA gain you can apply is 59.5 dB, and if you set your register to 0x75 then the gain applied is 58.5dB. You can also adjust volume in to the ADC with registers 17-24 for input level control, make sure you are not attenuating the signal before it makes it to the PGA (set to 0dB input level control gain).

    Best,
    Mir

  • 1、I don't understand how to configure the noise gate settings after enabling AGC. How should the parameters of registers 26 - 28 be adjusted? Are there any recommended values or detailed instruction documents?

    2、The value of PGA gain (reg:16) I mentioned is 0x4B (75), and when it is increased further, it will be muted. For example, when the value is 0x55 (85).\

    3、The mic is only connected to MIC1L, and the value of reg 19 is 0x84, which means the input level control gain is set to 0dB.\

    4、Can AGC be debugged after increasing the PAG gain? Or should AGC be configured first and then increase the PGA gain?

  • Mir is out of office but should be able to update this thread by the end of the week.

  • Hi Wenzel,

    1- The AGC has a section in the datasheet, section 10.3.3.2.2. I can try to explain here as well. The values depend on what your input signal is. I can explain the different settings you see in the registers. Target level is what the output of the AGC is aiming for, so when your input signal is below that value, it will increase the gain of your input by changing the PGA amplification to reach an output of that target level. Attack time is how long it takes to increase the gain to that target level, and decay time is how long it takes to decrease the gain once the input signal goes over the target level. So, for example, say you have a signal that typically is around -30dB when the subject talks into your microphone, and the noise is 30 dB lower so ~-60dB. If you set the target level to -8dB, then your PGA will amplify the signal around 22dB to reach -8dB, and it will take 8 ms to get there (from the default time constant). And, when your input signal suddenly increases to around -6dB into the microphone, then it will take 100 ms by default to decrease the PGA back to its original setting of 0dB gain. Then, the next register is the maximum gain allowed (reg 27 for L-AGC), which says how much the PGA can increase to reach the desired level, so if your signal was ~-30dB and you set the max gain to 10dB, then it would only increase to ~-20dB even when you set the target level to -8dB. Next are the noise gate settings, you should choose the threshold first, this is the dB level that anything BELOW will be considered "silence" and will bring down the gain when the sound in is below the gate. The hysteresis setting is so that if there is a sound right around that threshold, it will not wildly turn on and off the gain, so a hysteresis of 3dB and a threshold of -36dB will mean that if your signal goes above -36dB, it needs to hit -33dB before it will start the AGC, and when the signal goes below -36dB, it needs to be -39dB before it turns off the AGC.

    There is also this diagram from the datasheet: 

    I hope this helps explain enough. Keep in mind that all these dB levels are dBFS from what the input signal is received as, you should be able to tell with Audacity or any other type of waveform viewer if you do not already have a way to tell dBFS of your digital signal. 

    Best,
    Mir