[Wylug-help] V-CD problem

Aaron Crane wylug at aaroncrane.co.uk
Thu Jan 19 11:32:17 GMT 2006


John Hodrien writes:
> The fact he's getting I/O errors suggests there's something wrong when 
> linux mounts the disk.  Normally you'd assume this was a faulty disk, but 
> seeing as it works fine in XP, I'm curious.

Marginal media?  Conceivably the poster's combination of (IDE chipset,
drive) works better with dodgy disks under the XP driver than the Linux
one.  But, yeah, the I/O errors do make it look from here like there's
something wrong with the disk.

> >Googling for avseq##.dat provides several contradictory accounts.
> >Some suggest that avseq##.dat are pointers/shortcuts to the actual
> >files rather than the data files themselves. 
> 
> I've no idea, but if he's copied the .dat file off in XP and it plays
> under linux, I guess not.  I was under the impression that they're
> just normal iso9660 CDs but with a specific directory structure.

VCDs do have an ISO-9660 filesystem, and the AVSEQ##.DAT files do appear
in it.  However, the data blocks in those files normally appear in a
mode 2 (or mode 2 form 2) track on the CD, rather than in the mode 1
track that contains the filesystem metadata and the data for the other
files.

What's the difference?  Well, mode 1 tracks have 2048-byte sectors,
which works well for ordinary data.  Except that's a slight
simplification; each sector is actually 2048 bytes plus 304 bytes of
error correction.  Mode 1 sectors use all the error-correction bytes
for, well, error correction, on the assumption that a sector error in
the middle of arbitrary data would be bad.  Audio CD tracks use all 304
bytes as additional data, so they have 2352 bytes per sector (588
samples, or 1/75 seconds).  Mode 2 tracks use 16 bytes for error
correction, giving 2336 bytes per sector, and mode 2 form 2 tracks use
28 bytes for error correction, giving 2324 bytes per sector.

This makes some sense: human perception of audio and video data is
fairly robust, so error correction isn't as important as for other
things.  The tradeoff between reliability and storage capacity is made
in a different place.

So, with regard to reading a VCD as an ISO-9660 filesystem: the files
are there, but when the kernel reads the AVSEQ##.DAT files, it only
looks at the 2048 data bytes in each sector, so the file you'd get is
broken.  For VCDs that use mode 2 tracks, you need to access the video
data without going through the filesystem.

For anyone who's interested in how CDs actually store your data, this
has _lots_ of arcane technical information:

  http://www.cdrfaq.org/faq02.html#S2-43

-- 
Aaron Crane



More information about the Wylug-help mailing list