Hi Mr.Mirko,
I'm making WMA music player now with your library and Spiv's valuable information.
But, huge calculation of WMA decoding makes a skipping noise.
I have a question for sound library to increase the speed.
As you know, there are two PCM buffers as below in sound library.
======================================
#define playbuffer_size 4096*4
static unsigned char playbuffer1[playbuffer_size];
static unsigned char playbuffer2[playbuffer_size];
======================================
Those two bufferes are transfered to IIS FIFO via DMA in rotation(in turns).
I think when the playbuffer1 is doing DMA, we can update the playbuffer2 contents.
otherwise, we can update the playbuffer1 while playbuffer2 is transferring.
But, if you see below code in you library source code,
as you commented, to update a playbuffer, we need to wait for another buffer's
DMA transfer completion.
======================================
void gp_playbuffer( unsigned char *samples,int size) {
int i;
unsigned char *buffer;
if (size > playbuffer_size ) size = playbuffer_size;
while((rDSTAT2)!=0){ }; // wait for dma end...
buffer=playbuffer_zeiger;
for (i=0;i<size;i++) buffer
= samples;
}
======================================
If my understanding is correct, the efficiency of the ring-buffer is very low.
Is there any way to improve this routine ?
If I'm wrong, please let me know. :blink:
- omega5 -