Reading from an SD card and Decoding mp3 files
ejwong
Posts: 21
first of all, i just registered... well you know what that means.
my dad bought propeller and it looks interesting. so, as the title says, is it possible to read an SD card using propeller? and how do you program propeller to decode mp3 files from the SD card?
if theres an existing topic about this out there would you kindly link it? =P
my dad bought propeller and it looks interesting. so, as the title says, is it possible to read an SD card using propeller? and how do you program propeller to decode mp3 files from the SD card?
if theres an existing topic about this out there would you kindly link it? =P
Comments
I've seen two *.wav examples but none for *.mp3. One is from http://forums.parallax.com/showthread.php?123900-EFX-TEK-shows-the-Propeller-AP-16-WAV-Audio-Player-at-Parallax-wow! - I'm pretty certain the code for this board is available for download on the product page. Also, Kwabena made a fantastic demo this summer at Parallax which played back wav files. Kye's code should be posted somewhere in these forums, but I just did a quick search and couldn't find it. The forum has many members who will be quite familiar with his examples and may direct you to their location.
Ken Gracey
@KenG: China makes CHEAP MP3 players, and yet all of the MP3 kits I've seen are expensive. If Parallax could add a sub $20 MP3 module to it's line up it would be a real hit!
OBC
( ) = is how I'd wire it next time.
http://dl.dropbox.com/u/7557533/ledgerlabs/Propeller%20Protoboard%20Designs%20for%20the%20Beginner.pdf
SparkFun has some nice MP3 decoder modules that could be used with a Propeller.
another question, whats the max SD capacity that the propeller can detect? hopefully it can detect 16gb SD?
Edit: how about using this? http://lame.sourceforge.net/index.php
how much watts does the parallax chip consume in average and peak? P8X32A to be more precise.
how much volts and current can the outputs release? in watts as well, wouldn't wanna burn my chip now would i?
is it possible to program it to react to analog inputs? i mean programming the controls to react by voltage difference so i`d need only one pin to perform as a control input. to give you a vague example, 1.1volts = turn on LED1, 1.2volts = turn off LED1, 1.3volts = turn on LED2, and so on.
Download and read the Propeller Datasheet. It has a variety of graphs that characterize the Propeller's current drain (thus power drain) under different circumstances. The datasheet also defines how much current the outputs can provide
The Propeller can perform Sigma-Delta Analog to Digital conversions. Download and look at the Application Note AN001. It requires the use of two I/O pins as well as two resistors and two capacitors mounted close to the chip. For simple voltage dependent control, you could use something like the RCTIME technique described in the "app notes" section of this website. The description is for the Basic Stamps, but the same technique can be used with the Propeller. There are sample RCTIME routines in the BS2 Functions object in the Propeller Object Exchange.
Sure, LAME is an MP3 decoder. The problem is getting adequate performance (speed and code size). You're not going to get adequate speed just compiling it. It would have to be translated into assembly for speed. It's not at all clear that the algorithms would fit into the available memory.
You're welcome to give it a try, but, from the experience with getting quality audio from WAV files on an SD card, that's enough of a challenge. Look at EFX-TEK's AP-16+ for an example of this.
yea the speed is an issue... but didnt know getting quality output was that hard o.o hmmm, what about decoding the file into digital and feeding it into a DAC? that should eliminate most of the noise.
I've mentioned this in previous posts, but if Parallax were to do an MP3/MIDI board I recommend putting a small 1W amplifier on it, in addition to providing the earphone capability. A buffered line out would be a plus. The SF boards don't have the amp or buffered line out.
LAME isn't a licensed variation of MP3 (legitimate users of LAME obtain the MP3 licensing separately), so it's hardly practical for Parallax to recommend or demonstrate its use in a Parallax product, even if it were technically possible.
-- Gordon
well yea, allocating a whole prop for just LAME would be a good idea wouldn't it? then i`ll need two props to run the whole thing... yea i know its costy, and impractical as theres a couple of decent mp3 player out there for under 10$ BUT the big profit on this is the learning part, plus developing an effective way to decode mp3.
a rough idea i came up with, is to use one COG to decode the file to split the channels and allocate one COG per channel. this should give it a little more room to decode the mp3.
Edit: ahh... no i havent tried LAME yet... i still have to find a powersupply to powerup my starter kit...
You'd certainly need at the very least one extended memory Prop boards that some of the posters sell.
Better off letting Sparkfun's MP3 board do all the heavy lifting and letting the Prop handle the human I/O stuff.