MovingAverage
Member
Hi there! I already tried explaining my issue some time ago when the beta for Teensyduino 1.52 came out, but failed to give a reproducible scenario, which I hope I'm doing now:
My current setup is a Teensy 4.1 with WM8731 as master(44.1khz) BUT initially the issue was spotted with an Teensy 4.0 with the official audioboard. I'm using FAUST to generate an Audio Library object, which gives two outputs: a 1-sample impulse with a period of 10E4 samples and the same impulse going through a 16^2 sample delay on the other channel. That's what the FAUST code looks like:
The size of all buffers (in the generated .cpp file) is therefore 262'176 bytes, which makes sense, as the delay is 2^16 samples * 32bit, which should be 262’144 bytes. Perfect. As soon as I add 1 sample to the delay time (DT = (2^16) + 1), the summed buffer size jumps to around 524kB - which is to be expected, as the delay buffer works around bit masking, so 1 added sample doubles the buffer size. But please bear with me:
FAUST has a compilation option to switch from the bit masking to a wrapping index mode for buffers. This reduces the memory footprint in this case enormously, as the buffer doesn't double in size! So to speak in numbers, the size of the optimized buffers is now 262'184 bytes. Following to my problem:
This worked FLAWLESS before Teensyduino 1.52. I had also other FAUST generated Audio Library objects, which worked with multiple buffers and as long as I kept the size of all summed buffer under around 490kB (which is not too far away from the 512kB free space for DMAMEM variables in RAM2) everything was running fine!
Same code compiled with Teensyduino 1.52 suddenly started bricking the teensy. Was there a new way introduced of generating the buffers from the Audio Library or what happened?
I attached following files in View attachment pulseDelay.zip:
- .dsp Faust Code with 2^16 delay
- generated Audio Library compatible .cpp & .h WORKING with 2^16 delay
- generated Audio Library compatible .cpp & .h NON-WORKING with 2^16+1 delay (optimized version)
- .ino file
If there is anything else I missed to include or explain please tell me, I want to resolve this issue and appreciate every little clue!
Thanks a lot and all the best
My current setup is a Teensy 4.1 with WM8731 as master(44.1khz) BUT initially the issue was spotted with an Teensy 4.0 with the official audioboard. I'm using FAUST to generate an Audio Library object, which gives two outputs: a 1-sample impulse with a period of 10E4 samples and the same impulse going through a 16^2 sample delay on the other channel. That's what the FAUST code looks like:
Code:
DT = 2^16;
process = ba.pulsen(1, 100000) <: _, de.delay(DT-1,DT);
The size of all buffers (in the generated .cpp file) is therefore 262'176 bytes, which makes sense, as the delay is 2^16 samples * 32bit, which should be 262’144 bytes. Perfect. As soon as I add 1 sample to the delay time (DT = (2^16) + 1), the summed buffer size jumps to around 524kB - which is to be expected, as the delay buffer works around bit masking, so 1 added sample doubles the buffer size. But please bear with me:
FAUST has a compilation option to switch from the bit masking to a wrapping index mode for buffers. This reduces the memory footprint in this case enormously, as the buffer doesn't double in size! So to speak in numbers, the size of the optimized buffers is now 262'184 bytes. Following to my problem:
This worked FLAWLESS before Teensyduino 1.52. I had also other FAUST generated Audio Library objects, which worked with multiple buffers and as long as I kept the size of all summed buffer under around 490kB (which is not too far away from the 512kB free space for DMAMEM variables in RAM2) everything was running fine!
Same code compiled with Teensyduino 1.52 suddenly started bricking the teensy. Was there a new way introduced of generating the buffers from the Audio Library or what happened?
I attached following files in View attachment pulseDelay.zip:
- .dsp Faust Code with 2^16 delay
- generated Audio Library compatible .cpp & .h WORKING with 2^16 delay
- generated Audio Library compatible .cpp & .h NON-WORKING with 2^16+1 delay (optimized version)
- .ino file
If there is anything else I missed to include or explain please tell me, I want to resolve this issue and appreciate every little clue!
Thanks a lot and all the best