XMOS chip buffering issue
Posted: Wed Aug 27, 2014 9:15 am
I am working on MC board for audio processing. I added dsp core between decouple and audio cores. dsp core includes c codes. I am using 4 channels to record audio. When I increase buffer length then mc board return audio samples weird as shown in figure below.
Smaller buffer length works OK. But length is more than 53 it return like below figure.
1. What is the problem?
I cannot find what is the reason for this.
2. How to solve this if buffer length is more then 100 or more?
here is part of source code in .xc
here is part of .c code named cfunction
3. The function routine is wrong? So this problem is occurring?
Smaller buffer length works OK. But length is more than 53 it return like below figure.
1. What is the problem?
I cannot find what is the reason for this.
2. How to solve this if buffer length is more then 100 or more?
here is part of source code in .xc
Code: Select all
#pragma unsafe arrays
static inline void doDspIn(int samples_in_pre[], int samples_in_post[]){
#pragma loop unroll
for (int i=0;i<NUM_USB_CHAN_IN;i++)
{
cfunction(i,samples_in_pre);
samples_in_post[i] = samples_in_pre[i];
}
}
Code: Select all
#define BUFFER_SIZE (53)
...
void cfunction(int iChan,int * sampleFromXC)
{
for(int iSample=0; iSample<BUFFER_SIZE; iSample++)
{
bCh[iChan][iSample] = sampleFromXC[iChan];
sampleFromXC[iChan] = bCh[iChan][iSample];
}
}
3. The function routine is wrong? So this problem is occurring?