Main Site Documentation

Project - FEZ Music Shield Driver


#1

I just posted FEZ Music Shield Driver on Codeshare. Feel free to discuss and make suggestions here.


#2

Fantastic! I’ve been following this subject on GHI’s forum for a long time now. I was wondering if it would be possible to add gapless playback? So if you would playback each track of i.e. Pink Floyd’s Dark Side of the Moon it would be played seamlessly?


#3

Time to dust mine off. My son’s treehouse needs a sound system :slight_smile:


#4

@ djagab - Yes, it does play tracks seamlessly. I’ve been testing with a classical music album, and it plays just like a commercial player would.

I ran a test last night to play all 8 tracks of this album in a loop 20 times. Unfortunately after the 149th time it stopped playing. I’m not sure what the issue is, but I’ll look into it today.


#5

May be it just got sick of the same music playing over and over :wink:


#6

@ jasdev: Thanks for your reply. Good to know that gapless playback is supported. I remember this being an issue in the past. Did you use a music shield with the VS1063 or 1053?

And another feature request:

Report the duration and position of the file currently playing.

Look at the Skewworks example at:
https://www.ghielectronics.com/community/codeshare/entry/313

I believe the line “[em]_position = Command_Read(SCI_DECODE_TIME);[/em]” does the trick.

Thanks…


#7

@ Architect - LOL Good one!


#8

@ djagab - Thanks, I hadn’t seen that driver before. I’ll have a look.


#9

@ jasdev - Ohh, you are quick! I will see if it is possible to port to 4.2 and Spider. Not sure I can do it…


#10

@ njbuch - Take a look at the original driver from @ godfather. I believe that his SPI and GPIO ports were setup for EMX/Spider. You could use my enhanced driver, and just reconfigure the I/O ports.


#11

It would be great for me too if this functionality was available for the spider.
Unfortunately I don’t really know how to port the sources to 4.2 and spider.
So @ njbuch if you’re making any progresses I really would appreciate if you would share it.
If it is just a reconfiguration maybe the easiest way would be if @ jasdev would just revert the configurations that made his code work at the panda and we would test it…


#12

@ D. Helfenstein - I’ve fixed several bugs, and it is more stable than it was before, but it still occasionally stops playing after playing hundreds of tracks. It’s not a memory leak problem, I checked that. I believe it is a race condition between threads.

Once I get this problem solved, I will move the Panda specific configuration settings into a separate header file, and create an EMX version of the header file for Cobra 1 and Spider.


#13

I am putting all my eggs into jasdevs basket. I think he will manage to get through this challenge very well. I tried with the RLP stuff and gave up, I looked at jasdevs work and it looks really promising.

Keep up the good work jasdev!


#14

I updated the driver to version 4.0, which includes these fixes:

VERSION 4:
[ul]Modified to use hardcoded EndFillBytes for MP3 and FLAC. This is a temporary fix until I can get the recommended method working.
Fixed thread race condition issues.
Fixed Panda II SPI clock prescalar settings to conform to VS1053b recommendations.
Fixed VS1053b clock multiplier settings to conform to manufacturer’s recommendations.
Moved file open code from MusicShield driver to the application layer. The MusicShield driver only deals with streams, regardless of their source.
Fixed issue with DREQ not going low, which caused the player to hang, usually when finishing a song.[/ul]


#15

Great to hear that!
Now I hope you can find some time to make your driver work on the Spider under 4.2
njbuch and I are depending on you, at least I do!


#16

@ D. Helfenstein - I don’t own a Spider, but I do have a Cobra 1. I can test it using the Cobra 1 on SPI 1. I will use GPIO pins that are on the same Gadgeteer connector as SPI 1, so it should work for the Spider.


#17

I revised the RLP driver by replacing all SPI and GPIO references with symbolic #define’s located in the VSDriver.h file.


#18

Not sure what to do now?


#19

@ njbuch - You should be able to download the Cobra project from here:

https://www.ghielectronics.com/community/forum/topic?id=13505
https://www.ghielectronics.com/community/codeshare/entry/805

Replace the VSDriver.h file with the one in this post:

https://www.ghielectronics.com/community/forum/topic?id=13507

And hopefully it will work!

Note: You also need to do the following:

  1. If you want to play FLAC files, download the VS1053b Patches w/ FLAC Decoder plug-in here:
    http://www.vlsi.fi/en/support/software/vs10xxpatches.html
  2. Create an SD with this file structure:
    FLAC


    MP3


    Plugins
  3. Copy your music albums and tracks to the SD card.
  4. Modify Program.cs to match your music file locations/names, and whether you want to load the FLAC plugin.

#20

Thanks jasdev

Unfortunately I have problems building the native part of your project using your makefile:
First I just tried to compile the JDI.NETMF.Modules.Music directly from vs2012 but it gave me a strange Error:
The command “cd …Native
make rebuild” exited with code 2

So, the problem is the makefile but because VS2012 wouldn’t tell what the problem was with it I used the vs developer command prompt. This one tells me:
Makefile(26) : fatal error U1033: Syntaxfehler: “:” unerwartet
Stop.

There seems to be something wrong with:

$(OBJS): %.o: %.c
	$(CC) -c $(CCFLAGS) $< -o ./Output/$@ 

I simply don’t know what to do…