Compact Disc - The Inside Story

Part 4 - Sub-code

[Contents] [Previous Part] [Next Part]

Byting off a big mouthful

As described in Part 3 of this series, a Compact Disc player reads 7350 blocks of binary data from the disc every second. Of the 33 bytes in each block, one is the 8 bits of sub-code information.

The sub-code bytes from 98 successive data blocks make up one sub-code block. To synchronise the player to the start of a sub- code block, the first two bytes, called S0 and S1, are totally unique. They correspond to two of the eleven patterns of 14 bits that are not used by EFM to map onto 8 bit bytes. The sub-code block rate is 7350 / 98 = 75 per second.

Each of the bits in a sub-code byte is given a name; P, Q, R, S, T, U, V, and W. This unfortunate terminology is not to be confused with the P and Q redundancy bytes for correcting errors in audio sample data. The set of like named bits in the 96 remaining bytes in the sub-code block forms eight independent words of 96 bits each.

Only the P and Q words are used for audio applications, the other six are reserved for things like text, color graphics and video control. The sub-code resource consumes about 33 mega-bytes of the approximately 1100 mega-byte capacity of the disc.

Understanding the P word is very straight-forward. Before the start of each audio track, the P words are all binary ones. It must last a minimum of two seconds, and may extend back into the end of the previous track if the gap is less than this. During the tracks, the P word is all zeroes. The lead-out area, after the last track, contains a series of P words that alternate between all zeroes and all ones; two cycles per second. This "flagging" allows the start of tracks to be located very quickly by even the simplest of players. *

* [is he talking about me?.. Peter Allen, Editor, MAC News]

The Q data word is divided into various segments. The first 4 bits are for control, as follows. Bit 1 is zero for two-channel audio or one for four-channel. I do not know of any quadraphonic recordings available on CD however, or of players that decode them. Bit 2 is presently undefined. Bit 3 is zero for copy deny and one for copy permit. Bit 4 is zero for no pre-emphasis and one for pre-emphasis present, in the analog audio signal. The state of Bit 4 can only change when the P word is all ones, before the start of a track.

An RDAT machine will interpret Bit 3 in data blocks it receives on its digital input for recording. A "black box" could easily be built to intercept the digital signal from a CD player and send it to an RDAT recorder with this bit always set to one. In this manner, the RDAT recorder would always allow a digital copy to be made of a disc that has copy denial. The cost of such a device would probably be about 10% of the cost of an RDAT machine. So perfect digital copies could be made of CD's onto RDAT tapes using the 44.1 KHz, 16 bit sample rate.

The next 4 bits in the Q sub-code data word determine the Mode of the 72 bits following them. 16 more bits make up the total of 96 in the word. These are used for CRC error detection only. Corrupt Q words cannot be corrected, but because they tend to repeat themselves in successive sub-code blocks, it is not a problem.

Three of the possible sixteen Modes are currently defined. Mode 1 tells the player the number and start times of the tracks on the disc. The 72 bits following the 4 mode bits are divided into 9 bytes of 8 bits each. Each bytes is decoded as 2 hexi-decimal digits of 4 bits each, which is also often called BCD or Binary Coded Decimal. The first byte contains the track number, which can range from 01 to 99. During lead-in, this value is 00, during lead-out it is AA. The sixth byte is unused, and is always zero.

Any sub-code block interval on the disc is measured in minutes, seconds, and the block number within the second, which ranges from 00 to 74. This is stored in 3 bytes.

The third, fourth and fifth byte in the 72 bit mode-dependent segment contains the interval for the current sub-code block. During lead-in, this is from the start of the disc. During a track, it is from the start of the track. And finally, during the pause before a track, it is the count-down time to the start of the track.

After the disc lead-in, the seventh, eighth and ninth bytes contain the interval from the start of the first track. A player could, for example, decode and display this value.

The second byte is the index number within a track, which some players can locate or be programmed to play from. This may range from 01 to 99, and is 00 between tracks and 01 in the disc lead- out area.

During the disc lead-in, the second, seventh, eighth and ninth bytes have quite a different function. They describe a "Table Of Contents" for the disc. Each sub-code block is repeated 3 times; making it almost certain at least one is read without error. The second byte is the track number, ranging from 01 to 99; the seventh, eighth and ninth are the interval to the start of the track from the beginning of the first track. If the second byte is A0 or A1, the minute interval byte (seventh) is the first and last track number of the disc, respectively. If it is A2, the interval bytes define the total track time of the disc, including the gaps between tracks.

Well that's Mode 1 over with, only two more to go! Just as well the remaining modes are trivial compared with what we have already been through.

Mode 2 records the UPC or Univeral Product Code number of the disc. This appears as a bar code on the cover of many discs. The first 52 of the 72 bit mode-dependent segment encodes the number as 13 BCD digits. The next 12 bits are zero, and the remaining 8 bits contain the number of the sub-code data block within the current second. Mode 2 words must appear at least once every 100 successive sub-code blocks if they are present.

Mode 3 records the ISRC or International Standard Recording Code for each track on the disc. Like Mode 2, it is optional and must appear at least once every 100 successive sub-code blocks within the track. ISRC is 60 bits, leaving 4 zero bits and 8 block sequence bits, described in Mode 2, to make up the 72.

The ISRC is further broken down into 5 coded alphanumeric characters of 6 bits each, 2 zero bits, and 7 BCD digits of 4 bits each, making a total of 60 bits. The first two characters are a country of origin code, the other three are an owner code. The first two BCD digits are the year of recording, the remaining five a serial number.

As can be seen, the elapsed track time displayed on nearly all CD players is actually derived from the Q sub-code Mode 1 bytes three to five. That about wraps it up for sub-code. The previous two articles have concentrated on the digital data formats processed by a player. Next month, I will turn back to the hardware, to cover the Laser reader and its tracking mechanisms.

[Contents] [Previous Part] [Next Part]

Originally published in MAC Audio News No. 160, April 1988, pp 13-15.

Copyright © 1988 Glenn Baddeley. cd7.html was last updated 2 December 1996.