File number limit for VS1063 Standalone Encoder ?

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
Post Reply
morpheus
Senior User
Posts: 21
Joined: Fri 2013-02-15 19:59

File number limit for VS1063 Standalone Encoder ?

Post by morpheus » Thu 2016-04-21 10:13

Hi all,
I am using VS1063 as a standalone encoder to periodically record audio to separate MP3 files stored in a microSD card.
It generally works fine, but I have recently found that it stops recording after a number of files has been saved. I am thinking that there is some limitation in the FAT code of the standalone example, because the limit seems to be affected by the filesystem choice (FAT16/FAT32) and the allocation unit size.

I know that FAT16 has a limit of 512 files for the root directory and I have confirmed this in testing. Using FAT32 should solve this but somehow the max number of files is still low, depending I have seen 32, 128 or ~1024 max files so far and I am testing with different allocation unit sizes. I'm suspecting that the max number of files follows the rule 32*(Allocation unit size in KB) but haven't confirmed it fully.

I need at least ~2500 files written, so if the above rule is correct I would need an allocation unit of 128KB which I think is not an option.
I'm wondering if using different directories could help, but the VS1063 code does not seem able to write to other directories than the root.

Any advice is much appreciated,
Thank you in advance,
Giannis

User avatar
Henrik
VLSI Staff
Posts: 1041
Joined: Tue 2010-06-22 14:10

Re: File number limit for VS1063 Standalone Encoder ?

Post by Henrik » Thu 2016-04-21 12:07

Hello Giannis,

your findings are correct. The current VS1063a Encoder doesn't contain directory expansion.

As a workaround could you try to create 2500 files on the FAT32 file system main folder on a PC, then deleting them. This should expand the directory and make it possible for the VS1063a Encoder to do its thing.

Pasi is exploring the possibilities of compiling a version that does have directory expansion activated, and depending on whether the code fits in the VS1063a RAM memory he may chime in on this discussion later.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

morpheus
Senior User
Posts: 21
Joined: Fri 2013-02-15 19:59

Re: File number limit for VS1063 Standalone Encoder ?

Post by morpheus » Thu 2016-04-21 12:20

Hi Henrik,
thank you for the reply. I see that there is a macro EXTEND_DIRECTORY in c-fatfindentry.c but is commented out. I tried enabling but I got compile errors.
I will test your trick creating and deleting the files on a pc and report the results. Does it matter how large the files are? Would zero size files work?

Thank you for the help,
Giannis

User avatar
pasi
VLSI Staff
Posts: 1416
Joined: Thu 2010-07-15 16:04

Re: File number limit for VS1063 Standalone Encoder ?

Post by pasi » Thu 2016-04-21 19:29

The below should make it compile, but I have not tested if it works.

Code: Select all

#if 0
				FsMapMmcWrite(map, currentSector, 1, stream_buffer);
#else
				MmcWrite(currentSector, stream_buffer);
#endif
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply