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;