This part is fairly easy: AUDIO_MEMORY_PSRAM_8MB isn't declared, because you called it AUDIO_MEMORY8_PSRAM_8MB.
Not sure why serial messages aren't showing up, but ... it sounds as if you've added PSRAM to the Teensy...
It's a thing, apparently ... a fellow developer at work used the phrase to me, and it stuck: see https://en.wikipedia.org/wiki/Copypasta. Used here in the sense of "this code is just like the previous, so I'll make a...
Something like this should help - I haven't tested it beyond compiling it, though:
/*
* Generate a new sequential filename in the
* recFileName buffer. Adjust recFileFormat to your
* needs.
*/
char...
Even worse for mainMixer2 ... looks like you changed the design at some point and copy/pasta has left you only changing the gain of channel 0 (channel number is unsigned, and values >3 are ignored)
Recording is disabled, if I recall correctly because it didn’t work properly. You could try my library, see https://forum.pjrc.com/threads/70963-Yet-Another-File-Player-(and-recorder) for links and discussion.
How much buffer is "enough" is always likely to be application-dependent. If you have a fairly benign one that exits loop() or calls yield() or delay() often, then the EventResponder will have frequent opportunities to...
Sure, much better (or at least different) allocation strategies are possible ... but it's not intended as a demo of MIDI note allocation, just of the buffered playback! Actually, you may have found a bug ... I thought...
Good news. I thought it worked, but it's always good to have it confirmed by an independent witness!
There's some rather stale code between lines 333 and 345 of the SDPiano demo which monitors voice allocation and...
That's great, thanks Michael. It'd be good if there were similar suppliers in the UK and EU, but I guess the trouble is that you either do a lot of last-minute build and test, or have a lot of stock of different...
8 mono voices at near-normal speed should be fine, I think, even without PSRAM. For the SDPiano demo I used 8 stereo voices, each with a 32k buffer, for a total of 256k, or about a quarter of a Teensy 4.x's RAM. So 16k...
You probably are :D but thanks for the encouragement!
Development is a bit stalled at the moment, as I’ve been working on adding the ability to pre-load the start of a file for low latency applications; this will...
Try the latest version of the code … yes, we do recognise this, even when you only post an uncompilable fragment…
Try using the Teensy 4.1’s built-in SD slot, it can run the card faster
Try with it not plugged in to...
Wow ... not quite sure how you managed this! The emboldened text suggests you've somehow managed to persuade the Arduino IDE to try to compile a sketch directly from the .ZIP you downloaded - I can't do that, though I...
Great news ... though as you say a pity about your audio shield. I should hang on to it, though, those 32-pin SGTL5000 parts are like hens' teeth at the moment; you might even make a profit :D
It's a really obscure...
And there (possibly) you have it ... it seems various things, including audio, don't play well with different optimisation levels. You could try without the -Og, and go back to the default -O2. Or you could be another...
Further exploration yields the discovery that it's sufficient (for me) to add __attribute__((optimize("O2"))) before the definition of reset_PFD(), so the rest of startup.c can use whatever optimisation level is in...
No problem, glad it’s working for you now. If I remember I’ll have to see what the Arduino IDE uses as the optimisation level for startup.c, it may be different from platformIO (which I’ve never used), and a pragma...
Bit of a long shot, but a lot of the files aren’t being recompiled in your log, so it’s impossible to see if there are any weird options in use. Can you restart the IDE and post the log from the very first compilation?...
I've had what could be a similar problem using Arduino IDE, audio library and TeensyDebug. You might want to try finding the cores\teensy4\startup.c file, and commenting out the reset_PFD() call around line 92 or so....
That's what I'd expected ... but it's always worth checking!
https://www.pjrc.com/store/teensy41.html#memory is helpful, though it's quite likely you already found it. Pretty sure PROGMEM is to data as FLASHMEM is...
Compress your font files and decompress to heap / DMAMEM at boot? You don't say how you "reduced" them, so maybe you already did that! If not, I could only find this thread on the forum ... obviously you'd want to...
There’s a reason for the Forum Rule … now you tell us you’ve been connecting the headphone virtual ground to actual ground. Do Not Do This. It’s even written on the audio adaptor’s PCB. I seem to recall doing so can...
You could add another PSRAM to get to 16MB - that should allow buffering the start of 2048 sample files, each with an 8kB buffer. Or have I stuffed up my calculations at some point?
Yes, though you only waste an...
Sounds as if you're making good progress - hope you manage to get the hardware issue sorted out.
Inspired by this, I'm working on an update to my buffered playback which should make it easier to achieve low latency...
PR#451 is in, which aims to make playing of raw or WAV from any filesystem possible. However, there is still the issue that updating eyes takes 40-50ms, and these objects only buffer a few milliseconds of audio data, so...
I forgot to say ... another option in the dynamic library is for objects not on the update list to not be updated, so they don't consume CPU time. By default all existing objects do update, because there are some...
Sorry, that was probably a red herring … you’re not obliged to use new and delete!
Recent Teensyduino releases have added dynamic connections, but these don’t affect update order. The dynamic library, however, does...
This is true, and documented at https://www.pjrc.com/teensy/td_libs_AudioConnection.html. As you noted in the code in AudioStream.h, every time a new object is created it's linked at the end of the update list,...
Sorry folks, spotted a problem in post #13 - I've modified my audio adaptor's I˛C address, so I need sgtl5000_1.setAddress(HIGH);, but I'd guess most people don't - just delete that line! Fixed in the repo.
The latest commit adds the ability to specify the filesystem in use for playing and recording, on a per-object basis. Example code (which is in the commit, in examples/Buffered/AudioTestPlayMultiSD) plays from both the...
Excellent and most inspirational: thanks @KurtE. I've made an equivalent change and similar example for my buffered player (latest commit here) - button pins and filenames will need changing to suit your cards!
// Play...
Or you could try this: https://forum.pjrc.com/threads/70963-Yet-Another-File-Player-(and-recorder)
There’s an option to play from any opened File object, though it’s not thoroughly tested. You’d have to open and...
OK ... I found some time ... it had slipped down behind the sofa cushions :D. Looks like disconnection works:
#include <Audio.h>
// GUItool: begin automatically generated code
AudioSynthWaveform wav1; ...
Dynamic patch cords are fairly new.
From my reading of the code for the ladder filter the update() does an early exit with minimal execution time if there’s no audio to process and it’s not self-oscillating… but as...
You could maybe try using the dynamic patch cord capability in recent Teensyduino releases to disconnect() the audio input, combined with setting resonance to zero so it’s not trying to self-oscillate. Use connect() to...
Code? Image of audio design?
Based on my post #5 above, and given 64 samples is 1.5ms, you might hope for 6ms+trigger time, which is in line with what you're seeing. If you don't pre-buffer samples then the file...
PR now amended. I've had to back out my attempts to make USB packet sizes valid, as they seem to break something fundamental. However, I've fixed a few intermittent crashes, the code to allow all Audio+<stuff> build...
Will do, though spare time is going to be scarce for a while, I suspect … good news that you’ve had stable results, suggests strongly that I’m mucking up somewhere along the line!
One thing I forgot to ask, have you...
Got it, total failure at this end. Not a sausage. B****r all. I am disappointed with this result...
Python election sketches aside, I'm getting a fair few warnings... I've also not re-re-re-merged all my changes...
OK, so I've done a PR to align my automatic selection of bInterval for High Speed with your documentation effort. Seems "no worse than before"...
You're right, I do get sync_event() calls if I send to the Teensy; I...
At 96kHz, hence mucking about to be able to test at various different sample rates without having to give Windows a kicking every time I change something - the caching is a right pain then! I’ll put changing the audio...
True ... it all has the flavour of something punted out in a half-finished state because it mostly worked and there was more urgent stuff to do ... bit like a lot of my code!
I definitely see (relative) clock drift,...
I had been using both, but more recently only actively using AudioOutputUSB, though both objects are in the sketch. So that's probably the reason sync_event() isn't being called, but recent tries using both input and...
To be fair, I've never delved this far into USB before either ... still need to check the 125µs poll does work for me.
I've been checking the sync_event() by incrementing a counter within the function in the Teensy...
Well that's all very odd. On Windows I simply can't see the sync_event() function being called more than once, though after a closer reading of the code I can see it's supposed to be a callback from somewhere within the...
Haven't managed to make any useful progress on this, and none of the previous contributors to this thread seem to be interested :(, but I have spotted one other thing that could cause an issue, which is that with 8...
Yes, extmem_malloc() and similar are provided. Documented, if you read carefully, at https://www.pjrc.com/store/teensy41.html#memory, but not on the product page for some reason.
Note it’s PSRAM (Pseudo-Static RAM),...
Excellent news … I think when your 4.1 arrives you’re going to be very happy!
Ah yes. My SDPiano demo does that, total overkill with 30k pre-buffered for each of 261 samples. But that’s part of the application, not...
That all looks about like what I see using SD, topping out at about 20Mbytes/s (your 16k buffer test). The improvement I’d predict from using a Teensy 4.1 would indeed come from the bigger buffer sizes, not the CPU...
I thought I did, but couldn't find anything ... it may turn up. I did find this post where Paul states the PSRAM bandwidth is about 40Mbyte/s. I reckon that's nominally enough to play about 226 stereo 44.1kHz files,...
Just did a non-rigorous test of my SDPiano demo with the audio block size set to 16 samples, so an audio update interval of 363us. Pleasingly, it all worked first time after the change of block size, no further fixes...
Curious as to what you're measuring the latency with respect to? Some sort of trigger input to first sample output? 70us sounds a bit unbelievable, as it's only 3 samples at 44.1kHz, and it's hard to believe you can...
Yes, that works fine.
You can test without an audio adaptor, though the objects available depend on your Teensy - the Info pane to the right of the design tool is your friend here.
As I'm on Windows, it's a bit difficult to reproduce the above! However, I do have an oscilloscope so I can generate pin pulses at key points in the code without unduly affecting the timings. Which is nice. Are you...