No headphone output on Teensy 4.0 W/ Audio Shield

jackbartusch

New member
Hi, I've got a brand new Teensy 4.0 and Audio Shield Rev D that I've soldered on. Running the hardware test I cannot seem to get any audio out of the headphone output. I had originally connected the shield to the aux in of some powered monitors but have since switched to headphone output. I would expect that this potentially fried the board, however running some test code suggests the SGTL5000 is enabling, which I would think means the shield is running fine.
#include <Audio.h> #include <Wire.h> AudioSynthWaveform waveform1; AudioOutputI2S i2s1; AudioConnection patchCord1(waveform1, 0, i2s1, 0); AudioConnection patchCord2(waveform1, 0, i2s1, 1); AudioControlSGTL5000 sgtl5000_1; void setup() { Serial.begin(115200); Serial.println("Initializing..."); AudioMemory(8); if (sgtl5000_1.enable()) { Serial.println("Initialized audio shield"); } else { Serial.println("Failed to initialize audio shield"); } } void loop() {}

Any ideas would be greatly appretiated!
 

Attachments

  • IMG_5121.jpg
    IMG_5121.jpg
    183.8 KB · Views: 41
Your program needs to set the output volume (otherwise you get no headphone output) and configure the waveform parameters (otherwise the waveform doesn't generate data, effectively transmitting silence to the "i2s1" output).

It should look something like this.

Code:
#include <Audio.h>
#include <Wire.h>
AudioSynthWaveform    waveform1;
AudioOutputI2S        i2s1;
AudioConnection       patchCord1(waveform1, 0, i2s1, 0);
AudioConnection       patchCord2(waveform1, 0, i2s1, 1);
AudioControlSGTL5000  sgtl5000_1;
void setup() {
  Serial.begin(115200);
  Serial.println("Initializing...");
  AudioMemory(8);
  if (sgtl5000_1.enable()) {
    Serial.println("Initialized audio shield");
  } else {
    Serial.println("Failed to initialize audio shield");
  }
  sgtl5000_1.volume(0.4);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(440);
  waveform1.amplitude(0.9);
}


void loop() {}

You might also click File > Examples > Audio > Tutorial > Part_1_02_Hardware_Test in Arduino IDE for a similar program which turns the waveform on & off to create beeps.... which still aren't pleasant but not nearly as annoying to human ears as a continuous sine wave.
 
Last edited:
I had tried running the tutorial hardware test before and it did not work, tried your attached code, the "Initialized audio shield" text shows in the serial monitor but still no audio out...
 
Maybe you have a hardware issue?

I ran both here on known good hardware. The code in msg #2 definitely creates a continuous sine wave and the tutorial hardware test beeps.

In the photo, your boards look very close. Any chance parts on the bottom side of Teensy 4.0 might be touching the SD socket on the audio shield? Maybe try slipping a piece of paper or thin plastic between them to make sure nothing is shorting to the SD socket.
 
Perhaps also re-heat the solder on pins 18 and 19. Those look a little strange compared to the others.

1752053342893.png


If you have liquid flux, apply some before heating as it helps the solder flow nicely.
 
Agree with Paul, those solder joints on 18 and 19 look suspect. You can see a flux ring around the base, and they are rounded showing inadequate wetting to the pad. Touch up those solder joints.
 
Padding the SD card slot with paper didn't fix it either. The weirdness on those pads is actually from trying to touch it up at home. I would have to go somewhere else for access to a full soldering kit. Am I right to assume that the code showing the audio shield is initialised means the shield isn't dead and just needs resoldering, or should I order a new shield just in case?
 
It's possible the audio shield is still functional when using the Line Out ports. This interface can be connected to a powered speaker. Give that a try.

It's also possible the Headphone output is blown because you (unknowingly) connected VGND to GND when shield was connected to the powered speaker. See "Caution" text on bottom of audio shield. This Headphone output interface uses a virtual ground (VGND) and should only be connected to a headphone (and nothing else).
 
Am I right to assume that the code showing the audio shield is initialised means the shield isn't dead and just needs resoldering, or should I order a new shield just in case?

Yes and no. As a quick test, I ran your program on a Teensy 4.1 without any audio shield. Indeed it prints this:

Code:
Initializing...
Failed to initialize audio shield

However, your original program produces no sound on known-good hardware. So seeing "Initialized audio shield" only partially confirms your audio shield is in working order. Or to be more specific:

Yes, seeing "Initialized audio shield" means your hardware isn't dead. No hardware connected doesn't print this.

But no, seeing "Initialized audio shield" (at least with your original program) can't distinguish between a working audio shield and one that's been partially damaged in such a way that it can't create any sound output. So it really comes down to the meaning of the word "dead". Hardware that still partially responds to software but can't create any output may not be "dead", but perhaps "effectively dead".

If you're running the code from msg #3 which definitely does produce a sine wave output, and you get "Initialized audio shield" but you hear no (annoying) continuous sine wave, there something absolutely is wrong with your hardware. Whether it's damaged or something just isn't connected correctly, I really can't know.

Perhaps something "simple" is wrong? Earlier you said "connected the shield to the aux in of some powered monitors but have since switched to headphone output". Can you be more specific about how you're using the headphone output? Is it really just ordinary headphones? If you connect to other gear with earth grounding, you can run into problems with shorting the virtual ground. Yeah, this is a long shot... but it wouldn't be the first time we've had a conversation on this forum where a lot of time went into troubleshooting something that turned out be be "simple".
 
Back
Top