Re: Disc File Layout

Alistair Milne <[email protected]> Thu, 22 Jun 2006 09:49:08 +0200
Newsgroups gmane.games.devel.consoles
Message-ID <[email protected]>
Hi Brett,

>1. Sectors are counted from the center of the disc, is this correct? E.g. 
>the first sector is closest to the middle of the disc and the last one is 
>the edge of the disc?
>  
>
That's correct, yes.

>2. Do lower sectors seek faster? How about transfer speeds? Are they better 
>towards the inner or outer areas of the disc?
>  
>
That depends on the disc drive.  On PS2 no, the drive is CAV (constant 
angular velocity) so the outside edge has the fastest read rates, but 
also has the highest spoilage rates because of physical damage to the 
edge of the disc, so the best place to locate data for high transfer 
rates is near the outside edge, but not right on it.  If I remember 
correctly, PS2 DVD gives you over 2x performance reading from the 
outside edge compared to the inside, so it really makes a difference.

>3. Any general tips for laying out data on discs? I saw some posts on the 
>newsgroups suggesting putting the elf in the early sectors so it loads 
>faster, etc.
>  
>
>4. Any other things I should know about file placement? size of files?
>  
>
Seek times are the killer, for short reads it can take longer to seek 
there than it can to actually perform the read.  Therefore, try to 
layout your data so that files which are often read at the same time are 
physically near each other on the disc, to reduce seek overhead.  The 
Xbox DVD emulator has a nifty statistical tool for this which helps to 
semi-automatically lay-out your disc for you based on timings gathered 
during playing sessions. 

If you often have several simultaneous file reads in progress (e.g. 
music + speech, music + streamed data, etc) then it helps, on systems 
like PS2 where you can perform file reads by sector number, to write 
your filesystem as a queue of pending reads and then sort them by sector 
number.  This keeps the drive head moving in the same direction instead 
of jumping back & forth.  Again, the goal is to reduce seek times. 

PS2's DVD drive has a 16 sector (32Kb) cache, and is therefore most 
efficient making reads aligned on 16-sector boundaries, of multiples of 
32Kb.  So it makes sense to start your files on 16-sector boundaries, 
and to make sure that wherever possible you're only making reads in 
multiples of 32Kb.

To avoid one big seek per fopen you can pre-cache the disc's table of 
contents in memory, so that when you open a file it doesn't have to seek 
to the beginning of the disc, read some data (at the slowest possible 
rate because it's on the inside edge), then seek forward again to the 
file location.  You can seek straight to the beginning of the file instead.

Alistair


All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Gamedevlists-consoles mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-consoles
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=553