hello
I am using audio loop back program from TI's wiki for DSKC6173.
I have modified the code (or added certain blocks of audio processing for real time audio data) while working on adaptive filter
Some of the code part is as :
// Codec configuration settings
DSK6713_AIC23_Config config = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x01f9, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x01f9, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
void main ()
{
DSK6713_AIC23_CodecHandle hCodec;
Int16 OUT_L, OUT_R;
Uint32 IN_L,temp;
int i,k,j;
// Initialize BSL
DSK6713_init();
hCodec = DSK6713_AIC23_openCodec(0, &config);
// Set frequency to 48KHz
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8KHZ);
for(;;)
{
// Read sample from the left channel
while (!DSK6713_AIC23_read(hCodec, &IN_L));
// Feeding the input directly to output you can add effects here
temp = IN_L;
....
...// 40 lines of code including loops(128 iterations X 3times)
........
OUT_L = (Int16)(y_n*327680.0); //2^15;
OUT_R = (Int16)(y_n*327680.0); //2^15;
//OUT_L = IN_L; //OUT_L = fact*IN_L;
//OUT_R = IN_L; //OUT_R = fact*IN_L;
// Send sample, first left next right channel
while (!DSK6713_AIC23_write(hCodec, OUT_L));
while (!DSK6713_AIC23_write(hCodec, OUT_R));
}
}
the result is wrong when compared to other C compilers such as Visual Studios(when performed offline but on the same data). I think there might be a problem of delayed sample reading due to lag induced by the code. I am new to CCS and Audio coding and any help would be extremely helpful.
thanks
Nageshwar