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.

TMDSLCDK6748: Taking input from MIC IN (J11)

Part Number: TMDSLCDK6748

I was successfully able to run the MCASP_Audio_lcdkOMAPL138_c674xExampleProject, the instructions for which are provided in the Processor SDK RTOS. This demo takes input from the LINE IN (J10 Top) and plays it out on LINE OUT (J10 Bottom). However, I wish to take input from a MEMS mic (Sparkfun ADMP401 BOB) connected to the MIC IN port. I power the mic externally instead of using MICBIAS. I am unable to do this even after I make necessary changes in the AIC31.c file as suggested here. I edit the function int32_t aic31InitAdc in the file as follows:

    /* enable the programmable PGA for left and right ADC                     */
    retVal |= aic31RegWrite(instHandle, Aic31_P0_REG15, (uint8_t)0x00);
    retVal |= aic31RegWrite(instHandle, Aic31_P0_REG16, (uint8_t)0x00);

    /* MIC3L/R is connected to the left ADC PGA                           */
    retVal |= aic31RegWrite(instHandle, Aic31_P0_REG17,(uint8_t)0x00);//Here

    /* MIC3L/R is connected to the right ADC PGA                          */
    retVal |= aic31RegWrite(instHandle, Aic31_P0_REG18,(uint8_t)0x00);//Here

    /* power on the Line L1R                                                  */
    retVal |= aic31RegWrite(instHandle, Aic31_P0_REG19,(uint8_t)0x04);

    /* REG20 (not required)                                                   */
    /* REG21 (not required)                                                   */

    /* power on the Line LIL                                                  */
    retVal |= aic31RegWrite(instHandle, Aic31_P0_REG22,(uint8_t)0x04);

This does not help me get any input from the mic though. Even if I change 0x00 to 0x88 to change the input level control gain, it doesn't make a difference. Are there other places where I must make the change?

Overall, its hard to figure out how I can make these custom changes to starter demo codes in the TI processor sdk. For instance, my next step would be to save the sampled audio values to memory so I can work on filtering audio signal. However, I have no leads how/where to make these changes. Could you please suggest a good resource for an absolute beginner at programming dsp boards?

  • Ishani,

    We don`t extensively test with MICIN on the LCDK board as this was not a valid use case when the board was designed. However, we have some customers who have been able to get the microphone input working by connecting the MICBIAS. The LCDK design has the pin floating. Did you connect this to ground and then connect a externally powered MIC to it? 

    After you made the connections did you probe the clock, frame sync and the serializer pin to see if there is any data observed. In the LCDK, the DSP is the clock master so it drives the clock, so I would expect the clock and frame-sync to be present but since you don`t get any audio capture, we need to first understand if the AIC Codec is converting the analog audio to digital form and providing it to the MCASP RX pin or not. 

    In terms of programming or saving the audio data, if you have the example setup, you can locate the memcpy that us used to copy audio data from the TX buffer to RX buffer and replace that with your audio processing or save function. In general saving audio file using the DSP may impact your real time performance so I recommend that you process it and then send it to line out and use some PC tool to capture the filtered output. We have seen a lot of users leverage tools like Audacity for this function.

    Regards,

    Rahul   

  • Hi Rahul,

    Thanks for the input. However, that did not seem to be the issue.

    I figured that the function that I mentioned in MCASP_Audio_lcdkOMAPL138_c674xExampleProject (i.e, int32_t aic31InitAdc in aic31.c) is not being executed at all. Instead its the same function (AIC31ADCInit) defined in aic3106_if.c that is being invoked. I made changes to the register values in that file and I am able to get the input from the mic now.

  • About accessing the audio samples - what I want to do is basically run an adaptive filtering algorithm for noise cancellation. Therefore, I need the past N audio samples to be able to compute the new adaptive filter tap values and the anti-noise signal would have to be played through a speaker connected to LINE OUT to cancel the noise signal. Could you suggest a way to do this real time?

    It'll be very helpful if I can know exactly where in the code stack is the audio sample obtained from the codec.