Forum: ARM programming with GCC/GNU tools MP3 decoder with cortex M3

von Toto T. (Company: Poulet) (marsther)

Rate this post
0 useful
not useful
I have implemented an MP3 decoder based on helix decoder on a LM3S9B96 
microcontroller and I want to play the PCM sample (WAV) decoding through 
the audio codec.This board has one cortex M3 core.For play the song in 
the board I use the codec TLV320AIC23 of the board .I transfer the 
sample to the codec via i2s link by using one DMA controller.But I have 
one limitation with the DMA transfer , the maximum transfer I can make 
is 1024 items to tranfered , but the size of the PCM output array (MP3 
decoder output) is 2304  so he has 2304 short elements (that means 
1152*2 =2304).I must to transfer steaming MP3, and I want to used ping 
pong mode for this, but I can't used ping pong mode buffer to transfer 
1152 items, so I have implement one solution that transfer 576 items in 
primary buffer and 576 items in alternate buffer of the DMA controller.I 
use 4 buffeurs instead 2 (for transfer 4*576 items=2304).I have 2 
primary buffeur and  2 alternate buffer.When the first primary transfer 
has done I do the first alternate transfer and so on, beacause I can't 
fill primary buffer when he is done he has only 1152 size and my PCM 
output has 2304.I refill primary and alternate buffer of the DMA 
controller with MP3 decoder , so I refill primary and alternate at the 
same time when the second primary buffer is done.
But during the sound play I have some noise in the song and the song is 
too slow than original, it's like I lose some sample in the process.
Is anyone have one idea for help Me??I hope you've understand my 

Thank you in advance, and I hope someone will help me,


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.