0

Music Maker MP3 Shield not working properly
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Music Maker MP3 Shield not working properly

by Ninjared on Wed Dec 17, 2014 3:39 pm

Product ID: 1788 ("Music Maker" MP3 Shield for Arduino w/3W Stereo Amp)

I followed this product guide very carefully, from beginning to end (Except I used stacking headers):
https://learn.adafruit.com/adafruit-mus ... r/overview

I formatted a micro-SD card and put a variety of sound files on it, including MP3, OGG, and WAV formats, and named them correctly. I loaded the "player_simple" example sketch, and it began playing an MP3, but shortly afterward started generating strange, loud, distorted sounds, then froze the Arduino so that it couldn't perform any functions until it was reset. With some of the WAV files, it played them all the way through, but in very, very slow motion. I uploaded 2 new WAV files, reducing the sound quality to 44khz at 8bits and 22khz at 16bits. These played normal about 80% of the time, but the "pausePlaying" function didn't work. I moved onto the "player_interrupts" example sketch, and it also played the files, but the Arduino was unable to do anything in the background while playing the file. The code was supposed to serial.print a period every second while the music was playing, but it didn't print anything until after the file was done, and then it restarted the file. I also wrote a simple sketch, based on the "player_interrupts" example, which had a countdown timer that would print the current count to serial, and then play an audio file when it got to a certain count. It played the sound just fine, but the count down timer did not move while the file was playing. The timer would stop, the serial printing would stop, the file would play, and then when the file was finished, the timer would pick up where it had left off. I tried using both delays and millis for the timer. I suspected that since it didn't work in the example sketch, it most likely wouldn't work for mine, either.

The whole reason why I bought the shield was because it was supposed to be able to play files in the background while the Arduino performed other functions. It does not do this, and is very fickle at playing sound files in general. Where do I go from here? I'm pretty disappointed in this product, and would like to exchange it for store credit, if possible. Please let me know what can be done. Thank you.

Ninjared
 
Posts: 8
Joined: Fri Dec 12, 2014 1:49 pm

Re: Music Maker MP3 Shield not working properly

by adafruit_support_mike on Wed Dec 17, 2014 4:07 pm

The Music Maker should be able to do what you want.

Let's make sure the hardware is okay.. post a photo of the shield and your connections please. 800x600 images usually work best.

adafruit_support_mike
 
Posts: 51412
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker MP3 Shield not working properly

by Ninjared on Thu Dec 18, 2014 12:45 pm

Here's some pics:
MP3Shield01.jpg
MP3Shield01.jpg (278.28 KiB) Viewed 2962 times

MP3Shield02.jpg
MP3Shield02.jpg (226.83 KiB) Viewed 2962 times

MP3Shield03.jpg
MP3Shield03.jpg (212.44 KiB) Viewed 2962 times

Ninjared
 
Posts: 8
Joined: Fri Dec 12, 2014 1:49 pm

Re: Music Maker MP3 Shield not working properly

by Ninjared on Thu Dec 18, 2014 12:48 pm

And a couple more:
MP3Shield04.jpg
MP3Shield04.jpg (264.78 KiB) Viewed 2961 times

MP3Shield05.jpg
MP3Shield05.jpg (302.47 KiB) Viewed 2961 times

Ninjared
 
Posts: 8
Joined: Fri Dec 12, 2014 1:49 pm

Re: Music Maker MP3 Shield not working properly

by adafruit_support_mike on Fri Dec 19, 2014 5:26 am

Thank you.. your soldering looks excellent.

We've seen the "playing files slowly" issue before.. it's a symptom of data throttling between the SD card and the Arduino. The Arduino can't get data from the card fast enough to keep up with the VS1053.

Just to check, how old is the SD card you're using? Some older cards were fairly slow by today's standards, but they still hold data.

Also, could you please post the code you're using? Let's make sure that's working properly.

adafruit_support_mike
 
Posts: 51412
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker MP3 Shield not working properly

by Ninjared on Mon Dec 22, 2014 3:27 pm

The SD card is getting a little old, so that would make sense for the slow-playing files. I'll try something newer and see if it improves.
For the other problems, though, I'm not sure what would be causing it. The code I was using is the example code that came with the VS1053 library, plus one that I modified to do more tests. I will try a new SD card and see if any of the problems get resolved.

