Refine sectioning yet again, add pack numbers to appropriate sections. Other small changes.

This commit is contained in:
R. Bernstein
2012-02-07 21:53:58 -05:00
parent f7782843a2
commit 607602173e

View File

@@ -7,7 +7,7 @@
@c @end tex
@setfilename cd-text-format.info
@settitle CD-TEXT Format
@settitle CD Text Format
@copying
@quotation
@@ -15,7 +15,8 @@ Permission is granted to copy, modify, and distribute it, as long as the
references to the original information sources are maintained.
There is NO WARRANTY, to the extent permitted by law.
Copyright @copyright{} 2011-2012 Thomas Schmitt @email{scdbackup@@gmx.net}.
Copyright @copyright{} 2011-2012 Thomas Schmitt @email{scdbackup@@gmx.net}.@*
Copyright @copyright{} 2012 Rocky Bernstein
@end quotation
@end copying
@@ -23,7 +24,7 @@ Copyright @copyright{} 2011-2012 Thomas Schmitt @email{scdbackup@@gmx.net}.
@exampleindent 0
@titlepage
@title CD-TEXT Format
@title CD Text Format
@author Thomas Schmitt for libburnia-project.org
@vskip 2in plus 1filll
@insertcopying
@@ -33,11 +34,11 @@ Copyright @copyright{} 2011-2012 Thomas Schmitt @email{scdbackup@@gmx.net}.
@ifnottex
@node Top
@top CD-TEXT Format
@top CD Text Format
@insertcopying
CD-TEXT provides a way to give disk and track information in an audio
CD Text provides a way to give disk and track information in an audio
CD. This information is used, for example, in CD players to
provide information about the audio CD.
@@ -45,34 +46,36 @@ This document describes the information available in CD Text, and how
to decode and encode it.
@menu
* Encoding and Decoding CD-TEXT::
* Encoding and Decoding CD Text::
* Higher-Level Encoding::
* Acknowlegement::
* List of Tables::
* References::
@end menu
@end ifnottex
@node Encoding and Decoding CD-TEXT
@chapter Encoding and Decoding CD-TEXT
@node Encoding and Decoding CD Text
@chapter Encoding and Decoding CD Text
@menu
* CD-TEXT Categories (Pack Types)::
* Text Packs::
* Text Pack Contents::
* TOC Pack Types::
* Block Pack Type::
* CD Text Categories (Pack Types)::
* Text Pack Types:: Text Pack Types (0x80-0x85, 0x8e)
* Other Pack Types:: Other Pack Types (0x86, 0x87, 0x8d)
* TOC Pack Types:: TOC Pack Types (0x88, 0x89)
* Block Pack Type (0x8f)::
* Pack Contents::
@end menu
@node CD-TEXT Categories (Pack Types)
@section CD-TEXT Categories (Pack Types)
@node CD Text Categories (Pack Types)
@section CD Text Categories (Pack Types)
CD-TEXT information is grouped into @emph{blocks}, each one in a particular
CD Text information is grouped into @emph{blocks}, each one in a particular
language. Up to 8 languages (or blocks) can be stored.
Within a block, there are 13 categories of information, called @emph{Pack
Types}.
The CD-TEXT categories are identified by a single-byte code.
The CD Text categories are identified by a single-byte code.
@xref{table:categories}.
@float Table,table:categories
@@ -91,41 +94,60 @@ The CD-TEXT categories are identified by a single-byte code.
0x8e: UPC/EAN code of the album and ISRC code of each track
0x8f: Block Packet (binary)
@end smallexample
@caption{CD-TEXT Categories}
@caption{CD Text Categories}
@end float
Some additional information regarding specific pack types:
@itemize
@item Pack Types @kbd{0x8a} to @kbd{0x8c} are reserved.
@item Pack Types @kbd{0x86}, @kbd{0x87}, @kbd{0x88}, @kbd{0x89}, @kbd{0x8d} apply to the whole
@item Pack Types @kbd{0x8a} to @kbd{0x8c} although not specified are reserved for potential future use.
@item Pack Types @kbd{0x86}, @kbd{0x87}, @kbd{0x88}, @kbd{0x89}, @kbd{0x8d} (Disc Identification, Genre Identification, Table of Contents, Second Table of Contents and Closed Information respectively) apply to the whole
disc, and can not be attached to individual tracks.
@item Pack Types @kbd{0x80}, @kbd{0x81}, @kbd{0x82}, @kbd{0x83}, @kbd{0x84},
@kbd{0x85}, and @kbd{0x8e} have to be attributed to each
track if they are present for the whole disc.
@item Pack Type @kbd{0x8f} describes the overall content of a block and in part of all other blocks.
@item Pack Types @kbd{0x80}, @kbd{0x81}, @kbd{0x82}, @kbd{0x83}, @kbd{0x84}, @kbd{0x85}, and @kbd{0x8e} (Performers, Songwriters, Composers,
Arrangers, and Message Area respectively) have to be attributed to
each track if they are present for the whole disc.
@item Pack Type @kbd{0x8f} (Block Packet) describes the overall content of a block and in part of all other blocks.
@end itemize
The total size of a block's attribute set is restricted by the fact
that it has to be stored in at most 253 records with 12 bytes of
payload. These records are called @emph{Text Packs}. A shortcut for
repeated identical track texts is provided, so that a text that is
identical to the one of the previous track occupies only 2 or 4 bytes.
payload. These records are called @emph{Text Packs} described in the
next section. A shortcut for repeated identical track texts is
provided, so that a text that is identical to the one of the previous
track occupies only 2 or 4 bytes.
@node Text Packs
@section Text Packs
@node Text Pack Types
@section Text Packs (@kbd{0x80}--@kbd{0x85}, @kbd{0x8e})
Pack types @kbd{0x80} to @kbd{0x85} and @kbd{0x8e} contain a
NUL-termintated string. If double-byte characters are used, then two
zero bytes terminate the text. Pack types @kbd{0x80} (Title) to
@kbd{0x85} (Message Area) are encoded according to their block's
Pack types @kbd{0x80} to @kbd{0x85} and @kbd{0x8e} (Title, Performers,
Songwriters, Arrangers, Message Area and UPC/EAN code respectively)
contain a NUL-termintated string. If double-byte characters are used,
then two zero bytes terminate the text. Of these, all except the last,
@kbd{0x8e} or UPC/EAN code, are encoded according to their block's
Character Code. This could be either as ISO-8859-1 single byte
characters, as 7-bit ASCII single byte characters, or as MS-JIS double
byte characters. Pack type @kbd{0x8e} (album/track code) is described
below.
byte characters.
Pack type @kbd{0x8e} is documented by Sony as:
@quotation
@emph{UPC/EAN Code (POS Code) of the
album. This field typically consists of 13 characters.}
@end quotation
This is always ASCII encoded. It applies to tracks as ``ISRC code
[which] typically consists of 12 characters'' and is always ISO-8859-1
encoded. MMC calls these information entities ``Media Catalog Number''
and ``ISRC''. The catalog number consists of 13 decimal digits. ISRC
consists of 12 characters: 2 country code [0-9A-Z], 3 owner code
[0-9A-Z], 2 year digits (00 to 99), 5 serial number digits (00000 to
99999).
@node Other Pack Types
@section Other Pack Types (@kbd{0x86}, @kbd{0x87}, @kbd{0x8d})
For pack type @kbd{0x86} (Disc Identification) here is how Sony describes this:
@quotation
Catalog Number: (use ASCII Code) Catalog Number of the album
@emph{Catalog Number: (use ASCII Code) Catalog Number of the album}
@end quotation
So it is not really binary but might be non-printable, and should contain only
bytes with bit 7 set to zero.
@@ -170,126 +192,27 @@ their Big-endian 16-bit value are listed in @ref{table:genres}.
Sony documents report that this field contains:
@quotation
Genre information that would supplement
the Genre Code, such as ``USA Rock music in the 60's''.
@emph{Genre information that would supplement
the Genre Code, such as ``USA Rock music in the 60's''.}
@end quotation
This information is always ASCII encoded.
Pack type @kbd{0x88} records information from the CD's Table of
Contents, as of READ PMA/TOC/ATIP Format @kbd{0010b}. See Table 237 TOC
Track Descriptor Format, Q Sub-channel of @ref{mmc3r10g.pdf,, MMC-3}.
Pack type @kbd{0x89} (Second Table of Contents) is not yet clear. It
might be a representation of Playback Skip Interval, Mode-5 Q
sub-channel, POINT 01 to 40 See Section 4.2.6.3 of @ref{mmc3r10g.pdf,, MMC-3}.
If so, then this seems not to apply to write type SAO, because the CUE
SHEET format offers no way to express Mode-5 Q.
See @ref{TOC Pack Types} for more details about the content of pack
types @kbd{0x88} and @kbd{0x89}.
Pack type @kbd{0x8d} Sony documents says:
@quotation
Closed Information: (use 8859-1 Code) Any information can be recorded on
disc as memorandum. Information in this field will not be read by CD
TEXT players available to the public.
@emph{Closed Information: (use 8859-1 Code) Any information can
be recorded on disc as memorandum. Information in this field will not
be read by CD TEXT players available to the public.}
@end quotation
It is always ISO-8859-1 encoded.
Pack type @kbd{0x8e} is documented by Sony as:
@quotation
UPC/EAN Code (POS Code) of the
album. This field typically consists of 13 characters.
@end quotation
This is always ASCII encoded. It applies to tracks as ``ISRC code
[which] typically consists of 12 characters'' and is always ISO-8859-1
encoded. MMC calls these information entities Media Catalog Number
and ISRC. The catalog number consists of 13 decimal digits. ISRC
consists of 12 characters: 2 country code [0-9A-Z], 3 owner code
[0-9A-Z], 2 year digits (00 to 99), 5 serial number digits (00000 to
99999).
Pack type @kbd{0x8f} summarizes the whole list of text packs of a block.
See the next section for details.
@node Text Pack Contents
@section Text Pack Contents
The attributes are represented on CD as Text Packs in the sub-channel of
the Lead-in of the disc. The file @file{doc/cookbook.txt} of the
@url{http://libburnia-project.org/,libburnia} distribution describes how
to write the CD-TEXT pack array to CD, and how to read CD-TEXT packs
from CD.
The format is explained in part in Annex J of (@ref{mmc3r10g.pdf,,
MMC-3}), and in part by Sony'sdocumentation
@ref{cdtext.zip,,cdtext.zip}.
Each pack consists of a 4-byte header, 12 bytes of payload, and 2 bytes
of CRC.
The first byte of each pack tells the pack type. See above for a list of
types.
The second byte tells the track number to which the first text piece
in a pack is associated. Number 0 means the whole album. Higher
numbers are valid for types @kbd{0x80} to @kbd{0x85}, and
@kbd{0x8e}. With these types, there should be one text for the disc
and one for each track. With types @kbd{0x88} and @kbd{0x89}, the
second byte bears a track number, too. With type @kbd{0x8f}, the
second byte counts the record parts from 0 to 2.
The third byte is a sequential counter.
The fourth byte is the Block Number and Character Position Indicator.
It consists of three bit fields:
@table @dfn
@item bits 0-3
Character position. Either the number of characters which the current
text inherited from the previous pack, or 15 if the current
text started before the previous pack.
@item bits 4-6
Block Number (groups text packs in language blocks)
@item bit 7
Is Double Byte Character? Is 0 if single byte characters, 1 if double-byte
characters.
@end table
The 12 payload bytes contain pieces of ASCII NUL- or
@code{\0}-terminated texts or binary data. A text may span over
several packs. Unused characters in a pack are used for the next text
of the same pack type. If no text of the same type follows, then the
remaining text bytes are set to 0.
The CRC algorithm uses divisor @kbd{0x11021}. The resulting 16-bit
residue of the polynomial division is inverted (xor-ed with
@kbd{0xffff}) and written as Big-endian number in bytes 16 and 17 of
the pack.
The text packs are grouped in up to 8 blocks of at most 256 packs. Each
block is in charge for one language. Sequence numbers of each block are
counted separately. All packs of block 0 come before the packs of block
1.
The limitation of block number and sequence numbers imply that there are
at most 2048 text packs possible. (READ TOC/PMS/ATIP could retrieve 3640
packs, as it is limited to 64 KB - 2.)
If a text of a track (pack types @kbd{0x80} to @kbd{0x85} and
@kbd{0x8e}) repeats identically for the next track, then it may be
represented by a TAB character (ASCII 9) for single byte texts,
resp. two TAB characters for double byte texts. (This should be used
because 256 * 12 bytes is few space for 99 tracks.)
The two binary bytes of pack type @kbd{0x87} are written to the first
@kbd{0x87} pack of a block. They may or may not be repeated at the start
of the follow-up packs of type @kbd{0x87}.
@node TOC Pack Types
@section TOC Pack Types
@section TOC Pack Types (@kbd{0x88}, @kbd{0x89})
Pack type @kbd{0x88} records information from the CD's Table of
Contents, as of READ PMA/TOC/ATIP Format @kbd{0010b}. See Table 237 TOC
Track Descriptor Format, Q Sub-channel of @ref{mmc3r10g.pdf,, MMC-3}.
The first pack of type @kbd{0x88} (Table of Contents) records in its
payload bytes as follows:
@@ -330,8 +253,11 @@ Encoding the above gives:
88 0d 27 00 35 18 19 39 03 19 00 00 00 00 00 00 ea af
@end smallexample
It is unclear what Pack type @kbd{0x89} is used for, and what the
information shall mean to the user of the CD.
Pack type @kbd{0x89} (Second Table of Contents) is not yet clear. It
might be a representation of Playback Skip Interval, Mode-5 Q
sub-channel, POINT 01 to 40 See Section 4.2.6.3 of @ref{mmc3r10g.pdf,, MMC-3}.
If so, then this seems not to apply to write type SAO, because the CUE
SHEET format offers no way to express Mode-5 Q.
The time points in the Sony example are in the time range of the
tracks numbers that are given before the time points:
@@ -356,8 +282,8 @@ two time points are stored in byte 6 to 11 of the payload. Byte 0 of the
payload seems to be a sequential counter. Byte 1 always 4? Byte 2 to 5
always 0?
@node Block Pack Type
@section Block Pack Type
@node Block Pack Type (0x8f)
@section Block Pack Type (@kbd{0x8f})
Pack type @kbd{0x8f} summarizes the whole list of text packs of a
block. So there is one group of three @kbd{0x8f} packs per block.
@@ -454,7 +380,7 @@ referred to in bytes 28-38 of @ref{table:block-pack}.
@end float
Note: Not all of the language codes in @ref{table:languages} have
ever been seen with CD-TEXT.
ever been seen with CD Text.
Using the preceding information, we can work out the following example.
@smallexample
@@ -489,6 +415,82 @@ Byte :Value Meaning
29 : 00 00 00 00 00 00 00 = language codes for block 1..7 (none)
@end smallexample
@node Pack Contents
@section Pack Contents
The attributes are represented on CD as Text Packs in the sub-channel
of the Lead-in of the disc. The file @file{doc/cookbook.txt} of the
@url{http://libburnia-project.org/,libburnia} distribution describes
how to write the CD Text pack array to CD, and how to read CD Text
packs from CD. If you are just interested in a more high-level access
CD Text information without having to understand the internal
structure can use libcdio's CD Text API for getting and setting
fields.
The format is explained in part in Annex J of (@ref{mmc3r10g.pdf,,
MMC-3}), and in part by Sony's documentation
@ref{cdtext.zip,,cdtext.zip}.
Each pack consists of a 4-byte header, 12 bytes of payload, and 2 bytes
of CRC.
The first byte of each pack tells the pack type. See above for a list of
types.
The second byte tells the track number to which the first text piece
in a pack is associated. Number 0 means the whole album. Higher
numbers are valid for types @kbd{0x80} to @kbd{0x85}, and
@kbd{0x8e}. With these types, there should be one text for the disc
and one for each track. With types @kbd{0x88} and @kbd{0x89}, the
second byte bears a track number, too. With type @kbd{0x8f}, the
second byte counts the record parts from 0 to 2.
The third byte is a sequential counter.
The fourth byte is the Block Number and Character Position Indicator.
It consists of three bit fields:
@table @dfn
@item bits 0-3
Character position. Either the number of characters which the current
text inherited from the previous pack, or 15 if the current
text started before the previous pack.
@item bits 4-6
Block Number (groups text packs in language blocks)
@item bit 7
Is Double Byte Character? Is 0 if single byte characters, 1 if double-byte
characters.
@end table
The 12 payload bytes contain pieces of ASCII NUL-terminated texts or
binary data. A text may span over several packs. Unused characters in
a pack are used for the next text of the same pack type. If no text of
the same type follows, then the remaining text bytes are set to 0.
The CRC algorithm uses divisor @kbd{0x11021}. The resulting 16-bit
residue of the polynomial division is inverted (xor-ed with
@kbd{0xffff}) and written as Big-endian number in bytes 16 and 17 of
the pack.
The text packs are grouped in up to 8 blocks of at most 256 packs. Each
block is in charge for one language. Sequence numbers of each block are
counted separately. All packs of block 0 come before the packs of block
1.
The limitation of block number and sequence numbers imply that there are
at most 2048 text packs possible. (READ TOC/PMS/ATIP could retrieve 3640
packs, as it is limited to 64 KB - 2.)
If a text of a track (pack types @kbd{0x80} to @kbd{0x85} and
@kbd{0x8e}) repeats identically for the next track, then it may be
represented by a TAB character (ASCII 9) for single byte texts,
resp. two TAB characters for double byte texts. (This should be used
because 256 * 12 bytes is few space for 99 tracks.)
The two binary bytes of pack type @kbd{0x87} are written to the first
@kbd{0x87} pack of a block. They may or may not be repeated at the start
of the follow-up packs of type @kbd{0x87}.
@node Higher-Level Encoding
@chapter Higher-Level Encoding
@@ -496,7 +498,7 @@ This part gives examples of two ways to input CD Text for burning.
@menu
* Sony Text File Format (Input Sheet Version 0.7T)::
* CDRWIN Cue Sheet with CD-TEXT::
* CDRWIN Cue Sheet with CD Text::
@end menu
@node Sony Text File Format (Input Sheet Version 0.7T)
@@ -510,7 +512,7 @@ The information is given by text lines of the following form:
purpose specifier [whitespace] = [whitespace] content text
[whitespace] is zero or more ASCII 32 (space) or ASCII 9 (tab) characters.
The purpose specifier tells the meaning of the content text.
Empty content text does not cause a CD-TEXT attribute to be attached.
Empty content text does not cause a CD Text attribute to be attached.
The following purpose specifiers apply to the session as a whole:
@@ -548,27 +550,43 @@ The following purpose specifiers apply to particular tracks:
ISRC NN = Content of pack type 0x8e
@end smallexample
The following purpose specifiers have no effect on CD-TEXT:
The following purpose specifiers have no effect on CD Text:
@smallexample
Remarks = Comments with no influence on CD-TEXT
Remarks = Comments with no influence on CD Text
Disc Information NN = Supplementary information for use by record companies.
ISO-8859-1 encoded. NN ranges from 01 to 04.
Input Sheet Version = "0.7T"
@end smallexample
The following purpose specifiers accept byte values of the form 0xXY.
Text Code , Language Code , Genre Code , Text Data Copy Protection
E.g. to indicate MS-JIS character code (of which the exact name is unknown):
Text Code = 0x80
Genre Code is settable by 0xXY or 0xXYZT or 0xXY 0xZT.
Genre Code = 0x001b
Purposes specifiers Text Code, Language Code, Genre Code, and Text Data
Copy Protection are two hexidecimal digits.
Purpose specifiers which have the meaning "Content of pack type 0xXY"
may be replaced by the pack type codes. E.g.:
For example, to indicate MS-JIS character code (of which the exact
name is unknown) enter:
@smallexample
Text Code = 0x80
@end smallexample
Genre Code is settable by a 4-hexidecimal digit number, or by 2
two-digit hexidecimal numbers. For example:
@smallexample
Genre Code = 0x001b
Genre Code = 0x00 0x1b
@end smallexample
Purpose specifiers which have the meaning ``Content of pack type 0xXY''
may be replaced by the pack type codes. For example:
@smallexample
0x80 = Session content of pack type 0x80
Track 02 0x80 = Track content of pack type 0x80 for track 2.
Applicable are pack types 0x80 to 0x86, 0x8d, 0x8e.
@end smallexample
Applicable are pack types @kbd{0x80} to @kbd{0x86}, @kbd{0x8d},
@kbd{0x8e}.
Text Code may be specified only once. It gets specified ISO-8850-1
automatically as soon as content is defined which depends on the text
@@ -627,8 +645,8 @@ Track 03 Message =
ISRC 03 = XYBLG1100006
@end smallexample
@node CDRWIN Cue Sheet with CD-TEXT
@section CDRWIN Cue Sheet with CD-TEXT
@node CDRWIN Cue Sheet with CD Text
@section CDRWIN Cue Sheet with CD Text
A CDRWIN cue sheet file defines the track data source (@kbd{FILE}),
various text attributes (@kbd{CATALOG}, @kbd{TITLE}, @kbd{PERFORMER},
@@ -637,7 +655,7 @@ start addresses (@kbd{INDEX}). The rules for CDRWIN cue sheet files are
described at @url{http://digitalx.org/cue-sheet/syntax/} [4].
There are three more text attributes mentioned in the cdrecord manual
page for defining the corresponding CD-TEXT attributes: @kbd{ARRANGER},
page for defining the corresponding CD Text attributes: @kbd{ARRANGER},
@kbd{COMPOSER}, @kbd{MESSAGE}.
An Example of a CDRWIN cue sheet file:
@@ -668,6 +686,10 @@ TITLE "Joyful Nights"
INDEX 01 13:20:33
@end smallexample
@node Acknowlegement
@unnumbered Acknowlegement
Thanks to Leon Merten Lohse.
@node List of Tables
@unnumbered List of Tables
@listoffloats Table
@@ -684,11 +706,11 @@ in @email{libcdio-devel@@gnu.org}, December 2011. @* Mail archives at
Revision 10g, November 12. 2011
@url{http://www.t10.org/cgi-bin/ac.pl?t=f&f=mmc3r10g.pdf} In
particular, see Table 237 (TOC Track Descriptor Format, Q
Sub-channel), Annex J (CD-TEXT format in the Lead-in Area) and
Sub-channel), Annex J (CD Text format in the Lead-in Area) and
Sections 4.2.5.3 (Mode-5 Q).
@item Documents inside Sony's @file{cdtext.zip} @anchor{cdtext.zip}
@url{http://www.sonydadc.com/file/}
@item Documents inside Sony's CD Text Authoring tool @file{cdtext.zip} @anchor{cdtext.zip}
@url{http://www.sonydadc.com/file/cdtext.zip}
@item Cue-Sheet Syntax
@url{http://digitalx.org/cue-sheet/syntax}
@@ -702,7 +724,7 @@ Sections 4.2.5.3 (Mode-5 Q).
@item @emph{Specification of the EBU Subtitling data exchange format},@*
Appendix 3. February 1991
@url{http://tech.ebu.ch/docs/tech/tech3264.pdf} @*
Contains CD-TEXT Language codes shown in @ref{table:languages}.
Contains CD Text Language codes shown in @ref{table:languages}.
@item Genre codes
@url{http://helpdesk.audiofile-engineering.com/index.php?pg=kb.page&id=123}