Burning CDs for the Aiwa CDC-MP3 under Windows

Last updated: 1 April 2001

Disclaimer: This information comes with no guarantee. It's very easy to screw up CD recording, and your mileage may vary. However, this is a technique that has worked for me, and it might work for you. My environment is Windows 2000 Professional on a dual-Celeron 400 with a Philips CDD-2000 2x burner.

The Problem

The Aiwa CDC-MP3 car audio player will play CD-Rs recorded with (data) MP3 files. The player recognizes the standard ISO 9660 format, plus Microsoft Joliet extensions for long filenames (up to 63 characters, including the required ".mp3" extension).

The player treats directories as albums and individual MP3 files as tracks. The directories (albums) will be made available in alphabetical order, and the tracks within a directory will also be alphabetized. Therefore, to ensure that you end up with the correct ordering, it's useful to prepend each directory or track name with a two-digit number so they will sort correctly.

Unfortunately, the most common free or shareware CD burning programs do not have very useful support for renaming the directories copied onto an ISO 9660 image. Most use a very straightforward "file backup" scheme, and don't allow a mapping of directory names, so it's hard to get your directories to come out in the "right" order on CD.

The Solution

After fussing with the likes of Nero and CDRWIN for a while, and having to rename all my MP3 directories before each burn attempt, I stumbled on an alpha of the cdrtools port to Win32. cdrtools includes mkisofs, cdrecord and other goodies that Linux users know and love. The Win32 port runs as a Cygwin executable (the binary download comes with the cygwin1.dll library).

Note: I couldn't get the latest alpha (1.10a16) to run on my Win2K system, but 1.9a03 works fine. Note the word "alpha"!

mkisofs is a command-line utility, but has the very nice feature of supporting symbolic links. What this means is that I can make a symlink called "01 My Generation" that resolves to "//d/My Music/MP3/Rock/The Who/My Generation" using the Cygwin shell, and mkisofs will know, when it sees that link, to create a directory on the ISO 9660 image called "01 My Generation", filled with the contents of the MP3 directory.

To take advantage of this, here's the approach I use: First, make a temporary directory in some conveniently addressable location. I usually do this under the cdrtools directory, and call it "tmp" or "mycd" (the name is unimportant).

mkdir tmp
Change into this directory using Cygwin's shell, and use the ln command to make symbolic links. For example,
cd tmp
ln -s '//d/My Music/MP3/Rock/The Who/My Generation' '01 My Generation'
You'll need the single quotes if you're dealing with any spaces in the directory names. Repeat the ln command for each folder you want to put on the CD image. After setting these up, a good sanity check for the CDC-MP3 is to make sure none of the MP3 filenames are more than 63 characters long. You can do this from the Cygwin shell like this:
find . -follow -name '????????????????????????????????????????????????????????????*.mp3'
You may want to cut and paste that line; it contains exactly 60 question marks. If you see any files listed when you run that command, you know they need shortening. (Mmmmm... shortening...)

Next, change back up to the cdrtools directory.

cd ..
Now you can run mkisofs. The follow options work well with the CDC-MP3:
mkisofs -o tmp.iso -f -l -J tmp
For a full definition of the options, check the man page for mkisofs. Briefly, they tell mkisofs to (1) create a file called tmp.iso containing the output filesystem, suitable for burning, (2) follow symbolic links, (3) use long filenames, not just DOS 8.3 names, (4) use the Joliet method of encoding even longer filenames and (5) read the list of directories from the tmp directory.

Executing the above will take a while, depending on your computer's speed and the size of the directories you're copying. Note that this command doesn't burn a CD, it just prepares the image. If you're brave and dare to laugh in the face of buffer underrun, you can pipe its output to cdrecord instead of using the -o option.

To actually burn the CD, you need to run cdrecord -scanbus, determine the address for your burner, and then run cdrecord on the generated .iso file.

cdrecord dev=2,2,0 -v speed=2 tmp.iso
That will burn the CD. When it's done, take it down to your car and try it out. Happy listening!

Note: According to the Cygwin FAQ, symlink support in the next version of the Cygwin library will be interoperable with those .lnk shortcut files that Win32 uses. That means (hopefully) it will be even easier to create the mappings required for running mkisofs, because you can just right-click and drag folders into the temporary directory as shortcuts, and then rename the shortcuts so that they sort in the correct order. Look for this in Cygwin 1.3.0.

Open Questions

mkisofs truncates Joliet filenames at 64 characters (and rightly so, according to the specification). However, when I used CDRWIN, it allowed me to use the raw filenames (as seen in Windows Explorer), which in some cases were more than 100 characters long! Not only that, but the CDC-MP3 found and played those files (just like Win2K does when reading the CD). So perhaps Joliet is more flexible than it appears. Even so, the limit is probably 127 characters, because Joliet allows a single byte for filename length, and the names themselves are encoded using Unicode (two bytes per character). I thought at first that these filenames were being encoded into UTF-8 (primarily single-byte) format, but a run through the .iso file in emacs washed out that possibility. I might try burning an even longer filename and see what happens.

Even stranger, it appears that NTFS gives you 255 characters for filenames -- but each path component counts in the name. So you could have a 253-character-long filename in your root directory, but you wouldn't be able to move it to the "MP3" folder. Weird, huh? The things they do in Redmond.

-- Wes Biggs <wes@cacas.org>

Links: