effect_delay_ext.cpp and effect_delay_ext.h support for 2 PSRAM on 4.1 board ?

Have effect_delay_ext.cpp and effect_delay_ext.h been modified for use with 2 PSRAM chips soldered on the Teensy 4.1 board ? Will the Audio Design Tool AUDIO_MEMORY_xxxxx be updated to use those chips as well ?
 
Thanks for your reply and I am using your effect_delay_ext.cpp ,effect_delay_ext.h, extmem.cpp and extmem.h and my code compiles but no sound out of the delayed channel. Please see below code. It works if I use it as is but if I uncomment AudioEffectDelayExternal
and comment out AudioEffectDelay it compiles fine but I get no sound out of the delayed channel.

1708460280968.png


/*
* 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=241.88888549804688,189
//AudioEffectDelayExternal delay1(AUDIO_MEMORY_PSRAM64,95108); //xy=505.75,458.75
AudioEffectDelay delay1; //xy=268.8888931274414,328.8888931274414
AudioAmplifier amp1; //xy=406.8888854980469,255.88888549804688
AudioOutputI2S i2s2; //xy=556.8888626098633,190.00000476837158
AudioConnection patchCord1(i2s1, 0, i2s2, 0);
AudioConnection patchCord2(i2s1, 1, delay1, 0);
AudioConnection patchCord3(delay1, 0, amp1, 0);
AudioConnection patchCord4(amp1, 0, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=451.8888931274414,365.000036239624
// 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(400);
// Enable the audio shield, select input, and enable output
sgtl5000_1.enable();
sgtl5000_1.inputSelect(myInput);
sgtl5000_1.volume(0.5);
delay1.delay(0,1100);
amp1.gain(1.0);
Serial.begin(9600);
}


void loop() {
Serial.print(AudioMemoryUsageMax());
Serial.println();
delay(10000);
}
 
OK, a few things ...
  • it's really helpful to post code in the </> code tags, makes it easier to read! Not vital for this short piece of code
  • I have to assume you're using Teensyduino 1.59 - this is pretty important, a couple (?) of the previous releases broke this update
  • ...the important one ... finally ... you've installed EXTMEM, but said your delay memory is AUDIO_MEMORY_PSRAM64, which denotes a PSRAM fitted to the audio adaptor; try AUDIO_MEMORY_EXTMEM
The Design Tool info pane does have this documented, but it's a bit narrow by default and the table tends to get lost off the right-hand side :(
 
Glad you got it working.

It’s possibly worth pointing out that you don’t have to assign all 95.1 seconds of EXTMEM to a single delay object, as your sample code does. You can have multiple objects each with their own maximum delay time, up to a total of 95.1s (or 190.2s if you have two PSRAMs fitted). Any you don’t use for delays is of course available to your sketch, using extmem_malloc().
 
Thank you again for your additional hints.
I am not sure what you mean by "it's really helpful to post code in the </> code tags"
 
Thank you again for your additional hints.
I am not sure what you mean by "it's really helpful to post code in the </> code tags"
When entering data press the </> button on the entry screen and post your code in the resulting form that opens.
 
Back
Top