Teensy 4.0 does not pass my audio through

nschagen

Member
Hello Teensy-enthousiasts,

I'm trying to embed a teensy 4.0 + audio board into my eurorack setup which involves converting the voltages into ones that the teensy can handle. I've got that all done but for some reason my teensy does not work anymore in this setup. It did partially work before, but no more.

I'm feeding audio to both left & right LINE IN inputs and I get no sound back. Here is a simple 'pass through' that does not work in my setup:

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

AudioInputI2S            i2s1;
AudioOutputI2S           i2s2; 

AudioConnection          patchCord2(i2s1, 0, i2s2, 0);
AudioConnection          patchCord3(i2s1, 1, i2s2, 1);

AudioControlSGTL5000     sgtl5000_1; 


void setup() {
  AudioMemory(10);

  sgtl5000_1.enable();
  sgtl5000_1.volume(0.8);
}

void loop() {
}

However, if I connect to USB and send audio straight from my PC into line-in and connect my speakers to the teensy, I do get sound. Also my more complex code with audio-effects applied works in that scenario.

I changed my sketch to make the LED on the teensy blink to ensure the teensy is actually running. This worked and I confirmed it is actually running but not processing audio.

The main difference between the two setups is the way my teensy is powered. In the eurorack setup, I'm converting 12V into 5V using an L7805 with two small caps on both sides, like so:

Understanding-7805-Voltage-Regulator-IC-Basic-Circuit.jpg

I used slightly different cap values though. Some of this power is sent to my opamps as well.

The voltage that the teensy sees often hangs around 4.7V and sometimes dips lower (e.g 4.2V). I'm not sure how bad this is since the teensy has its own 3.3V regulator so this should be plenty. It seems to draw around 100mA but it doesn't work during these current measurements (not 100% sure why). I'm rather surprised that the voltage is not stable at 5V at this current :confused: It might have something to do with my crappy breadboard or the fact that I don't use a heatsink !?!?

While my audio does not work, the LED blinks. Can it be that the teensy works but somehow, my audio board does not?

I'm quite frustrated because I'm really stuck and messed around quite a bit to find an angle to make it work again. Do you have any suggestions how I can debug this further?
 
No need to get frustrated... how about just trying the example from the audio lib?
Maybe it's a missing "sgtl5000_1.inputSelect()" line?
Just to rule issues like this out, you should use known to work code.

You only need a headsink if the regulator gets hot.
SO.. is it hot?
If it's not "bad connection", a short might be the reason for the low measurements. Also, for the hot 7805.

The shield needs a well-defined reset (poweron-off) - esp when experimenting with code etc this reset does not happen. So, it helps just to switch off the whole thing sometimes.
The SGTL-Chip has NO reset input.
 
Are you confident all the pins are still connected between your Teensy and the audio shield? This problem really sounds like what happens when 1 or more wire between the two boards is disconnected.
 
Thanks for your quick replies!!

I did tons of testing, added heatsink. Replaced PSU but I was clearly looking in the wrong place.

Are you confident all the pins are still connected between your Teensy and the audio shield? This problem really sounds like what happens when 1 or more wire between the two boards is disconnected.

Not quite but this was right direction. I didn't think it could be related since I directly connected the audio shield to my teensy using stacking headers, so a disconnect is kindof out of the question.

However, I forgot to mention that I have 4 pots connected to A2, A3, A4 and A5 which should allow me to tune some effect parameters. It turns out that A5 (pin 19) is especially critical in communication between the audio shield and the teensy. Applying a voltage to that pin caused communication to fail. This explains why my LED was blinking, but no audio was heard.

I'm really happy I managed to find the problem. Learning a lot here :D

When reading the docs, I was a bit disappointed to find that out of the 10 analog inputs, I am only able to use 4 (A0, A2, A3 and A8) while I was planning to have 6 knobs control my effects.

Are there ways to rescue additional analog pins by disconnecting them from the shield? I'm not sure if the VOL pin needs to be connected for example? The other ones (mainly clock signals) seem pretty important to me. I would be interested to learn if it is possible to connect some different teensy pins to these audio shield pins to free up analog inputs. That would help me since I otherwise would need to set up additional ADC's which is really not ideal.
 
Oh I just discovered that teensy 4.0 has 4 more analog inputs on the backside. What a lovely surprise. Then I will definitely have enough for my goals :D
 
When reading the docs, I was a bit disappointed to find that out of the 10 analog inputs, I am only able to use 4 (A0, A2, A3 and A8) while I was planning to have 6 knobs control my effects.

A1 (pin 15) should be usable.


Are there ways to rescue additional analog pins by disconnecting them from the shield?

If you want to reclaim A6, A7, A9, you could use I2S2 instead of I2S1. But then you'll need to disconnect the 5 I2S signals from their normal pins and use wires to connect those 5 signals to the pins used by I2S2.


That would help me since I otherwise would need to set up additional ADC's which is really not ideal.

If you're going to add hardware, just an analog mux chip like 74HC4051 should be enough. See the USB MIDI page for info.

https://www.pjrc.com/teensy/td_midi.html
 
@nschagen: If it works for your particular setup/application, you might look into using a 74HC4067 analog MUX (Adafruit has a nice breakout board). Using this device would allow you to sample 16 analog inputs thru a single analog input pin. Utilizing this analog MUX IC would require 4 additional digital pins which are used to set the address in the MUX, but this could help with your shortage of analog pins.

Mark J Culross
KD5RXT
 
Back
Top