Page 1 of 2

WAV audio player

Posted: Sat Dec 12, 2009 4:18 pm
by Berni
Version: 0.1
Status: Public release
License: Custom Licence
Download: /files/project_builds/WAVPlay.zip

So here is a small project that plays *.WAV files from a FAT16 formated SD card.Audio output is done using PWM and a RC filter to smooth it out.Its built very modular so you can take the hardware drivers out very easily as they are grouped in folders.
Supported wav formats:

PCM 8bit mono

PCM 8bit stereo

PCM 16bit mono

PCM 16bit stereo

Supported sample rates:

1-192Khz (nonstandard rates are ok)

Note: The normal SD cards are too slow to play very high bitrate wav files!
Video:

Images:

Re: WAV audio player

Posted: Sat Dec 12, 2009 4:44 pm
by jason
Great to see people using good modular design to make it easy to integrate and update. Great work! Do you have a video of it working with audio? Would be great to hear it as I dont have a card to hand to try it out as at home!

Re: WAV audio player

Posted: Sat Dec 12, 2009 6:04 pm
by leon_heller
I designed this little breakout board for miniSD cards (and microSD cards with an adapter), and am intending to interface it to one of my XMOS boards:

http://www.leonheller.com/Propeller/min ... miniSD.jpg

The pic shows it interfaced to a Propeller Proto Board for testing.

I made it at home in the kitchen sink, as is my wont. The artwork is available if anyone else wants to make one.

I'll be trying it out with Berni's code, thanks very much for it.

Leon

Re: WAV audio player

Posted: Sat Dec 12, 2009 6:08 pm
by Juhizo
leon_heller, could you check that picture link, interested to see if it's possible to do with my equipments.
edit: Works now, don't know why it didn't a minute ago.

Re: WAV audio player

Posted: Sat Dec 12, 2009 7:12 pm
by Berni
Not yet, but its planned

Re: WAV audio player

Posted: Sat Dec 12, 2009 7:47 pm
by leon_heller
You miust have tried it just after I posted the msg. I noticed that the URL was wrong and changed it very quickly.

The artwork and layout are in the same directory:

http://www.leonheller.com/Propeller/miniSD%20BO/

Re: WAV audio player

Posted: Sat Dec 12, 2009 8:55 pm
by leon_heller
I just built the project and got this error:

../XMOS/WAV_Player/main.xc:26: error: `PORT_LED_1_0' undeclared here (not in a function)
../XMOS/WAV_Player/main.xc:26: error: invalid initializer

for this statement:

on stdcore[1] : out port led_1 = PORT_LED_1_0;

But I can't see anything wrong with it. PORT_LED_1_0 is defined for Core 1 in the XC-2.xn file.

Leon


Re: WAV audio player

Posted: Sat Dec 12, 2009 10:08 pm
by Berni
Hmm thats strange, try putting in the port that the LED is connected to, or just delete the stuff since its not inportant. The LED shows a buffer underflow, this usually means the SD card is reading too slow for a very high bitrate wav file.(and it flashes on the start when the buffer hasent been filled yet)

Re: WAV audio player

Posted: Sat Dec 12, 2009 10:30 pm
by leon_heller
I removed it, and the code using led_1, which fixed that problem. I also tried using the port name, as you suggested, and that worked. However, I'm getting these errors now:

xcc -O0 -g -Wall -c -o "XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.o" "../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc"
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:84: warning: End of input with no newline, supplemented newline
}
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:5: error: `XS1_PORT_1A' undeclared here (not in a function)
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:5: error: invalid initializer
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:6: error: `XS1_PORT_1B' undeclared here (not in a function)
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:6: error: invalid initializer
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:7: error: `XS1_PORT_1C' undeclared here (not in a function)
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:7: error: invalid initializer
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:8: error: `XS1_PORT_1D' undeclared here (not in a function)
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:8: error: invalid initializer
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:9: error: `XS1_PORT_8A' undeclared here (not in a function)
../XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.xc:9: error: invalid initializer
xmake: *** [XMOS/WAV_Player/Driver_CharLCD/LCD_Driver.o] Error 1

What version of the tools did you use? I'm using 9.9.1.

Leon

Re: WAV audio player

Posted: Sat Dec 12, 2009 10:38 pm
by Berni
I made it with the 9.9.0 tools

I tried importing the zip file my self in to a new workspace and it compiled no problem. Did you meaby extract it and then add the files in a project or something? You should use Import>Exisitng project in to workspace>Select archive file
then just put in the zip file you download from here