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.

Audio data with a lot noise

Other Parts Discussed in Thread: TVP5158

hi

I used dm6467 and my custom tvp5158 board to record some audio data. I got the data with a lot
noise.

The related registers of tvp5158 were set :

C0 = 0x00;
C1 = 0x88;
C2 = 0x88;
C3 = 0x60;
C4 = 0x02;
C5 = 0x00;

I also tried to set the registers of mcasp.
I set the RDATDLY bits of  RFMT from 0 to 2. But I found the noise was still high.
Could you tell me how to do?

thank.

best regards

Armstrong

  • Hi Armstrong,

    Can you provide information or a schematic of your TVP5158 audio input circuitry?  On the TVP5158 EVM, we use a 5.7K-5.7K divide by 2 on the audio inputs followed by 2.2uf AC-coupling capacitors.

    Can you provide information on how your TVP5158 I2S ouput pins are connected to the dm6467 input pins?

    How many TVP5158 input channels are you using?

    Are you currently using TVP5158 firmware patch code?

    We will check your TVP5158 register settings.

  • Hi Armstrong:

    I noticed in register C3 you have selected I2S-Justified mode.  This is usually only used when 2 audio channels are

    being recorded.  FS is high the entire first half of the sample.  In register C4 8-ch TDM is selected. 

    You may want to change register C3 to 0x40 to select DSP mode.  Then FS is high just the first bit of the frame.

    Of coarse, the I2S/DSP mode used by the DM6467 McASP has to be the same.

    It depends on how many audio channels you are recording.

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

  • Hello Armstrong,

    The most common cause of excessive audio noise is when the McASP data delay is set incorrectly.

    The TVP5158 audio data is delayed two BCLK cycles from the rising edge of the frame sync pulse. Therefore, the McASP data delay should be set to 2 bits.

    Recommend reviewing the TVP5158-DM6467 A/V driver sampe code provided at the following website.

        http://software-dl.ti.com/dsps/dsps_public_sw/dsps_swops_houston/ANALOG_VIDEO/DM_TVP5158_Driver.htm

    Regards,

    Jim

  • hi Michael T,

    Thank you.

    I have set the C3 to 0x70( Master mode, DSP mode ). But i found the noise  was still high.

     

    Regards

    Armstrong.

  • Hi Jim,

    Thank you.

    When I used dsp mode, mcasp_config.rxfmt was 0x000280f0;

    So,  the McASP data delay should be set to 2 bits.

    But the nosie of audio  data was very high.

    Regards

    Armstrong.

     

  • Hi Jim,

    Could I ask you another question? 

    I want to set mcasp0 to master mode, I2S mode and  48k sample_rate . so I modified  the related code.

    on the func : mcasp_configure

    printk(KERN_INFO "Configuring the McASP as Master\n");

      mcasp_config.aclkxctl = 0x000000A0;
      mcasp_config.ahclkxctl = 0x0008010;
      mcasp_config.txfmctl = 0x00000002;

      mcasp_config.aclkrctl = 0x000000A0;
      mcasp_config.ahclkrctl = 0x0008010;
      mcasp_config.rxfmctl = 0x00000002;


      //mcasp_config.pdir |= (0x7 << 26);
       if(  mcasp_id == 0){
        mcasp_config.pdir = 0xe0000001;
        audio_cfg->sample_rate = 48000;
        mcasp_unit->sample_rate = audio_cfg->sample_rate;
       }else{
        mcasp_config.pdir |= (0x7 << 26);
       }

    on the file: audio_controller.c
      

    /* This audio config is for each ASP */
    static audio_config_t audio_cfg[] = {
     {
      .mcasp_id = 0,
      //.mode = CODEC_IS_MASTER,   //default
      .mode = CODEC_IS_SLAVE,    

    #ifdef AIC32_I2S_MODE
      .channel_size = 16,  /* I2S mode */
    #else
      .channel_size = 16,   /* Hyun */
    #endif
      .serializer_count = 4,
      .serializer_mode[0] = CONFIGURED_AS_TX,       
      .serializer_mode[1] = CONFIGURED_AS_RX,
      .serializer_mode[2] = CONFIGURED_AS_INACTIVE,
      .serializer_mode[3] = CONFIGURED_AS_INACTIVE,
      .loopback = 0,
      .amute = 0,
    //#ifdef AIC32_DSP_MODE
    //  .tdm_slots = 16,  //Hyun 0
    //#else
      .tdm_slots = 2,   /* I2S mode */
    //#endif
      //.sample_rate  = 16000,   //default
      .sample_rate  = 48000,     

     },

    I could detect  the AHCLKR signal, but couldn't detect the sample rate signal.

    thanks.

    Regards

    Armstrong.

  • Hello Armstrong,

    The TVP5158 only supports audio sample rates of 8kHz and 16kHz.  See I2C address C0h in the TVP5158 data manual.

    Regards,

    Jim

  • Hi Jim,

    Sorry, I didn't  put my views across very well.

    I want to use other audio codec instead of  using tvp5158 . So I set mcasp0 as master mode, sample rate 48K.

    Regards,

    Armstrong.