I’ve been thinking about sample storage and what the path is from disk to the headphone jack. The RP2350 supports two 16 MB external memories on the QSPI interface. One of those will be the program flash, so the other can be a 16 MB RAM. That’s in addition to the 520 KB of SRAM on the chip. By far the simplest thing to do would be to load samples used in a track into the 16 MB RAM from the sample library on the non-volatile disk (which is currently an SD card, but will hopefully be soldered-down NAND flash). Then everything is in RAM, it’s fast and there’s no filesystem access to deal with while playing. But then I was worried 16 MB might not be enough, so I looked at the possibility of streaming sample data from disk. With a FAT-formatted SD card and using the ubiquitous fatfs library, the results are not great. The latency of SD card reads is just not predictable enough to allow eight samples to be played simultaneously.

When I get some NAND flash set up I may look at this again, but I think it would add a lot of complexity. With NAND flash the throughput would be fine but you still need a filesystem. I think I would probably have to use an RTOS in order to do non-blocking filesystem access, which I’ve been trying to avoid.

A limit of 16 MB per track sounds about right anyway. It’s 3 minutes of sample data, I’m happy with that for now.