Jordi22:
However, to have a continuous data stream to the PWM output, I had to configure two 512 byte buffer arrays in SRAM in addition to the ~ 1000 bytes of buffer that the SDFat library is already using.
This means that for all other variables only 500 bytes are left. This is a severe limitation for all other functions I want to implement, i.e. defining playlists etc. It also means that this method doesn't work on an Atmega 328 , that has only 2048 bytes SRAM. Trying to reduce the buffer size always leads to audible interruptions of the data stream.
Well... now you are noticing the drawback of most AVR microcontrollers: small RAM size. That's something you have to either deal with, or switch to an ATmega2560 (aka Arduino Mega).
Jordi22:
Has somebody managed to directly read from the SDFat buffer , w/o using the file.read() function
No, but you can by modifying the library.
Although it's not recommended to have direct access to that buffer, since it's actually what is called a "disk cache", which could also contain important filesystem data that must not be incorrectly altered.
To modify it for double buffering, maybe it's better to redo (more or less from scratch) the whole filesystem driver. The "low-level access" part is already done even on the included SD library, the class is named Sd2Card; what you'll have to reimplement is what actually takes the 512 bytes of RAM: the volume (partition) and filesystem driver.
To say the least, you need to have knowledge on how a partition table (the "Master Boot Record" version) and a FAT filesystem works.
Why all this? Because unless you (as a regular user) actually wrote those files knowing the "physical" location in the card, sticking to the filesystem rules is mandatory. It's not as simple as just reading the next block, there's a lot going on when a filesystem is involved; the library actually does a good job of turning all that juggling into an easy task (that's the "hidding principle" of object-oriented programming).
Jordi22:
which is far too slow for single byte transfer at the needed 88 kByte/s ?
Have you tried the multiple byte version of read()? It's supposed to be more efficient than the single byte version multiple times:
// This example assumes you're using a double buffer
unsigned int bytesRead = file.read(buffer[whichBuffer], sizeof(buffer[0]));
// Saving the amount of bytes obtained might be a good idea to realize on time when the end of the file has been reached
Also, are you filling the buffers in the main program and playing the samples in an interrupt?