Ninjared
 
Posts: 8
Joined: Fri Dec 12, 2014 1:49 pm

Re: Music Maker MP3 Shield not working properly

by Ninjared on Mon Jan 05, 2015 3:38 pm

Ok, so I went and bought a brand new micro SD card: Sony, 8gb, 40mb/s.
I formatted it, uploaded the .wav files, uploaded the sketch to the Arduino, and it is still doing exactly the same thing as before. The sound plays in very slow motion, and nothing can be done in the background until the .wav file is done playing.

First, here is the code that I wrote for a simple countdown timer. The countdown always runs and prints the current value to the serial monitor once a second. When typing "15min" into the serial input, it sets the timer to 902 seconds. At 900 seconds it plays 'timer15m.wav' (file name is 8 characters long) with interrupts. The audio is a voice saying "15 minutes remaining". Currently, the file plays sound in very slow motion, and while the file plays, the timer is frozen at 900 seconds. When the .wav file finishes playing, the timer resumes at 899.
Code: Select all | TOGGLE FULL SIZE
//Ninjared Event Timer

#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>

#define SHIELD_RESET  -1     // VS1053 reset pin (unused!)
#define SHIELD_CS     7      // VS1053 chip select pin (output)
#define SHIELD_DCS    6      // VS1053 Data/command select pin (output)
#define CARDCS 4             // Card chip select pin
#define DREQ 3               // VS1053 Data request, ideally an Interrupt pin
Adafruit_VS1053_FilePlayer musicPlayer = Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);

byte eventlength = 0;
byte eventstart = 0;
int eventtimer = 0;
unsigned long timer = 0;

void setup(){

  Serial.begin(9600);
  musicPlayer.begin();
  SD.begin(CARDCS);
  musicPlayer.setVolume(20, 20);
  musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT);
  //musicPlayer.useInterrupt(VS1053_FILEPLAYER_TIMER0_INT);
  Serial.println("Timer ready");
 
}

void loop(){

//TIMER+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 if(millis() - timer >= 1000){
  eventtimer--;
  timer = millis();
  Serial.println(eventtimer);
 }
 /* //Test for whether the timer needs to be set to run while the music is playing
 while (musicPlayer.playingMusic) {
  if(millis() - timer >= 1000){
   eventtimer--;
   timer = millis();
   Serial.println(eventtimer);
  }
 } */

//READ THE INPUT COMMAND++++++++++++++++++++++++++++++++++++++++++++++
 String input = "";
 while(Serial.available() > 0){
  input += (char) Serial.read();
  delay(5);
 }
 
//VALID COMMANDS++++++++++++++++++++++++++++++++++++++++++++++++++++++
 if(input == "15min"){
  eventtimer = 902;
  eventlength = 15;
 }

//BEGIN 15 MIN EVENT+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 if(eventlength == 15){
  if(eventtimer == 900){
   musicPlayer.startPlayingFile("timer15m.wav");
  }
 }
 
}

I'm sure it is very possible that I may have used the library commands for the MP3 shield incorrectly above, but even if so, the example sketches that came with the library didn't work properly either. Here is the exact example sketch that I used:
Code: Select all | TOGGLE FULL SIZE
// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>

// These are the pins used for the breakout example
#define BREAKOUT_RESET  9      // VS1053 reset pin (output)
#define BREAKOUT_CS     10     // VS1053 chip select pin (output)
#define BREAKOUT_DCS    8      // VS1053 Data/command select pin (output)
// These are the pins used for the music maker shield
#define SHIELD_RESET  -1      // VS1053 reset pin (unused!)
#define SHIELD_CS     7      // VS1053 chip select pin (output)
#define SHIELD_DCS    6      // VS1053 Data/command select pin (output)

// These are common pins between breakout and shield
#define CARDCS 4     // Card chip select pin
// DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt
#define DREQ 3       // VS1053 Data request, ideally an Interrupt pin

Adafruit_VS1053_FilePlayer musicPlayer =
  // create breakout-example object!
  //Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS);
  // create shield-example object!
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);


////

