

Many people burn compact discs almost as casually as they once used floppy disks, and CDs serve many of the same purposes as floppies. But CDs do not act like floppy disks. Whereas floppies and hard disks were conceived from the ground up as media for storage and exchange of computer data, the CD was designed for music, and it had to work within the limitations of affordable hardware technology in the early 1980s. The CD has evolved as a medium for data storage and for entertainment, but it can never fully escape its roots. That accounts in large part for the different, and at times quirky, ways that CD-Rs behave.
The variety of CD types can also be confusing. You know CD-Audio and CD-ROM are different beasts, but what are the differences, and how do they affect you? Many people don't really understand or know how to use other application formats, such as Video CD.
Although you may be using CD-R successfully, if you know a little more about what's going on, it's likely you'll be able to do more cool things with it. When problems strike, knowing something about what's under the hood can save your butt. With that in mind, I'll try to answer some of those nagging questions and give you practical hints for getting the most from the medium.
BURNING QUESTIONS
CD recorders write data to CD-R blanks by “burning” spots, or pits, onto the disc (see the sidebar “How CD-Rs Are Made”). A writing laser that draws 4 to 11 mW of power heats a special dye in the recording layer and the substrate of the disc. The recording layer melts, and the substrate expands to fill the space. The resulting spot where the substrate peeks through is seen by a CD-ROM or CD player in nearly the way that a true pit on a manufactured disc appears, and thus the disc can be read. Lingering incompatibilities, especially with CD-rewriteable (CD-RW), indicate that those spots are not precisely identical to the pits in a replicated disc, but they are close.
So far, so good. But consider the tolerances involved. You have a disc spinning at 200 to 500 revolutions per minute. As it spins, the writing laser has to focus on a recording layer that's about one eighth of one millionth of a meter (one eighth of a micron), or 125 nanometers, deep. The disc is flat to a tight tolerance, but at the level of the focusing laser, it appears to be bouncing up and down by a huge amount around three to ten times per second. That absurdly tight focus is held with almost complete reliability by an electronic servo that continuously detects any tiny deviation from focus and applies the appropriate correction (see Fig. 1). Bull riding would be easy by comparison, but these inexpensive little mechanisms perform their task without a burp or hiccup.
At the same time, the rotational speed must be precisely controlled while the head laterally tracks a groove on the disc that is just half a micron wide and less than two microns from the next turn of the spiral. Those miracles of control are performed by the drive's controller chip and by additional servos in the drive. This remarkable control of focus and tracking is maintained as the laser writes a spiral track that is three to five miles in length. That's pretty good driving!
While all that is going on, the writing laser flashes on and off approximately 100 million times a second. Not only is it flashing that fast but it's doing so with precise control to deliver exactly the right amount of heat to melt the recording layer in precise multiples of 0.83 microns. That deserves your respect.
WRITE AGAIN
CD-RW uses the same dimensional specification and tracking mechanisms as CD-R, but the mechanism used to create the required spot on the disc is different. In CD-RW, the recording layer is made of a metallic alloy rather than a dye. The alloy is a special blend that has two states: polycrystalline and amorphous. The alloy has a distinct index of reflectivity in each of the two states; that is, it looks darker in one state than in the other.
During CD-RW writing, a laser that is slightly more powerful than the one used for CD-R heats the alloy to 500 to 700 degrees Celsius, at which point it switches from the polycrystalline state to the amorphous state, creating a spot that is seen by the reading laser as being darker than the surrounding polycrystalline material. To erase the disc, the laser heats the surface to just 200 degrees Celsius, at which point the alloy softens but doesn't actually melt, returning to its polycrystalline state. CD-RW discs can be completely erased, but erasing and writing are usually done in one operation.
The difference in underlying technology is the reason that CD-RW remains incompatible with a lot of older CD players and CD-ROM drives. The distinctions in reflectivity that enable the read process are shallower in CD-RW than they are for CD-R. If the drive was not built with CD-RW media in mind, it probably will never be able to read it. Today most drives are manufactured to be CD-RW compatible, so the problem is becoming less widespread, but it might never go away completely.
THE WAY TO GO
When should you use CD-R, and when should you use CD-RW? For one thing, if you are going to hand discs out, you definitely will want to use write-once CD-R. It has the highest compatibility, and the discs are cheaper — important if you don't expect to get the disc back.
When CD-RW was introduced, CD-R blanks were still a few bucks. In that context, the rewriteability of CD-RW was compelling. Today, though, blank CD-Rs cost about 50 cents each if you buy in bulk, and the need for rewriteable discs is less critical for many people. If you're backing up data and do not need to continually update the backup disc, or if you are writing discs that you want to keep, using CD-Rs is probably cheaper.
If you are dynamically iterating test discs for a CD-ROM or an audio project, are continually updating a backup (for example, doing incremental backups), or are just bugged by the accumulation of discs, it may be worthwhile to use CD-RW discs. It's up to you to figure out where the exact crossover point lies. But first, make sure that all the players and ROM drives you use will read the media.
For the remainder of this article, most comments apply to both formats but primarily to CD-R. I'll note where there's a distinction, but otherwise assume that anytime I say CD-R, I also mean CD-RW.
BUFFER-LOW HUNTING
One common problem when burning a CD-R is buffer underrun. As Andy McFadden puts it in his excellent CD-R FAQ (see the sidebar “For Further Information”), “[buffer underrun] means you have an attractive new coaster for your table.” That's true, at least for non-Multisession CD-R. But where does the nuisance come from?
CD writing is a continuous process and cannot be interrupted in midsession. Once the laser begins to write, any interruption will make a physical gap on the disc that cannot be read. To ensure writing continuity, data is stored in a buffer within the drive. Depending on the drive's make and model, the buffer ranges from 512 KB to 4 MB in size. More is better. As the host computer feeds data to the drive, the data is stored in the buffer; from there it is sent to the disc in a nice, well-behaved stream.
Thanks to the buffer, the drive can tolerate an interruption in data transfer from the host — up to a point. But if new data doesn't arrive before the buffer runs out, that constitutes an underrun (see Fig. 2), and at least for Disc-at-Once and Track-at-Once writing, the disc is ruined.
Underruns occur for any number of reasons relating to the host's ability to provide data continuously. Not all underruns can be prevented, but elementary housekeeping can reduce their incidence substantially. Here are a few guidelines:
Use a fast hard drive, one that doesn't do slow thermal recalibrations in midtransfer. Almost any hard disk made in the past couple of years will work fine. For older drives, check out the characteristics before you rely on them for this purpose. If you have an underrun problem, drop the CD-writing speed.
Be careful about using your computer during CD writing. Avoid I/O-intensive tasks that might interfere with regular data transfers to the drive.
Don't try to write from a file server on a multiuser network.
Defragment your drives often.
If you have trouble with underruns, try recording from a precompiled disc image instead of recording on the fly.
Put the recorder and the hard drive on separate SCSI or FireWire buses if possible.
Turn off virtual memory (Mac only).
Watch out for antivirus programs that run at odd moments, screen savers that activate during the CD-creation process, unusual network activity, and background downloads of data or faxes. One way to check for those potential interrupters is to run the hard-drive defragmenter in Windows. If it restarts every few seconds, something is accessing the drive.
Buffer underruns are becoming less of a problem as faster hardware, bigger buffers, and better controller technology permeate the market. If you encounter the problem today, chances are good that it's because you're using older or dysfunctional gear. If and when an underrun occurs, keep your head and look around at what's going on in your system. Do what optimizing you can and try again.
VIVE LA DIFFERÉNCE
Red Book audio tracks on CD are not accessed the same way CD-ROM data is. Audio streams sequentially, as with playing a phonograph record. For that to happen, even on dirt-cheap CD players, the method of access to the stream has to differ markedly from a computer's way of reading a CD-ROM, and the data itself must be carefully structured for robust, steady streaming. Remember, CD-Audio was created more than 20 years ago, and the specification is exactly the same today.
CD-ROM uses a complete file system that tells a computer or other controlling device exactly where every piece of data starts and ends. It isn't like that for CD-Audio or for Red Book audio tracks on a combination CD-Audio/CD-ROM.
All CDs have a lead-in area, a program area, and a lead-out area. As the name implies, the program area is where the meat of the content is, whether the content is audio tracks, ROM files, or some combination of the two. The lead-in area and lead-out area help the drive and controller “lock on” to the disc and locate information in the program area.
For CD-Audio, the lead-in area includes a table of contents (TOC) to define where audio tracks start and end. On a consumer player, the information in the TOC is loaded into the player's memory when the disc starts up. When the CD format was established, memory was nowhere near as cheap as it is today, and it was important to limit the amount of information in the TOC. For that reason, the audio TOC is far simpler than any standard computer file system.
To save memory, the pointers to tracks in the TOC do not pinpoint the exact byte that begins the track; instead, they drop the read head somewhere near the actual start. Because audio CDs are designed to play sequentially, like phonograph records, that originally was not an issue. It's like dropping the needle into the space between tracks on a record: unless you're a DJ doing beat matching, you are happy as long as the needle goes in somewhere between the end of the previous song and the beginning of the song you want to hear. In contrast, a drive reading a CD-ROM must locate the exact beginning of the desired data file.
CD-ROM and CD-Audio also differ in the ways that data is formatted and grouped. All CDs are made up of 2,352-byte sectors. In CD-ROM, 304 bytes of each sector are dedicated to header information that is part of the file system and allows direct and precise access to every one of the remaining 2,048 data bytes. CD-Audio sectors also contain 2,352 bytes, but all are dedicated to audio, with no header. In normal audio play, that is perfect, but when a CD-ROM drive tries to read CD-Audio data, it has problems. Computers don't read data in continuous streams but in snippets of varying size that are loaded to memory and processed. When the computer finishes processing one snippet, the processor goes back and gets the next, and so on until completion.
When a CD-ROM drive tries to extract (rip) audio data to turn it into a file, it has a hard time locating the start of each snippet. The direct addressing of CD-Audio only gets the head to within one second of a desired location. The drive controller and software then have to use data embedded into audio-data frames to home in on the desired location. But the accuracy of this subcode information is limited to 1/75 second.
To make matters worse, many older drives locate only to within four of these units so that accuracy of position is limited to something like 50 ms. That's close enough for listening, but it's a nightmare for data extraction, and it's the reason ripped files sometimes have pops and clicks. The extracting software must rely on the capabilities of the drive's controller chip to locate audio data accurately, and some controller chips can do that much better than others; in fact, many older CD-ROM drives cannot be used for audio extraction at all.
The trouble isn't over when the audio track's start point has been located. CD-Audio data is arranged into 24-byte frames, which include actual audio data along with sync bits, error-correction data, and control bits. The data in those frames do not appear sequentially on the disc but are interleaved with the data of many other frames. That prevents a scratch on the disc from ruining a whole chunk of data. Instead, the error is spread over individual bits and words. The player then relies on data correction and interpolation to correct the errors. That doesn't always work, but most of the time it does.
In audio play, the deinterleaving of frames is performed as the CD plays, in silicon, which can be made very efficient for the purpose. In audio extraction, software usually has to perform this job and do audio error correction, as well. Depending on the drive, condition of the disc, speed of the processor used, and sophistication of the extracting software, the whole process can grind to a halt. Do you have any discs you just can't rip with your system? That's probably why.
Improvements in hardware and software technology make audio ripping much less troublesome. One such improvement is a revision of the ATAPI specification that governs drive interfacing. The latest specification, used for many of the current generation of drive controllers, includes a new command set that supports functions that previously had to be handled by the ripping software, including a lot of error-correction and subcode functions.
With those functions embedded in the drive, audio extraction becomes much easier and more efficient, and the complexity of software required for ripping goes way down. When the drives position the heads more accurately, even older software works better, because less iterative searching is required to cue the next snippet. The feature is called Accurate Streaming, and if you're shopping for a new CD-ROM drive, look for it.
FILLING IN THE GAPS
The system of tracks and indexes on a CD-Audio disc has some interesting aspects that can affect your work. Audio tracks on a CD are defined as groups of indexes. Each CD has as many as 99 groups, or tracks, and each track has multiple indexes, also called index points.
In the original specification (IEC 908), index points on CDs were defined to allow access to tracks and for cueing to points within a track. The latter application never really caught on, though; few discs are made with indexes other than those that cue the start of tracks, and few players permit access to indexes. For that reason, most folks are probably unaware that indexes exist.
Index points are mostly used to define the start of a track and the gap between a track and the previous track. Index 0 defines the beginning of a gap, and index 1 indicates the start of the actual track. When you play through a disc sequentially, you hear all of the gaps. If there is audio in the gap, you'll hear that audio. But if you seek a particular track, the player will cue to index 1, and you won't hear the material in the gap. This mechanism is sometimes used to “hide” tracks on a disc. You can't find a hidden track by searching, but if you play through the disc, you'll find the track.
IN THE MODE
The various modes for writing to CD can be confusing. When you're getting this in perspective, remember that the original mode for CD recording was Not-at-All! Recordable technology evolved years after CD was created, and at every step, the ability to write has had to be grafted onto a format and technology that was never meant to go there.
Disc-at-Once
For a long time after CD-R came on the market (remember when burners were $10,000 and blank discs $50?), the only mode of writing was Disc-at-Once (DAO). People didn't call it that, because there was nothing to contrast it with. All you knew was the whole disc had to be written in one pass, and if there was any error in the content or the process failed for one reason or another, that disc was completely useless other than as arts-and-crafts materials.
In DAO mode, all the data is written to the disc without ever turning off the recording laser. These days Track-at-Once and Multisession modes are in common use, but DAO has advantages, especially for audio mastering. Because the data is recorded continuously, audio tracks can be set back-to-back, with no gap in between. That allows for crossfades and segues between cuts. If you're mastering for CD release, DAO is the way to go.
When writing in DAO mode, all the data needs to be easily accessible, because there's no time for search and retrieval between tracks. Preferably, the data is arranged continuously on a recently defragmented hard disk, though with today's fast drives, you'll probably have success even if the data is spread across one or more local volumes. Be cautious about attempting to burn multiple tracks across a network, however. Data can be interrupted on a network in lots of ways, and DAO is the least forgiving mode.
If you encounter problems completing a burn, the most foolproof tactic is to compile a disc image. A disc image is a single file that incorporates all the data content and the file system that will go on the disc. In the early days of CD mastering, burning from disc images was the rule, but today it is the exception. To prepare a disc image, you need to have a chunk of hard-disk space equal to the size of all the data you want to put on disc.
Track-at-Once
Track-at-Once (TAO) is the most widely supported mode of CD recording because of its versatility. Because the laser is turned off between tracks, the writing software can take the time to search for the next chunk of data, prompt for a new CD, and so on.
The principle disadvantage of TAO mode is that there will always be an audible gap (generally about two seconds but variable with some recorders) between tracks. If you plan to send a CD submaster out for replication, be aware that not all replicators can properly interpret a disc submaster done with TAO. That is another reason to record audio masters in Disc-at-Once mode.
Multisession
In Multisession recording, data is added incrementally, letting you add, replace, and delete files. Multisession recording makes it possible to use the CD-R disc in a way that is similar (though not identical) to the way you're accustomed to using floppy disks.
The trade-off is platform compatibility. Audio-CD players generally do not know Multisession discs from Adam, so you can't use that mode to make audio CDs. Many older CD-ROM drives also cannot interpret the Multisession structure. Multisession is most useful when the context is vertical — that is, you are reading back the disc on your own drive and on other drives that you know for sure are compatible.
In Multisession recording, each track of data is written in a separate session, and the session is closed after recording by writing a lead-out. That makes each session into a separate file system that can be recognized by a CD-ROM drive. The lead-out uses some space (about 22 MB for the first session and 13 for subsequent sessions), so you can't get quite as much data on a Multisession disc.
If you were to record sessions in that manner, without doing anything to tie them together, a Multisession-compatible CD-ROM drive would see the sessions as separate volumes. (A non-Multisession drive will see only the first session). That is known as a multivolume disc, and it has its uses.
More often, though, you will want to create discs that are seen as a single large volume with read, write, and delete capability. That is done by linking sessions together. The linking process creates a directory structure that references files in all sessions on the disc. As you record additional sessions, replace or delete files, and so forth, the directory structure is re-created to reflect updates to the disc. The Multisession-compatible CD-ROM drive has intelligence to direct it to use only the most recent version of the file system so that previous versions are effectively disabled.
You can turn a disc into a Multisession disc after recording (assuming there's space), but that can introduce other compatibility issues. Not all Multisession CD-ROM drives will recognize the disc unless the first track is recorded in a specific format (CD-ROM XA). It's all just part of the fun and games of grafting new capabilities onto an established format.
Multisession mode is not very useful for audio. In theory, audio tracks can be recorded in Multisession mode, but most CD players will see only the first track. Many CD-recording software packages support recording tracks incrementally using Track-at-Once recording. However, the disc is not readable for standard CD players and CD-ROM drives until the disc is closed by writing the lead-out area.
Packet Writing
Track-at-Once, Disc-at-Once, and Multisession are basically three ways to slice the same orange. Packet Writing, though, is a fundamentally unique approach to the medium. In Packet Writing, data is actually written in little pieces rather than in the large chunks known as Tracks or Sessions. Packet Writing must be supported at the hardware and firmware level, and it absolutely will not work on recorders and drives that predate the technology. Packet Writing brings CD recording that much closer to the grail of behaving like a big floppy disk.
With Packet Writing, there are two types of data chunks, or packets. Fixed-length packets are tailored for CD-RW, allowing data to be randomly erased and rewritten without the need to keep track of a potentially huge and changing map of different-length packets. The downside is that fixed-length packets entail a substantial overhead, which cuts the disc capacity down to something in the range of 500 MB.
Variable-length packets are optimal for CD-R recording because the mapping remains fixed once the files are written. With Multisession CD-R, you can delete files from the disc, but the data is not actually deleted. Instead, the file system that points to the files is updated so that the deleted file becomes invisible to the user. The mapping of packets is not affected. With variable-length packets, more space on the disc is available.
COLOR MY WORLD
Various types of CD-R and CD-RW blank discs do have differences, and some recorders may work better with one type than another. In some cases, the firmware of a drive may even limit it to working with certain types of media. However, that is a matter of the match of media and drive rather than a general superiority of one type to another.
These days the process of manufacturing blank discs is refined, and it's unlikely that a manufacturer will ship inferior-grade discs to the stores. In fact, recorded CD-R and CD-RW discs on the whole exhibit substantially lower error rates than pressed discs. No matter what medium you use, the disc you record is of better of quality than any commercial CD-ROM or audio title you can buy at the store.
If you have purchased different brands of CD-R and CD-RW blanks, you've probably noticed that the business side of the discs comes in several colors. Those distinctions in color result from the combination of the dye formulation and the type of reflective layer. Reflective layers are either gold or silver. For the dye layer, four formula types are used: phthalocyanine, so-called advance phthalocyanine, cyanine, and metal azo.
Cyanine-based media are usually bright green. The dye itself is blue, but it is usually paired with a gold reflective layer that shows through the translucent dye. Phthalocyanine (say that three times fast!) is a pale green color that results from pairing a yellow-green dye with a gold backing layer. Advance phthalocyanine has an aqua hue. Metal-azo dye is deep blue in color. With a silver backing layer, the deep blue color is preserved, but if gold is used, the disc appears as green. Gold or silver backing can be used with metal-azo dye.
Do those colors matter? Yes and no. Phthalocyanine and advance phthalocyanine are known to be less sensitive to ordinary light than the others. If you are going to leave your discs out in the sunlight, they may hold up better. Does that make phthalocyanine better? Not for practical purposes: you shouldn't leave your discs out in sunlight or any kind of light. Store all CD-Rs in a case, away from light, and they will be good for 30 years at least. Sensitivity to ordinary light should not be an issue.
Other differences in media affect what happens when a disc is being written. With the drive controllers and software used today, however, those dissimilarities are generally unimportant. Current drives use active control and feedback from the media itself to optimize the write strategy for the disc in the drive. You should get good, consistent results with any media.
If you use an older drive, you can take advantage of others' experience. Cyanine and phthalocyanine have been around the longest and are compatible with the largest range of legacy hardware. Of the two, cyanine has a broader range of writing power and may work in more drives than phthalocyanine.
HOT STUFF
As exciting as DVD is — and it is very exciting, indeed — the CD formats are still likely to be around for quite a while. Admittedly, sundry CD specifications have developed in peculiar ways because so much has been grafted onto what started out as a straightforward music-delivery platform. But CD-ROM, CD-Audio, CD-R, and CD-RW are proven, practical, and perhaps most important, ubiquitous. CD is as close as it's come to a universal digital delivery medium, with support for audio, data files, video, text, and graphics.
Now that you know how CD-R works, you should be well equipped to decide which CD format and mode to use for each application, and to know what problems are likely to arise, how to avoid them, and why this already venerable medium works the way it does. In short, you are ready to satisfy your burning ambitions!