Fried Audio Board?

Status
Not open for further replies.

lownote

Active member
I've been working on a project for a while, and I was beginning to explore how I'd interact with the teensy. I made a huge error in attaching a pot to the wrong pin. I miscounted in the wrong direction on my bread board, ran a sketch, and then messed with a pot, causing mass chaos. Not realizing I had wired to the wrong pin, I messed with the software for a while, repeatedly sending signal from the pot to either pin 15, 18, or 19. I eventually rewired everything, and I don't remember where it was, but noticed immediately that I was now putting the wire in a different spot.

Once I realized my error, parts of my sketch run fine, but triggering two wav files would wreck everything. I was troubleshooting this for about a week, not realizing that it might be connected to my above mistake, but I've run out of software errors. I re-ran the Mixers tutorial sketch, and I still get this intense awful crackling output. It sounds like this linked mp3. I've tried reading from multiple SD cards with the same result.

So, could sending signal to one of the above pin cause some sort of hardware malfunction in reading the SD card? Is there anything at this point I can do? Is the damage probably on the audio shield of teensy itself? It's not a huge loss if I can only use this one for non-SD purposes when testing stuff out, but I figure it would be good to know the level of destruction I've caused.
 
How was you pot connected? Whats the max voltage that could have been on the pins?
And have you tested a very simple program that just outputs a sine? That can at least give you a hint if there are some HW faults.
 
How was you pot connected? Whats the max voltage that could have been on the pins?
And have you tested a very simple program that just outputs a sine? That can at least give you a hint if there are some HW faults.

The pot was connected from the 3.3V out on the teensy.

Running a sine out seems... fine? I just ran a few other tutorial sketches and anything involving synthesis seemed to sound correct. Having the teensy play a single SD card also seems fine. Playing 2 wav files is where I run into trouble.

What's interesting to me is that the AudioUsageMax will output low numbers, often single digits, when playing two wav files, but the sound output will be a mess (like in the example above). It seems like the processor is handling it, but its receiving garbled information? Does that seem fair? Could it just be the SD reader? Is that.... fixable?
 
If you post the code of your program it would help. But if you use a mixer and mix both of them at unity gain, you would probably get some overdrive! Signals will add up and you will hear clipping bacause the signal is too loud. Try to set the gain in the mixer lower.
If you put a peak detect on your output signal you can see if it is above 1. That means clipping!
 
Oh, sorry if it wasn't clear. I've been running the tutorial sketches because they're simple and proven to work. I did make an adjustment to Part 2-02 Mixers to test volume output, posted below:

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioPlaySdWav           playSdWav1;     //xy=177.5,223.75
AudioPlaySdWav           playSdWav2;     //xy=201.25,345
AudioMixer4              mixer1;         //xy=611.25,201.25
AudioMixer4              mixer2;         //xy=621.25,313.75
AudioAnalyzePeak         peak1;          //xy=849,176
AudioOutputI2S           i2s1;           //xy=856.75,241.25
AudioConnection          patchCord1(playSdWav1, 0, mixer1, 0);
AudioConnection          patchCord2(playSdWav1, 1, mixer2, 0);
AudioConnection          patchCord3(playSdWav2, 0, mixer1, 1);
AudioConnection          patchCord4(playSdWav2, 1, mixer2, 1);
AudioConnection          patchCord5(mixer1, 0, i2s1, 0);
AudioConnection          patchCord6(mixer1, peak1);
AudioConnection          patchCord7(mixer2, 0, i2s1, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=877.5,321.25
// GUItool: end automatically generated code





void setup() {
  Serial.begin(9600);
  AudioMemory(8);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.5);
  SPI.setMOSI(7);
  SPI.setSCK(14);
  if (!(SD.begin(10))) {
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }
  pinMode(13, OUTPUT); // LED on pin 13
  mixer1.gain(0, 0.5);
  mixer1.gain(1, 0.5);
  mixer2.gain(0, 0.5);
  mixer2.gain(1, 0.5);
  delay(1000);
}

void loop() {
  if (playSdWav1.isPlaying() == false) {
    Serial.println("Start playing 1");
    playSdWav1.play("SDTEST2.WAV");
    delay(10); // wait for library to parse WAV info
  }
  if (playSdWav2.isPlaying() == false) {
    Serial.println("Start playing 2");
    playSdWav2.play("SDTEST4.WAV");
    delay(10); // wait for library to parse WAV info
  }
  // uncomment this code to allow Knob A3 to pan between songs
  Serial.println(peak1.read());
  int knob = analogRead(A3);  // knob = 0 to 1023
  float gain1 = ((float)knob / 1023.0) * 0.5;
  float gain2 = 0.50 - gain1;
  mixer1.gain(0, gain1);
  mixer1.gain(1, gain2);
  mixer2.gain(0, gain1);
  mixer2.gain(1, gain2);

    
  
}
Weirdly, I don't get any serial output re: the peak volume. The pot is also unresponsive. It sounds like this. https://dl.dropboxusercontent.com/u/30863455/MixersMixdown2.mp3

Commenting out either if statement to play a single audio file causes it to run just fine. I get peak values consistently at 1.0 with intermittent drops into 0.3ish range. Is that reading weird? It seems weird to me.
 
Status
Not open for further replies.
Back
Top