I want to play 44kHz stereo 16bit wav files from LocalFileSystem. However I measured the performance of fread() reading 4096 bytes at a time and I got a maximum read performance of about 100kbyte/s. It is much lower than 176kbyte/s I need to feed the external DAC. Is it the absolute maximum I can achieve with LocalFileSystem? Is there a way to boost performance?
I guess by now Sheldon has found a solution. However, I am also interested in the LocalFileSystem performance, and I can't find much about it other than in this thread.
Well, I also found where somebody said "in general the localfilesystem is not meant for fast access". In comparison to what I guess you could get reading from an SD card instead, maybe 100kbytes per second is slow, but for what I am trying to do (coax an LPC11u24 into playing a midi file), I could live with 100 kbyte/s.
Actually, I would be real happy right now if I saw 10kbyte/s per second, but I am not even getting 1kbyte/s.
If I read 4096 bytes using fread(), I am seeing a blistering 627 bytes per second - it takes around 6.5 seconds to read the 4096 bytes! Unfortunately, it gets worse, particularly if I am playing a multi-track file, because I then have to read much smaller chunks of data, and I have to precede every read with an fseek, and I can be down to less than 400 bytes per second,
Can anybody else confirm a speed of 100kbytes per second for a LocalFileSystem read?
If my times are out of line with expectations, what might I be doing wrong?
I want to play 44kHz stereo 16bit wav files from LocalFileSystem. However I measured the performance of fread() reading 4096 bytes at a time and I got a maximum read performance of about 100kbyte/s. It is much lower than 176kbyte/s I need to feed the external DAC. Is it the absolute maximum I can achieve with LocalFileSystem? Is there a way to boost performance?