SDK 2013 R2: Music module error

Hi, tried to upgrade to new SDK with a project. Created a new project in VS2010 and copied source files to new folder. Updated all missing references, and did a Rebuild All.

Deployed succesfully but ends up saying “Failed to initialize MP3 Decoder.”

It never reaches my own code…

Whats wrong?

Did you double check the socket location?

Sockets double-checked, no change…

Which mainboard? Tried a new project with a simple test?

Spider 1.0 with newest Firmware. Will try New simple Project tomorrow.

We were able to reproduce on a Spider. Do you have a G120 based device you can quickly test it on?

Thanks for letting me know. No, I dont have any cool boards in the house.

Alright, we will let you know when we have something more for you.

Due to a bug in the recent Gadgeteer core release, SPI is not handled properly in some cases. To work around this, add the music module driver source to your project and change line 282 to read “temp = m_cmdBuffer[2];” and line 285 to read “temp += m_cmdBuffer[3];” in Music_42.cs.


Thanks, will test.

Newbie question here: where is the source for the module driver? I’m suffering from teh same problem


Just to close things out on this thread, I can confirm that this workaround worked. I chose to load the .sln, change the code and build in release mode, then install from the generated .msi

1 Like

I am also getting the “Failed to initialize MP3 Decoder” using the Hydra mainboard. I tried modifying Music_42.cs - see code below - original line 282 and 285 are after comments. I continue to get the error. I have the music module on the 3rd port.

279 byte[] readBuffer = new byte[4];
281 //m_SPI.WriteRead(m_cmdBuffer, m_cmdBuffer, 2);
282 temp = m_cmdBuffer[2]; // m_SPICmd.WriteRead(m_cmdBuffer, readBuffer);
284 temp = readBuffer[2];
285 temp += m_cmdBuffer[3]; // temp <<= 8;
287 temp += readBuffer[3];

@ Darold The fix in this thread was for a prior SDK version. The most recent SDK includes it. It looks like you have a version of the SDK that includes this fix, so you don’t need it. Can you create a minimal test program that exhibits this problem using the original drivers, making sure to use the latest SDK. What modules do you have plugged into the Hydra?

I started a new VS C# project in VS 2012 Express that has only the usbClientDP and music modules. Program.cs has only the Debug.Print(“Program Started”); statement. I tried the music module on port 3 and then port 4. I get the "An unhandled exception of type ‘System.Exception’ occurred in GTM.GHIElectronics.Music.dll. Additional information: Failed to initialize MP3 Decoder whether using port 3 or 4.

The project is set use the .NET Micro Framework 4.2 as the Target framework.

Using mainboard GHI Electronics FEZHydra version 1.2
#### Exception System.Exception - 0x00000000 (1) ####
#### Message: Failed to initialize MP3 Decoder.
#### Gadgeteer.Modules.GHIElectronics.Music::.ctor [IP: 00bd] ####
#### MusicTestSimple.Program::InitializeModules [IP: 000e] ####
A first chance exception of type ‘System.Exception’ occurred in GTM.GHIElectronics.Music.dll
An unhandled exception of type ‘System.Exception’ occurred in GTM.GHIElectronics.Music.dll
Uncaught exception

I tried switching to the .NET Micro Framework 4.3 as the Target framework and got the following error which says I am running 4.2 on the Hydra.

Error 2 Cannot deploy the base assembly ‘mscorlib’, or any of his satellite assemblies, to device - USB:Gadgeteer twice. Assembly ‘mscorlib’ on the device has version, while the program is trying to deploy version

Thanks for looking at this. Holler if we should move to a different post.

@ Darold -

I distracted everyone with the observations about .NET Micro Framework 4.3 - sorry.

If I start a new .NET Micro Framework 4.2 C# project in VS 2012 Express that has only the usbClientDP and music modules on a Hydra mainboard and run it, then I get the “Failed to initialize MP3 Decoder”. The startup fails before any code of mine is executed. I can replicate this with the music module on port 3 or port 4.

I see, normally that message comes when there is no connection with the module. Have you tried the specific module on another mainboard?

I tried the music module on a FEZ Cererbus mainboard. I also swapped out the ribbon cable in case that was the problem. I continue to get the “Failed to initialize MP3 Decoder”. If others are not having trouble with the music module, then I wonder if maybe my music module is bad. Is that where you were going with it being like “there is no connection with the module”?