Teensy 4.0 AudioInputAnalog and AudioOutputMQS

ghostintranslation

Well-known member
Hi,

I'd like to get confirmation I'm not missing anything and that there is a bug in current version.

I'm just trying to send a signal on A0 and hear it on the MQS, but when I use both together I just get a loud constant buzz, but if I switch the adc1 for waveform1 in this code it works fine:

Code:
#include <Audio.h>

AudioInputAnalog         adc1(A0);
//AudioSynthWaveform       waveform1;
AudioOutputMQS           mqs1;
AudioConnection          patchCord1(adc1, 0, mqs1, 0);
AudioConnection          patchCord2(adc1, 0, mqs1, 1);
AudioOutputI2S           i2s1;


void setup() {
  AudioMemory(40);
    
  Serial.begin(9600);
  while (!Serial && millis() < 5000) ;
  
//  waveform1.frequency(40);
//  waveform1.amplitude(.05);
//  waveform1.begin(WAVEFORM_TRIANGLE);
}

void loop() {
}

I also tried to use the ADC.h library instead, but similar issue, the ADC.h works fine on its own and MQS works fine on its own but when using both then there is this loud buzz coming out.

I am guessing it has to do with the timers both are using, maybe the same timer?

I know it says "experimental" on the GUI so I just want to know more about that like is it still not fixed, is there a workaround, do we know where it's coming from and just didn't have time to look at it maybe I can try something...?

Thanks
 
I've been working on AudioInputAnalog for Teensy 4, hopefully to get to a usable no-longer-experimental state. Improved code is on github now.

Tried this program with the latest github code. If the A0/14 pin is unconnected, I absolutely can reproduce the horrible buzzing sound. The ADC pins pick up noise from the rest of the chip every easily. They must be driven by a low impedance (strong signal) to overcome the on-chip coupling.

With a signal on A0/14 and the new code, this is working. I'm listening to the MSQ output connected via a R-C filter (1K and 10nF) sent to a M-Audio AV40 monitor speaker.

mqs.jpg

In this photo, you can see a green wire. That's connecting pin 16/A2 to pin 14/A0, since I built that hardware to send the iPhone's audio to pin 16/A2 (the AudioInputAnalog default). If I pull that green wire, the result is indeed a loud buzzing tone. The ADC pin picks up a lot of coupling from other stuff on the chip when floating!
 
Back
Top