Memory add-on options for Audio Board ...

Status
Not open for further replies.

sealyons

Member
The audio board states that an Spi flash chip can be added. What is the max size chip you can add? It talks about 128M but there are now 1G chips available. Is it possible to add a 1G chip? There is also a 1G flash breakout available on Tindie (https://www.tindie.com/products/onehorse/spi-flash-memory-add-ons-for-teensy-3x/), could this be used with the audio library? Does anyone know an specific 1G flash chips that can be used?

Also, it states that either an SPI flash memory chip can be added or a RAM chip. Why would you use one over the other? Are there things you can do with the RAM chip that you can't with the flash?

Appreciate any help.
 
You can actually buy up to 2 Gbit add ons. I don't know if they might interfere with the audio board but since the flash add-ons are designed to use the Teensy SPI port (pins 10, 11, 12, 13) I expect they might.
 
Also, it states that either an SPI flash memory chip can be added or a RAM chip. Why would you use one over the other? Are there things you can do with the RAM chip that you can't with the flash?

First, if you're not familiar with the audio library, I highly recommend watching the 48 minute tutorial video. If you don't have 48 minutes, perhaps start at 12:02 and watch at least the sample playing and delay parts.

You'd use SPI flash memory to hold longer samples, perhaps entire songs, and perhaps many more of them.

You'd use the 23LC1024 RAM chip to implement longer delays.

Again, this will probably be more meaningful if you've at least watched those parts of the video, where you can see the use of small samples using only Teensy's extra program space, and the normal delay using only Teensy's internal RAM.
 
Are there things you can do with the RAM chip that you can't with the flash?

RAM means "Random Access Memory", you can read or - and - important - write them any time. Writing does'nt take longer than reading.

Flash was developed from EEPROM - ROM means "Read Only Memory" (EE="Electric Erasable"). You can not write to random adresses. Instead, for these chips (or , more exact, parts of them ("block" or "sectors") are erasing-commands needed which take _really_ long time. With Teensy we're used to think in micro or millicsconds. Erasing them (or parts) needs dozens or hundrets of ms to seconds. They can only be written when they are erased.

For more detailed information, ask google and wikipedia :)
Edit: There are much more differences.
 
Last edited:
I am just getting started with the Audio library. I have watched your entire 48 minute intro video (haven't run through the materials yet but will once I get the audio board running). I just got my audio board and am starting to get it setup. That's why I'm asking about the memory options, since I'd rather get the memory issues resolved from the start before I begin digging into the library and board usage. I'd certainly like to have more fast memory at hand. Again, what is the largest flash chip that can be added to the audio board? Can I use another flash device, like I listed, and then add extra RAM to the on-board memory pads to give me the most flexibility? I'm an EE and understand the basic differences between RAM and Flash but not necessarily in the context of Teensy Audio library usage. That was the reason for my question. Based on this what would you recommend? Thanks for any help.
 
I just got my audio board and am starting to get it setup. That's why I'm asking about the memory options, since I'd rather get the memory issues resolved from the start before I begin digging into the library and board usage.

Actually, I'd recommend you do exactly the opposite. Leave the optional memory off until you have a real need. Only a couple very specific objects access the external memory. Everything else makes absolutely no use of either type of memory chip.

I'd certainly like to have more fast memory at hand.

This doesn't work like a traditional computer, where extra memory gets used automatically to make things run better.

Even with Teensy's internal RAM, the memory usage isn't like traditional software were allocating more memory allows more stuff to be cached and things run better. The audio library requires a certain amount of memory. It's a hard real-time system. If that memory is available, things work. If not, some or all parts fail. No extra memory is ever used, only the amount needed based on your design.

In fact, the library has memory usage query functions so you can observe how much of the memory it's actually using. The idea is you can use these to adjust your AudioMemory(number) line at the beginning of your program to only the amount the library actually needs to run whatever audio design you've created. Extra memory just sits there, forever unused.

Again, just to be clear, every object in the library that needs memory for general operation will *not* be able to use the external memory chips. No matter how much memory you add, it won't actually be used by pretty much everything in the library. Only a couple very specific features access that memory. Even those use some of the general purpose internal RAM. They only go to the extra (slower) work to access the external memory for specific features.


... but not necessarily in the context of Teensy Audio library usage. That was the reason for my question. Based on this what would you recommend? Thanks for any help.

Really, your best path is to just start using the audio library without any extra memory. You can use the normal delay object with the internal RAM. You can play sound clips from the SD card or from C files using wav2sketch.

Do those first! If you need a longer delay than you can get from Teensy's internal RAM, then add the 23LC1024 chip. If you want longer clips and the SD card is too slow to layer several of them together, than add the flash chip. By that point, your decision about which chip to use can be guided by the actual sound clips you're trying to use. (and your knowledge of how things actually work)

However... if you really want to disregard this advice and max out with as much memory as possible, go to OSH Park and order Frank's memoryboard, and get six 23LC1024 chips and the other misc parts it needs. That will give you RAM for a 9 second delay. It'll also leave the 8 pin location on the audio board unused. Then your can choose either a Winbond W25Q128FV (the largest easy-to-solder) or a Micron N25Q512A13G (the largest 8 pin possible-to-solder) chip for the bottom of the audio shield.

Or if you *really* want to max things out, get Onehorse's 2Gb board. It'll need fiddling with wires to get hooked up to the right pins, but that will give you absolutely the largest NOR flash memory chip that exists in the world today!
 
Last edited:
Thank you very much for the info. I'll follow your advice and just start playing with the board and see where that takes me.

Do you have any recommendations for headphone and line-out jacks? Is there a reason you don't stock these parts in the store? Really appreciate your help.
 
Do you have any recommendations for headphone and line-out jacks?

Pretty much any normal headphone work fine. For the workshop we did, I tested many inexpensive ones. Panasonic RP-HT21 had particularly good sound quality among many others in its price range that, well, didn't.

For line-out, the pads are meant to sort-of follow the HD audio connector pinout uses on PC motherboards. I have tested with a couple PC front panel parts, which worked fine. Many people find it more convenient to just solder wires. It's up to you.

Is there a reason you don't stock these parts in the store?

PJRC mainly focuses on developing Teensy and technology that helps people build awesome projects.

Maybe we should have a more Adafruit or Sparkfun like business model. Would probably make more money that way. But not everything is about making money...
 
Flash Memory Add-On

I'm trying to figure out if I need the additional flash memory on the audio board because it will be difficult to add once the boards are soldered together. My understanding was that internal memory was available to accomplish my goal but I'm second guessing this based on some things I've read. I'm working on a drum machine which will need to play 10-15 different short sounds. Is this possible with the stock audio board?

I've watched the tutorial video but it is unclear if the audio board is using additional memory. Any help would be appreciated.

Thanks!


Actually, I'd recommend you do exactly the opposite. Leave the optional memory off until you have a real need. Only a couple very specific objects access the external memory. Everything else makes absolutely no use of either type of memory chip.



This doesn't work like a traditional computer, where extra memory gets used automatically to make things run better.

Even with Teensy's internal RAM, the memory usage isn't like traditional software were allocating more memory allows more stuff to be cached and things run better. The audio library requires a certain amount of memory. It's a hard real-time system. If that memory is available, things work. If not, some or all parts fail. No extra memory is ever used, only the amount needed based on your design.

In fact, the library has memory usage query functions so you can observe how much of the memory it's actually using. The idea is you can use these to adjust your AudioMemory(number) line at the beginning of your program to only the amount the library actually needs to run whatever audio design you've created. Extra memory just sits there, forever unused.

Again, just to be clear, every object in the library that needs memory for general operation will *not* be able to use the external memory chips. No matter how much memory you add, it won't actually be used by pretty much everything in the library. Only a couple very specific features access that memory. Even those use some of the general purpose internal RAM. They only go to the extra (slower) work to access the external memory for specific features.




Really, your best path is to just start using the audio library without any extra memory. You can use the normal delay object with the internal RAM. You can play sound clips from the SD card or from C files using wav2sketch.

Do those first! If you need a longer delay than you can get from Teensy's internal RAM, then add the 23LC1024 chip. If you want longer clips and the SD card is too slow to layer several of them together, than add the flash chip. By that point, your decision about which chip to use can be guided by the actual sound clips you're trying to use. (and your knowledge of how things actually work)

However... if you really want to disregard this advice and max out with as much memory as possible, go to OSH Park and order Frank's memoryboard, and get six 23LC1024 chips and the other misc parts it needs. That will give you RAM for a 9 second delay. It'll also leave the 8 pin location on the audio board unused. Then your can choose either a Winbond W25Q128FV (the largest easy-to-solder) or a Micron N25Q512A13G (the largest 8 pin possible-to-solder) chip for the bottom of the audio shield.

Or if you *really* want to max things out, get Onehorse's 2Gb board. It'll need fiddling with wires to get hooked up to the right pins, but that will give you absolutely the largest NOR flash memory chip that exists in the world today!
 
Can the AudioPlayMemory object utilize external RAM? It's unclear to me if any objects other than AudioEffectDelayExternal are able to use external memory. AudioPlayMemory is perfect for my application because its playback latency is so quick.

Thanks.
 
Is it true there is no larger storage option than the 23LC1024 for RAM?

I know they can be chained on a daughter card but it just seems a messy solution and it's still a limited quantity.

I used to do looper software in Flowstone (nee Synthmaker) and I'd like to try a hardware version with the audio board but it would need a LOT more RAM (at least four channels at 16 bit min at 48k or better SR for something like 20 seconds length would be 8MB).

Assuming it's not in the cards for the stock audio board today are there any reasonable options for a custom audio board that doesn't involve writing low level code?
 
Maybe you can mix the channels before storing them to RAM,
but the audiolib is 44k only, so it would'nt work anyway.
 
you can solder BGA ?

Lol ...not so much...
The 48-pin TSOP-I package option is not yet available...
And I can't solder these either. There are several options for the chip but all are parallel interface... so the real problem is having to add SPI functionality ...hopefully with some kind of interface chip... and keep the cost reasonable.

I'm not thinking of me doing this any time soon. But there are people here with real EE skills that might undertake this... right now I'm just wondering if Teensy would ever be an option for looper projects. This is the only faint hope I can see for it.
 
right now I'm just wondering if Teensy would ever be an option for looper projects. This is the only faint hope I can see for it.
There are Kinetis K60 parts with DDR interface, e.g. MK61FN1M0VMJ15. So a TeensyXL 4.x with a few dozen megabytes of DRAM might theoretically be a possibility, if enough people ask for it...
 
No, but it's easy to add it.
Can you tell me why you need RAM, and ext. Flash isn't sufficiant ?


I'm using the Teensy as a stimulus generation module as part of an auditory ERP system. In auditory ERP you measure a subject's time locked EEG (brainwave) response to an auditory stimulus. Ideally, you want the sound play back latency to be consistent and less than a millisecond. Currently, my stimuli are mostly produced by the sine wave generator, but in the future I will probably need to be able to play from a selection of wave files. The AudioPlayMemory function is working very well for playing back the one stored sound sample I'm using, but I expect to run into memory limitations pretty quickly if I try to add more samples.

Based on something I read on the forum, I believe the playback latency using Flash isn't nearly as quick. Of course if the latency is known and consistent, I can subtract that time when examining the EEG data, but it's much nicer if the latency is negligible (<= 1 millisecond) and can be ignored.

Thanks!
 
This sounds very interesting.
But, the latency is the same with external memory - both, RAM and FLASh use SPI, and the same commands for addressing.
The Teensy 3.6 has 1MB internal flash.
 
This sounds very interesting.
But, the latency is the same with external memory - both, RAM and FLASh use SPI, and the same commands for addressing.
The Teensy 3.6 has 1MB internal flash.

Thanks for clarifying that. I didn't realize that the external RAM had that constraint. I need to investigate how the internal flash performs.

I did not know about the 3.5 and 3.6. Their specs are so good, they pretty much moot my previous question. Do you know if they will work with the Audio Adaptor with the existing Audio Library, or will that functionality be unavailable until the new Audio Library is written? Is the functionality of the Audio Adapter incorporated into these new boards?

Thanks again.
 
Do you know if they will work with the Audio Adaptor with the existing Audio Library,

Yes, it's been tested and definitely works.

Is the functionality of the Audio Adapter incorporated into these new boards?

No. You'll still need the audio adaptor or a similar board if you want real 16 bit stereo ADCs & DACs.

But the new boards do have two 12 bit DAC outputs. Teensy 3.2 only has a single 12 bit DAC. You can now have stereo output directly from the pins, if 12 bits is good enough quality (it sounds surprisingly good actually). Or you will be able to... the 2nd DAC isn't supported yet by the audio lib, but it will be soon.
 
No, but it's easy to add it.

I'm sorry for bumping a very old thread. Frank, would you be willing to expand on this a little bit? For various reasons that would be tough to get into here, I'm hoping to avoid LittleFS and instead use AudioPlayMemory to play from external flash memory. I'm assuming it's more complicated than changing the .cpp file generated by wav2sketch from PROGMEM to EXTMEM, as that alone doesn't seem to work ;)
 
Status
Not open for further replies.
Back
Top