Main
Contact
Comments
Intro
Hardware
Software
FAT32
Photos
ASP.NET
ASP
Perl/CGI
NAS Sys
Libraries
Utilities
Projects DB
Parts Source
MP3Car
YAMMP
Oxygen MP3
PJRC
Z Player
PRUK2000
DSP MP3
Add a link
Playlists and FAT32

Facts

- FAT32 and its long filename extensions VFAT, were never meant to ran on a microcontroller with only 4K SRAM.
- The micro is too slow to index/search and deal with directory trees quickly and effeciently


Idea
When I first started interfacing a hard disc to a microcontroller, it was obvious that using the FAT filing system was a good idea from the point of view of ease of copy files and data on to the drive from a PC.
I developed a lot of embedded code to read disks, and to even impliment some cutdown ANSI C style file commands like fopen(), fgetc(), etc, and to support directory trees. (click here for more information)
While this worked and the results were good, there is constant battle of running out of SRAM on the small microcontroller as my boards only used the internal SRAM that is contained on the AVR ICs.


When I redesigned my MP3 player, I decided I wanted the following features;

- To allow 'normal' directory structures with MP3s placed in logical form, rather than having to store them all in the root directory like many other MP3 players.
- To support some sort of playlist/grouping features, whereby albums or collections of songs could be grouped together.
- To be able to change track quickly, and to be able to skip groups of tracks with out much effort.

The main problem with continuing to impliment string matching to search through folders finding subfolders and files was that it used plenty of memory (RAM), especially considering you have to buffer the VFAT entries and then match up long file names.

My only method of putting files onto the player would be to put this hard disk into a PC and copy data on to it, so why not use the PC to build up an index or a database of playlists that is easily readable from the MP3 player, whilst still maintaining the ability to format the drive with FAT32?


MP3 File System
The idea is to put the hard disk into the PC, copy on the MP3s into any folder structure that you choose and then to run a small application which takes these files, looks at the FAT32 drive, works out where each MP3 starts, and write all this information, and playlist orders into a small binary database file which is easily understandable on a memory limited system.

I wrote the tool in Windows tool in C# (using some unmanaged C++ DLL's to access the disk) to perform this indexing function

Now that I had this small database system on the target disk drive with the MP3s, the MP3 players firmware could be striped of its directory browsing, indexing and matching code which used all that precious SRAM.
Using only basic FAT32 disk access (including cluster traversing) I could now read MP3s quickly which were grouped in playlists.


MPFS Windows Tool



Click Here to Download Executable...
Written mostly in C# with some C++ DLL's, the MPFS Windows tool creates playlists automatically from a FAT32 formatted partition, and creates the cutdown playlist file.


Updated Firmware
Supports the new 'database' format, and the 'Sony Rotary Commander' joystick controller.
Click Here for source code...


New Features
- Auto locate 'playlist.bin' file in root dir to play all playlists from.
- Favourites Manager: Add a track you like to favourites for ease of playing again.
- General playlisting improvements
- Control commands can come from serial port or through decoding an ADC channel for devices like Sony Rotary Commander.

Advertiser Links

ASP.NET Digital Sales IPN
Digital sales ecommerce system for PayPal's IPN.
Start making money from only $14.99.


ASP User Membership
User signup & login authentication system
Low cost ASP script from only $4.99...

ASP.NET User Management
ASP.NET members area system, protect your website from only $5.99...

.NET Download Protection
ASP.NET download link protection/anti-leach system.
Low cost ASP.NET module for $3.99...

.NET Email Validation
Email address verification module
Low cost ASP.NET script only $3.99...

Advertise here!
(c) R. Riglar 2003-2006
Disclaimer