Ogg Vorbis decoding with STM32F103RE works!
Company  
ST Home | Microcontrollers

Index  »  ARM Cortex-M3 STM32  »  Ogg Vorbis decoding with STM32F103RE works!
     
   Ogg Vorbis decoding with STM32F103RE works!
 Moderated by :   »  STOne-32

Author
beginning argument    ( Replies received: 5 )
mdeneen   Posted 19-11-2008 at 17:17   



Registered on :
10-09-2009

Messages : 8

 OFF-Line

I was looking for this sort of information before I started, but was unable to find it. I figure that this may be worth posting for the next person who might be looking.

I have 22050 KHz stereo ogg vorbis decoding on a STM32F103RE, running at 48MHz. It suffers from some very minor popping at 32MHz -- with some tuning I could probably get that to work. With full PLL, I'm sure 44100KHz is possible, but I don't need that for my application.

I used the "Tremor" integer math reference decoder (http://svn.xiph.org/branches/lowmem-branch/Tremor/) and GCC (CodeSourcery G++). The DAC is a TI TLV320AIC23B, and the ogg files are stored on a MMC card. Decoded PCM data is buffered in SRAM and fed to the I2S peripheral with DMA transfers.

Overall, I am very happy with the STM32 cortex-m3 processors. Good job!

Mark



 Profile   Quote  
STOne-32   Posted 19-11-2008 at 18:28   





Registered on :
05-29-2007

From STMicroelectronics

Messages : 455

 OFF-Line

Dear Mark,

Excellent news and Great to Job for your port as well !! STM32 is designed to release your creativity

Can you share your project with others Forum users ? so we can may be enhance it by special hand made optimization.

Cheers,

STOne-32.



 Profile   www   Quote  
martin.davey   Posted 20-11-2008 at 13:58   



Registered on :
01-02-2009

Messages : 7

 OFF-Line

Hi Mark,

Nice one. If you are using the MMC are you decoding from a filesystem, or linear data block. If it's filesystem, just out of interest whos filesystem code are you using?

After playing with MP3, I did this a few months back with the STR9 using the tremor branch, and efsl (FAT16 filesystem). However, as I did not use an RTOS and make the most of the SD card fetch time, I ended up wasting cycles on the SPI (file read) which caused some gapping as the CPU could not quite keep up.

I am in the process of re-writing this with FreeRTOS, but I have also been drawn away by eCos / eCosCentric, who have released support for the STM32. So I am considering using this as it has built in filesystem support.


Martin.



 Profile   Quote  
mdeneen   Posted 20-11-2008 at 16:15   



Registered on :
10-09-2009

Messages : 8

 OFF-Line

Quote:

On 20-11-2008 at 13:58, Anonymous wrote:
Hi Mark,

Nice one. If you are using the MMC are you decoding from a filesystem, or linear data block. If it's filesystem, just out of interest whos filesystem code are you using?

After playing with MP3, I did this a few months back with the STR9 using the tremor branch, and efsl (FAT16 filesystem). However, as I did not use an RTOS and make the most of the SD card fetch time, I ended up wasting cycles on the SPI (file read) which caused some gapping as the CPU could not quite keep up.

I'm not familiar with the
I am in the process of re-writing this with FreeRTOS, but I have also been drawn away by eCos / eCosCentric, who have released support for the STM32. So I am considering using this as it has built in filesystem support.


Martin.




To STOne-32: Sadly, I am not at liberty to release my code.

Martin:

I am using the ELM FatFs library. (http://elm-chan.org/fsw/ff/00index_e.html) It looks like it is either the same or very similar to EFSL. I've had no trouble with the MMC SPI access keeping pace, although I agree it is somewhat wasteful. Since the STM32 I am using has 64K of RAM, I buffer 2K of the file before I start playing.

I'm not familiar with the STR9, but with the STM32 DMA transfers were immensely helpful. I think I would have trouble keeping up otherwise. Also, did you use the tremor low-mem branch?

Mark



 Profile   Quote  
martin.davey   Posted 20-11-2008 at 17:01   



Registered on :
01-02-2009

Messages : 7

 OFF-Line

Hi Mark,

Interesting, yes I did use the low mem branch. Tremor seems to work by dynamically allocating buffers all the time, and using the normal one I soon ran out of memory. Although it needs more CPU power to use lowmem.

Yes DMA is immensely useful, while playing back a decoded audio buffer, you can be decoding the next packet into another playback buffer. I would have also like to use DMA on the sector read command, which obviously using an RTOS could be done, thread only needs to wake up when DMA terminal count interrupt arrives, leaving the CPU to work on those intensive decode routines.

The other thing I started was porting the math routines to use the STM32 MAC. Did you do this in your port?


Martin.







 Profile   Quote  
mdeneen   Posted 20-11-2008 at 17:14   



Registered on :
10-09-2009

Messages : 8

 OFF-Line

I looked at the asm_arm.h in tremor, which doesn't assemble properly for the STM32. If I had trouble keeping up, implementing those with ASM for the cortex-m3 was my next step.




 Profile   Quote  
On Top

Search in the forums
 
Jump To