Adafruit Audio FX Sound Board Fixes

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dwk
 
Posts: 3
Joined: Sat Oct 13, 2012 3:00 am

Adafruit Audio FX Sound Board Fixes

Post by dwk »

Hi everyone,

I've been having issues with the Adafruit Audio FX Sound Board (16mb, no amp version) in UART mode, connected to an Arduino Uno. After two 4am nights I've got them working reliably but there is strangeness involved. I noticed a lot of other people having issues with the same board on this forum so I'm posting this in case it helps. These steps work for all 4 of the boards I've used.

Issue 1: You put files on the board but they won't play in UART mode

1) The board shows up as a drive in Windows 10
2) Copy 2 audio files onto it called 'TRACK001OGG' and 'TRACK002OGG'
3) Eject the drive from the computer
4) Connect to Arduino and power up the Audio FX in UART mode
5) Call sfx.listFiles()

Code: Select all

void listFiles() {
  uint8_t files = sfx.listFiles();
  Serial.println(": Audio file listing");
  Serial.println("========================");
  Serial.println();
  Serial.print("Found "); Serial.print(files); Serial.println(" files");
  for (uint8_t f=0; f<files; f++) {
    Serial.print(f); 
    Serial.print("\tname: "); Serial.print(sfx.fileName(f));
    Serial.print("\tsize: "); Serial.println(sfx.fileSize(f));
  }
  Serial.println("========================");
}
6) Listfiles() reports 2 files with correct names
7) Call sfx.playTrack using a track name

Code: Select all

char fullName[13] = {'T', 'R', 'A', 'C', 'K', '0', '0', '1', 'O', 'G', 'G', '\n'};
if (!sfx.playTrack(fullName)) {
  Serial.print("Failed to play");
}
8) The track fails to play
9) Unplug power to the Arduino and SFX board
10) Plug in power again. This time Listfiles reports '0' files.
11) Connect SFX drive to computer. Windows 10 reports a drive problem and offers to fix it. Windows fixes it for Windows, but it still doesn't report any files via Arduino.
12) The SFX board seems to be broken.

If this happens:
1) Re-image the SFX board using the image on the Adafruit support page.
2) Re-copy the audio files onto the board
3) Make sure to wire up the RST pin and call sfx.reset() from Arduino before calling any other functions. Just re-powering the board doesn't seem to do a full reset, causing the board to seemingly corrupt itself when you call a function.
If the board won't show up as a drive in Windows any more... move on to issue 2.

Issue 2: The board doesn't show up when you try to mount it in Windows
In my case this was because I had the RST pin connected to a powered-down Arduino while the SFX board was corrupt. After disconnecting the RST pin, the drive showed up as expected. After re-imaging the SFX board it worked fine with the RST pin connected.

Issue 3: Calling sfx.stop() twice seems to break the board
1) Call sfx.playTrack using a track name

Code: Select all

char fullName[13] = {'T', 'R', 'A', 'C', 'K', '0', '0', '1', 'O', 'G', 'G', '\n'};
if (!sfx.playTrack(fullName)) {
  Serial.print("Failed to play");
}
2) Call sfx.stop()

Code: Select all

if (sfx.stop()) {
   Serial.println(": Track stopped");
}
else {
  Serial.println(": Failed to stop track");
}
Everything works as expected here. You play, they you stop. If you play again, it plays again.
3) If you call sfx.stop() for a second time, when the board is already stopped (in standby mode), you get 'Failed to stop track'.
4) Calling play once now doesn't work. You need to call play twice to get a file to play. It seems that calling stop in standby mode "double stops". You need to "double play" to get out of the mess. The code below works well to avoid double stopping but seems really silly.

Code: Select all

void stopTrack() {
  // Try to stop audio and return to standby
  if (sfx.stop()) {
    Serial.println(": Track stopped");
  }
  else {
    Serial.println(": Failed to stop track");
    soundFix(); // SFX board backstack fix/hack
  }
}

void soundFix() {
  // Play track 1. It won't play but instead gets you out of the double stopped state.
  uint8_t n = 0;
  if (sfx.playTrack((uint8_t)n)) {
    // If, somehow, the track does play, stop it. That wasn't supposed to happen. This is optional. It has never fired but is there just in case.
    Serial.println(" Error: SFX board backstack fix failed");
    sfx.stop();
  }
}

User avatar
bernadre
 
Posts: 3
Joined: Fri Oct 12, 2018 5:42 pm

Re: Adafruit Audio FX Sound Board Fixes

Post by bernadre »

Hi dwk,

Could you tell me how to re-image Audio SFX?
Or where are the files to do it?

Also, I need to know what command I have to send thru serial to reset the SFX board.

Thanks a lot
Regards

User avatar
dwk
 
Posts: 3
Joined: Sat Oct 13, 2012 3:00 am

Re: Adafruit Audio FX Sound Board Fixes

Post by dwk »

Hi bernadre,

The image download and instructions to re-image are here:
https://learn.adafruit.com/adafruit-aud ... /downloads

To reset the board, first define which pin is the reset pin then use sfx.reset()
More instructions here:
https://learn.adafruit.com/adafruit-aud ... io-control

User avatar
dwk
 
Posts: 3
Joined: Sat Oct 13, 2012 3:00 am

Re: Adafruit Audio FX Sound Board Fixes

Post by dwk »

Actually, that reset command only works with their example patch. To do it in your own patch it seems like you need to build the function yourself.

On the serial page I linked to above it says:
"You can use 3.3V or 5V logic on the RX pin, it has a level shifter. TX is output at 3.3V which can be read from a 3.3V or 5V logic. For the RST pin, it's 3.3V and has a pullup. To reset the board, set the microcontroller pin to low, then an output, then back to an input like so:"

Code: Select all

digitalWrite(reset_pin, LOW);
  pinMode(reset_pin, OUTPUT);
  delay(10);
  pinMode(reset_pin, INPUT);
  delay(1000); // give a bit of time to 'boot up'

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”