]> The GNU Compact Disc Input and Control library libcdio This file documents GNU CD Input and Control library Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein and Herbert Valerio Riedel History As a result of the repressive Digital Millennium Copyright Act (DMCA) I became aware of Video CD's (VCD's). Video CD's are not subject to the DMCA and therefore enjoy the protection afforded by copyright but no more. But in order for VCD's to be competitive with DVD's, good tools (including GPL tools) are needed for authoring and playing them. And so through VCD's I became aware of the excellent Video CD tools by Herbert Valerio Riedel which form the vcdimager package. Although vcdimager is great for authoring, examining and extracting parts of a Video CD, it is not a VCD player. And when I looked at the state of Video CD handling in existing VCD players: xine, MPlayer, and vlc, I was a bit disappointed. None handled playback control, menu selections, or playing still frames and segments from track 1. Version 0.7.12 of vcdimager was very impressive, however it lacked exportable libraries that could be used in other projects. So with the blessing and encouragement of Herbert Valerio Riedel, I took to extract and create libraries from this code base. The result was two libraries: one to extract information from a VCD which I called libvcdinfo, and another to do the reading and control of a VCD. Well, actually, at this point I should say that a Video CD is really just Video put on a existing well-established Compact Disc or CD format. So the library for this is called libcdio rather than libvcdio. While on the topic of the name libcdio, I should also explain that the library really doesn't handle writing or output (the final "o" in the name). However it was felt that if I put libcdi that might be confused with a particular CD format called CD-I. Later on, the ISO-9660 filesystem handling component from vcdimager was extracted, expanded and made a separate library. Next the ability to add MMC commands was added, and then CD paranoia support. And from there, the rest is history. The problem and previous work If around the year 2002 you were to look at the code for a number of open-source CD or media players that work on several platforms such as vlc, MPlayer, xine, or xmms to name but a few, you'd find the code to read a CD sprinkled with conditional compilation for this or that platform. That is there was no OS-independent programmer library for CD reading and control even though the technology was over 10 years old; yet there are media players which strive for OS independence. One early CD player, xmcd by Ti Kan, was I think a bit better than most in that it tried to encapsulate the kinds of CD control mechanisms (SCSI, Linux ioctl, Toshiba, etc.) in a "CD Audio Device Interface Library" called libdi. However this library is for Audio CD's only and I don't believe this library has been used outside of xmcd. Another project, Simple DirectMedia Layer also encapsulates CD reading. SDL is a library that allows you portable low-level access to a video framebuffer, audio output, mouse, and keyboard. With SDL, it is easy to write portable games which run on ... Many of the media players mentioned above do in fact can make use of the SDL library but for video output only. Because the encapsulation is over many kinds of I/O (video, joysticks, mice, as well as CD's), I believe that the level of control provided for CD a little bit limited. (However to be fair, it may have only been intended for games and may be suitable for that). Applications that just want the CD reading and control portion I think will find quite a bit overhead. Another related project is Jörg Schilling's SCSI library. You can use that to make a non-SCSI CD-ROM act like one that understands SCSI MMC commands which is a neat thing to do. However it is a little weird to have to install drivers just so you can run a particular user-level program. Installing drivers often requires special privileges and permissions and it is pervasive on a system. It is a little sad that along the way to creating such a SCSI library a library similar to libcdio wasn't created which could be used. Were that the case, this library certainly never would have been written. At the OS level there is the “A Linux CD-ROM Standard” by David van Leeuwen from around 1999. This defines a set of definitions and ioctl's that mask hardware differences of various Compact Disc hardware. It is a great idea, however this “standard” lacked adoption on OS's other than GNU/Linux. Or maybe it's the case that the standard on other OS's lacked adoption on GNU/Linux. For example on FreeBSD there is a “Common Access Method” (CAM) used for all SCSI access which seems not to be adopted in GNU/Linux.And I'm thankful for that since, at least for MMC commands, it is inordinately complicated and in some places arcane. Finally at the hardware level where a similar chaos exists, there has been an attempt to do something similar with the MMC (multimedia commands). This attempts to provide a uniform command set for CD devices PostScript does for printer commands.I wrote “attempts” because over time the command set has changed and now there are several different commands to do a particular function like read a CD table of contents and some hardware understands some of the version of the commands set but might not others In contrast to PostScript where there one in theory can write a PostScript program in a uniform ASCII representation and send that to a printer, for MMC although there are common internal structures defined, there is no common syntax for representing the structures or an OS-independent library or API for issuing MMC-commands which a programmer would need to use. Instead each Operating System has its own interface. For example Adaptec's ASPI or Microsoft's DeviceIoControl on Microsoft Windows, or IOKit for Apple's OS/X, or FreeBSD's CAM. I've been positively awed at how many different variations and differing levels of complexity there are for doing basically the same thing. How easy it is to issue an MMC command from a program varies from easy to very difficult. And mastering the boilerplate code to issue an MMC command on one OS really doesn't help much in figuring out how to do it on another OS. So in libcdio we provide a common (and hopefully simple) API to issue MMC commands. What is in this package (and what's not) The library, libcdio, encapsulates CD-ROM reading and control. Applications wishing to be oblivious of the OS- and device-dependent properties of a CD-ROM can use this library. Also included is a library, libiso9660, for working with ISO-9660 filesystems, libcdio_paranoia, and libcdio_cdda libraries for applications which want to use cdparanoia's error-correction and jitter detection. Some support for disk-image types like cdrdao's TOC, CDRWIN's BIN/CUE and Ahead Nero's NRG format is available, so applications that use this library also have the ability to read disc images as though they were CDs. libcdio also provides a way to issue SCSI “MultiMedia Commands” (MMC). MMC is supported by many hardware CD-ROM manufacturers; and in some cases where a CD-ROM doesn't understand MMC directly, some Operating Systems (such as GNU/Linux, Solaris, or FreeBSD or Microsoft Windows ASPI to name a few) provide the MMC emulation.This concept of software emulation of a common hardware command language is common for printers such as using ghostscript to private postscript emulation for a non-postscript printer. The first use of the library in this package are the Video CD authoring and ripping tools, VCDImager (http://vcdimager.org). See http://www.gnu.org/software/libcdio/projects.html for a list of projects using libcdio. A version of the CD-DA extraction tool cdparanoia (http://www.xiph.org/paranoia and its library which corrects for CD-ROM jitter are part of the distribution. Also included in the libcdio package is a utility program cd-info which displays CD information: number of tracks, CD-format and if possible basic information about the format. If libcddb (http://libcddb.sourceforge.net) is available, the cd-info program will display CDDB matches on CD-DA discs. And if a new enough version of libvcdinfo is available (from the vcdimager project), then cd-info shows basic VCD information. Other utility programs in the libcdio package are: cdda-player shows off libcdio audio and CD-ROM control commands. It canplay a track, eject or load media and show the the status of a CD-DAthat is might be currently played via the audio control commands. Itcan be run in batch mode or has a simple curses-based interface.If libcddb is available or a CD has CD-Text and your CD-ROM drivesupports CD-Text, track/album information about the CD can be shown. cd-drive shows what drivers are available and some basic properties ofcd-drives attached to the system. (But media may have to be insertedin order to get this info.) lists out drive capabilities cd-read performs low-level block reading of a CD or CD image, iso-info displays ISO-9660 information from an ISO-9660 image. Below is somesample output iso-info version 0.72 Copyright (c) 2003, 2004, 2005 R. Bernstein This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. __________________________________ ISO 9660 image: ../test/joliet.iso Application: K3B THE CD KREATOR VERSION 0.11.12 (C) 2003 SEBASTIAN TRUEG AND THE K3B TEAM Preparer : K3b - Version 0.11.12 Publisher : Rocky Bernstein System : LINUX Volume : K3b data project Volume Set : K3b data project __________________________________ ISO-9660 Information /: Oct 22 2004 19:44 . Oct 22 2004 19:44 .. Oct 22 2004 19:44 libcdio /libcdio/: Oct 22 2004 19:44 . Oct 22 2004 19:44 .. Mar 12 2004 02:18 COPYING Jun 26 2004 07:01 README Aug 12 2004 06:22 README.libcdio Oct 22 2004 19:44 test /libcdio/test/: Oct 22 2004 19:44 . Oct 22 2004 19:44 .. Jul 25 2004 06:52 isofs-m1.cue iso-read extracts files from an ISO-9660 image. At present, there is no support for writing CD's. Nor is there any support for reading or writing DVDs. For some of these, there are other libraries (e.g. libdi, libscg, or libdvdread) may be helpful. I'm not theoretically opposed to putting support like this into libcdio. However at present there are already many gaps in this package, so narrowing its scope in order to focus on these things I think is a good idea. CD Formats Much of what I write in this section can be found elsewhere. See for example http://www.pctechguide.com/08cd-rom.htm or http://www.pcguide.com/ref/cd/format.htm We give just enough background here to cover Compact Discs and Compact Disc formats that are handled by this library. The Sony and Philips Corporations invented and Compact Disc (CD) in the early 1980s. The specifications for the layout is often referred to by the color of the cover on the specification. Red Book (CD-DA) Red Book The first type of CD that was produced was the Compact Disc Digital Audio (CD-DA) or just plain “audio CD”. The specification, ICE 908, is commonly called the “Red Book”. Music CD's are recorded in this format which basically allows for around 74 minutes of audio per disc and for that information to be split up into tracks. Tracks are broken up into "sectors" and each sector contains up to 2,352 bytes. To play one 44.1 kHz CD-DA sampled audio second, 75 sectors are used. The minute/second/frame numbering of sectors or MSF format is based on the fact that 75 sectors are used in a second of playing of sound. (And for almost every other CD format and application the MSF format doesn't make that much sense). In libcdio when you you want to read an audio sector, you call cdio_read_audio_sector() or cdio_read_audio_sectors(). subchannel In addition the the audio data “channel” a provision for other information or subchannel information) can be stored in a sector. Other subchannels include a Media Catalog Number (also abbreviated as MCN and sometimes a UPC), or album meta data (also called CD-Text). Karioke graphics can also be stored in a format called CD+G. CD Text, CD+G CD Text CD+G CD Text is an extension to the CD-DA standard that adds the ability to album and track meta data (titles, artist/performer names, song titles) and and graphical (e.g. Karioke) information. For an alternative way to get album and track meta-data see See . Information is stored in such a way that it doesn't interfere with the normal operation of any CD players or CDROM drives. There are two different parts of the CD where the data can be stored. The first place the information can be recorded is in the R-W sub codes in the lead in area of the CD giving a data capacity of about 5,000 ASCII characters (or 2,500 Kanji or Unicode characters). This information is stored as a single block of data and is the format used in virtually all of the CD Text CDs shipping today. The method for reading this data from a CDROM drive is covered under the Sony proposal to the MMC specification. The format of the data is partially covered in the MMC specification. The second place the information can be recorded is in the R-W sub codes in the program area of the CD giving a data capacity of roughly 31MB. This information is stored in a format that follows the Interactive Text Transmission System (ITTS) which is the same data transmission standard used by such things as Digital Audio Broadcasting (DAB), and virtually the same as the data standard for the MiniDisc. Traditionally the R-W sub codes have been used for text and graphics in applications such as CD+G (CD w/graphics) or in the case of most audio CDs, not at all. The methods for reading this data from a CD-ROM drive is covered by the programming specs from the individual drive manufacturers. In the case of ATAPI drives, the SFF8020 spec covers the reading of the RW subcodes. Not all drives support reading the RW subcodes from the program area. However for those that do, libcdio provides a way to get at this information via cdtext_get() and its friends. Internet CD Database (CDDB) CDDB CDDB is an database on the Internet of of CD album/track, artist, and genre information similar to CD Text information. Using track information (number of tracks and length of the tracks), devices that have access to the Internet can query for meta information and contribute information for CD's where there is no existing information. When storage is available (such as you'd expect for any program using libcdio, the information is often saved for later use when the Internet is not available; people tend request the same information since they via programs play the same music. Obtaining CD meta information when none is encoded in an audio CD is useful in media players or making one's own compilations from audio CDs. There are currently two popular CDDB services on the Internet. The original database has been renamed Gracenote and is a profit making entity. FreeDB (http://freedb.org is an open source CD information resource that is free for developers and the public to use. As there already is an excellent library for handling CDDB libcddb (http://libcddb.sourceforge.net we suggest using that. Our utility program cd-info will make use it if it is available and it's what we use in our applications that need it. Yellow Book (CD-ROM Digital Data)The CD-ROM specification or the “Yellow Book” followed a few years later (Standards ISO/IEC 10149), and describes the extension of CD's to store computer data, i.e. CD-ROM (Compact Disk Read Only Memory). The specification in the Yellow Book defines two modes: Mode 1 and Mode 2. ISO 9660 ISO 9660 The Yellow Book doesn't specify how data is to be stored on a CD-ROM. It was feared that different companies would implement proprietary data storage formats using this specification, resulting in incompatible data CDs. To prevent this, representatives of major manufacturers met at the High Sierra Hotel and Casino in Lake Tahoe, NV, in 1985, to define a standard for storing data on CDs. This format was nicknamed High Sierra Format. In a slightly modified form it was later adopted as ISO the ISO 9660 standard. This standard is further broken down into 3 "levels", the higher the level, the more permissive. ISO 9660 Level 1Level 1 ISO 9660 defines names in the 8+3 convention so familiar to MS-DOS: eight characters for the filename, a period, and then three characters for the file type, all in upper case. The allowed characters are A-Z, 0-9, ".", and "_".Level 1 ISO 9660 requires that files occupy a contiguous range of sectors. This allows a file to be specified with a start block and a count. The maximum directory depth is 8. For a table of the characters, see See . ISO 9660 Level 2Level 2 ISO 9660 allows far more flexibility in filenames, but isn't usable on some systems, notably MS-DOS. ISO 9660 Level 3Level 3 ISO-9660 allows non-contiguous files, useful if the file was written in multiple packets with packet-writing software. There have been a number of extensions to the ISO 9660 CD-ROM file format. One extension is Microsoft's Joliet specification, designed to resolve a number of deficiencies in the original ISO 9660 Level 1 file system, and in particular to support the long file names used in Windows 95 and subsequent versions of Windows. Another extension is the Rock Ridge Interchange Protocol (RRIP), which enables the recording of sufficient information to support POSIX File System semantics. Joliet Extensions Joliet extensions Joliet extensions were an upward-compatible extension to the ISO 9660 specification that removes the limitation initially put in to deal with the limited filename conventions found in Microsoft DOS OS. In particular, the Joliet specification allows for long filenames and allows for UCS-BE (Big-endian Unicode) encoding of filenames which include mixed case letter, accented characters spaces and various symbols. The way all of this is encoded is by adding a second directory and filesystem structure in addition to or in parallels to original ISO 9600 filesystem. The root node of the ISO 9660 filesystem is found via the Primary Volume Descriptor or PVD. The root of the Joliet-encode filesystem is found in a Supplementary Volume Descriptor or SVD defined in the ISO 9660 specification. The SVD structure is almost identical to a PVD with a couple of unused fields getting used and with the filename encoding changed to UCS-BE. Rock Ridge Extensions Rock Ridge extensions Using the Joliet Extension one overcome the limitedness of the original ISO-9660 naming scheme. But another and probably better method is to use the Rock Ridge Extension. Not only can one store a filename as one does in a POSIX OS, but the other file attributes, such as the various timestamps (creation, modification, access), file attributes (user, group, file mode permissions, device type, symbolic links) can be stored. This is much as one would do in XA attributes; however the two are not completely interchangeable in the information they store: XA does not address filename limitations, and the Rock Ridge extensions don't indicate if a sector is in Mode 1 or Mode 2 format. The Rock Ridge extension makes use of a hook that was defined as part of the ISO 9660 standard. Mode 1 (2048 data bytes per sector) Mode 1 Mode 1 is the data storage mode used by to store computer data. There are 3 layers of error correction. A Compact Disc using only this format can hold at most 650 MB. The data is laid out in basically the same way as in and audio CD format, except that the 2,352 bytes of data in each block are broken down further. 2,048 of these bytes are for “real” data. The other 304 bytes are used for an additional level of error detecting and correcting code. This is necessary because data CDs cannot tolerate the loss of a handful of bits now and then, the way audio CDs can. In libcdio when you you want to read a mode1 sector you call the cdio_read_mode1_sector() or cdio_read_mode1_sectors(). Mode 2 (2336 data bytes per sector) Mode 2 Mode 2 data CDs are the same as mode 1 CDs except that the error detecting and correcting codes are omitted. So still there are 2 layers of error correction. A Compact Disc using only this mode can thus hold at most 742 MB. Similar to audio CDs, the mode 2 format provides a more flexible vehicle for storing types of data that do not require high data integrity: for example, graphics and video can use this format. But in contrast to the Red Book standard, different modes can be mixed together; this is the basis for the extensions to the original data CD standards known as CD-ROM Extended Architecture, or CD-ROM XA. CD-ROM XA formats currently in use are CD-I Bridge formats, Photo CD and Video CD plus Sony's Playstation. In libcdio when you you want to read a mode1 sector you call the cdio_read_mode2_sector() or cdio_read_mode2_sectors(). Green Book (CD-i) Green Book This was a CD-ROM format developed by Philips for CD-i (an obsolete embedded CD-ROM application allowing limited user user interaction with films, games and educational applications). The format is ISO 9660 compliant and introduced mode 2 form 2 addressing. It also contains XA (Extended Architecture) attributes. Although some Green Book discs contain CD-i applications which can only be played on a CD-i player, others have films or music videos. Video CDs in Green-Book format are labeled "Digital Video on CD." The Green Book for video is largely superseded by White book CD-ROM which draws on this specification. White Book (DV, Video CD) Green Book The White Book was released by Sony, Philips, Matsushita, and JVC in 1993, defines the Video CD specification. The White Book is also known as Digital Video (DV). A Video CD contains one data track recorded in CD-ROM XA Mode 2 Form 2. It is always the first track on the disc (Track 1). The ISO-9660 file structure and a CD-i application program are recorded in this track, as well as the Video CD Information Area which gives general information about the Video Compact Disc. After the data track, video is written in one or more subsequent tracks within the same session. These tracks are also recorded in Mode 2 Form 2. In libcdio when you you want to read a mode2 format 2 audio sector you call the cdio_read_mode2_sector() or cdio_read_mode2_sectors() setting b_form2 to true. CD Image Formats In both the cdrdao and bin/cue formats there is one meta-file with extensions .toc or .cue respectively and one or more files (often with the extension .bin) which contains the content of tracks. The format of the track data is often interchangeable between the two formats. For example, in libcdio's regression tests we make use of this to reduce the size of the test data and just provide alternate meta-data files (.toc or .cue). In contrast to the first two formats, the NRG format consists of a single file. This has the advantage of being a self-contained unit: in the other two formats it is possible for the meta file to refer to a file that can't be found. A disadvantage of the NRG format is that the meta data can't be easily viewed or modified say in a text file as it can be with the first two formats. In conjunction with this disadvantage is another disadvantage that the format is not documented, so how libcdio interprets an NRG image is based on inference. It is recommended that one of the other forms be used instead of NRG where possible. CDRDAO TOC Format This is cdrdao's CD-image description format. Since this program is GPL and everything about it is in the open, it is the preferred format to use. (Alas, at present it isn't as well supported in libcdio as the BIN/CUE format.) The toc-file describes what data is written to the media in the CD-ROM; it allows control over track/index positions, pre-gaps and sub-channel information. It is a text file, so a text editor can be used to create, view or modify it. The cdrdao(1) manual page, contains more information about this format. CDRDAO Grammar Below are the lexical tokens and grammar for a cdrdao TOC. It was taken from the cdrdao's pacct grammar; the token and nonterminal names are the same. #lexclass START #token Eof "@" #token "[\t\r\ ]+" #token Comment "//~[\n@]*" #token "\n" #token BeginString "\"" #token Integer "[0-9]+" #tokclass AudioFile { "AUDIOFILE" "FILE" } #lexclass STRING #token EndString "\"" #token StringQuote "\\\"" #token StringOctal "\\[0-9][0-9][0-9]" #token String "\\" #token String "[ ]+" #token String "~[\\\n\"\t ]*" <toc> ::= ( "CATALOG" <string> | <tocType> )* { <cdTextGlobal> } ( <track> )+ Eof <track> ::= "TRACK" <trackMode> { <subChannelMode> } ( "ISRC" <string> | { "NO" } "COPY" | { "NO" } "PRE_EMPHASIS" | "TWO_CHANNEL_AUDIO" | "FOUR_CHANNEL_AUDIO" )* { <cdTextTrack> } { "PREGAP" <msf> } ( <subTrack> | "START" { msf } | "END" { msf } )+ ( "INDEX" <msf> )* <subTrack> ::= AudioFile <string> { "SWAP" } { "#" <sLong> } <samples> | "DATAFILE" <string> { "#" <sLong> { <dataLength> } } | "FIFO" <string> <dataLength> | "SILENCE" <samples> | "ZERO" { dataMode } { <subChannelMode> } <dataLength> <string> ::= BeginString ( String | StringQuote | StringOctal )+ EndString <stringEmpty> ::= BeginString ( String | StringQuote | StringOctal )* EndString <uLong> ::= Integer <sLong> ::= Integer <msf> ::= Integer ":" Integer ":" Integer <samples> ::= <msf> | <uLong> <dataLength> ::= <msf> | <uLong> <dataMode> ::= "AUDIO" | "MODE0" | "MODE1" | "MODE1_RAW" | "MODE2" | "MODE2_RAW" | "MODE2_FORM1" | "MODE2_FORM2" | "MODE2_FORM_MIX" <trackMode> ::= "AUDIO" | "MODE1" | "MODE1_RAW" | "MODE2" | "MODE2_RAW" | "MODE2_FORM1" | "MODE2_FORM2" | "MODE2_FORM_MIX" <subChannelMode> ::= "RW" | "RW_RAW" <tocType> ::= "CD_DA" | "CD_ROM" | "CD_ROM_XA" | "CD_I" <packType> ::= "TITLE" | "PERFORMER" | "SONGWRITER" | "COMPOSER" | "ARRANGER" | "MESSAGE" | "DISC_ID" | "GENRE" | "TOC_INFO1" | "TOC_INFO2" | "RESERVED1" | "RESERVED2" | "RESERVED3" | "RESERVED4" | "UPC_EAN" | "ISRC" | "SIZE_INFO" <binaryData> ::= "{" { Integer ( "," Integer )* } "}" <cdTextItem> ::= <packType> ( <stringEmpty> | <binaryData> ) <cdTextBlock> ::= "LANGUAGE" Integer "{" ( <cdTextItem> )* "}" <cdTextLanguageMap> ::= "LANGUAGE_MAP" "{" ( Integer ":" ( Integer | "EN" ) )+ "}" <cdTextTrack> ::= "CD_TEXT" "{" ( <cdTextBlock> )* "}" <cdTextGlobal> ::= "CD_TEXT" "{" { <cdTextLanguageMap> } ( <cdTextBlock> )* "}" CDRWIN BIN/CUE Format BIN/CUE, CD Image Format The format referred to as CDRWIN BIN/CUE Format in this manual is a popular CD image format used in the PC world. Not unlike cdrdao's TOC file, the cue file describes the track layout, i.e. how the sectors are to be placed on the CD media. The cue file usually contains a reference to a file traditionally having the .bin extension in its filename, the bin file. This bin file contains the sector data payload which is to be written to the CD medium according to the description in the cue file. The following is an attempt to describe the subset of the .cue file syntax used in libcdio and vcdimager in an EBNF-like notation: BIN/CUE Grammar <cue-document> ::= +( <file-line> +<track-expr> ) <digit> ::= "0" | "1" ... "8" | "9" <number> ::= +<digit> <msf> ::= <digit><digit> ":" <digit><digit> ":" <digit><digit> <file-line> ::= "FILE" <pathname-expr> <file-type> <EOL> <pathname-expr> ::= [ "\"" ] <pathname-str-without-spaces> [ "\"" ] | "\"" <pathname-str> "\"" <file-type> ::= "BINARY" <track-expr> ::= <track-line> [ <flag-line> ] [ <pregap-line> ] *<index-line> [ <postgap-line> ] <flag-line> ::= "FLAGS" *<flag-type> <EOL> <flag-type> ::= "DCP" <track-line> ::= "TRACK" <number> <track-type> <EOL> <pregap-line> ::= "PREGAP" <msf> <EOL> <index-line> ::= "INDEX" <number> <msf> <EOL> <postgap-line> ::= "POSTGAP" <msf> <EOL> <track-type> ::= "AUDIO" | "MODE1/2048" | "MODE1/2352" | "MODE2/2336" | "MODE2/2352" <comment-line> ::= "REM" *<char> <EOL> NRG Format Nero NRG, CD-Image format The format referred to as NRG Format in this manual is another popular CD image format. It is available only on Nero software on a Microsoft Windows Operating System. It is proprietary and not generally published, so the information we have comes from guessing based on sample CD images. So support for this is incomplete and using this format is not recommended. Unlike cdrdao's TOC file the BIN/CUE format everything is contained in one file. that one can edit Meta information such as the number of tracks and track format is contained at the end of the file. This information is not intended to be edited through a text editor. The units that make up a CD tracks — disc subdivisions track In this section we describe CD properties and terms that we make use of in libcdio. A CD is formated into a number of tracks, and a CD can hold at most 99 such tracks. This is defined by CDIO_CD_MAX_TRACKS in cdio/sector.h. Between the tracks CD specifications require a “2 second” in gap (called a lead-in gap. This is unused space with no “data” similar to the space between tracks on an old phonograph. The word “second” here really refers to a measure of space and not really necessarily an amount of time. However in the special case that the CD encodes an audio CD or CD-DA, the amount of time to play a gap of this size will take 2 seconds. lead out The beginning (or inner edge) of the CD is supposed to have a “2 second” lead-in gap and there is supposed to be another “2 second” lead-out gap at the end (or outer edge) of the CD. People have discovered that they can put useful data in the various gaps and their equipment can read this, violating the standards but allowing a CD to store more data. In order to determine the number of tracks on a CD and where they start, commands are used to get this table-of-contents or TOC information. Asking about the start of the lead-out track gives the amount of data stored on the Compact Disk. To make it easy to specify this leadout track, special constant 0xAA (decimal 170) is used to indicate it. This is safe since this is higher than the largest legal track position. In libcdio, CDIO_CDROM_LEADOUT_TRACK is defined to be this special value. block addressing (MSF, LSN, LBA) MSF LSN LBA sectors frames A track is broken up into a number of 2352-byte blocks which we sometimes call sectors or frames. Whereas tracks have to have a gap between them, a block or sector does not. (In libcdio the block size constant is defined using CDIO_CD_FRAMESIZE_RAW). A Compact Disc has a limit on the number of blocks or sectors. This values is defined by constant CDIO_CD_MAX_LSN in cdio/sector.h. One can addressing a block in one of three formats. The oldest format is by it's minute/second/frame number, also referred to as MSF and written in time-like format MM:SS:FF (e.g. 30:01:40). It is best suited in audio (Red Book) applications. In libcdio, the type msf_t can be used to declare variables to hold such values. Minute, second and frame values are one byte and stored BCD notation.Perhaps this is a libcdio design flaw. It was originally done I guess because it was convenient for VCDs. There are libcdio conversion routines cdio_from_bcd8() and cdio_to_bcd8() to convert the minute, second, and frame values into or out of integers. If you want to print a field in a BCD-encoded MSF, one can use the format specifier %x (not %d) and things will come out right. In the MSF notation, there are 75 “frames” in a “second,” and the familiar (if awkward) 60 seconds in a minute. Frame here is what we called a block above. The CD specification defines “frame” to be another unit which makes up a block. Very confusing. A frame is also sometimes called a sector, analogous to hard-disk terminalogy. Even more confusing is using this time-like notation for an address or for a length. Too often people confuse the MSF notation this with an amount of time. A “second” (or CDIO_CD_FRAMES_PER_SEC blocks) in this notation is only a second of playing time for something encoded as CD-DA. It does not necessarily represent the amount time that it will take to play a of Video CD—usually you need more blocks than this. Nor does it represent the amount of data used to play a second of an MP3—usually you need fewer blocks than this. It is also not the amount of time your CD-ROM will take to read a “second” of data off a Compact Disc: for example a 12x CD player will read 12x CDIO_CD_FRAMES_PER_SEC CDIO_CD_FRAMSIZE_RAW-byte blocks in a one second of time. When programming, unless one is working with a CD-DA (and even here, only in a time-like fashion), is generally more cumbersome to use an MSF rather than a LBA or LSN described below, since subtraction of two MSF's has the awkwardness akin to subtraction using Roman Numerals. Probably the simplest way to address a block is to use its LSN or “logical sector number.” This just numbers the blocks usually from 0 on. fix me: LSNs can be negative up to the pregap size? The Lead-in and Lead-out gaps described above have LSNs just like any other space on a CD. The last unit of address is a LBA. It is the same as a LSN but the 150 blocks associated with the initial lead-in is are not counted. So to convert a LBA into an LSN you just add 150. Why the distinction between LBA and LSN? I don't know, perhaps this has something to do with “multisession” CDs. How to use The libcdio package comes with a number of small example programs in the directory example which demonstrate different aspects of the library and show how to use the library. The source code to all of the examples here are contained on the package. Other sources for examples would be the larger utility programs cd-drive, cd-info, cd-read, iso-info, and iso-read which are all in the src directory of the libcdio package. See also See . Example 1: list out tracks and LSNsHere we will give an annotated example which can be found in the distribution as example/tracks.c. 1: #include <stdio.h> 2: #include <sys/types.h> 3: #include <cdio/cdio.h> 4: int 5: main(int argc, const char *argv[]) 6: { 7: CdIo_t *p_cdio = cdio_open ("/dev/cdrom", DRIVER_DEVICE); 8: track_t first_track_num = cdio_get_first_track_num(p_cdio); 9: track_t i_tracks = cdio_get_num_tracks(p_cdio); 10: int j, i=first_track_num; 11: 12: printf("CD-ROM Track List (%i - %i)\n", first_track_num, i_tracks); 13 14: printf(" #: LSN\n"); 15: 16: for (j = 0; j < i_tracks; i++, j++) { 17: lsn_t lsn = cdio_get_track_lsn(p_cdio, i); 18: if (CDIO_INVALID_LSN != lsn) 19: printf("%3d: %06d\n", (int) i, lsn); 20: } 21: printf("%3X: %06d leadout\n", CDIO_CDROM_LEADOUT_TRACK, 22: cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK)); 23: cdio_destroy(p_cdio); 24: return 0; 25: } Already from the beginning on line 2 we see something odd. The #include <sys/types.h> is needed because libcdio assumes type definitions exist for uint32_t, uint16_t and so on. Alternatively you change line 2 to: #define HAVE_SYS_TYPES_H and <cdio/cdio.h> will insert line 2. If you use GNU autoconf to configure your program, add sys/types.h to AC_HAVE_HEADERS and it will arrange for HAVE_SYS_TYPES_H to get defined. If you don't have <sys/types.h> but have some other include that defines these types, put that instead of line 2. Or you could roll your own typedefs. (Note: In the future, this will probably get “fixed” by requiring glib.h.) Okay after getting over the hurdle of line 2, the next line pretty straightforward: you need to include this to get cdio definitions. One of the types that is defined via line 3 is CdIo_t and a pointer that is used pretty much in all operations. Line 6 initializes the variable cdio which we will be using in all of the subsequent libcdio calls. It does this via a call to cdio_open(). The second parameter of cdio_open is DRIVER_UNKNOWN. For any given installation a number of Compact Disc device drivers may be available. In particular it's not uncommon to have several drivers that can read CD disk-image formats as well as a driver that handles some CD-ROM piece of hardware. Using DRIVER_UNKNOWN as that second parameter we let the library select a driver amongst those that are available; generally the first hardware driver that is available is the one selected. If there is no CD in any of the CD-ROM drives or one does not have access to the CD-ROM, it is possible that libcdio will find a CD image in the directory you run this program and will pick a suitable CD-image driver. If this is not what you want, but always want some sort of CD-ROM driver (or failure if none), then use DRIVER_DEVICE instead of DRIVER_UNKNOWN. Note that in contrast to what is typically done using ioctls to read a CD, you don't issue any sort of CD-ROM read TOC command—that is all done by the driver. Of course, the information that you get from reading the TOC is often desired: many tracks are on the CD, or what number the first one is called. This is done through calls on lines 8 and 9. For each track, we call a cdio routine to get the logical sector number, cdio_get_track_lsn() on line 17 and print the track number and LSN value. Finally we print out the “lead-out track” information and we finally call cdio_destroy() in line 23 to indicate we're done with the CD. Example 2: list drivers available and default CD device One thing that's a bit hoaky in Example 1 is hard-coding the name of the device used: /dev/cdrom. Although often this is the name of a CD-ROM device on GNU/Linux and possibly some other Unix derivatives, there are many OSs for which use a different device name. In the next example, we'll let the driver give us the name of the CD-ROM device that is right for it. 1: #include <stdio.h> 2: #include <sys/types.h> 3: #include <cdio/cdio.h> 4: int 5: main(int argc, const char *argv[]) 6: { 7: CdIo_t *p_cdio = cdio_open (NULL, DRIVER_DEVICE); 8: driver_id_t driver_id; 9: 10: if (NULL != p_cdio) { 11: printf("The driver selected is %s\n", cdio_get_driver_name(p_cdio)); 12: printf("The default device for this driver is %s\n\n", 13: cdio_get_default_device(p_cdio)); 14: cdio_destroy(p_cdio); 15: } else { 16: printf("Problem in trying to find a driver.\n\n"); 17: } 18: 19: for (driver_id=CDIO_MIN_DRIVER; driver_id<=CDIO_MAX_DRIVER; driver_id++) 20: if (cdio_have_driver(driver_id)) 21: printf("We have: %s\n", cdio_driver_describe(driver_id)); 22: else 23: printf("We don't have: %s\n", cdio_driver_describe(driver_id)); 24: return 0; 25: } Example 3: figure out what kind of CD (image) we've got In this example is a somewhat simplified program to show the use of cdio_guess_cd_type() to figure out the kind of CD image we've got. This can be found in the distribution as example/sample3.c. #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> #include <string.h> #include <sys/types.h> #include <cdio/cdio.h> #include <cdio/cd_types.h> static void print_analysis(cdio_iso_analysis_t cdio_iso_analysis, cdio_fs_anal_t fs, int first_data, unsigned int num_audio, track_t i_tracks, track_t first_track_num, CdIo_t *cdio) { switch(CDIO_FSTYPE(fs)) { case CDIO_FS_AUDIO: break; case CDIO_FS_ISO_9660: printf("CD-ROM with ISO 9660 filesystem"); if (fs & CDIO_FS_ANAL_JOLIET) { printf(" and joliet extension level %d", cdio_iso_analysis.joliet_level); } if (fs & CDIO_FS_ANAL_ROCKRIDGE) printf(" and rockridge extensions"); printf("\n"); break; case CDIO_FS_ISO_9660_INTERACTIVE: printf("CD-ROM with CD-RTOS and ISO 9660 filesystem\n"); break; case CDIO_FS_HIGH_SIERRA: printf("CD-ROM with High Sierra filesystem\n"); break; case CDIO_FS_INTERACTIVE: printf("CD-Interactive%s\n", num_audio > 0 ? "/Ready" : ""); break; case CDIO_FS_HFS: printf("CD-ROM with Macintosh HFS\n"); break; case CDIO_FS_ISO_HFS: printf("CD-ROM with both Macintosh HFS and ISO 9660 filesystem\n"); break; case CDIO_FS_UFS: printf("CD-ROM with Unix UFS\n"); break; case CDIO_FS_EXT2: printf("CD-ROM with Linux second extended filesystem\n"); break; case CDIO_FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); break; case CDIO_FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; } switch(CDIO_FSTYPE(fs)) { case CDIO_FS_ISO_9660: case CDIO_FS_ISO_9660_INTERACTIVE: case CDIO_FS_ISO_HFS: printf("ISO 9660: %i blocks, label `%.32s'\n", cdio_iso_analysis.isofs_size, cdio_iso_analysis.iso_label); break; } if (first_data == 1 && num_audio > 0) printf("mixed mode CD "); if (fs & CDIO_FS_ANAL_XA) printf("XA sectors "); if (fs & CDIO_FS_ANAL_MULTISESSION) printf("Multisession"); if (fs & CDIO_FS_ANAL_HIDDEN_TRACK) printf("Hidden Track "); if (fs & CDIO_FS_ANAL_PHOTO_CD) printf("%sPhoto CD ", num_audio > 0 ? " Portfolio " : ""); if (fs & CDIO_FS_ANAL_CDTV) printf("Commodore CDTV "); if (first_data > 1) printf("CD-Plus/Extra "); if (fs & CDIO_FS_ANAL_BOOTABLE) printf("bootable CD "); if (fs & CDIO_FS_ANAL_VIDEOCD && num_audio == 0) { printf("Video CD "); } if (fs & CDIO_FS_ANAL_SVCD) printf("Super Video CD (SVCD) or Chaoji Video CD (CVD)"); if (fs & CDIO_FS_ANAL_CVD) printf("Chaoji Video CD (CVD)"); printf("\n"); } int main(int argc, const char *argv[]) { CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); cdio_fs_anal_t fs=0; track_t i_tracks; track_t first_track_num; lsn_t start_track; /* first sector of track */ lsn_t data_start =0; /* start of data area */ int first_data = -1; /* # of first data track */ int first_audio = -1; /* # of first audio track */ unsigned int num_data = 0; /* # of data tracks */ unsigned int num_audio = 0; /* # of audio tracks */ unsigned int i; if (NULL == p_cdio) { printf("Problem in trying to find a driver.\n\n"); return 1; } first_track_num = cdio_get_first_track_num(p_cdio); i_tracks = cdio_get_num_tracks(p_cdio); /* Count the number of data and audio tracks. */ for (i = first_track_num; i <= i_tracks; i++) { if (TRACK_FORMAT_AUDIO == cdio_get_track_format(p_cdio, i)) { num_audio++; if (-1 == first_audio) first_audio = i; } else { num_data++; if (-1 == first_data) first_data = i; } } /* try to find out what sort of CD we have */ if (0 == num_data) { printf("Audio CD\n"); } else { /* we have data track(s) */ int j; cdio_iso_analysis_t cdio_iso_analysis; memset(&cdio_iso_analysis, 0, sizeof(cdio_iso_analysis)); for (j = 2, i = first_data; i <= i_tracks; i++) { lsn_t lsn; track_format_t track_format = cdio_get_track_format(p_cdio, i); lsn = cdio_get_track_lsn(p_cdio, i); switch ( track_format ) { case TRACK_FORMAT_AUDIO: case TRACK_FORMAT_ERROR: break; case TRACK_FORMAT_CDI: case TRACK_FORMAT_XA: case TRACK_FORMAT_DATA: case TRACK_FORMAT_PSX: ; } start_track = (i == 1) ? 0 : lsn; /* save the start of the data area */ if (i == first_data) data_start = start_track; /* skip tracks which belong to the current walked session */ if (start_track < data_start + cdio_iso_analysis.isofs_size) continue; fs = cdio_guess_cd_type(p_cdio, start_track, i, &cdio_iso_analysis); print_analysis(cdio_iso_analysis, fs, first_data, num_audio, i_tracks, first_track_num, p_cdio); if ( !(CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660 || CDIO_FSTYPE(fs) == CDIO_FS_ISO_HFS || CDIO_FSTYPE(fs) == CDIO_FS_ISO_9660_INTERACTIVE) ) /* no method for non-ISO9660 multisessions */ break; } } cdio_destroy(p_cdio); return 0; } Example 4: use libiso9660 to extract a file from an ISO-9660 image Next a program to show using libiso9660 to extract a file from an ISO-9660 image. This can be found in the distribution as example/iso3.c. A more complete and expanded version of this is iso-read, part of this distribution. /* This is the ISO 9660 image. */ #define ISO9660_IMAGE_PATH "../" #define ISO9660_IMAGE ISO9660_IMAGE_PATH "test/copying.iso" #define LOCAL_FILENAME "copying" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <sys/types.h> #include <cdio/cdio.h> #include <cdio/iso9660.h> #include <stdio.h> #ifdef HAVE_ERRNO_H #include <errno.h> #endif #ifdef HAVE_STRING_H #include <string.h> #endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #define my_exit(rc) \ fclose (p_outfd); \ free(p_statbuf); \ iso9660_close(p_iso); \ return rc; \ int main(int argc, const char *argv[]) { iso9660_stat_t *p_statbuf; FILE *p_outfd; int i; iso9660_t *p_iso = iso9660_open (ISO9660_IMAGE); if (NULL == p_iso) { fprintf(stderr, "Sorry, couldn't open ISO 9660 image %s\n", ISO9660_IMAGE); return 1; } p_statbuf = iso9660_ifs_stat_translate (p_iso, LOCAL_FILENAME); if (NULL == p_statbuf) { fprintf(stderr, "Could not get ISO-9660 file information for file %s\n", LOCAL_FILENAME); iso9660_close(p_iso); return 2; } if (!(p_outfd = fopen (LOCAL_FILENAME, "wb"))) { perror ("fopen()"); free(p_statbuf); iso9660_close(p_iso); return 3; } /* Copy the blocks from the ISO-9660 filesystem to the local filesystem. */ for (i = 0; i < p_statbuf->size; i += ISO_BLOCKSIZE) { char buf[ISO_BLOCKSIZE]; memset (buf, 0, ISO_BLOCKSIZE); if ( ISO_BLOCKSIZE != iso9660_iso_seek_read (p_iso, buf, p_statbuf->lsn + (i / ISO_BLOCKSIZE), 1) ) { fprintf(stderr, "Error reading ISO 9660 file at lsn %lu\n", (long unsigned int) p_statbuf->lsn + (i / ISO_BLOCKSIZE)); my_exit(4); } fwrite (buf, ISO_BLOCKSIZE, 1, p_outfd); if (ferror (p_outfd)) { perror ("fwrite()"); my_exit(5); } } fflush (p_outfd); /* Make sure the file size has the exact same byte size. Without the truncate below, the file will a multiple of ISO_BLOCKSIZE. */ if (ftruncate (fileno (p_outfd), p_statbuf->size)) perror ("ftruncate()"); my_exit(0); } Example 5: list CD-Text and disc mode info Next a program to show using libcdio to list CD-TEXT data. This can be found in the distribution as example/cdtext.c. /* Simple program to list CD-Text info of a Compact Disc using libcdio. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> #include <sys/types.h> #include <cdio/cdio.h> #include <cdio/cdtext.h> static void print_cdtext_track_info(CdIo_t *p_cdio, track_t i_track, const char *message) { const cdtext_t *cdtext = cdio_get_cdtext(p_cdio, 0); if (NULL != cdtext) { cdtext_field_t i; printf("%s\n", message); for (i=0; i < MAX_CDTEXT_FIELDS; i++) { if (cdtext->field[i]) { printf("\t%s: %s\n", cdtext_field2str(i), cdtext->field[i]); } } } } static void print_disc_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) { track_t i_last_track = i_first_track+i_tracks; discmode_t cd_discmode = cdio_get_discmode(p_cdio); printf("%s\n", discmode2str[cd_discmode]); print_cdtext_track_info(p_cdio, 0, "\nCD-Text for Disc:"); for ( ; i_first_track < i_last_track; i_first_track++ ) { char psz_msg[50]; sprintf(msg, "CD-Text for Track %d:", i_first_track); print_cdtext_track_info(p_cdio, i_first_track, psz_msg); } } int main(int argc, const char *argv[]) { track_t i_first_track; track_t i_tracks; CdIo_t *p_cdio; cdio = cdio_open (NULL, DRIVER_UNKNOWN); i_first_track = cdio_get_first_track_num(p_cdio); i_tracks = cdio_get_num_tracks(p_cdio); if (NULL == p_cdio) { printf("Couldn't find CD\n"); return 1; } else { print_disc_info(p_cdio, i_tracks, i_first_track); } cdio_destroy(p_cdio); return 0; } Example 6: Using MMC to run an INQURY command Now a program to show issuing a simple MMC command (INQUIRY). This MMC command retrieves the vendor, model and firmware revision number of a CD drive. For this command to work, usually a CD to be loaded into the drive; odd since the CD itself is not used. This can be found in the distribution as example/mmc1.c. #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> #include <sys/types.h> #include <cdio/cdio.h> #include <cdio/scsi_mmc.h> #include <string.h> /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 int main(int argc, const char *argv[]) { CdIo_t *p_cdio; p_cdio = cdio_open (NULL, DRIVER_UNKNOWN); if (NULL == p_cdio) { printf("Couldn't find CD\n"); return 1; } else { int i_status; /* Result of MMC command */ char buf[36] = { 0, }; /* Place to hold returned data */ scsi_mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); i_status = scsi_mmc_run_cmd(p_cdio, DEFAULT_TIMEOUT_MS, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf); if (i_status == 0) { char psz_vendor[CDIO_MMC_HW_VENDOR_LEN+1]; char psz_model[CDIO_MMC_HW_MODEL_LEN+1]; char psz_rev[CDIO_MMC_HW_REVISION_LEN+1]; memcpy(psz_vendor, buf + 8, sizeof(psz_vendor)-1); psz_vendor[sizeof(psz_vendor)-1] = '\0'; memcpy(psz_model, buf + 8 + CDIO_MMC_HW_VENDOR_LEN, sizeof(psz_model)-1); psz_model[sizeof(psz_model)-1] = '\0'; memcpy(psz_rev, buf + 8 + CDIO_MMC_HW_VENDOR_LEN +CDIO_MMC_HW_MODEL_LEN, sizeof(psz_rev)-1); psz_rev[sizeof(psz_rev)-1] = '\0'; printf("Vendor: %s\nModel: %s\nRevision: %s\n", psz_vendor, psz_model, psz_rev); } else { printf("Couldn't get INQUIRY data (vendor, model, and revision\n"); } } cdio_destroy(p_cdio); return 0; } Example 7: Using the CD Paranoia library for CD-DA reading #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <cdio/cdda.h> #include <cdio/cd_types.h> #include <stdio.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> #endif int main(int argc, const char *argv[]) { cdrom_drive_t *d = NULL; /* Place to store handle given by cd-paranoia. */ char **ppsz_cd_drives; /* List of all drives with a loaded CDDA in it. */ /* See if we can find a device with a loaded CD-DA in it. */ ppsz_cd_drives = cdio_get_devices_with_cap(NULL, CDIO_FS_AUDIO, false); if (ppsz_cd_drives) { /* Found such a CD-ROM with a CD-DA loaded. Use the first drive in the list. */ d=cdio_cddap_identify(*ppsz_cd_drives, 1, NULL); } else { printf("Unable find or access a CD-ROM drive with an audio CD in it.\n"); exit(1); } /* Don't need a list of CD's with CD-DA's any more. */ cdio_free_device_list(ppsz_cd_drives); /* We'll set for verbose paranoia messages. */ cdio_cddap_verbose_set(d, CDDA_MESSAGE_PRINTIT, CDDA_MESSAGE_PRINTIT); if ( 0 != cdio_cddap_open(d) ) { printf("Unable to open disc.\n"); exit(1); } /* Okay now set up to read up to the first 300 frames of the first audio track of the Audio CD. */ { cdrom_paranoia_t *p = cdio_paranoia_init(d); lsn_t i_first_lsn = cdio_cddap_disc_firstsector(d); if ( -1 == i_first_lsn ) { printf("Trouble getting starting LSN\n"); } else { lsn_t i_cursor; track_t i_track = cdio_cddap_sector_gettrack(d, i_first_lsn); lsn_t i_last_lsn = cdio_cddap_track_lastsector(d, i_track); /* For demo purposes we'll read only 300 frames (about 4 seconds). We don't want this to take too long. On the other hand, I suppose it should be something close to a real test. */ if ( i_last_lsn - i_first_lsn > 300) i_last_lsn = i_first_lsn + 299; printf("Reading track %d from LSN %ld to LSN %ld\n", i_track, (long int) i_first_lsn, (long int) i_last_lsn); /* Set reading mode for full paranoia, but allow skipping sectors. */ paranoia_modeset(p, PARANOIA_MODE_FULL^PARANOIA_MODE_NEVERSKIP); paranoia_seek(p, i_first_lsn, SEEK_SET); for ( i_cursor = i_first_lsn; i_cursor <= i_last_lsn; i_cursor ++) { /* read a sector */ int16_t *p_readbuf=cdio_paranoia_read(p, NULL); char *psz_err=cdio_cddap_errors(d); char *psz_mes=cdio_cddap_messages(d); if (psz_mes || psz_err) printf("%s%s\n", psz_mes ? psz_mes: "", psz_err ? psz_err: ""); if (psz_err) free(psz_err); if (psz_mes) free(psz_mes); if( !p_readbuf ) { printf("paranoia read error. Stopping.\n"); break; } } } cdio_paranoia_free(p); } cdio_cdda_close(d); exit(0); } Those who are die-hard cdparanoia programmers will notice that the libcdio paranoia names are similar but a little bit different. In particular instead of paranoia_read we have above cdio_paranoia_read and instead of cdda_open we have cdio_cddap_open. This was done intentionally so that it is possible for the original paranoia program can co-exist both in source code and linked libraries and not conflict with libcdio's paranoia source and libraries. In general in place of any paranoia routine that begins paranoia_, use cdio_paranoia_ and in place of any paranoia routine that begins cdda_, use cdio_cddap_. But for a limited time libcdio will accept the old paranoia names which may be useful for legacy paranoia code. The way this magic works is by defining the old paranoia name to be the libcdio name. In the unusual case where you do want to use both the original paranoia and libcdio routines in a single source, the C preprocessor symbol DO_NOT_WANT_PARANOIA_COMPATIBILITY can be define'd and this disables the #define substitution done automatically. The may still be a problem with conflicting structure definitions like cdrom_drive_t. A list of all sample programs in the example directory The example directory contains some simple examples of the use of the libcdio library. A larger more-complicated example are the cd-drive, cd-info, cd-read, iso-info and iso-info programs in the src directory. Descriptions of the sample are as follows... cdchange.c A program to test if a CD has been changed since the last change test. cdtext.c A program to show CD-Text and CD disc mode info. drives.c A program to show drivers installed and what the default CD-ROM driveis and what CD drives are available. eject.c A program eject a CD from a CD-ROM drive and then close the door again. isolist.c A program to show using libiso9660 to list files in a directory of an ISO-9660 image. C++/isolist.cpp The same program as isolist.c written in C++. iso2.c A program to show using libiso9660 to extract a file from aCDRWIN cue/bin CD image. C++/iso2.cpp The same program as iso2.c written in C++. iso3.c A program to show using libiso9660 to extract a file from an ISO-9660image. C++/iso3.cpp The same program as iso3.c written in C++. isofuzzy.c A program showing fuzzy ISO-9660 detection/reading. mmc1.c A program to show issuing a simple MMC command (INQUIRY). C++/mmc1.cpp The same program as mmc1.c written in C++. mmc2.c A more involved MMC command to list CD and drive features from aSCSI-MMC GET_CONFIGURATION command. mmc2a.c Prints MMC MODE_SENSE page 2A paramaters.Page 2a are the CD/DVD Capabilities and Mechanical Status. C++/mmc2.cpp The same program as mmc2.c written in C++. paranoia.c A program to show using libcdio's version of the CD-DA paranoia. paranoia2.c A program to show using libcdio's version of the CD-DA paranoialibrary. But in this version, we'll open a cdio object before callingparanoia's open. I imagine in many cases such as media players thismay be what will be done since, one may want to get CDDB/CD-Text infobeforehand. tracks.c A simple program to list track numbers and logical sector numbers of aCompact Disc using libcdio. sample2.c A simple program to show drivers installed and what the default CD-ROMdrive is. sample3.c A simple program to show the use of cdio_guess_cd_type(). Figures outthe kind of CD image we've got. sample4.c A slightly improved sample3 program: we handle cdio logging and takean optional CD-location. udf1.c A program to show using libudf to list files in a directory of an UDFimage. udf2.c A program to show using libudf to extract a file from an UDF image. Diagnostic programs (‘cd-drive’, ‘cd-info’, ‘cd-read’, ‘iso-info’, ‘iso-read’) cd-drive’ ‘cd-drive’ lists out drive information, what features drive supports, and information about what hardware drivers are available. cd-info’ ‘cd-info’ will print out the structure of a CD medium which could either be a Compact Disc in a CD ROM or an CD image. It can try to analyze the medium to give characteristics of the medium, such as how many tracks are in the CD and the format of each track, whether a CD contains a Video CD, CD-DA, PhotoCD, whether a track has an ISO-9660 filesystem. cd-read’ ‘cd-info’ can be used to read blocks a CD medium which could either be a Compact Disc in a CD ROM or an CD image. You specify the beginning and ending LSN and what mode format to use in the reading. iso-info’ ‘iso-info’ can be used to print out the structure of an ISO 9660 image. iso-read’ ‘iso-read’ can be used to extract a file in an ISO-9660 image. CD-ROM Access and Drivers Multimedia Commands (MMC) In contrast to the rest of the sections in this chapter, MMC (Multimedia commands) is not a driver per se, although many of the CD-ROM drivers do in fact issue MMC commands. MMC commands gives (in theory) a broad and uniform way to access a CD-ROM drive. If your CD-ROM drive understands MMC commands this is probably gives the most flexibility in control. SCSI and ATAPI CD-ROM devices generally support a fairly large set of MMC commands. The name “SCSI MMC” is often found in the literature in specifications and on the Internet. The “SCSI” part is probably a little bit misleading because a drive can understand “SCSI MMC” commands but not use a SCSI interface—ATAPI CD-ROMs are one such broad class of examples. In fact there are drivers to “encapsulate” non-SCSI drives or a non-MMC-compliant drives and make them act like MMC drives. I believe that many OS SCSI “pass-through” mechanisms do roughly the same thing. The name “SCSI MMC” is no doubt due to the fact that these commands grew out of the SCSI command set and thus were bundled in them. For clarity and precision we will use the term “MMC” rather than “SCSI MMC”. One of the problems with MMC is that there are so many different “standards”. In particular there are MMC ftp://ftp.t10.org/t10/drafts/mmc/, MMC 2 ftp://ftp.t10.org/t10/drafts/mmc2/, MMC 3 ftp://ftp.t10.org/t10/drafts/mmc3/, MMC 4 ftp://ftp.t10.org/t10/drafts/mmc4/, and MMC 5 ftp://ftp.t10.org/t10/drafts/mmc5/ standards several “drafts” for each standard. The good news about ATAPI drives is that they too understand some sort of MMC subset. The bad news (as I understand it) is that they do not understand any full MMC command set. Another problem with the MMC commands related to the variations in standards is the variation in the commands themselves and there are perhaps two or three ways to do many of the basic commands like read a CD frame. There seems to be a fascination with the number of bytes a command takes in the MMC-specification world. (Size matters?) So often the name of an operation will have a suffix with the number of bytes of the command (actually in MMC jargon this is called a “CDB” CDB (Command Descriptor Block) or command descriptor block). So for example there is a 6-byte “MODE SELECT” often called “MODE SELECT 6” and a 10-byte “MODE SELECT” often called “MODE SELECT 10”. Presumably the 6-byte command came first and it was discovered that there was some deficiency causing the longer command. In libcdio where there are two formats we add the suffix in the name, e.g. CDIO_MMC_GPCMD_MODE_SELECT_6 or CDIO_MMC_GPCMD_MODE_SELECT_10. If the fascination and emphasis in the MMC specifications of CDB size is a bit odd, equally so is the fact that this too often has bled through at the OS programming API. However in libcdio, you just give the opcode in scsi_mmc_run_cmd() and we'll do the work to figure out how many bytes of the CDB are used. Down the line it is hoped that libcdio will have a way to remove a distinction between the various alternative and alternative-size MMC commands. In cdio/scsi-mmc.h you will find a little bit of this for example via the routine scsi_mmc_get_drive_cap(). However much more work is needed. GNU/Linux The GNU/Linux uses a hybrid of methods. Somethings are done vai ioctl and some things via MMC. GNU/Linux has a rather nice and complete ioctl mechanism. On the other hand, the MMC mechanism is more universal. There are other “access modes” listed which are not really access modes and should probably be redone/rethought. They are just different ways to run the read command. But for completeness These are “READ_CD” and “READ_10”. Microsoft Windows ioctl and ASPI There are two CD drive access methods on Microsoft Windows platforms: ioctl and ASPI. The ASPI interface specification was developed by Adaptec for sending commands to a SCSI host adapter (such as those controlling CD and DVD drives) and used on Window 9x/NT and later. Emulation for ATAPI drives was added so that the same sets of commands worked those even though the drives might not be SCSI nor might there even be a SCSI controller attached. However in Windows NT/2K/XP, Microsoft provides their Win32 ioctl interface, and has taken steps to make using ASPI more inaccessible (e.g. requiring administrative access to use ASPI). Solaris ATAPI and SCSI There is currently only one CD drive access methods in Solaris: SCSI (called “USCSI” or “user SCSI” in Solaris). There used to be an ATAPI method and it could be resurrected if needed. USCSI was preferred since on newer releases of Solaris and Solaris environments one would needs to have root access for ATAPI. FreeBSD ioctl and CAM There are two CD drive access methods on Solaris: ioctl and CAM (common access method). CAM is preferred when possible, especially on newer releases. However CAM is right now sort of a hybrid and includes some ioctl code. More work on this driver is needed. Volunteers? OS X (non-exclussive access) A problem with OS/X is that if the OS thinks it understands the drive it gains exclusive access to it and thus prevents a library like this to get non-exclusive access. Currently libcdio access the CD-ROM non-exclusively. However in order to be able to issue MMC, the current belief is that exclusive access is needed. Probably in a future libcdio, there will be some way to specify which kind of access is desired (with the inherent consequences of each). More work on this driver is needed. Volunteers? Internal Program Organization file organization Here is a list of libcdio directories. include/cdioThis contains the headers that are public. One that will probably beused quite a bit is <cdio/cdio.h>. libCode for installed libraries. See below for further breakout lib/driverCode for various OS-specific CD-ROM drivers, image drivers, andcommon MMC routines.This code comprises libcdio.a (or the shared version of it). lib/iso9660Code for to extract or query ISO-9660 images.This code comprises libiso9660.a (or the shared version of it). lib/paranoiaThis is from cdparanoia. It is the OS- and hardware- dependent code todetect and correct jitter for CD-DA CDs. lib/cdda_interfaceThis is also from cdparanoia. It is the OS- and hardware- independentcode to detect and correct jitter for CD-DA CDs. docA home for fine documentation such as this masterpiece. exampleHere you will find various small example programs usinglibcdio which are largely for pedagogical purposes. You mightbe able to find one that is similar to what you want to do that couldbe extended. In fact some these are contain the kernel ideas behind ofsome of the larger programs in src. srcVarious stand-alone utility programs. See below. src/paranoialibcdio's version of cdparanoia. Except for the factthat the back-end CD-reading code has been replaced bylibcdio's routines the code is pretty much identical. testRegression tests libcdiolibcdio exports one opaque type CdIo_t. Internally this a structure containing an enumeration for the driver, a structure containing function pointers and a generic “environment” pointer which is passed as a parameter on a function call. See lib/driver/cdio_private.h. The initialization routine for each driver sets up the function pointers and allocates memory for the environment. When a particular user-level cdio routine is called (e.g cdio_get_first_track_num for lib/driver/track.c), the environment pointer is passed to a device-specific routine which will then cast this pointer into something of the appropriate type. Because function pointers are used, there can be and is quite a bit of sharing of common routines. Some of the common routines are found in the file lib/driver/_cdio_generic.c. Another set of routines that one is likely to find shared amongst drivers are the MMC commands. These are located in lib/driver/scsi_mmc.c. There is not only an attempt to share functions but we've tried to create a generic CD structure generic_img_private_t of file lib/driver/generic.h. By putting information into a common structure, we increase the likelihood of being able to have a common routine to perform some sort of function. The generic CD structure would also be useful in a utility to convert one CD-image format to another. Basically the first image format is “parsed” into the common internal format and then from this structure it is unparsed. libiso9660’ To be completed.... Coding Conventions In libcdio there are a number of conventions used. If you understand some of these conventions it may facilitate understanding the code a little. namespace names For the most part, the visible external libcdio names follow conventions so as not to be confused with other applications or libraries. If you understand these conventions, there will be little or no chance that the names you use will conflict with libcdio and libiso9660 and vice versa. All of the external libcdio C routines start out with cdio_, e.g. cdio_open; as a corollary, the libcdio CD-Paranoia routines start cdio_cddap_, e.g. cdio_cddap_open. libiso9660 routines start iso9660_, e.g. iso9660_open. libcdio C-Preprocessor names generally start CDIO_, for example CDIO_CD_FRAMESIZE_RAW; libiso9660 C-preprocessor names start ISO9660_, e.g. ISO9660_FRAMESIZE. suffixes (type and structure names) A few suffixes are used in type and structure names: _eAn enumeration tag. Generally though the same name will appear with the_t suffix and probably that should be used instead. _sA structure tag. Generally though the same name will appear with the_t suffix and probably that should be used instead. _tA type suffix. prefixes (variable names) A number of prefixes are used in variable names here's what they mean i_An integer type of some sort. A variable of this ilk one might findbeing iterated over in for loops or used as the index of anarray for example. b_A boolean type of some sort. A variable of this ilk one might findbeing in an if condition for example. p_A pointer of some sort. A variable of this ilk, sayp_foo one is like likely to see *p_foo orp_foo->.... pp_A pointer to a pointer of some sort. A variable of this ilk, saypp_foo one is like likely to see **p_foo orp_foo[x][y] for example psz_A char * pointer of some sort. A variable of this ilk, saypsz_foo may be used in a string operation. For exampleprintf(%s\n", psz_foo) or strdup(psz_foo). ppsz_A pointer to a char * pointer of some sort. A variable of thisilk, say ppsz_foo is used for example to return a list ofCD-ROM device names There are a some other naming conventions. Generally if a routine name starts cdio_, e.g. cdio_open, then it is an externally visible routine in libcdio. If a name starts iso9660_, e.g. iso9660_is_dchar then it is an externally visible routine in libiso9660. If a name starts scsi_mmc_, e.g. scsi_mmc_get_discmode, then it is an externally visible MMC routine. (We don't have a separate library for this yet. Names using entirely capital letters and that start CDIO_ are externally visible #defines. ISO-9660 Character Sets For a description of where are used see See . ISO646 d-Characters | 0 1 2 3 4 5 6 7 --+----------------- 0 | 0 P 1 | 1 A Q 2 | 2 B R 3 | 3 C S 4 | 4 D T 5 | 5 E U 6 | 6 F V 7 | 7 G W 8 | 8 H X 9 | 9 I Y a | J Z b | K c | L d | M e | N f | O _ ISO646 a-Characters | 0 1 2 3 4 5 6 7 --+----------------- 0 | 0 P 1 | ! 1 A Q 2 | " 2 B R 3 | 3 C S 4 | 4 D T 5 | % 5 E U 6 | & 6 F V 7 | ' 7 G W 8 | ( 8 H X 9 | ) 9 I Y a | * : J Z b | + ; K c | , < L d | - = M e | . > N f | / ? O _ Glossary See also http://www.dvdrhelp.com/glossary. ASPI ASPISee Win32 ASPI ATA Advanced Technology Attachment (ATA). The same things as IDE. ATAPI Advanced Technology Attachment (ATA) Packet Interface. The interfaceprovides a mechanism for transferring and executing SCSI CDBs on IDECD Drives and DVD Drives.IDE (also called ATA) was originally designed for hard drives only,but with help of ATAPI it is possible to connect other devices, inparticular CD-ROMS to the IDE/EIDE connections.The ATAPI CD-ROM drives understand a subset of MMC commands. Inparticular multi-initiator commands are neither needed nor deviced forATAPI devices. BIN/CUE A CD-image format developed by Jeff Arnold for CDRWIN software onMicrosoft Windows. Many other programs subsequently support using thisformat. The .CUE file is a text file which contains CD formatand track layout information, while the .BIN file holds theactual data of each track. CD Compact Disc CD-DA CD-DACompact Disc Digital Audio, described in the “Red Book” or ICE908. This commonly referred to as an audio CD and what mostpeople think of when you play a CD as it was the first touse the CD medium. CD+G CD+GCompact Disc + Graphics. An extension of the CD audio format containsa limited amount of graphics in subcode channels. This disc works inall audio players but the graphics portion is only available in aspecial CD+G or Karaoke player. CD-i CD-iCompact Disc Interactive. An extension of the CD format designedaround a set-top computer that connects to a TV to provide interactivehome entertainment, including digital audio and video, video games,and software applications. Defined by the “Green Book” standard.http://www.icdia.org/. CD-i for video and video music haslargely (if not totally) been superceded by VCDs. CD-i Bridge CD-i BridgeA standard allowing CD-ROM XA discs to play on CD-i. Kodak PhotoCDsare CD-XA Bridge discs. CD-ROM CD-ROMCompact Disc Read Only Memory or “Yellow Book” describe in StandardsISO/IEC 10149. The data stored on it can be either in the form ofaudio, computer or video files. CD-ROM Mode 1 and Mode2 The Yellow Book specifies two types of tracks, Mode 1 and Mode 2. Mode1 is used for computer data and text and has an extra error correctionlayer. Mode 2 is for audio and video data and has no extra correctionlayer. CD-ROM/XA An expansion of the CD-ROM Mode 2 format that allowsboth computer and audio/video to be mixed in the same track. CD Text CD TextCD Text is a technology developed by Sony Corporation and PhilipsElectronics in 1996 that allows storing in an audio CD and its tracksinformation such as artist name, title, songwriter, composer, orarranger. Commercially available audio CDs sometimes contain CD Textinformation. CD XA CD XACD-ROM EXtended Architecture. A modification to the CD-ROMspecification that defines two new types of sectors. CD-ROM XA wasdeveloped jointly by Sony, Philips, and Microsoft, and announced inAugust 1988. Its specifications were published in an extension to theYellow Book. CD-i, Photo CD, Video CD and CD-EXTRA have allsubsequently been based on CD-ROM XA.CD-XA defines another way of formatting sectors on a CD-ROM, includingheaders in the sectors that describe the type (audio, video, data) andsome additional info (markers, resolution in case of a video or audiosector, file numbers, etc).The data written on a CD-XA is consistent with and can be in ISO-9660file system format and therefore be readable by ISO-9660 file systemtranslators. But also a CD-I player can also read CD-XA discs even ifits own `Green Book' file system only resembles ISO 9660 and isn'tfully compatible. Command Packet Command PacketThe data structure that is used to issue an ATAPI command. The samething as a SCSI Command Descriptor Block (CDB). FSF FSFFree Software Foundation, http://www.fsf.org/ GNU GNUGNU is not UNIX, http://www.gnu.org/ IDE Integrated Drive Electronics. This is a commonly used interface forhard disk drives and CD-ROM drives. It is less expensive than SCSI,but offers slightly less in terms of performance. ISO ISOInternational Standards Organization. ISO 9660 ISO 9660The ISO 9660 is an operating-system independent filesystem format forCD-ROM media and DVD-ROMs. It was standardized in 1988 and replaced theHigh Sierra standard for the logical format on CD-ROM media (ISO 9660and High Sierra are identical in content, but the exact format isdifferent).There are several specification levels. In Level 1, file names must bein the 8.3 format (no more than eight characters in the name, no morethan three characters in the suffix) and in capital letters. Directorynames can be no longer than eight characters. There can be no morethan eight nested directory levels. Level 2 and 3 specifications allowfile names up to 32 characters long.ECMA-119(http://www.ecma-international.org/publications/standards/Ecma-119.htmis the European specification which is identical to ISO 9660.ISO 13490 is basically ISO 9660 with multisession support. Joliet extensions Joliet extensionsThis ISO-9660 upward-compatible standard was developed for Windows 95and Windows NT by Microsoft as an extension of ISO 9600 which allowsthe use of Unicode characters and supports file names up to 64characters.See http://bmrc.berkeley.edu/people/chaffee/jolspec.html forthe Joliet Specification.The name Joliet comes from the city in Illinois (U.S) that thestandard was defined. LBA LBALogical Block Addressing. Mapped integer numbers from CD Red BookAddressing MSF. The starting sector is -150 and ending sector is449849, which correlates directly to MSF: 00:00:00 to 99:59:74.Because an LBA is a single number it is often easier to work with inprogramming than an MSF. Lead in lead inThe area of a CD where the Table Of Contents (TOC) and CD Text arestored. I think it is supposed to be around 4500 (1 min) or moresectors in length. On a CDR(W) the lead-in length is variable,because each manufacturer will have a different starting positionindicated by the ATIP start of lead-in position that is recorded inthe ATIP groove on the disk. LSN LSNLogical Sector Number. Mapped integer numbers from CD Red BookAddressing MSF. The starting sector is 0 and ending sector is 449699,which correlates to MSF: 00:00:00 to 99:59:74. Because an LSN is asingle number it is often easier to work with in programming than anMSF. Because it starts at 0 rather than -150 as is the case of an LBAit can be represented as an unsigned value. MCN MCNMedia Catalog Number. A identification number on an audio CD. Alsocalled a UPC. Another identification number is ISRC. MMC MMC (Multimedia Commands)MMC (Multimedia Commands). A SCSI programming specification made bythe SCSI committee T10 organization http://www.t10.org/. MMCare raw commands for communicating with CDROM drives, CD-Rewriters,DVD-Rewriters, etc.Many manufacturers have adopted this standard and it also applies toATAPI versions of their drives. Mixed Mode CD Mixed Mode CDA Mixed Mode is a CD that contains tracks of differing CD-ROM Modeformats. In particular the first track may contain both computer data(Yellow Book) CD ROM data while the remaining tracks are audio orvideo data. Video CD's can be Mixed Mode CDs. Multisession MultisessionA way of writing to a CD that allows more data to beadded to readable discs at a later time. Nero NRG format file Nero NRG, CD-Image formatA proprietary CD image file format use by a popular program forMicrosoft Windows, Ahead Nero. The specification of this format isnot to our knowlege published. Rock Ridge Extensions Rock Ridge extensionsAn extension to the ISO-9660 standard which adds POSIX information to files. SCSI SCSISmall Computer System Interface. A set of ANSI standard electronicinterfaces (originally developed at Apple Computer) that allowpersonal computers to communicate with peripheral hardware such asCD-ROM drives, disk drives, printers, etc. SCSI CDB SCSI CDBSCSI Command Descriptor Block. The data structure that is used toissue a SCSI command. SCSI Pass Through Interface. SCSI Pass Through Interface.Yet another way of issuing MMC commands for accessing a CD-ROM. Aswith MMC or ASPI, the CD-ROM doesn't necessarily have to be aSCSI-attached drive. See also MMC and ASPI. Session A fully readable complete recording that contains one or more tracksof computer data or audio on a CD. SVCD Super VCD (SVCD)Super VCDAn improvement of Video CD 2.0 specification which includes mostnotably a switch from MPEG-1 (constant bit rate encoding) toMPEG-2 (variable bit rate encoding) for the video stream.Also added was higher video-stream resolution, up to 4 overlaygraphics and text (OGT) sub-channels for user switchablesubtitle displaying, closed caption text, and command lists forcontrolling the SVCD virtual machine.See http://www.dvdrhelp.com/svcd TOC TOC (CD Table of Contents)(Compact Disc) Table of Contents. The TOC contains the starting tracknumber, last track number individual track starting time, and sometrack flags (copy protection, linear audio preemphasis, track format:CDDA or data). Every CD must have at least 1 TOC, the first TOC isalways recorded at the start of the CD (lead-in area). Amulti-session CD may have several TOCs. Track trackA unit of data of a CD. The size of a track can vary; it can occupythe entire contents of the CD. Most CD standards however require thattracks have a 150 frame (or “2 second”) lead-in gap. VCD Video CD (VCD)The Video Compact Disc (Video CD or VCD) is a standardizeddigital video storage format. It is based on the commonly availableCompact Disc technology, which allows for low-cost video authoring.Video CD's can be played in most DVD standalone player,dedicated VCD players and finally, modern Personal Computers withmultimedia support.A Video CD is made up of CD-ROM XA sectors,i.e. CD-ROM mode 2 form 1 & 2 sectors. Non-MPEG datais stored in mode 2 form 1 sectors with a user data area of 2048 byte,which have a similiar L2 error correction and detection(ECC/EDC) to CD-ROM mode 1 sectors. Whilerealtime MPEG streams is stored in CD-ROM mode 2form 2 sectors, which by have no L2 ECC, yield a ~14% greateruser data area consisting of 2324 bytes actually raw mode 2sectors have a 2336 byte user data area, but parts of it are used forerror codes and headers when using the mode 2 form 1 or form 2configurations. http://www.dvdrhelp.com/vcd Win32 ASPI ASPIThe ASPI interface specification was developed by Adaptec forsending commands to a SCSI host adapter (such as those controlling CDand DVD drives) and used on Window 9x/NT and later. Emulation forATAPI drives was added so that the same sets of commands worked thoseeven though the drives might not be SCSI nor might there even be aSCSI controller attached.However in Windows NT/2K/XP, Microsoft provides their Win32 ioctlinterface, and has take steps to make using ASPI more inaccessible(e.g. requiring adminstrative access to use ASPI).See also MMC Win32 ioctl driver Ioctl (Input Output ConTroLs). A Win32 function, implemented in allMicrosoft Windows. It is used for sending commands to devices usingdefined codes and structures. XA XASee CD-ROM XA GNU General Public License GPL, GNU General Public License
Version 2, June 1991
Copyright © 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software—to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. This License applies to any program or other work which containsa notice placed by the copyright holder saying it may be distributedunder the terms of this General Public License. The “Program”, below,refers to any such program or work, and a “work based on the Program”means either the Program or any derivative work under copyright law:that is to say, a work containing the Program or a portion of it,either verbatim or with modifications and/or translated into anotherlanguage. (Hereinafter, translation is included without limitation inthe term “modification”.) Each licensee is addressed as “you”.Activities other than copying, distribution and modification are notcovered by this License; they are outside its scope. The act ofrunning the Program is not restricted, and the output from the Programis covered only if its contents constitute a work based on theProgram (independent of having been made by running the Program).Whether that is true depends on what the Program does. You may copy and distribute verbatim copies of the Program'ssource code as you receive it, in any medium, provided that youconspicuously and appropriately publish on each copy an appropriatecopyright notice and disclaimer of warranty; keep intact all thenotices that refer to this License and to the absence of any warranty;and give any other recipients of the Program a copy of this Licensealong with the Program.You may charge a fee for the physical act of transferring a copy, andyou may at your option offer warranty protection in exchange for a fee. You may modify your copy or copies of the Program or any portionof it, thus forming a work based on the Program, and copy anddistribute such modifications or work under the terms of Section 1above, provided that you also meet all of these conditions: You must cause the modified files to carry prominent noticesstating that you changed the files and the date of any change. You must cause any work that you distribute or publish, that inwhole or in part contains or is derived from the Program or anypart thereof, to be licensed as a whole at no charge to all thirdparties under the terms of this License. If the modified program normally reads commands interactivelywhen run, you must cause it, when started running for suchinteractive use in the most ordinary way, to print or display anannouncement including an appropriate copyright notice and anotice that there is no warranty (or else, saying that you providea warranty) and that users may redistribute the program underthese conditions, and telling the user how to view a copy of thisLicense. (Exception: if the Program itself is interactive butdoes not normally print such an announcement, your work based onthe Program is not required to print an announcement.) These requirements apply to the modified work as a whole. Ifidentifiable sections of that work are not derived from the Program,and can be reasonably considered independent and separate works inthemselves, then this License, and its terms, do not apply to thosesections when you distribute them as separate works. But when youdistribute the same sections as part of a whole which is a work basedon the Program, the distribution of the whole must be on the terms ofthis License, whose permissions for other licensees extend to theentire whole, and thus to each and every part regardless of who wrote it.Thus, it is not the intent of this section to claim rights or contestyour rights to work written entirely by you; rather, the intent is toexercise the right to control the distribution of derivative orcollective works based on the Program.In addition, mere aggregation of another work not based on the Programwith the Program (or with a work based on the Program) on a volume ofa storage or distribution medium does not bring the other work underthe scope of this License. You may copy and distribute the Program (or a work based on it,under Section 2) in object code or executable form under the terms ofSections 1 and 2 above provided that you also do one of the following: Accompany it with the complete corresponding machine-readablesource code, which must be distributed under the terms of Sections1 and 2 above on a medium customarily used for software interchange; or, Accompany it with a written offer, valid for at least threeyears, to give any third party, for a charge no more than yourcost of physically performing source distribution, a completemachine-readable copy of the corresponding source code, to bedistributed under the terms of Sections 1 and 2 above on a mediumcustomarily used for software interchange; or, Accompany it with the information you received as to the offerto distribute corresponding source code. (This alternative isallowed only for noncommercial distribution and only if youreceived the program in object code or executable form with suchan offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work formaking modifications to it. For an executable work, complete sourcecode means all the source code for all modules it contains, plus anyassociated interface definition files, plus the scripts used tocontrol compilation and installation of the executable. However, as aspecial exception, the source code distributed need not includeanything that is normally distributed (in either source or binaryform) with the major components (compiler, kernel, and so on) of theoperating system on which the executable runs, unless that componentitself accompanies the executable.If distribution of executable or object code is made by offeringaccess to copy from a designated place, then offering equivalentaccess to copy the source code from the same place counts asdistribution of the source code, even though third parties are notcompelled to copy the source along with the object code. You may not copy, modify, sublicense, or distribute the Programexcept as expressly provided under this License. Any attemptotherwise to copy, modify, sublicense or distribute the Program isvoid, and will automatically terminate your rights under this License.However, parties who have received copies, or rights, from you underthis License will not have their licenses terminated so long as suchparties remain in full compliance. You are not required to accept this License, since you have notsigned it. However, nothing else grants you permission to modify ordistribute the Program or its derivative works. These actions areprohibited by law if you do not accept this License. Therefore, bymodifying or distributing the Program (or any work based on theProgram), you indicate your acceptance of this License to do so, andall its terms and conditions for copying, distributing or modifyingthe Program or works based on it. Each time you redistribute the Program (or any work based on theProgram), the recipient automatically receives a license from theoriginal licensor to copy, distribute or modify the Program subject tothese terms and conditions. You may not impose any furtherrestrictions on the recipients' exercise of the rights granted herein.You are not responsible for enforcing compliance by third parties tothis License. If, as a consequence of a court judgment or allegation of patentinfringement or for any other reason (not limited to patent issues),conditions are imposed on you (whether by court order, agreement orotherwise) that contradict the conditions of this License, they do notexcuse you from the conditions of this License. If you cannotdistribute so as to satisfy simultaneously your obligations under thisLicense and any other pertinent obligations, then as a consequence youmay not distribute the Program at all. For example, if a patentlicense would not permit royalty-free redistribution of the Program byall those who receive copies directly or indirectly through you, thenthe only way you could satisfy both it and this License would be torefrain entirely from distribution of the Program.If any portion of this section is held invalid or unenforceable underany particular circumstance, the balance of the section is intended toapply and the section as a whole is intended to apply in othercircumstances.It is not the purpose of this section to induce you to infringe anypatents or other property right claims or to contest validity of anysuch claims; this section has the sole purpose of protecting theintegrity of the free software distribution system, which isimplemented by public license practices. Many people have madegenerous contributions to the wide range of software distributedthrough that system in reliance on consistent application of thatsystem; it is up to the author/donor to decide if he or she is willingto distribute software through any other system and a licensee cannotimpose that choice.This section is intended to make thoroughly clear what is believed tobe a consequence of the rest of this License. If the distribution and/or use of the Program is restricted incertain countries either by patents or by copyrighted interfaces, theoriginal copyright holder who places the Program under this Licensemay add an explicit geographical distribution limitation excludingthose countries, so that distribution is permitted only in or amongcountries not thus excluded. In such case, this License incorporatesthe limitation as if written in the body of this License. The Free Software Foundation may publish revised and/or new versionsof the General Public License from time to time. Such new versions willbe similar in spirit to the present version, but may differ in detail toaddress new problems or concerns.Each version is given a distinguishing version number. If the Programspecifies a version number of this License which applies to it and “anylater version”, you have the option of following the terms and conditionseither of that version or of any later version published by the FreeSoftware Foundation. If the Program does not specify a version number ofthis License, you may choose any version ever published by the Free SoftwareFoundation. If you wish to incorporate parts of the Program into other freeprograms whose distribution conditions are different, write to the authorto ask for permission. For software which is copyrighted by the FreeSoftware Foundation, write to the Free Software Foundation; we sometimesmake exceptions for this. Our decision will be guided by the two goalsof preserving the free status of all derivatives of our free software andof promoting the sharing and reuse of software generally. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTYFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHENOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIESPROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSEDOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK ASTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THEPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,REPAIR OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITINGWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/ORREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISINGOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITEDTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BYYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHERPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGES. Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. one line to give the program's name and a brief idea of what it does. Copyright (C) yyyy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than ‘show w’ and ‘show c’; they could even be mouse-clicks or menu items—whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer” for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
GNU Free Documentation License FDL, GNU Free Documentation License
Version 1.1, March 2000
Copyright © 2000 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. PREAMBLEThe purpose of this License is to make a manual, textbook, or otherwritten document free in the sense of freedom: to assure everyonethe effective freedom to copy and redistribute it, with or withoutmodifying it, either commercially or noncommercially. Secondarily,this License preserves for the author and publisher a way to getcredit for their work, while not being considered responsible formodifications made by others.This License is a kind of “copyleft”, which means that derivativeworks of the document must themselves be free in the same sense. Itcomplements the GNU General Public License, which is a copyleftlicense designed for free software.We have designed this License in order to use it for manuals for freesoftware, because free software needs free documentation: a freeprogram should come with manuals providing the same freedoms that thesoftware does. But this License is not limited to software manuals;it can be used for any textual work, regardless of subject matter orwhether it is published as a printed book. We recommend this Licenseprincipally for works whose purpose is instruction or reference. APPLICABILITY AND DEFINITIONSThis License applies to any manual or other work that contains anotice placed by the copyright holder saying it can be distributedunder the terms of this License. The “Document”, below, refers to anysuch manual or work. Any member of the public is a licensee, and isaddressed as “you”.A “Modified Version” of the Document means any work containing theDocument or a portion of it, either copied verbatim, or withmodifications and/or translated into another language.A “Secondary Section” is a named appendix or a front-matter section ofthe Document that deals exclusively with the relationship of thepublishers or authors of the Document to the Document's overall subject(or to related matters) and contains nothing that could fall directlywithin that overall subject. (For example, if the Document is in part atextbook of mathematics, a Secondary Section may not explain anymathematics.) The relationship could be a matter of historicalconnection with the subject or with related matters, or of legal,commercial, philosophical, ethical or political position regardingthem.The “Invariant Sections” are certain Secondary Sections whose titlesare designated, as being those of Invariant Sections, in the noticethat says that the Document is released under this License.The “Cover Texts” are certain short passages of text that are listed,as Front-Cover Texts or Back-Cover Texts, in the notice that says thatthe Document is released under this License.A “Transparent” copy of the Document means a machine-readable copy,represented in a format whose specification is available to thegeneral public, whose contents can be viewed and edited directly andstraightforwardly with generic text editors or (for images composed ofpixels) generic paint programs or (for drawings) some widely availabledrawing editor, and that is suitable for input to text formatters orfor automatic translation to a variety of formats suitable for inputto text formatters. A copy made in an otherwise Transparent fileformat whose markup has been designed to thwart or discouragesubsequent modification by readers is not Transparent. A copy that isnot “Transparent” is called “Opaque”.Examples of suitable formats for Transparent copies include plainascii without markup, Texinfo input format, La&tex; input format,SGML or XML using a publicly availableDTD, and standard-conforming simple HTML designedfor human modification. Opaque formats include PostScript,PDF, proprietary formats that can be read and edited only byproprietary word processors, SGML or XML for whichthe DTD and/or processing tools are not generally available,and the machine-generated HTML produced by some wordprocessors for output purposes only.The “Title Page” means, for a printed book, the title page itself,plus such following pages as are needed to hold, legibly, the materialthis License requires to appear in the title page. For works informats which do not have any title page as such, “Title Page” meansthe text near the most prominent appearance of the work's title,preceding the beginning of the body of the text. VERBATIM COPYINGYou may copy and distribute the Document in any medium, eithercommercially or noncommercially, provided that this License, thecopyright notices, and the license notice saying this License appliesto the Document are reproduced in all copies, and that you add no otherconditions whatsoever to those of this License. You may not usetechnical measures to obstruct or control the reading or furthercopying of the copies you make or distribute. However, you may acceptcompensation in exchange for copies. If you distribute a large enoughnumber of copies you must also follow the conditions in section 3.You may also lend copies, under the same conditions stated above, andyou may publicly display copies. COPYING IN QUANTITYIf you publish printed copies of the Document numbering more than 100,and the Document's license notice requires Cover Texts, you must enclosethe copies in covers that carry, clearly and legibly, all these CoverTexts: Front-Cover Texts on the front cover, and Back-Cover Texts onthe back cover. Both covers must also clearly and legibly identifyyou as the publisher of these copies. The front cover must presentthe full title with all words of the title equally prominent andvisible. You may add other material on the covers in addition.Copying with changes limited to the covers, as long as they preservethe title of the Document and satisfy these conditions, can be treatedas verbatim copying in other respects.If the required texts for either cover are too voluminous to fitlegibly, you should put the first ones listed (as many as fitreasonably) on the actual cover, and continue the rest onto adjacentpages.If you publish or distribute Opaque copies of the Document numberingmore than 100, you must either include a machine-readable Transparentcopy along with each Opaque copy, or state in or with each Opaque copya publicly-accessible computer-network location containing a completeTransparent copy of the Document, free of added material, which thegeneral network-using public has access to download anonymously at nocharge using public-standard network protocols. If you use the latteroption, you must take reasonably prudent steps, when you begindistribution of Opaque copies in quantity, to ensure that thisTransparent copy will remain thus accessible at the stated locationuntil at least one year after the last time you distribute an Opaquecopy (directly or through your agents or retailers) of that edition tothe public.It is requested, but not required, that you contact the authors of theDocument well before redistributing any large number of copies, to givethem a chance to provide you with an updated version of the Document. MODIFICATIONSYou may copy and distribute a Modified Version of the Document underthe conditions of sections 2 and 3 above, provided that you releasethe Modified Version under precisely this License, with the ModifiedVersion filling the role of the Document, thus licensing distributionand modification of the Modified Version to whoever possesses a copyof it. In addition, you must do these things in the Modified Version: Use in the Title Page (and on the covers, if any) a title distinctfrom that of the Document, and from those of previous versions(which should, if there were any, be listed in the History sectionof the Document). You may use the same title as a previous versionif the original publisher of that version gives permission. List on the Title Page, as authors, one or more persons or entitiesresponsible for authorship of the modifications in the ModifiedVersion, together with at least five of the principal authors of theDocument (all of its principal authors, if it has less than five). State on the Title page the name of the publisher of theModified Version, as the publisher. Preserve all the copyright notices of the Document. Add an appropriate copyright notice for your modificationsadjacent to the other copyright notices. Include, immediately after the copyright notices, a license noticegiving the public permission to use the Modified Version under theterms of this License, in the form shown in the Addendum below. Preserve in that license notice the full lists of Invariant Sectionsand required Cover Texts given in the Document's license notice. Include an unaltered copy of this License. Preserve the section entitled “History”, and its title, and add toit an item stating at least the title, year, new authors, andpublisher of the Modified Version as given on the Title Page. Ifthere is no section entitled “History” in the Document, create onestating the title, year, authors, and publisher of the Document asgiven on its Title Page, then add an item describing the ModifiedVersion as stated in the previous sentence. Preserve the network location, if any, given in the Document forpublic access to a Transparent copy of the Document, and likewisethe network locations given in the Document for previous versionsit was based on. These may be placed in the “History” section.You may omit a network location for a work that was published atleast four years before the Document itself, or if the originalpublisher of the version it refers to gives permission. In any section entitled “Acknowledgments” or “Dedications”,preserve the section's title, and preserve in the section all thesubstance and tone of each of the contributor acknowledgmentsand/or dedications given therein. Preserve all the Invariant Sections of the Document,unaltered in their text and in their titles. Section numbersor the equivalent are not considered part of the section titles. Delete any section entitled “Endorsements”. Such a sectionmay not be included in the Modified Version. Do not retitle any existing section as “Endorsements”or to conflict in title with any Invariant Section. If the Modified Version includes new front-matter sections orappendices that qualify as Secondary Sections and contain no materialcopied from the Document, you may at your option designate some or allof these sections as invariant. To do this, add their titles to thelist of Invariant Sections in the Modified Version's license notice.These titles must be distinct from any other section titles.You may add a section entitled “Endorsements”, provided it containsnothing but endorsements of your Modified Version by variousparties—for example, statements of peer review or that the text hasbeen approved by an organization as the authoritative definition of astandard.You may add a passage of up to five words as a Front-Cover Text, and apassage of up to 25 words as a Back-Cover Text, to the end of the listof Cover Texts in the Modified Version. Only one passage ofFront-Cover Text and one of Back-Cover Text may be added by (orthrough arrangements made by) any one entity. If the Document alreadyincludes a cover text for the same cover, previously added by you orby arrangement made by the same entity you are acting on behalf of,you may not add another; but you may replace the old one, on explicitpermission from the previous publisher that added the old one.The author(s) and publisher(s) of the Document do not by this Licensegive permission to use their names for publicity for or to assert orimply endorsement of any Modified Version. COMBINING DOCUMENTSYou may combine the Document with other documents released under thisLicense, under the terms defined in section 4 above for modifiedversions, provided that you include in the combination all of theInvariant Sections of all of the original documents, unmodified, andlist them all as Invariant Sections of your combined work in itslicense notice.The combined work need only contain one copy of this License, andmultiple identical Invariant Sections may be replaced with a singlecopy. If there are multiple Invariant Sections with the same name butdifferent contents, make the title of each such section unique byadding at the end of it, in parentheses, the name of the originalauthor or publisher of that section if known, or else a unique number.Make the same adjustment to the section titles in the list ofInvariant Sections in the license notice of the combined work.In the combination, you must combine any sections entitled “History”in the various original documents, forming one section entitled“History”; likewise combine any sections entitled “Acknowledgments”,and any sections entitled “Dedications”. You must delete all sectionsentitled “Endorsements.” COLLECTIONS OF DOCUMENTSYou may make a collection consisting of the Document and other documentsreleased under this License, and replace the individual copies of thisLicense in the various documents with a single copy that is included inthe collection, provided that you follow the rules of this License forverbatim copying of each of the documents in all other respects.You may extract a single document from such a collection, and distributeit individually under this License, provided you insert a copy of thisLicense into the extracted document, and follow this License in allother respects regarding verbatim copying of that document. AGGREGATION WITH INDEPENDENT WORKSA compilation of the Document or its derivatives with other separateand independent documents or works, in or on a volume of a storage ordistribution medium, does not as a whole count as a Modified Versionof the Document, provided no compilation copyright is claimed for thecompilation. Such a compilation is called an “aggregate”, and thisLicense does not apply to the other self-contained works thus compiledwith the Document, on account of their being thus compiled, if theyare not themselves derivative works of the Document.If the Cover Text requirement of section 3 is applicable to thesecopies of the Document, then if the Document is less than one quarterof the entire aggregate, the Document's Cover Texts may be placed oncovers that surround only the Document within the aggregate.Otherwise they must appear on covers around the whole aggregate. TRANSLATIONTranslation is considered a kind of modification, so you maydistribute translations of the Document under the terms of section 4.Replacing Invariant Sections with translations requires specialpermission from their copyright holders, but you may includetranslations of some or all Invariant Sections in addition to theoriginal versions of these Invariant Sections. You may include atranslation of this License provided that you also include theoriginal English version of this License. In case of a disagreementbetween the translation and the original English version of thisLicense, the original English version will prevail. TERMINATIONYou may not copy, modify, sublicense, or distribute the Document exceptas expressly provided for under this License. Any other attempt tocopy, modify, sublicense or distribute the Document is void, and willautomatically terminate your rights under this License. However,parties who have received copies, or rights, from you under thisLicense will not have their licenses terminated so long as suchparties remain in full compliance. FUTURE REVISIONS OF THIS LICENSEThe Free Software Foundation may publish new, revised versionsof the GNU Free Documentation License from time to time. Such newversions will be similar in spirit to the present version, but maydiffer in detail to address new problems or concerns. Seehttp://www.gnu.org/copyleft/.Each version of the License is given a distinguishing version number.If the Document specifies that a particular numbered version of thisLicense “or any later version” applies to it, you have the option offollowing the terms and conditions either of that specified version orof any later version that has been published (not as a draft) by theFree Software Foundation. If the Document does not specify a versionnumber of this License, you may choose any version ever published (notas a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (C) year your name. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being list their titles, with the Front-Cover Texts being list, and with the Back-Cover Texts being list. A copy of the license is included in the section entitled ``GNU Free Documentation License''. If you have no Invariant Sections, write “with no Invariant Sections” instead of saying which ones are invariant. If you have no Front-Cover Texts, write “no Front-Cover Texts” instead of “Front-Cover Texts being list”; likewise for Back-Cover Texts. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
xreflabel="General Index" id="General-Index"> General Index A ASPI, see B BIN/CUE, CD Image Format, see C CD Text, see CD Text, see CD XA, see CD+G, see CD+G, see CD-DA, see CD-i, see CD-i Bridge, see CD-ROM, see CDB (Command Descriptor Block), see CDDB, see Command Packet, see F FDL, GNU Free Documentation License, see frames, see FSF, see G GNU, see GPL, GNU General Public License, see Green Book, see Green Book, see I ISO, see ISO 9660, see ISO 9660, see J Joliet extensions, see Joliet extensions, see L LBA, see LBA, see lead in, see lead out, see LSN, see LSN, see M MCN, see Mixed Mode CD, see MMC (Multimedia Commands), see Mode 1, see Mode 2, see MSF, see Multisession, see N Nero NRG, CD-Image format, see Nero NRG, CD-Image format, see R Red Book, see Rock Ridge extensions, see Rock Ridge extensions, see S SCSI, see SCSI CDB, see SCSI Pass Through Interface., see sectors, see subchannel, see Super VCD (SVCD), see T TOC (CD Table of Contents), see track, see track, see V Video CD (VCD), see X XA, see