Documentation is at https://www.pjrc.com/teensy/td_libs_AudioConnection.html
To create an unconnected object, just do AudioConnection myNewPatchCord();
To connect it, do myNewPatchCord.connect(src,src_port,dst,dst_port)
To discconnect it, do...
RESAMPLE_BUFFER_COUNT affects the number of buffers allocated to each playback object, so 2048, 7 gives you seven buffers of 2048 samples, thus 28kB of memory used to buffer about 325ms of audio. Once a buffer's data is consumed the...
Please don't post the same question on multiple threads.
As far as I can see you've missed setting the CS42448 address by wiring the address setting pins AD0 and AD1. There's a long discussion, with relevant information starting at this post. My...
Update mentioned above now has a fix for the glitch, too. This is not production-ready - I need to remove some debug code and check whether I've broken filesystems other than SD.
Can you give this update a go? It's a bit of a hasty update, and it's quite likely that I've broken all the other filesystems (LittleFS etc.), but SD seems to be working and faster (~8ms/file rather than 12ms). You'll get a bit of extra speed by...
I agree with your prioritization, and thank you so much for dedicating time to this!
I've switched from using SW SPI to HW SPI for talking to the OLED display, and it is way faster, and this basically eliminated the stuttering in the audio /...
Just reporting in... I think there are three issues for me to attack, probably in this order:
triggering playback from uClock or other interrupt code
slow playback start
your repeatable click
I've been struggling a bit today with getting...
Remembered as I was putting the light out that EventResponder has an interrupt option which may be relevant to your interests. Can’t work on it today but will take a look as soon as I get a moment.
“Easily” is almost certainly a no, though I could be wrong.
The fundamental issue is that for efficient streaming of multiple files, you need to read in quite big chunks - 4kB is a sweet spot for SD, typically. For current technology. It’s...
Sorry, my thoughts keep pouring in instead of altogether at once. First, thank you so much again, really inspired by this progress. I was kind of dreading the current state of sampling on my box, and now I'm looking forward to seeing how far I...
Whatever works for your application, really. I'm just glad someone's pushing the boundaries a bit, and willing to supply test cases. I'm under no illusions my code is bug-free... I was wondering if having several layers of directories was slowing...
OK, so, there seems to be nothing wrong with my library code after all! The problem is, the heap just isn't big enough for the playback buffers. I keep forgetting that they're specified in samples, so 2048x7 is actually 28kB per object, and we...
Actually, so long as the programmer makes just a bit of effort to parse fairly basic WAV files, they're a lot easier than RAW. They contain vital information about how many channels you have, the sample rate, and whether the file is really 16-bit...
@graydetroit thanks for that, got it all and investigating now. There's definitely "something rotten in the State of Denmark", I'm getting intermittent crashes when playback is started, specifically during loading of the buffers with audio data...
I think it’s typically about 5ms from calling play() to the sample being ready to play on the next audio update. That’s not too bad for only a few files, but worst-case with triggering all 16 tracks at once it’d be 80ms, which you’d definitely...
Thought I recognised your name … we had a dialogue about starting buffered SD playback from an interrupt handler. In the end I haven’t rolled that in, as it was going to have massive ramifications for a fairly unusual use-case … sorry. The same...
What I suggested in my post should give you “instant” playback, or at least as instant as the audio library is capable of - there’s always the 2.9 millisecond uncertainty. There will be a few milliseconds’ wait when you call play(), but after...
@graydetroit, you could give my changes a try. Please see posts #104 and #122 for links to my branch, and ways of tuning that for (possibly) better results - I wasn't very generous with my default buffer allocations.
In order to "cue up" a...
Heresy on a Teensy forum, but if you need to add extra hardware anyway ... you might want to look into one of the RP2040 or RP2350 (Raspberry Pi Pico) boards as an I²C co-processor. They natively only have two I²C ports, but you can use the PIO...
Putting a resistor in parallel with the pot won't help - it's the pot itself that needs a low enough resistance to drive the ADC input properly. There's a lot of discussion about this on the forum, though it's a bit hard to ferret out...
500K is pretty high, you’ll certainly need pinMode(A1,INPUT_DISABLE); in your setup(). See this discussion. A lower value pot wouldn’t hurt, if you have one, 5K would probably be a better option.
Most information can be found on this thread, and that's the ideal place to go for support as any answers I give will be fairly easily found by future Seekers of Knowledge. The thread started out with me checking I wasn't about to re-invent the...
I know a bit more now, so maybe I can figure out a way to destroy I/O objects completely, though it probably has very little practical use...
For ordering, I took the fairly simplistic approach that it becomes defined between any two objects...
I've just glanced over my code to refresh my memory - it's been a long time!
So ... the cores changes are confined to AudioStream.cpp and .h, and almost entirely about:
dealing with the ordering problem
keeping track of stale pointers, e.g...
No, I've not put in a PR for my all-singing all-dancing updates, partly because they are so far-reaching, and partly because even minor changes weren't being pulled. I know Paul is aware of my changes, and keeps a close eye on the forum, so I'm...
Believe me, if I thought a more modest approach would work, I'd've adopted it! Well, to be fair, I did, to start with. But then the shortcomings became increasingly apparent, until I arrived at what exists today.
pushing the contract to...
What Paul said ... trying to jump straight in with "your application" is a poor way of familiarising yourself with the Teensy audio system. The Design Tool is just one part of that.
As you don't say what your application is, I can't express an...
Ah ... I missed that i2s2_2 is an AudioOutputI2S2 object ... it's all a bit confusing to start with :unsure:
The audio adaptor uses AudioInputI2S and AudioOutputI2S, not the I2S2 ones. If you start from a blank Design Tool and place one of...
Hard to say without more detail of your intended application. It's correct for processing a mono signal, though you're not doing any processing apart from anything the SGTL5000 is doing internally, and outputting your mono signal on two outputs...
You're right. This is entirely my fault, I fixed setting breakpoints on T4.x with TD 1.59, and broke T3.x :eek:
I've put in a pull request, but in the mean time, if you modify the code around line 1182 of TeensyDebug.cpp like this, you should...
Here are some bugfix PRs:
https://github.com/PaulStoffregen/Audio/pull/464
https://github.com/PaulStoffregen/Audio/pull/462
https://github.com/PaulStoffregen/Audio/pull/426
https://github.com/PaulStoffregen/Audio/pull/407...
Also, it might be worth investigating the internal PLLs. Certainly the one used for I²S / TDM is capable of generating 24.576MHz (i.e. 256x 96kHz), and I'd expect it'd go up to 32MHz. You'd need to check the Reference Manual...
Hi Chip
I've put a bunch of effort into this, with results at https://github.com/h4yn0nnym0u5e/Audio/tree/features/dynamic-updates and https://github.com/h4yn0nnym0u5e/cores/tree/feature/Audio/dynamic-updates, and a forum thread for support and...
I've not played with the filters much, but I'd certainly expect more stages = steeper rolloff. Note that the biquads each contain 4 stages, of which you've so far only used one.
I just picked one of your examples, since they were basically...
I want to apologize and close the loop on this one. I must have previewed my response months ago but forgot to hit the "post" button. Anyway, your detective work @h4yn0nnym0u5e was spot on. I thought I had combined the two sample programs without...
This is probably "zipper noise" from the mixer, as any gain changes are sudden. One way around it is to use DC objects and multipliers, thus:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
//...
Thanks a lot @h4yn0nnym0u5e for your response and sorry if I confuse others. I thought indeed that FXs where based on the internal audio processor of the audio shield, because I tried one of them quickly once on my DAC and didn’t work. Now I know...
2 and 5 belong to SAI2; 6, 7, 8, 9 and 32 to SAI1. The TDM objects in the Audio library use SAI1, and the TDM2 use SAI2.
Pin 32 is what’s used for AudioOutputTDMB and AudioInputTDMD. It may be the hardware can be configured to “discount” pin 32...
Argh. Sorry. We’re talking about inputs! Here’s a PR intended to fix an input problem, though it never got merged … it was ignored for 3 years, then the contributor closed it and replaced it with a PR for some totally broken multi-IO code … so I...
…hit “post” too soon…
Maybe the omission of the masks for in1 is the issue? Hard to say…
For my multi-output update I had to completely re-write the blocks-to-buffer code, because the interleaving changes with the number of outputs in use. I’d...