Re: I2S Record to SDCard using FATFs
Posted: Mon Mar 11, 2019 5:57 pm
Thanks for your answer.
Does this mean recording audio to SDCard using FATFs is not possible ?
Using an oscilloscope, the minimum time I measure to continuously write blocs of 16128 bytes to SD is about 50ms to 70ms (depending on the SD Card) as follow :
On the other side, filling one bloc of 16128 bytes from I2S @ 24/96K/Stereo is about 17ms.
According to the above, even if using huge circular buffers, recording is not possible.
Few questions :
1) Do you think using a faster SDCard could help ? I already tried with 2 different models SDHC
2) Is there anything to setup in make menuconfig that could improve fwrite() ? BTW I'm using long file names for FAT.
3) What is the most efficient between writing blocks of 512 bytes VS blocks of 16K bytes ?
I'm stuck on this, any idea would be greatly appreciated.
Does this mean recording audio to SDCard using FATFs is not possible ?
Using an oscilloscope, the minimum time I measure to continuously write blocs of 16128 bytes to SD is about 50ms to 70ms (depending on the SD Card) as follow :
Code: Select all
void mytask()
{
while(1)
{
// wait trigger to start recording
...
do
{
// toggle one IO to check with scope
...
fwrite(recorded 16128 bytes from I2S);
// delay 1ms to avoid watchdog error
vTaskDelay(1 / portTICK_RATE_MS);
} while (!trigger to stop recording);
}
}
According to the above, even if using huge circular buffers, recording is not possible.
Few questions :
1) Do you think using a faster SDCard could help ? I already tried with 2 different models SDHC
2) Is there anything to setup in make menuconfig that could improve fwrite() ? BTW I'm using long file names for FAT.
3) What is the most efficient between writing blocks of 512 bytes VS blocks of 16K bytes ?
I'm stuck on this, any idea would be greatly appreciated.