Rockbox Development > Feature Ideas

FAT read ahead

(1/1)

dreamlayers:
I noticed that when filling the buffer my iPod does noticeable seeks at semi-regular intervals even if reading from a single non-fragmented file.  It seems this is due to having to read the next FAT sector.  In firmware/drivers/fat.c there is a FAT cache but no read-ahead of the FAT.

I created a function to preload the FAT cache, and I use it on files right before they're loaded into the buffer.  This got rid of that regular seeking and it seems to it can remove about two seconds from the time needed to fill the buffer when reading a single non-fragmented file.  Currently the code is quite simple and unintelligent.  Fragmentation or other activity can overwrite the pre-loaded FAT sectors in the cache, and in such cases the pre-load leads to extra reads.  I didn't submit a patch because I'm not sure if such simple experiments should be submitted.

saratoga:
Open an FS entry.

dreamlayers:
Here you go http://www.rockbox.org/tracker/task/9621

Navigation

[0] Message Index

Go to full version