Teensy 3.5/3.6 & Audio Adaptor Board and simultaneous use of 4 channels

Status
Not open for further replies.

kk12

Active member
Hi.

I need to build a device that simultaneously takes 2x audio inputs, modifies them (instructions on EEPROM, SD-card or in FLASH) and outputs them to 2x audio outputs. So its kinda audio throughput device that modifies the audio stream in realtime in two directions:

in1 --> FUNC1--> out1
out2 <-- FUNC2 <-- in2

In my understanding, this is supported by the existing libraries with 1x Teensy 3.5/3.6 & 1x Audio Adaptor Board. Is this correct or do I need something else?

Is it possible to use BOTH provided SD-card slots simultaneously with this setup? Schematics:
https://www.pjrc.com/store/teensy3_audio.html
https://www.pjrc.com/teensy/schematic.html
 
Last edited:
Still no answers. It says "The Teensy Audio Library lets you use the input and output simultaneously together with a toolkit of audio processing objects, to easily create all types of sophisticated audio applications. You can play multiple sound files, create synthesized waveforms, apply effects, mix multiple streams and output high quality audio to the headphones or line out pins." at https://www.pjrc.com/store/teensy3_audio.html

Is this limited to only one input and one output at a time?
 
Still no answers. It says "The Teensy Audio Library lets you use the input and output simultaneously together with a toolkit of audio processing objects, to easily create all types of sophisticated audio applications. You can play multiple sound files, create synthesized waveforms, apply effects, mix multiple streams and output high quality audio to the headphones or line out pins." at https://www.pjrc.com/store/teensy3_audio.html

Is this limited to only one input and one output at a time?

AFAIK, There is only 1 input object, that triggers the processing.
If all processing is synchronous, I cannot see , why you can not have multiple inputs, I have used myself only multiple outputs.

Obviously, i2s_quad allows you to use 4 i2s channels both on input and output.

You cannot have two independent processing chains (at least with stock audio library)
 
Yes, with 1 audio board you can use stereo input and stereo output at the same time.

Yes, you can use the stereo in/out as 2 mono signals.

No, the SD library only talks to a single SD card. Using 2 cards isn't supported by the software. Theoretically, the hardware could do it, but to accomplish that would require a major rewrite of the software.

While your message seems to talk of only 2 channels with 1 audio board, the subject mentions 4 channels. Just to pre-emptively answer that too, yes, you can use 4 channels if you connect 2 audio boards with the mods documented for using 2 boards. Yes, you can use 4 inputs and 4 output simultaneously. Yes, it can be two stereo or 4 mono channels.

Even though the tutorial doesn't specifically answer all questions, I would highly recommend you read or watch it. Especially the concept of how the design tool works and lets you create arbitrary audio processing systems is pretty important background to understand.

https://www.pjrc.com/store/audio_tutorial_kit.html
 
Yes, with 1 audio board you can use stereo input and stereo output at the same time.

Yes, you can use the stereo in/out as 2 mono signals.

No, the SD library only talks to a single SD card. Using 2 cards isn't supported by the software. Theoretically, the hardware could do it, but to accomplish that would require a major rewrite of the software.

While your message seems to talk of only 2 channels with 1 audio board, the subject mentions 4 channels. Just to pre-emptively answer that too, yes, you can use 4 channels if you connect 2 audio boards with the mods documented for using 2 boards. Yes, you can use 4 inputs and 4 output simultaneously. Yes, it can be two stereo or 4 mono channels.

Even though the tutorial doesn't specifically answer all questions, I would highly recommend you read or watch it. Especially the concept of how the design tool works and lets you create arbitrary audio processing systems is pretty important background to understand.

https://www.pjrc.com/store/audio_tutorial_kit.html

Thanks for clear answer. Making order to local reseller in the following days, as this was the last unresolved question on the way.
 
Yes, with 1 audio board you can use stereo input and stereo output at the same time.

Yes, you can use the stereo in/out as 2 mono signals.

No, the SD library only talks to a single SD card. Using 2 cards isn't supported by the software. Theoretically, the hardware could do it, but to accomplish that would require a major rewrite of the software.

While your message seems to talk of only 2 channels with 1 audio board, the subject mentions 4 channels. Just to pre-emptively answer that too, yes, you can use 4 channels if you connect 2 audio boards with the mods documented for using 2 boards. Yes, you can use 4 inputs and 4 output simultaneously. Yes, it can be two stereo or 4 mono channels.

Even though the tutorial doesn't specifically answer all questions, I would highly recommend you read or watch it. Especially the concept of how the design tool works and lets you create arbitrary audio processing systems is pretty important background to understand.

https://www.pjrc.com/store/audio_tutorial_kit.html

Finally programmed the boards, however as Im trying to use USB audio input and output while using headphone jack and microphone (audio throughput), it doesn't work. So does a channel equal to one way 'audio wire'? I'd like to use Teensy as inline amplifier/modifier and it is recognized by Windows and Linux as both USB input and output device, but no voice goes through from Teensy MIC to USB audio output (PC). USB (PC) to Teensy headphone works however, but only for left audio channel.

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

AudioInputUSB usb1; //xy=200,69 (must set Tools >
USB Type to Audio)
AudioOutputI2S i2s1; //xy=365,94

AudioOutputUSB usb2; //xy=200,169 (must set Tools >
USB Type to Audio)
AudioInputI2S i2s2; //xy=365,294

AudioConnection patchCord1(usb1, 0, i2s1, 0);
AudioConnection patchCord2(usb2, 1, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=302,184

void setup() {
AudioMemory(12);
sgtl5000_1.enable();
sgtl5000_1.volume(0.6);
}

void loop() {
// read the PC's volume setting
float vol = usb1.volume();

// scale to a nice range (not too loud)
// and adjust the audio shield output volume
if (vol > 0) {
// scale 0 = 1.0 range to:
// 0.3 = almost silent
// 0.8 = really loud
vol = 0.3 + vol * 0.5;
}

// use the scaled volume setting. Delete this for fixed volume.
sgtl5000_1.volume(vol);

delay(100);
}

// Teensyduino 1.35 & earlier had a problem with USB audio on Macintosh
// computers. For more info and a workaround:
//
https://forum.pjrc.com/threads/3485...-on-Teensy-3-1?p=110392&viewfull=1#post110392

Just did a small edit, which is now providing both left and right audio from PC to Teensy headphone jack:

Code:
AudioConnection          patchCord1(usb1, 0, i2s1, 0);
AudioConnection          patchCord2(usb1, 1, i2s1, 1);
AudioConnection          patchCord3(usb2, 0, i2s2, 0);
AudioConnection          patchCord4(usb2, 1, i2s2, 1);
 
Last edited:
Yes, one wire is one channel. I don't think that more than one USB Audio device is supported, at the moment (@others: please correct me, if i'm wrong)
 
Should this be the case with USB audio, I wonder if it's possible using line out, line in, headphone out and microphone in? And what is the code for that functionality. Examples and tutorial don't demonstrate it. Luckily Teensy 3.5 features include 2x ADC + 2x DAC , so they are the last resort.
 
Status
Not open for further replies.
Back
Top