void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit VS1053 Library Test");

  // initialise the music player
  if (! musicPlayer.begin()) { // initialise the music player
     Serial.println(F("Couldn't find VS1053, do you have the right pins defined?"));
     while (1);
  }
  Serial.println(F("VS1053 found"));

  musicPlayer.sineTest(0x44, 500);    // Make a tone to indicate VS1053 is working
 
  if (!SD.begin(CARDCS)) {
    Serial.println(F("SD failed, or not present"));
    while (1);  // don't do anything more
  }
  Serial.println("SD OK!");
 
  // list files
  printDirectory(SD.open("/"), 0);
 
  // Set volume for left, right channels. lower numbers == louder volume!
  musicPlayer.setVolume(20,20);

  /***** Two interrupt options! *******/
  // This option uses timer0, this means timer1 & t2 are not required
  // (so you can use 'em for Servos, etc) BUT millis() can lose time
  // since we're hitchhiking on top of the millis() tracker
  //musicPlayer.useInterrupt(VS1053_FILEPLAYER_TIMER0_INT);
 
  // This option uses a pin interrupt. No timers required! But DREQ
  // must be on an interrupt pin. For Uno/Duemilanove/Diecimilla
  // that's Digital #2 or #3
  // See http://arduino.cc/en/Reference/attachInterrupt for other pins
  // *** This method is preferred
  if (! musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT))
    Serial.println(F("DREQ pin is not an interrupt pin"));
}

void loop() { 
  // Alternately, we can just play an entire file at once
  // This doesn't happen in the background, instead, the entire
  // file is played and the program will continue when it's done!
  musicPlayer.playFullFile("track001.ogg");

  // Start playing a file, then we can do stuff while waiting for it to finish
  if (! musicPlayer.startPlayingFile("track001.mp3")) {
    Serial.println("Could not open file track001.mp3");
    while (1);
  }
  Serial.println(F("Started playing"));

  while (musicPlayer.playingMusic) {
    // file is now playing in the 'background' so now's a good time
    // to do something else like handling LEDs or buttons :)
    Serial.print(".");
    delay(1000);
  }
  Serial.println("Done playing music");
}


/// File listing helper
void printDirectory(File dir, int numTabs) {
   while(true) {
     
     File entry =  dir.openNextFile();
     if (! entry) {
       // no more files
       //Serial.println("**nomorefiles**");
       break;
     }
     for (uint8_t i=0; i<numTabs; i++) {
       Serial.print('\t');
     }
     Serial.print(entry.name());
     if (entry.isDirectory()) {
       Serial.println("/");
       printDirectory(entry, numTabs+1);
     } else {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.println(entry.size(), DEC);
     }
     entry.close();
   }
}
In this example code, I believe the serial monitor is supposed to be printing "......" every second while the sound file plays, which it does not do. I tried other tests, and it will not perform any functions until the sound is finished.

Where do I go from here?

Ninjared
 
Posts: 8
Joined: Fri Dec 12, 2014 1:49 pm

Re: Music Maker MP3 Shield not working properly

by adafruit_support_mike on Tue Jan 06, 2015 7:17 am

If the sample files aren't playing at the correct speed, it sounds like something is wrong in the chip itself.

Send a note to support@adafruit.com with a link to this thread and the folks there will get you a replacement Music Maker. They might also arrange return shipping for the one you have so we can look at it in our own lab.

adafruit_support_mike
 
Posts: 51412
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker MP3 Shield not working properly

by dietzj on Fri Jan 23, 2015 2:29 pm

I have had no luck with the Music Maker Shield. It works fine in MIDI mode.

However, trying to use the Simple Player Sketch is unsuccessful- I Just keep getting
" Couldn't find VS1053, do you have the right pins defined? " error.

If I edit the simple player code per the instructions,

Code: Select all | TOGGLE FULL SIZE
// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>

// define the pins used
//#define CLK 13       // SPI Clock, shared with SD card
//#define MISO 12      // Input data, from VS1053/SD card
//#define MOSI 11      // Output data, to VS1053/SD card
// Connect CLK, MISO and MOSI to hardware SPI pins.
// See http://arduino.cc/en/Reference/SPI "Connections"

// These are the pins used for the breakout example
//#define BREAKOUT_RESET  9      // VS1053 reset pin (output)
//#define BREAKOUT_CS     10     // VS1053 chip select pin (output)
//#define BREAKOUT_DCS    8      // VS1053 Data/command select pin (output)

