propa
Well-known member
Hi,
Got a Teensy 4.1 and Rev D shield, trying to just get the audio passthrough working, and it's execution is intermittent, not predictable. I uploaded once successfully, but once the board is unplugged and plugged back in it ceases to work.
Just using simple passthrough example, and have neither been able to change the volume from external pot, nor could I get this code to work again after unplugging and pluggin the Teensy once it was working.
I've never had this sort of problem before with any of the 3.2 or 3.6, or other Audio Shields
Using Teensyduino 1.53, 1.8.13
Is this Audio board a dud? Unplugging while audio was playing into jack wouldn't hurt the audio board?
Got a Teensy 4.1 and Rev D shield, trying to just get the audio passthrough working, and it's execution is intermittent, not predictable. I uploaded once successfully, but once the board is unplugged and plugged back in it ceases to work.
Just using simple passthrough example, and have neither been able to change the volume from external pot, nor could I get this code to work again after unplugging and pluggin the Teensy once it was working.
Code:
/*
* A simple hardware test which receives audio from the audio shield
* Line-In pins and send it to the Line-Out pins and headphone jack.
*
* This example code is in the public domain.
*/
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=200,69
AudioOutputI2S i2s2; //xy=365,94
AudioConnection patchCord1(i2s1, 0, i2s2, 0);
AudioConnection patchCord2(i2s1, 1, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=302,184
// GUItool: end automatically generated code
const int myInput = AUDIO_INPUT_LINEIN;
//const int myInput = AUDIO_INPUT_MIC;
void setup() {
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(12);
// Enable the audio shield, select input, and enable output
sgtl5000_1.enable();
sgtl5000_1.inputSelect(myInput);
sgtl5000_1.volume(0.8);
delay(20);
}
elapsedMillis volmsec=0;
void loop() {
// every 50 ms, adjust the volume
// if (volmsec > 50) {
float vol = analogRead(18);
//Serial.println(vol);
vol = vol / 1023.0;
sgtl5000_1.volume(vol); // <-- uncomment if you have the optional
// volmsec = 0; // volume pot on your audio shield
// }
}
I've never had this sort of problem before with any of the 3.2 or 3.6, or other Audio Shields
Using Teensyduino 1.53, 1.8.13
Is this Audio board a dud? Unplugging while audio was playing into jack wouldn't hurt the audio board?