This article is from the CD-Recordable FAQ, by Andy McFadden (email@example.com) with numerous contributions by others.
There are 8 subcode channels, labeled P,Q,R,S,T,U,V,W, or sometimes "P-W"
for short. (The ECMA-130 standard refers to subcode bytes as "Control
bytes".) Every frame contains one byte of subcode data, and each byte holds
1 bit of P, 1 of Q, and so on. The bytes from 98 consecutive frames are
combined to form a subcode "section". The first two bits in each channel
are used for synchronization, leaving 96 bits of useful data per channel
(which is where RAW DAO-96 gets its name).
The P and Q channels are defined by the CD audio standard. (They are
unrelated to the P and Q parity fields.) The P channel can be used to
find the start of a track, but in practice most devices use the more
sophisticated Q channel. Q contains four chunks of information: control
(4 bits), address (4 bits), Q data (72 bits), and an EDC (16-bit CRC).
The control bits determine whether the track holds audio or data, the number
of audio channels (stereo or quadraphonic), and specifies the Digital Copy
Permitted and Pre-emphasis flags. The address bits determine the format
of the Q data section. Address mode 1 holds information about tracks,
mode 2 holds a catalog number (such as a UPC code, constant for an entire
disc), and mode 3 contains the ISRC (International Standard Recording Code,
constant for a given track but may change with each track).
A disc has three main regions: the lead-in area, the program area, and the
lead-out area. Subcode Q mode 1 data in the lead-in is used to hold the
table of contents (TOC) for the disc. The TOC is repeated continuously in
the lead-in area in case of damage (remember, no CIRC encoding on subcode
channels). In the program and lead-out area, mode 1 contains track numbers,
index numbers, time within the current track, and absolute time. Index 0
marks the start of a pregap (pause) before the audio in a track begins,
index 1 marks the start of the music, and indexes 2 through 99 are usually
not set but can be added if desired.
The ability to specify track and index markers when writing a Red Book
audio CD is often referred to as "PQ editing" because that information is
contained in the P and Q subcodes.
Subcode channels R through W are not defined by the CD standard, except
to say that they should be set entirely to zero if not used. They're
currently used for CD+G (e.g. Karaoke) discs, CD-Text, and some forms of
It is interesting to note that, while bytes from 98 consecutive frames are
used to create a subcode "section", those frames don't have to be from a
single sector. It's possible for a subcode section to start in one sector
and end in the next.