WAV audio player

XCore Project reviews, ideas, videos and proposals.
User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

WAV audio player

Postby Berni » Sat Dec 12, 2009 4:18 pm

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:
User avatar
jason
XCore Expert
Posts: 577
Joined: Tue Sep 08, 2009 5:15 pm
Contact:

Postby jason » Sat Dec 12, 2009 4:44 pm

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!
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Postby leon_heller » Sat Dec 12, 2009 6:04 pm

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/miniSD%20BO/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
User avatar
Juhizo
Member
Posts: 11
Joined: Thu Dec 10, 2009 10:16 pm
Location: Finland
Contact:

Postby Juhizo » Sat Dec 12, 2009 6:08 pm

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.
User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

Postby Berni » Sat Dec 12, 2009 7:12 pm

Not yet, but its planned
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Postby leon_heller » Sat Dec 12, 2009 7:47 pm

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/
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Postby leon_heller » Sat Dec 12, 2009 8:55 pm

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

User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

Postby Berni » Sat Dec 12, 2009 10:08 pm

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)
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Postby leon_heller » Sat Dec 12, 2009 10:30 pm

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
User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

Postby Berni » Sat Dec 12, 2009 10:38 pm

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

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests