cancel
Showing results for 
Search instead for 
Did you mean: 

Helix MP3 fails to decode audio at 44.1 kHz (OK at 48kHz)

Maxime3
Associate

Hello,

I try to decode MP3 files from SD card using I2S and DMA. It works fine with a sampling rate of 48 kHz, but it fails when using 44.1 kHz.

Specifically, the MP3Decode() function fails to decode the audio at 44.1 kHz.

I have checked the clock configuration and the I2S peripheral settings, but I can’t figure out what causes the failure.

(I use STM32F407vgt6)

Could you please help me understand what might be wrong or how to properly handle 44.1 kHz decoding in this setup?

If someone is interested i can send you the code.

Thank you in advance for your support!

5 REPLIES 5
Saket_Om
ST Employee

Hello @Maxime3 

What "issues", exactly, do you encounter?

What tests/investigations/debugging have you done to find out what's going on?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om
Andrew Neil
Super User

Are you talking about this: https://github.com/liuduanfei/helix ?

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Yes, i use this library.

Do you have ideas why it not work ?

Hello @Saket_Om,

When I decode MP3 files, I read the data from the SD card and send it to the decoder. The decoder sometimes fails, and I suspect it's because I'm not feeding it the data correctly.

While debugging, the MP3Decode() function returns errors such as ERR_MP3_INVALID_HUFFCODES or ERR_MP3_INVALID_FRAMEHEADER.
This might be due to the fact that I'm not providing a valid frame using the MP3FindSyncWord() function.

Can I share the code with you in case it helps to understand the issue better?


@Maxime3 wrote:

While debugging, the MP3Decode() function returns errors such as ERR_MP3_INVALID_HUFFCODES or ERR_MP3_INVALID_FRAMEHEADER.


So have you looked-up what, exactly, those codes mean?

Have you looked into where & why, exactly, those codes are generated.

 


@Maxime3 wrote:

I suspect it's because I'm not feeding it the data correctly.


So what have you done to investigate that hypothesis?

http://www.8052mcu.com/faqs/120313

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/706966/highlight/true#M49

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.