Combee on Palm OS

Monday, 8 November 2004  2:53 PM

I'm working on a secret project.  As part of this, I've been looking into recording sound files to SD cards using different Palm OS devices.  The program of choice is SoundRec from infinityball.com.  However, when I started to record at 22KHz to an external card, I was surprised to find my voice garbled on playback.  Looking at their forums, I found that many SD cards can't be written quickly enough to support recording audio at reasonable bitrates.  Using the free Card Speed tool from Audacity Audio, I tested several of my SD cards to determine their write speeds:

CardZire 72Treo 600Tungsten T3
Panasonic 16MB129 KB/s27 KB/s123 KB/s
PNY (Toshiba) 256MB14 KB/s13 KB/s14 KB/s
Lexar (Panasonic) 256MB78 KB/s24 KB/s67 KB/s
PQI (Unknown) 1GB94 KB/s82 KB/s93 KB/s

So, your performance can vary considerably, not just from card to card but from device to device.  The SD controller and card driver play a big role, in some cases I had a 5x improvement in write speed depending on the device.

For 22.05 KHz, 16-bit mono recording, I need at least 45 KB/s which is only provided by the 1GB card on my Treo; I'd actually like a bit of margin over that write speed, since some of the writing goes to updating directory structures and FAT tables, not just saving my audio data.

Of course, if you're writing an application using VFS, please try to avoid reads or writes that are smaller than 8K.  The VFS code for SD cards doesn't contain any caching, so each call to read or write will result in at least one full sector being accessed from the card.  By putting your own buffering layer between your code and VFS, you can get much better performance and also save wear on the cards that can result from rewriting the same sector over-and-over.  All of the results posted were from the 8K write tests.  In comparison, when writing one byte at a time, the Panasonic card does 18 bytes per second on the T3.  That is a an order of 1000x performance difference.