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.

EVMC5515 - Problem with reading audio samples from AIC3204 two stereo inputs using I2S2

I am using EVMC5515. In my application I need two input audio sources working simultaneously not independently.  We bought EVMC5515 since it has two stereo inputs.  Unfortunately, we are unable to make it work for the dual input scenario.  If you have any ideas help us please. 

Single input case everything looks good. Also, I can switch between the inputs by changing the register (52-54) configuration of the AIC3204 Codec.  Here the problem is I need to read the two different samples from the codec to the DSP using the I2S2.  Unfortunately it doesn’t work. Your help.. help… will be much appreciated.  Thanks in advance.

Regards,

Krishna.

AIC3204 and I2S2 Configuration is as given below.

I am using C5515EVM. I am trying to read the audio samples from the Stereo In1 and Stereo In2 simultaniously.

The two inputs are working fine if I read the samples from one interrupt source at a time but not when used at the same time as given below. I want to read the data from the two independent audio sources connected to the Stereo In1 and Stereo In 2 respectively. When I use a loopback test of the received audio the second source is not reaching the DSP.  Currently I am stuck don't know what to do, your help is much appreciated.

Thanks in advance

Please find the code below:

for ( ;; ) {

/* Read Digital audio */

while((Rcv & I2S2_IR) == 0);   // Wait for receive interrupt to be pending

        data1 = I2S2_W0_MSW_R;

        data2 = I2S2_W1_MSW_R;

data0 = stereo_to_mono (data1, data2);

while((Rcv & I2S2_IR) == 0);   // Wait for receive interrupt to be pending

data3 = I2S2_W0_MSW_R;

data4 = I2S2_W1_MSW_R;

data = stereo_to_mono (data3, data4);

}

AIC3204 initialization is given below:

    AIC3204_rset(  0, 0x00 );   

    AIC3204_rset(  1, 0x01 );   

    AIC3204_rset(  0, 0x01 );   

    AIC3204_rset(  1, 0x08 );   

    AIC3204_rset(  2, 0x00 );   

    AIC3204_rset(  0, 0x00 );   

    AIC3204_rset( 27, 0x00 );   

    AIC3204_rset(  4, 0x07 );   

    AIC3204_rset(  6, 0x20 );   

    AIC3204_rset(  7, 0 );      

    AIC3204_rset(  8, 0 );      

    AIC3204_rset(  5, 0x92 );   

    AIC3204_rset( 13, 0x00 );   

    AIC3204_rset( 14, 0x80 );   

    AIC3204_rset( 20, 0x80 );   

    AIC3204_rset( 11, 0x84 );   

    AIC3204_rset( 12, 0x82 );   

    AIC3204_rset( 18, 0x84 );   

    AIC3204_rset( 19, 0x82 );   

    AIC3204_rset(  0, 0x01 );   

    AIC3204_rset( 14, 0x08 );   

    AIC3204_rset( 15, 0x08 );   

    AIC3204_rset(  0, 0x00 );   

    AIC3204_rset( 64, 0x02 );   

    AIC3204_rset( 65, 0x08 );   

    AIC3204_rset( 63, 0xd4 );   

    AIC3204_rset(  0, 0x01 );   

    AIC3204_rset( 18, 0x00 );   

    AIC3204_rset( 19, 0x00 );   

    AIC3204_rset(  9, 0x0C );   

    AIC3204_rset(  0, 0x00 );   

    EVM5515_wait( 500 );      

    AIC3204_rset(  0, 0x01 );   

    AIC3204_rset( 52, 0x3C );   

    AIC3204_rset( 55, 0x3C );   

    AIC3204_rset( 54, 0x03 );   

    AIC3204_rset( 57, 0xC0 );   

    AIC3204_rset( 59, 0x0f );   

    AIC3204_rset( 60, 0x0f );   

    AIC3204_rset(  0, 0x00 );   

    AIC3204_rset( 81, 0xc0 );   

    AIC3204_rset( 82, 0x00 );   

    EVM5515_wait( 200 );

// Wait

 

/* I2S settings */

    I2S2_SRGR = 0x0015;

    I2S2_ICMR = 0x0028; 

// Enable interrupts

    I2S2_CR   = 0x8012;    

  • Could you please elaborate on what is not working fine?

    Is the code stuck up at the second while((Rcv & I2S2_IR) == 0);   above?

    Are you not receiving any audio out on you lineouts?

    What is the exact nature of failure you're observing?

  • Hi,

    Thank you so much for the reply. 

    1.  We want to read audio samples from two different input sources and we are using EVMC5515.  This EVM has two built in microphones (x2) and  two line inputs.

    2. The two audio sources are connected to two line inputs and the AIC3204 codec is configured to read inputs from two line inputs.

    3. Unfortunately the samples from the second audio source are not reaching the DSP.

    4. The big question is ..

    Using EVM5515, is it possible to use two audio inputs (line inputs)  simultaniously to read samples from two different sources?

    5. Do you have any suggestions on which TIEVMs  to use for proving audio processing algorithms such as dual microphone noise cancellation.

    Thanks in advance

    KP.

  • 1. You mention, when run independently, the audio streams out. With the above code kept the same, could you confirm the following:

    a.  if you stream only STEREO_IN1, does it work?

    b.  if you stream only STEREO_IN2, does it work?

    2. Could you try the following change to your code:

    for ( ;; ) {

    /* Read Digital audio */

    AIC3204_rset( 52, 0x30 );   

    AIC3204_rset( 55, 0x30 );  

    while((Rcv & I2S2_IR) == 0);   // Wait for receive interrupt to be pending

            data1 = I2S2_W0_MSW_R;

            data2 = I2S2_W1_MSW_R;

    AIC3204_rset( 52, 0x0c );   

    AIC3204_rset( 55, 0x0c );  

    data0 = stereo_to_mono (data1, data2);

    while((Rcv & I2S2_IR) == 0);   // Wait for receive interrupt to be pending

    data3 = I2S2_W0_MSW_R;

    data4 = I2S2_W1_MSW_R;

    data = stereo_to_mono (data3, data4);

    }

    Best Regards.

  • Thank you for the response. I appreciate your inputs. Please find my answers below:

    a.  if you stream only STEREO_IN1, does it work?

    YES, it works good. 

    b.  if you stream only STEREO_IN2, does it work?

    YES, it works good. 

    I will try changing the code and let you know how it goes.

    Regards,

    KP.