MP3 Decoder Options - Page 1
Forum section: electronics / projects

author: Kasper
author_rank: Frequent Contributor
timestamp: January 27, 2019, 06:37:13 pm
content: Hello,I am looking for an MP3 decoder for an MP3 player I hope to put on Kickstarter or similar.Last year I had a working prototype using VS1053B. But then I got busy with other projects and got married so it got shelved with all my other proofs of concepts. I am hoping to get back into it soon.I chose VS1053B because it was used by Sparkfun and Adafruit and sounded like it had pretty good quality output. Now that I have VS1053B working, I think I should move forward with that.I want it to be solid, simple and affordable with good quality sound not over engineered, over spec'd, and over priced.Does anyone recommend any other MP3 decoders I should consider?

author: amyk
author_rank: Super Contributor
timestamp: January 27, 2019, 06:52:19 pm
content: Those are way overpriced, costing even more than a general-purpose MCU you can run an MP3 decoder on (and now that the patents have expired, you don't even have to worry about that --- if you were going to.) Look at what's in the various Chinese MP3 players...

author: tsman
author_rank: Frequent Contributor
timestamp: January 27, 2019, 07:00:01 pm
content: The only other dedicated MP3 codec chip I know of is the ST STA013 but it isn't cheap either. Do what amyk said with a microcontroller.

author: Kasper
author_rank: Frequent Contributor
timestamp: January 27, 2019, 07:33:59 pm
content: Thank you for the replies. I guess I'm shopping for MCUs and DACs when I get home from my hikeWhat are the min requirements of an MCU to read MP3 off microSD card, decode then send to DAC?I'm guessing I'll want a separate DAC but I'll have a look for MCUs with DACs >= 16 bit first.

author: Kasper
author_rank: Frequent Contributor
timestamp: January 28, 2019, 04:43:56 am
content: Looks like MCUs with DAC >= 16 bit aren't too common. And audio DACs are spread into multiple categories on DK.DK categories with audio DACs:Data Acquisition - ADCs/DACs - Special PurposeData Acquisition - Digital to Analog Converters (DAC)Interface - CODECsLinear - Amplifiers - AudioThe TI series TLV320DAC is my favorite so far but if I have to get a separate DAC, I mind as well stick with VS1053B for my DAC and decoder.Price for VS1053B-L is high at low quantities but it drops quickly ($10usd at qty 100). Still a little pricey but it seems much cheaper than R&D for a new MCU and DAC.On a side note, some places call it VS1053B and others call it VS1053B-L. Seems to be the same part and some people just drop the "L".

author: mariush
author_rank: Super Contributor
timestamp: January 28, 2019, 05:49:07 am
content: You should look into supporting Opus as well, since it has much better quality than mp3 and even AAC... should also support FLAC as well.PIC32 has enough power to decode them, and there's libraries available:https://www.microchip.com/design-centers/audio-and-speech/technology/pic32-digital-audio/pic32-audio-decodersAnd not only pic32, maybe the microchip ATSAM family or some other ARM Cortex micro would work for you, with a separate audio codec (you can use spi or i2s or something) ... for example see this (probably overkill but has usb, memory card support, 120 mhz) :https://www.digikey.com/product-detail/en/microchip-technology/ATSAM4S16CA-AN/1611-ATSAM4S16CA-AN-ND/6829666

author: Kasper
author_rank: Frequent Contributor
timestamp: January 28, 2019, 07:29:31 am
content: Thanks for the links.VS1053B supportsOgg Vorbis/MP3/AAC/WMA/MIDII think you are right about ATSAM. Adafruit has a library they say can decode MP3 and output through DAC on ATSAMD51J19. Its a little big though, small size is one of my requirements.Microchip wants $200usd for MP3 library.

author: mariush
author_rank: Super Contributor
timestamp: January 28, 2019, 07:41:08 am
content: There are smaller versions, like a 64-QFN one :https://www.digikey.com/product-detail/en/microchip-technology/ATSAM4S8BA-MU/ATSAM4S8BA-MU-ND/3593646See whatever has better price if you buy 10 or more, and see if you can manage with just 64 KB of ram... I think most audio formats won't need more than around 10-16 KB of memory to decode so you may be able to work with just 64k of ram.You probably saw this already :https://learn.adafruit.com/native-mp3-decoding-on-arduino/overviewand maybe check this out as well :https://github.com/otsaregorodtsev/walkgeek

author: amyk
author_rank: Super Contributor
timestamp: January 28, 2019, 12:19:20 pm
content: Quote from: Kasper on January 28, 2019, 07:29:31 amGithub wants $0https://github.com/lieff/minimp3

author: Kasper
author_rank: Frequent Contributor
timestamp: January 28, 2019, 04:11:00 pm
content: Quote from: mariush on January 28, 2019, 07:41:08 amThanks again for the links.I started with atmega328P and ran out of memory. Now I am kicking myself for trying to save a few dollars on an MCU.I appreciate the suggestions and have noted them for version 2.For version 1, I am not looking for absolute best BOM regardless of R&D time. At my volumes, R&D time is a significant cost.

author: Kasper
author_rank: Frequent Contributor
timestamp: January 28, 2019, 04:13:16 pm
content: Quote from: amyk on January 28, 2019, 12:19:20 pmYes and my PC that has working code wants $0

author: OwO
author_rank: Super Contributor
timestamp: January 28, 2019, 04:37:09 pm
content: STM32F107RCT6.64KB ram, 256KB flash, and integrated 12-bit DAC.$1.5 at small quantities.

author: Kasper
author_rank: Frequent Contributor
timestamp: January 28, 2019, 08:52:28 pm
content: Thanks but I don't think 12 bit will cut it. I've read 16 bit is plenty for everyone except the most expert audiophiles. So I am aiming for atleast 16.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 29, 2019, 12:41:07 am
content: Quote from: Kasper on January 28, 2019, 04:43:56 amThat's true. But you could consider another option. Is it going to be a portable MP3 player, mainly used with headphones? If so, you'll need an headphones amp anyway, so an additional IC.There are actually audio DACs that include an headphones amp, so you will only need an MCU capable of decoding MP3 and having an I2S output, and such a DAC. Problem solved.For instance the TLV320DAC3100 from TI is about $2.5 per 1, about $1.8 per 100 (Digikey).http://www.ti.com/product/TLV320DAC3100With a VS1053B, you'll need an MCU anyway to feed it? But it does include an headphones driver. So does the above DAC. And the overall sound quality will probably be much higher. So you'll essentially go from a $10 IC per 100 to a $1.8 IC per 100, plus the MCU, for a better sounding solution.The advantage is that it'll be also more flexible. You could for instance add FLAC decoding or anything else the MCU can decode.

author: mariush
author_rank: Super Contributor
timestamp: January 29, 2019, 01:03:08 am
content: If money's no issue, how about something like Cirrus Logic WM8731 :https://www.digikey.com/product-detail/en/cirrus-logic-inc/WM8731SEDS-RV/WM8731SEDS-RVTR-ND/5036734It's around 2$ in quantity (1000+)The WM8731 or WM8731L (WM8731/L) are low power stereo CODECs withan integrated headphone driver. The WM8731/L is designed specifically for portable MP3 audio and speech players and recorders. The WM8731 is also ideal for MD, CD-RW machines and DAT recorders.Stereo line and mono microphone level audio inputs are provided, along with a mute function, programmable line level volume control and a bias voltage output suitable for an electret type microphone.Stereo 24-bit multi-bit sigma delta ADCs and DACsare used with oversampling digital interpolation and decimation filters. Digital audio input word lengths from16-32 bitsand sampling rates from8kHz to 96kHzare supported.Stereo audio outputs are buffered for driving headphones from a programmable volume control, line level outputs are also provided along with anti-thump mute and power up/down circuitry.The device is controlled via a2 or 3 wire serial interface.The interface provides access to all features including volume controls, mutes, de-emphasis and extensive power management facilities.If you want something cheaper, may want to check out AK4951 that costs around 1.3$/100 or 1$ /500 :https://www.digikey.com/product-detail/en/akm-semiconductor-inc/AK4951EN/974-1064-1-ND/5180415AK4951 is a low power24-bit stereo CODEC with a microphone, headphone and speaker amplifiers. The AK4951 supports sampling frequency from8kHz to 48kHz. It is suitable for a wide range of application from speech signal processing for narrowband, wideband and super wideband to sound signal processing for audio band.The input circuits includea microphone amplifier,an automatic wind noise reduction filter of the proprietary algorithms and a high performance digital ALC (automatic level control) circuit, therefore the AK4951 can record with high-quality sound regardless of whether indoors or outdoors. In addition, the output circuits include acap-less headphone amplifierwith a negative voltage generated by charge pump circuit and aspeaker amplifier with 1W output power. It is suitable for various products as well as portable applications with recording/playback function.(but keep in mind it's listed as "not for new designs" - check out other parts from them which are "active", before committing to this part)

author: OwO
author_rank: Super Contributor
timestamp: January 29, 2019, 03:34:12 am
content: It's 12 bit but running at 1MSPS. With just a little bit of delta sigma modulation you can get >16 effective bits.If you just need to play mp3 files from an SD card maybe look into the dfplayer module, which is about $1.5.I would say using a "proper" audio DAC here is overkill and the total cost of the solution shouldn't exceed $2.

author: ucanel
author_rank: Regular Contributor
timestamp: January 29, 2019, 04:15:30 am
content: I think you do not want cheap Chinese solutions butat least as a note i wanted to write about it:There is YX5200 and variations of it likebuilt in small memory and or amplifier etc.It goes under these names at aliexpressGpd2846 - U Disk Mini Player - DfPlayer - arduino mp3 module.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: January 29, 2019, 06:08:42 am
content: STM32F401RCT6 + CS4344 total cost under 2$

author: Miyuki
author_rank: Frequent Contributor
timestamp: January 29, 2019, 07:28:39 am
content: Quote from: ali_asadzadeh on January 29, 2019, 06:08:42 amI agreeThis provide good sound quality and flexible fast CPU can decode any format (wonder if this can have enough power to decode even small video) for good price

author: Kasper
author_rank: Frequent Contributor
timestamp: January 29, 2019, 07:31:41 am
content: Thanks everyone for the replies. I appreciate all the different options you are sharing.I started out with the dfplayer. Great option for something simple but I want better quality.If use 12 bits and some fancy firmware and say it has 16 effective bits, will I get called out by audiophiles for over-selling a 12 bit DAC or will most people understand what you are saying about 1 MSPS?This will be one of my first products done on my own, I don't expect high or even moderate volume sales, though I would like to be prepared for that. My main goal is to build a good reputation with solid products delivered on time. And to not spend years worth of weekends developing products that never get released.

author: Whales
author_rank: Super Contributor
timestamp: January 29, 2019, 07:36:33 am
content: Quote from: Kasper on January 28, 2019, 08:52:28 pmOpinion: 16bits is useful for editing (it gives you a little headroom), but for final renders and playback it's not super necessary. You're already talking about MP3 after allTo counter your "from what I've read" with my own "from what I've read": many audio DAC chipsets that claim 16 bits don't otherwise have a low enough noise floor in most circuit implementations for this to be useful anyway. The "resulting" number of bits out is lower.

author: OwO
author_rank: Super Contributor
timestamp: January 29, 2019, 07:57:52 am
content: Quote from: Kasper on January 29, 2019, 07:31:41 amAudiophools will have far more problems with the use of MP3 compressionSeriously though, ~everyaudio DAC on the market nowadays use delta-sigma modulation with a 1- or 2-bit DAC internally. Implementing a delta sigma modulator in software is trivial. Start with outputting the 16 bit sample rounded down to 12 bits, and accumulate the error value into a variable. Once the accumulator reaches a set threshold you switch to rounding up (if the accumulator is negative) or rounding down (if it was positive).I think even without the delta-sigma tricks you probably won't tell the difference between 12-bit and 16-bit audio.

author: amyk
author_rank: Super Contributor
timestamp: January 29, 2019, 01:01:40 pm
content: Quote from: Miyuki on January 29, 2019, 07:28:39 amThat's more than enough to decode small video,theseused to be popular many years ago and could play 160x128 MJPEG at 15FPS --- using a 24MHz Z80.

author: Kasper
author_rank: Frequent Contributor
timestamp: January 29, 2019, 04:35:26 pm
content: My title is a little misleading. To be clear, I plan to offer more than just MP3.VS1053B supports Ogg Vorbis/MP3/AAC/WMA/MIDI. It sounds like some of those are valuable options and might make use of higher resolution.I'm not sure if I could tell the difference between 12 bits and 16 bits. I don't want to be all about the marketing but I have noticed audio products proported as high end on ks seem to do much better than moderate to low cost products. I want to make sure I have good specs to appease that larger customer base even if it is better than needed.