I'm developing on OMAP-L137 http://www.ti.com/tool/tmdsoskl137
I tried to design my own audio effect. I have FIFO to keep audio data.
FIFO is just a one-dimension array. It's short[10000]
(I enlarge stack and heap size. So, there is no problem to use short[10000])
one FIFO input could work.
I could retrieve sound from ADC and generate sound to DAC.
"FIFO input" is save data in one-dimension array.
/**** standard sample code , add one FIFO input****/
/*** work successfully ***/
/**** standard sample code , add two FIFO input****/
/* Can't Work */
for
( sec = 0 ; sec < 1000 ; sec++ ){
for
( msec = 0 ; msec < 1000 ; msec++ ){
for
( sample = 0 ; sample < 48 ; sample++ ){
/* Read then write the right sample */
while
( ! ( MCASP1_SRCTL0 & 0x20 ) );
right_data = MCASP1_RBUF0_32BIT;
while
( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = right_data;
/* Read then write the left sample */
while
( ! ( MCASP1_SRCTL0 & 0x20 ) );
left_data = MCASP1_RBUF0_32BIT;
fifo_input (left_data);
fifo_input (left_data);
while
( ! ( MCASP1_SRCTL5 & 0x10 ) );
MCASP1_XBUF5_32BIT = left_data;
}
}
}
==>ADC / DAC can't have sound. It can't work.
Two FIFO input might consume too many CPU operation.
Why? C6747 should be 375MHz
375000000 / 48000 (sample rate) / 4 (2ADC,2DAC) = 1953
There should be enough CPU computing power to do "two FIFO input".
How to improve this? Please help me. Thx!