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.

Issues with TWL6040 HMIC capture

Other Parts Discussed in Thread: TWL6040

Hi,
We are using TWL6040 in our custom Board. We have requirement in which Audio input can be either MIC input or Line In input.We are using HMICP and HMICN pins of TWL6040 to interface the Audio Input. Please refer http://e2e.ti.com/support/omap/f/849/t/335091.aspx link which says headset MIC can be used for Line-in and MIC input provided signal levels are within the TWL6040 spec.
When we use MIC-in audio input we are setting Pre-amplifier (MicAmpL) gain to 24dB. When we use Line-in audio input we are setting Pre-amplifier (MicAmpL) gain to 12dB, since Line-in signal level will be higher than Mic input.
With Line-in we are facing few issues. We are able to capture proper Voice playback ( Low frequency) from Line-in input. But when we play Music files from Line-in input we are seeing distorted audio file being captured. It looks like high frequency content being attenuated during capture. We have few queries,
[1] In the TWL6040 block diagram there is a AAFL (Anti-aliasing Filter Left) block before ADC. What is the cutoff frequency of the AAFL. Will this attenuate high frequency audible audio signal ?
[2] What is the audio frequency range that can be captured by ADCL block in TWL6040?
[3] Is there any specific MIC or Line-in audio frequency related settings in the TWL6040?
Thanks and Regards,
Dinesh Guni
  • Any suggestion for above query?

  • Hello Dinesh,

    1. In the TWL6040 block diagram there is a AAFL (Anti-aliasing Filter Left) block before ADC. What is the cutoff frequency of the AAFL. Will this attenuate high frequency audible audio signal ?

    - There is no information about cut off frequency of AAFL. The Antialias attenuation at Fs is:


    2. What is the audio frequency range that can be captured by ADCL block in TWL6040?

    - Two audio analog-to-digital converter (ADC) channels: 96-dBA signal-to-noise ratio (SNR). The clock system of the TWL6040 is based on a 48 kS/s audio data rate for all channels. The data converters on OMAP use a fixed over-sampling ratio (OSR) equal to 80 (3.84 MHz).

    3. Is there any specific MIC or Line-in audio frequency related settings in the TWL6040?

    - No, there is no any specific requirement for microphone.

    You can see the structure of TWL6040 drivers and see the default values set:

    sound/soc/omap/omap-abe-twl6040.c

    sound/soc/codecs/twl6040.c

    drivers/mfd/twl6040-core.c

    Best regards,

    Yanko

     

  • Hi Yanko,

    Thanks for your response.

    As explained, in our test case we need to capture full range of audio signal. But it seems some of the high frequency audio contents are attenuating during the recording. Can you think of any exercise that we can  perform to solve this issue?

    By the way is there any platform which has TWL6040 line-in (AFM) proved?

    Thanks and Regards,

    Dinesh Guni

  • Hello Dinesh,

    #Q1: As explained, in our test case we need to capture full range of audio signal. But it seems some of the high frequency audio contents are attenuating during the recording. Can you think of any exercise that we can  perform to solve this issue?

    -  I suggest you checking, MICGAIN register of TWL6040 and set 6dB-preattenuation per microphone's input channels. Set the programmable preamplifier gain.
    See in sound/soc/codecs/twl6040.c configuration file.

    /*
     * MICATT volume control:
     * from -6 to 0 dB in 6 dB steps
     */
    static DECLARE_TLV_DB_SCALE(mic_preamp_tlv, -600, 600, 0);

    /*
     * MICGAIN volume control:
     * from 6 to 30 dB in 6 dB steps
     */
    static DECLARE_TLV_DB_SCALE(mic_amp_tlv, 600, 600, 0);

    /*
     * AFMGAIN volume control:
     * from -18 to 24 dB in 6 dB steps
     */
    static DECLARE_TLV_DB_SCALE(afm_amp_tlv, -1800, 600, 0);

    #Q2: By the way is there any platform which has TWL6040 line-in (AFM) proved?

    - Yes, you can refer to PandaBoard reference schematics: http://pandaboard.org/sites/default/files/board_reference/pandaboard-ea1/panda-ea1-schematic.pdf

    and http://pandaboard.org/sites/default/files/board_reference/pandaboard-es-b/panda-es-b-schematic.pdf

    Best regards,

    Yanko