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.

Gap cycle between Read and write instruction in TMS320c6713

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   

  • Nageshwar,

    Q1: What is wrong?

    Q2: Do you get the different answers when you run it on the DSK6713 in offline mode, just looking at the output data in a buffer to compare with the VS version?

    Q3: From what evidence did you decide the problem might be "delayed sample reading"?

    Regards,
    RandyP

  • Hello randyP

    Thanks for your reply. I am running my above code on Tms320c6713 hardware (real time)and comparing a variable in ccs5 and VS 13 (offline) with the same input and same code..nageshwar

  • Nageshwar,

    I will try to help you when you address my three earlier questions.

    Note that for comparison purposes, you must do the DSK6713 run in offline mode where you save the data to RAM the same way you do it on the VS13 run. Comparing offline to online analog data will not be easily analyzed. But comparing offline to offline will eliminate a barrier to progress.

    Regards,
    RandyP
  • Thanks RankyP for your time ....I did some basic mistake in my code related to array usage. i got your point ...i should compare offline data to offline data.

    Thanks
    nageshwar