cancel
Showing results for 
Search instead for 
Did you mean: 

Is STM32F401VC Discovery Board suitable to implement the LIBMAD into it for decoding MP3 purpose?

kwanweipeng
Associate II
Posted on January 06, 2015 at 07:46

Hello,

I am currently developing an application based on the STM32F401VC-Discovery Board to decode the MP3 data anhd play it out as WAV. I have tried different methods as suggested by everyone but comes out with no result as all. I found out the main problem seems to be dealing with the malloc side as the board cannot allocate the required memory. So, I opt for the optimized version of Libmad from Philips. Still, nothing happened. Can somebody tell me whether is this STM32F401 suitable for the Libmad or shall I changed the board to STM32F407 (maybe)? Below are some details about the STM32F401:-

  • Memories
  • Up to 256 Kbytes of Flash memory
  • Up to 64 Kbytes of SRAM
For more info, please refer here => http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1577/LN1810/PF255711

Thank you.

#stm32f401-audio-codec #libmad
4 REPLIES 4
Posted on January 06, 2015 at 17:53

Haven't used LIBMAD, presumably there are some specification / requirements provided. Suggest you use the library on a PC, and understand how the data goes in and comes out, and the resources (memory) it takes.

ST also has a library, but suspect you have to request it from them.

http://www.st.com/st-web-ui/static/active/cn/resource/technical/document/data_brief/DM00024441.pdf

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
kwanweipeng
Associate II
Posted on January 07, 2015 at 05:10

Hello Mr. clive1,

Thanks for your suggestion. May I know is the f_read functions in the STM32 from Chan Library will read the next bulk of data after being called the second time? Like this:-

f_read(&FileRead, ReadStart, ReadSize, &br);

In the code above, when we read the MP3 for the first time, we will get the MP3 header being stored in the ''ReadStart'' address. What if I called the function ''f_read'' above for two times like below:-

f_read(&FileRead, ReadStart, ReadSize, &br);
f_read(&FileRead, ReadStart, ReadSize, &br);

Will it update it's pointer and read the upcoming bytes or still read from the start? Sincerely, Kwan
AvaTar
Lead
Posted on January 07, 2015 at 12:56

Will it update it's pointer and read the upcoming bytes or still read from the start?

 

It continues to read the next bytes, if present in the file.

The f_read() function is similiar to the Posix function read(). But since some clib support is missing (like errno), the interface (parameters) had to be changed.

BTW: I never tried MP3/libmad on a STM32, but would be surprised if there is a free compatible port. On my Linux host, it shows linkage against libc and liblinux.

kwanweipeng
Associate II
Posted on January 08, 2015 at 02:29

Hello Argentum,

Thanks for your explanation. 

BTW: I will share out the code here as soon as it's done for anyone interested to try it out in an easier way.

Sincerely,

Kwan