// These are the pins used for the music maker shield
#define SHIELD_CS     7      // VS1053 chip select pin (output)
#define SHIELD_DCS    6      // VS1053 Data/command select pin (output)
#define SHIELD_RESET -1    // (my addition!)
// These are common pins between breakout and shield
#define CARDCS 4     // Card chip select pin
// DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt
#define DREQ 3       // VS1053 Data request, ideally an Interrupt pin

Adafruit_VS1053_FilePlayer musicPlayer =
  // create breakout-example object!
 // Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS);
  // create shield-example object!
  Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
 // Adafruit_VS1053_FilePlayer(SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
 
This gave an error " player_simple:45: error: 'SHIELD_RESET' was not declared in this scope"
so I added the line:
 #define SHIELD_RESET -1    // (my addition!)

The sketch will upload, but the files does not play, and I keep getting
" Couldn't find VS1053, do you have the right pins defined? " error.

I am using an Arduino Mega 2560. I have soldered the 3 SPI jumpers per the instructions. Do I need to
change the SPI code:

// define the pins used
//#define CLK 13       // SPI Clock, shared with SD card
//#define MISO 12      // Input data, from VS1053/SD card
//#define MOSI 11      // Output data, to VS1053/SD card
// Connect CLK, MISO and MOSI to hardware SPI pins.
// See http://arduino.cc/en/Reference/SPI "Connections"


The sample program should just work. It doesn't.
Last edited by adafruit_support_mike on Sat Jan 24, 2015 12:19 am, edited 1 time in total.
Reason: added CODE tags to preserve formatting

dietzj
 
Posts: 3
Joined: Fri Jan 23, 2015 1:47 pm

Re: Music Maker MP3 Shield not working properly

by adafruit_support_mike on Sat Jan 24, 2015 12:20 am

Post a photo of your hardware and connections and we'll see what we can find.

adafruit_support_mike
 
Posts: 51412
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker MP3 Shield not working properly

by dietzj on Mon Jan 26, 2015 9:21 pm

I found I was missing header pin 7, which I then installed.

With this fix, when I try to play an MP3, it says:

"VS1053 found--Playing track 001" ; I hear only occasional short bursts of sound, but no music.

Works fine in Midi Mode

shield1.JPG
shield1.JPG (62.75 KiB) Viewed 2761 times

shield2.JPG
shield2.JPG (104.78 KiB) Viewed 2761 times

screenshotmusicmaker.jpg
screenshotmusicmaker.jpg (89.3 KiB) Viewed 2761 times

dietzj
 
Posts: 3
Joined: Fri Jan 23, 2015 1:47 pm

Re: Music Maker MP3 Shield not working properly

by adafruit_support_mike on Tue Jan 27, 2015 5:38 pm

It's hard to see the details of the solder joints from the photos, but it looks like there are a few dimples and horns.

Try reheating the joints with a bit of flux and try to get a smooth, shiny fillet for each one.

adafruit_support_mike
 
Posts: 51412
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker MP3 Shield not working properly

by savannahbarkley on Sun May 03, 2015 5:04 pm

Hi,

I recently purchased a music maker shield to use with my arduino uno. I am having issues with getting consistent sound out of the shield. It seems as if the connection between the pins and the arduino is a bit fussy and only works sometimes. I have checked my soldering job & have used a voltage meter to make sure that all of the pins are getting a connection. When I run the program I am getting the "Couldn't find VS1053, do you have the right pins defined?" message for the most part other then the few minutes I got the sound to play.


Any suggestions? I really need to either get a replacement or a solution quite soon as this is for a project with a deadline.

Thanks!
Savannah

savannahbarkley
 
Posts: 6
Joined: Sun May 03, 2015 4:56 pm

Re: Music Maker MP3 Shield not working properly

by dietzj on Sun May 03, 2015 5:45 pm

I had a similar problem. It turned out that one of the solder pins( Pin 7) was missing.

Check all of your pins . . .

dietzj
 
Posts: 3
Joined: Fri Jan 23, 2015 1:47 pm

Re: Music Maker MP3 Shield not working properly

by savannahbarkley on Sun May 03, 2015 6:29 pm

I have all the pins in - none are missing. I can at times get the board to work but it is very flaky and dosen't always want to play sound.

savannahbarkley
 
Posts: 6
Joined: Sun May 03, 2015 4:56 pm

Please be positive and constructive with your questions and comments.