File access and threads

07 Jun 2012

Hello, I am new to mbed and get here for a specific project.

I want to playback .wav files some 20 seconds long. I tried the wave_player, but it sounded bad so, willing to learn the platform, I decided to program the player by myself. I managed to playback small .wav files from memory, so I went into playing from the flash memory and found that every 512 read bytes, it took a full 10 ms to read the next block.

No problem, a circular buffer, a thread for playing and a thread for filling the buffer. Then I found that the LocalFileSystem blocks all threads while reading. Ok, let's try with and SD card.

Unable to find a 2 GB SD card in the store near my house, I bought a 4 GB SDHC card, wired as described here http://mbed.org/users/ceri/notebook/mbed-now-with-sd-card/ and loaded the SDHCFileSystem only to find the same problem.

So, the LocalFileSystem and the SDHCFileSystem are blocking. My question is: the SDFileSystem is also blocking? if so, is there a way to stream continous data from a file in the mbed?

Hope somebody can help me.

08 Jun 2012

Nobody?