SCSI-2 CD-ROM Command Set Proposal X3T9.2/87-210 Revision 2. 6 March 1988 Paul Boulay Laser Magnetic Storage International 4425 ArrowsWest Drive Colorado Springs, Colorado 80907 (719) 593-4323 TABLE OF CONTENTS 13. Read-Only Direct Access Devices......................................13-1 13.1. Model for Read-Only Direct Access Devices......................13-1 13.1.1. CD-ROM Media Organization..............................13-1 13.1.2. CD-ROM Physical Data Format............................13-4 13.1.2.1. Frame Format for Audio.......................13-4 13.1.2.2. Sector Format for Data.......................13-4 13.1.2.3. Sub-channel Information Formats..............13-5 13.1.3. CD Audio Error Reporting...............................13-6 13.1.4. CD-ROM Ready Condition/Not Ready Condition.............13-6 13.1.5. CD-ROM Address Reporting Formats.......................13-6 13.1.6. Sensing Support for CD-Audio Commands. ................13-7 13.2. Command Descriptions for Read-Only Devices....................13-10 13.2.1. PAUSE/RESUME Command..................................13-12 13.2.2. PLAY AUDIO Command....................................13-13 13.2.2.1. PLAY AUDIO - 12 Byte Command ...............13-14 13.2.3. PLAY AUDIO - M/S/F Command............................13-15 13.2.4. PLAY AUDIO - TRACK / INDEX Command....................13-16 13.2.5. PLAY - TRACK RELATIVE Command.........................13-18 13.2.5.1. PLAY - TRACK RELATIVE - 12 Byte ............13-19 13.2.6. READ Command..........................................13-20 13.2.6.1. READ Command - 10 Byte .....................13-22 13.2.6.2. READ - 12 Byte .............................13-24 13.2.7. READ CD-ROM CAPACITY Command..........................13-25 13.2.8. READ HEADER Command...................................13-27 13.2.9. READ SUB-CHANNEL Command..............................13-29 13.2.10. READ TOC Command.....................................13-32 13.3. Page Descriptions for Read Only Direct Access Devices.........13-35 13.3.1. MODE SELECT Pages.....................................13-35 13.3.2. MODE SENSE Pages......................................13-35 13.3.3. Definitions of Mode Select / Mode Sense Pages.........13-36 13.3.3.1. Read Error Recovery Parameters .............13-36 13.3.3.2. Verify Error Recovery Parameters............13-42 13.3.3.3. CD-ROM Device Parameters ...................13-43 13.3.3.4. CD-ROM Audio Control Parameters.............13-44 13.3.4. MODE SELECT/MODE SENSE Block Descriptor...............13-47 13.4. Error Codes for Read Only Direct Access Devices...............13-48 13.5. Glossary for Read Only Direct Access Devices..................13-51 13.5.1. CD-ROM Terminology....................................13-51 LIST OF TABLES 13-1: M/S/F Address Format................................................13-7 13-2: Example Mixed Mode CD-ROM Disc Layout...............................13-8 13-3: Command Summary for Read-Only Devices..............................13-10 13-4: PAUSE Command......................................................13-12 13-5: PLAY AUDIO - 10 Command ...........................................13-13 13-6: PLAY AUDIO - 12 Command ...........................................13-14 13-7: PLAY AUDIO - M/S/F Command.........................................13-15 13-8: PLAY AUDIO - TRACK / INDEX Command.................................13-16 13-9: PLAY - TRACK RELATIVE -10 Command..................................13-18 13-10: PLAY - TRACK RELATIVE - 12 Command................................13-19 13-11: READ-6 Command....................................................13-20 13-12: READ-10 Command...................................................13-22 13-13: READ - 12 Command.................................................13-24 13-14: READ CD-ROM CAPACITY Command......................................13-25 13-15: READ CAPACITY Data................................................13-26 13-16: READ HEADER Command...............................................13-27 13-17: Header Data Format................................................13-28 13-18: Definition of CD-ROM Mode.........................................13-28 13-19: READ SUB-CHANNEL Command..........................................13-29 13-20: Sub-channel Data Format...........................................13-30 13-21: CD Audio State....................................................13-31 13-22: READ TOC Command..................................................13-32 13-23: TOC Data Format ..................................................13-33 13-24: Definition of Control Bits........................................13-34 13-25: Mode Select Page Codes............................................13-35 13-26: Mode Sense Page Codes.............................................13-35 13-27: Page Code One: Read Error Recovery Parameters....................13-36 13-28: Error Recovery Byte Bit Settings..................................13-37 13-29: CD-ROM Error Recovery Procedures..................................13-38 13-30: Page Code Seven: Verify Error Recovery Parameters................13-42 13-31: Page Code Eight: CD-ROM Parameters...............................13-43 13-32: Inactivity Timer Multiplier Values................................13-43 13-33: Page Code Nine: CD-ROM Audio Control Parameters ..................13-44 13-34: Audio Control Mode Bits...........................................13-46 13-35: Output Port Channel Selection.....................................13-47 13-36: Density Codes for CD-ROM Devices..................................13-47 13-37: Additional Sense Code Descriptions................................13-48 13. Read-Only Direct Access Devices Read Only Direct Access Devices permit reading data from a rotating media. Writing the media is not supported. Data transfer can begin with any of the consecutively numbered Logical Blocks. Some Read Only Direct Access Devices support a separate information stream (e.g. audio or video) transmitted via a connection other than the SCSI Bus. One such device is a CD-ROM drive. CD-ROM drives are designed to work with any disc that meets the Sony-Philips "red-book" or "yellow-book" (IEC 908) documents at the current revision level. Most new drives will read CD-ROM data discs, digital audio discs, and mixed- mode discs (i.e. some tracks are audio, some tracks are data). CD-ROM media has the same physical size and properties as CD-Digital Audio discs. The discs have two sizes, 120 millimeter diameter and 80 millimeter diameter. These correspond to 5-1/4 inch and 3-1/2 inch footprint drives. The media is single sided and contains approximately 600 megabytes of data or up to 74 minutes of audio in the larger diameter. The smaller diameter has a capacity of 200 megabytes of data or 23 minutes of audio. A disc may contain both audio and data, a so called mixed-mode disc. 13.1. Model for Read-Only Direct Access Devices Data on Read-Only Direct Access Devices is addressed the same as usual (magnetic) direct access devices. 13.1.1. CD-ROM Media Organization. The formats written on the CD-ROM and CD-DA (Digital Audio) media require special interfacing considerations. IMPLEMENTORS NOTE: The following description is based on CD-ROM technology, however the command set is designed to be usable by all read-only devices. The model is provided as a means to understand the CD-ROM implications of the command set. As such the model description does not impose any mandatory requirements. These discs may contain either audio information, data or a mixture of the two. Table 13-1 shows the layout of a mixed mode disc to illustrate the correspondence between the logical addresses reported across the SCSI interface and the physical Minutes / Seconds / Frames (M/S/F) location information encoded in the media. Note: The term "Frame" is used in two different ways in the CD-ROM standard. The intended meaning can only be determined from the context. Whenever possible, this description replaces the larger data unit with the more familiar term "sector". The primary exception to this policy is the "Frame" of the CD-ROM physical location M/S/F address. In the M/S/F context, one frame equals one sector. In Audio applications, one M/S/F frame equals 1/75th of a second. The CD-ROM physical format provides 2352 bytes per sector. For usual computer data applications, 2048 bytes are used for user data, 12 bytes for a synchronization field, 4 bytes for a sector address tag field and 288 bytes - the auxiliary field - for L-EC (CD-ROM Mode 1). In less critical applications, the auxiliary field may also be used for user data (CD-ROM Mode 2). A CD-ROM drive may return to the host 2048, 2336 or 2340 bytes from each sector. These values correspond to user data field only, user data plus auxiliary data, the 4 byte address tag plus user data plus auxiliary data. Selection among these options is made by setting the Density Code field of the MODE SELECT Block Descriptor. The usual selection is 2048 bytes per sector via a Density Code setting of 1. This same area of the CD-ROM or CD audio media may store 1/75th of a second of 2 channel audio information. (These audio channels are usually the Left and Right components of a stereo pair.) An audio only Density Code value can be used to declare an area of the media to be invalid for data operations. For the purposes of mapping logical block addresses to physical locations on the media such areas are assumed to return 2048 bytes per sector. Logical addressing of CD-ROM information may use any Logical Block Length. This standard does not specify the handling of Logical Block Length selections which do not evenly divide or are not exact multiples of the selected number of blocks per sector. This is intended to allow implementations which, for instance, map 5 Logical Blocks of 512 bytes to each CD-ROM sector when 2336 or 2340 bytes per sector are selected. Bytes beyond 2336 or 2340 would be filled with vendor specific contents. IMPLEMENTORS NOTE: Most CD-ROM devices will reject selections of the Logical Block Length other than 256, 512, 1024 or 2048 bytes when 2048 bytes per sector (user data field only) is selected. Similarly, in the 2336 and 2340 byte per sector modes, most devices do not support Logical Block Lengths other than these exact full sector values. Most CD-ROM devices support only one Block Descriptor.) Data sectors are addressed by their Logical Block Address relative to the first addressable block on the media which is located at M/S/F location 00/02/00. This block is referred to as the logical beginning of the media, LBA zero. A track may be viewed as a partition of the CD address space. A CD media contains from one to ninety-nine tracks. All information sectors of a track are required to be of the same type (Audio/Data) and mode. Each change in the type of information on the disc (audio or data) requires a change in track number. A disc containing both audio and data would have at least two tracks, one for audio and one for data. The tracks of a CD media are numbered consecutively with values between 1 and 99. However, the first information track may have a number greater than 1. Tracks have a minimum length of 4 seconds or 300 sectors including any transition area that is part of a track. Transition areas are required between consecutive tracks encoded with deferring kinds of information (Audio vs. Data). They may also be used at the beginning and/or end of any track. For Audio tracks the transition areas are called Pause areas. For Data tracks they are called Pre-gap and Post-gap areas. Table 13-1 shows the possible arrangements. The CD-ROM and CD-DA standards give the lengths of these areas as minimum values, maximums are not defined. Seek operations can be performed to transition areas. However read or play operations cannot be performed in these areas. Transition areas are formatted and the logical addressing sequence continues to increment through transition areas. CD-ROM media also have lead-in and a lead-out areas. These areas are outside of the user defined area as reported in the READ CD-ROM CAPACITY data. The lead-in area of the media is formatted as track zero. The lead-out area is track 0AAh. These tracks are not addressable. The Q sub-channel blocks of the lead-in track contains a Table of Contents (TOC) for the media. IMPLEMENTORS NOTE: The READ CD-ROM CAPACITY command returns the Logical Block Address of the last block prior to the lead-out area. This location may be in a transition area and therefore not a valid address for read or play operations. The Table of Contents (TOC) gives the absolute M/S/F location of the first information sector of each track. Control information (audio/data, mode of audio recording, etc.) for each track is also given in the TOC. (The TOC does not distinguish Data tracks with CD-ROM Mode One data from CD-ROM Mode Two data.) The M/S/F locations of the beginning of data tracks in the TOC are required to be accurate, however, the TOC values for audio tracks have a tolerance of plus or minus one second. Information from the TOC can be used to reply to a READ CD-ROM CAPACITY command. When this is done the drive implementer should consider the possible tolerances and return a value which allows access to all information sectors. An index is a partition of a track. Pre-gap areas are encoded with an index value of zero. Pause areas at the beginning of Audio tracks are also encoded with index 0. The first information sector of a track will have index 1. Consecutive values up to 99 are permitted. Index information is not found in the TOC. Not all sectors carry index data (the requirement is 9 out of 10). A sector without an index value is presumed to have the same index as the preceding sector. Tracks and indexes are not defined to be any particular length. (Except for a minimum track length of 300 sectors.) A CD media may be created with a single information track with a single index or with 99 information tracks each with 99 indexes. The sub-channel information which is part of each sector includes a relative M/S/F value giving the distance from the first information sector of the track. On the media this value decreases during the pre-gap area (sectors with index values of 0) and increases for the rest of the track. Over the SCSI interface (in the data returned by the Read Sub-channel command with M/S/F = 0) this is converted to a relative logical address. It is monotonic over a track and pre- gap areas will return negative values. (With M/S/F = 1, the value from the media is reported without change.) 13.1.2. CD-ROM Physical Data Format The physical format of CD-ROM and CD-DA media uses a smaller unit of synchronization than the more familiar magnetic or optical recording systems. The basic data stream synchronization unit is a frame. (Note, this is not the same frame as referred to in the M/S/F time unit.) Each small frame consists of 588 bits. A sector on CD-ROM media consists of 98 frames. A CD-ROM small frame consists of: 1 Synchronization pattern (24+3 bits) 1 Byte of Sub-channel Data (14+3 bits) 24 Bytes of Data (24 x (14+3) bits) 8 Bytes of CIRC code (8 x (14+3) bits) Total: 588 bits. Data, Sub-channel and CIRC bytes are encoded with an eight-to-fourteen bit code then 3 merging bits are added. (The merging bits are chosen to provide minimum low frequency signal content and optimize phase lock loop performance.) 13.1.2.1. Frame Format for Audio Each small frame of an Audio track consists of six digitized 16 bit samples of each stereo channel. These 24 bytes of data are combined with a synchronization pattern, CIRC bytes and a sub-channel byte to make a frame. Each frame takes approximately 136.05 uS to play. This gives a sampling rate of 44.1 KHz for each channel. The sub-channel information creates the higher level sector grouping for Audio tracks. 13.1.2.2. Sector Format for Data The data bytes of all the frames of a sector make up the physical unit of data. A sector is made up of 98 frames, and there are (98 x 24) 2352 bytes of data per sector. A sector contains the following if the CD-ROM Mode field has a value of one: 12 bytes Synchronization Field 4 bytes CD-ROM data header Absolute Minute Field in bcd format Absolute Second Field in bcd format Absolute Frame Field in bcd format CD-ROM Mode Field 2048 bytes User Data Field 4 bytes Error Detection Code 8 bytes zero 276 bytes Layered Error Correction Code A sector contains the following if the CD-ROM Mode field has a value of two: 12 bytes Synchronization Field 4 bytes CD-ROM Data Header -- Absolute Minute Field in bcd format Absolute Second Field in bcd format Absolute Frame Field in bcd format CD-ROM Mode Field 2336 bytes User Data Field (2048 bytes of Mode 1 data plus 288 bytes of Auxiliary data) NOTE: Many drives are capable of returning CD-ROM Mode one data in a CD-ROM Mode two format. This allows the user to investigate the error detection and error correction codes. However if the data is encoded as CD-ROM Mode two it cannot be read as CD-ROM mode one data. 13.1.2.3. Sub-channel Information Formats The Sub-channel byte of each frame is assigned one bit to each of 8 sub- channels P, Q, R, S, T, U, V, W. Only sub-channels P and Q are defined for CD- ROM media. The other sub-channel bits are zero. Sub-channel P is a simple flag bit used for audio muting control and track boundary determination in low-cost CD players. Sub-channel Q has a higher level of structure. All the Q sub-channel bits of a sector define a the Q sub-channel information block. (For Audio tracks, decoding the Q sub-channel is the only way to distinguish sector boundaries.) The Q Sub-channel block consists of 98 bits, one bit from each frame of a sector. Three formats are defined for the Q Sub-channel. Format 1 is provides location information: 2 bits Sub-channel Synchronization Field 4 bits ADR Field - defines the format 4 bits Control field - defines the type of information in this sector. 8 bits Track Number (in BCD) 8 bits Index Number (in BCD) 24 bits Track Relative M/S/F address 8 bits reserved (0) 24 bits Absolute M/S/F Address 16 bits CRC error detection code. Format 1 Q Sub-channel information is required to be present on at least 9 of 10 successive sectors. Formats 2 and 3 are optional. If provided, each must occupy at least 1 of 100 successive sectors. Format 2 gives the Catalog Number of the media (UPC/EAN Bar Code number). This information is constant over the whole media. Format 3 gives the International-Standard-Recording-Code (ISRC) for each track. The ISRC is defined in DIN-31-621. Format 3 is not present on lead-in or lead-out tracks and may change only after the Track Number changes. Formats 2 and 3 include the Absolute Frame byte of the M/S/F address to provide location information continuity. 13.1.3. CD Audio Error Reporting Audio playback operations started with the Immediate bit set in the audio control mode are terminated by the CD player without notification to the initiator. Error termination of these operations will be reported to the initiating host by returning immediate CHECK CONDITION status to the next command (except for REQUEST SENSE and INQUIRY.) The Deferred Error Sense Data (Byte 0) Error Code (71h) is used with such reports to indicate that the error is not due to the current command. Other SCSI initiators should not receive CHECK CONDITION status due to audio playback error terminations (but may receive BUSY status terminations if the device does not implement independent Sense Data storage.) The state of the current or immediately previous audio play operation may be sensed by using paired TEST UNIT READY -- REQUEST SENSE commands. The Audio State (see Table 13-21) information may be reported in the Additional Sense Code Qualifier (Byte 13) when the Sense Key indicates No Sense (0h). 13.1.4. CD-ROM Ready Condition/Not Ready Condition The ready condition occurs after a cartridge is inserted and drive has performed its initialization tasks. These may include reading the table of contents from the media. A not ready condition may occur for the following reasons: 1) There is no cartridge inserted. 2) The drive is unable to load or unload the cartridge. 3) The drive is unable to recover the table of contents. 4) The controller cannot select drive. (This can only occur if the controller was previously able to select the drive). 13.1.5. CD-ROM Address Reporting Formats Several CD-ROM specific commands report addresses either as Logical Block Addresses or the CD-ROM physical M/S/F format. This option is defined for these commands: Read Sub-Channel Read Header Read Table of Contents An M/S/F bit of zero in the CDB will return the usual Logical Block Address in a CD-ROM Absolute Address field or an offset from the beginning of the current track expressed as a number of Logical Blocks in a CD-ROM Track Relative Address field. An M/S/F bit of one in the CDB will return a Minutes / Seconds / Frames value relative to the beginning of the media for a CD-ROM Absolute Address field or a Minutes / Seconds / Frames value relative to the beginning of the current track for a CD-ROM Track Relative Address Field. The values for minutes, seconds, and frames are each expressed as binary numbers returned in one byte; not as BCD. Note that in a CD-ROM Track Relative Address field, for a location in the transition area of a track, prior the first information sector, the value returned for M/S/F equals zero will be a twos-complement negative Logical Block offset. Sectors closer to the first information sector will return less negative values. The M/S/F format returns the values in the Q sub-channel in this case. In a CD-ROM Track Relative Address field, for a location in the transition area of a track, prior the first information sector, the value returned for M/S/F equals one will be positive M/S/F values. Sectors closer to the first information sector will return smaller positive values. Table 13-1: M/S/F Address Format ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | Minutes (binary) | -----|-----------------------------------------------------------------------| 2 | Seconds (binary) | -----|-----------------------------------------------------------------------| 3 | Frames (binary) | ============================================================================== 13.1.6. Sensing Support for CD-Audio Commands. If any of the audio related CD-ROM specific commands are implemented the PLAY AUDIO - LBA - 10 command shall be supported. For the purpose of this test, a Transfer Length of zero can be set. Consequently, devices which respond to this command with ILLEGAL REQUEST - Invalid Command Op-code, can be assumed to support none of the CD-Audio commands defined in section 13.2. These commands are: Pause/Resume Play Audio (all types) Read Sub-Channel Support for the PLAY AUDIO - LBA - 10 command does not imply support for any other command. However, a negative response is meaningful. Table 13-2: Example Mixed Mode CD-ROM Disc Layout Logical Addresses given assume a Block Length of 2048, 2336 or 2340 bytes. For Block Lengths of 1024, 512 or 256 multiply all values given in the SCSI Addressing columns by 2, 4 or 8 respectively. SCSI /--- Sub-channel Information ----\ Data Addressing / \ Header Logical Track Absolute Track Track sector Mode Data Address Relative M/S/F and Relative is Info Audio Block Block (decimal) Logical Address Index M/S/F or is or Mode Description Address (1) Address Pause Data (2) ----------------------------------------------------------------------------- Lead-In Area (3) --- --- --- 0/- --- --- Audio --- Pre-gap (3) --- --- 00/00/00 1/0 00/02/00 Pause Data Null 1st Trk 0000 0 00/02/00 1/1 00/00/00 Info Data L-EC Data (5) (4) 2nd Trk 6000 0 01/22/00 2/1 00/00/00 Info Data L-EC Data (5) (4) 7500 1500 01/42/00 2/2 00/20/00 Info Data L-EC Post-gap 9000 3000 02/02/00 2/3 00/40/00 Pause Data Null Pause- 9150 -150 02/04/00 3/0 00/02/00 Pause Audio --- Silence (9) (8) 3rd Trk 9300 0 02/04/00 3/1 00/00/00 Info Audio --- Audio (7) (6) 11400 2250 02/34/00 3/2 00/30/00 Info Audio --- Track 4 21975 0 04/53/00 4/1 00/00/00 Info Audio --- Audio (7) (6) Pre-gap 30000 -225 06/40/00 5/0 00/03/00 Pause Audio --- Part 1 (9) Pre-gap 30075 -150 06/41/00 5/0 00/02/00 Pause Data Null Part 2 Track 5 30225 0 06/43/00 5/1 00/00/00 Info Data L-EC Data Last 263999 233774 58/39/74 5/1 51/56/74 Info Data L-EC Info (10) Post-gap --- 233775 58/40/00 5/2 51/57/00 Pause Data Null Lead-out 264000 0 58/42/00 AA/1 00/00/00 Pause Audio --- track (11) (12) (13) Notes for Table 13-1: (1) Absolute M/S/F Address repeated in the header field of data blocks. (2) The data block mode is stored in the header of data tracks. This indicates that the block is part of a data pre-gap or post-gap (Null), that this a data block using the auxiliary field for L-EC symbols (ECC), or that this is a data block using the auxiliary field for data. (3) Table of Contents information is stored in the sub-channel of Lead-In Area. The lead-in area is coded as track zero. Track zero and the initial 2 second pre-gap (or audio pause) are not accessible with SCSI logical addressing. (4) Value stored in Table of Contents with zero tolerance. (5) Exact value returned by Read TOC command. (6) Value stored in Table of Contents plus or minus 1 second. (7) Value returned by Read TOC command plus or minus 75 blocks. (8) Track relative M/S/F value decreases from >= 2 Sec to 0 in pre-gap areas. (9) Track relative Logical addresses are negative in the pre-gap areas. Pre- gap areas have index values of zero. (10) Minimum value returned by Read Capacity - Exact value depends on encoding of this track and the lead out track and whether this is derived from the TOC data. (11) Value returned by Read TOC command - exact if lead-out track is coded as Data, or plus or minus 75 blocks if coded as Audio. (12) Value stored in Table of Contents - exact if lead-out track is coded as Data, or plus or minus 75 blocks if coded as Audio. (13) Lead-out track number is defined as 0AAh. ----------------------------------------------------------------------------- 13.2. Command Descriptions for Read-Only Devices Table 13-3: Command Summary for Read-Only Devices ============================================================================== Operation Command Name Code Type Section ------------------------------------------------------------------------------ COMPARE 39h O 7 COPY 18h O 7 COPY AND VERIFY 3Ah O 7 INQUIRY 12h M 7 LOCK/UNLOCK CACHE 35h O 8 MODE SELECT 15h O 7 MODE SELECT EXTENDED 55h O 7 MODE SENSE 1Ah O 7 MODE SENSE EXTENDED 5Ah O 7 PAUSE/RESUME 4Bh O 13 PLAY AUDIO - 10 45h O* 13 PLAY AUDIO - 12 A5h O 13 PLAY AUDIO - M/S/F 47h O 13 PLAY AUDIO - TRACK/INDEX 48h O 13 PLAY - TRACK RELATIVE - 10 49h O 13 PLAY - TRACK RELATIVE - 12 A9h O 13 PRE-FETCH 34h O 8 PREVENT/ALLOW MEDIUM REMOVAL 1Eh O 15 READ - 6 08h O 13 READ - 10 28h M 13 READ - 12 A8h O 13 READ BUFFER 3Ch M 7 READ CD-ROM CAPACITY 25h M 13 READ SUB-CHANNEL 42h O 13 READ HEADER 44h O 13 READ LOG 1Fh O 7 READ TABLE OF CONTENTS 43h O 13 RECEIVE DIAGNOSTIC RESULTS 1Ch O 7 RELEASE 17h M 15 REQUEST SENSE 03h M 7 RESERVE 16h M 15 REZERO UNIT 01h O 15 SEARCH DATA EQUAL 31h O 8 SEARCH DATA HIGH 30h O 8 SEARCH DATA LOW 32h O 8 SEEK - 6 0Bh O 15 SEEK - 10 2Bh O 15 SEND DIAGNOSTIC 1Dh M 7 SET LIMITS 33h O 8 START/STOP UNIT 1Bh O 15 SYNCHRONIZE CACHE 35h O 8 TEST UNIT READY 00h M 7 VERIFY 2Fh O 15 WRITE BUFFER 3Bh O 7 ============================================================================== Notes: Command Codes C0h through FFh are Vendor Unique; all other Command Codes are Reserved. [Rather than declaring Op Code 46h as VU forever, Jeff S. suggests that it be reserved in SCSI-2 and informally set aside to avoid overlap with Sony's current products. In SCSI-3 we can recover it for some other use if necessary. prb] Support the PLAY AUDIO - 10 Command is Mandatory for CD-ROM devices that support any of the audio related commands -- Command Codes 42h, 45h, 47h, 48h, 49h, 4Bh, A5h and A9h. (See 13.1.6.) 13.2.1. PAUSE/RESUME Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-4: PAUSE Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (4Bh) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Reserved | -----|-----------------------------------------------------------------------| 8 | Reserved | Resume | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The PAUSE/RESUME command requests that the device stop/start the current audio playback operation. This command is used with PLAY AUDIO commands issued while the Immediate bit of the Audio Control Mode is a one. A Resume bit of zero causes the drive to enter the hold track state with the audio output muted after the current audio block is played. A Resume bit of one indicates the drive will release the pause and begin play at the block following the last block played. GOOD Status shall be returned in these cases where there is no change in the state of the drive: This command is received requesting a Pause when the device is already in a paused condition; or This command is received requesting a Resume when the device is playing audio. CHECK CONDITION Status shall be returned in response to a Resume function request if an audio play operation cannot be resumed. (For instance, the Resume function is requested when the device is not paused and not playing. An ILLEGAL REQUEST Sense Key would be posted in this case. Another possible cause is a NOT READY condition.) 13.2.2. PLAY AUDIO Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-5: PLAY AUDIO - 10 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (45h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Starting Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB)| -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The PLAY AUDIO command requests that the device begin an audio playback operation. The playback is to start with the audio sector with the specified Logical Block Address. The audio signals are output as specified by the Audio Control parameters. The playback operation is to continue until Transfer Length Logical Blocks of audio data are played. If the requested Transfer Length causes the playback operation to continue past the last sector of the track and the Continue bit of the Audio Control parameters is zero, the operation will stop. In this situation, if the playback is not to be repeated (Repeat also zero), the command is terminated with CHECK CONDITION, a BLANK CHECK Sense Key is set and the Additional Sense Code indicates END OF USER AREA ENCOUNTERED ON THIS TRACK. However, if Repeat is set, the playback is repeated and no error is posted. Implementors Note: If the Logical Block Length is less than 2048, more than one logical block address will map to a single audio sector. In most CD-ROM drives, any of the logical addresses that map to a physical sector will cause playback to start with the beginning of that sector. Similarly, most CD-ROM devices will truncate any partial audio sector request at the end of a transfer. The requested playback operation will be repeated and/or be terminated or repeated early based on the Repeat and Continue bits of the current Audio Control Mode. If the immediate bit of the current Audio Control Mode is a zero, the requested playback operation terminates before the command completes. If the Immediate bit is a one, the command returns the ending status byte and COMMAND COMPLETE message when the playback operation has started. If the starting address is not found, if the address is not within an audio track, or if the drive is not ready, a CHECK CONDITION status will be returned and the appropriate sense key set. 13.2.2.1. PLAY AUDIO - 12 Byte Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-6: PLAY AUDIO - 12 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A5h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB)| -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The 12 byte version of the PLAY AUDIO command requests that the device begin an audio playback operation. The operation is the same as the 10 byte command described above. The 12 byte format allows a longer Transfer Length. 13.2.3. PLAY AUDIO - M/S/F Command Peripheral Device Type: CD-ROM Operation Code Type: Optional Table 13-7: PLAY AUDIO - M/S/F Command ============================================================================== | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (47h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Starting Minutes | -----|-----------------------------------------------------------------------| 4 | Starting Seconds | -----|-----------------------------------------------------------------------| 5 | Starting Frame | -----|-----------------------------------------------------------------------| 6 | Ending Minutes | -----|-----------------------------------------------------------------------| 7 | Ending Seconds | -----|-----------------------------------------------------------------------| 8 | Ending Frame | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The PLAY AUDIO - M/S/F command requests that the device begin an audio playback operation at the M/S/F starting address and continue until the M/S/F ending address is detected. The audio signals are output as specified by the audio control parameters. The Starting minutes, seconds, frame specify the starting address in absolute time. The Ending minutes, seconds, frame specify the ending address in absolute time. The requested playback operation will be repeated and/or be terminated or repeated early based on the Repeat and Continue bits of the current Audio Control Mode. This command returns the status byte when the address requested is found. If the address is not found, the device is not ready, or the address is not within an audio track, a CHECK CONDITION status shall be returned and the appropriate sense key set. The starting track field specifies the track number of the audio track. The starting index field specifies the index number within starting track to begin the audio play operation. This command returns the status byte when the address requested is found. If the address is not found, or if the ready condition does not exist, or if the address is not within an audio track, a CHECK CONDITION status shall be returned and the appropriate sense key set. 13.2.4. PLAY AUDIO - TRACK / INDEX Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-8: PLAY AUDIO - TRACK / INDEX Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (48h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Starting Track | -----|-----------------------------------------------------------------------| 5 | Starting Index | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Last Track | -----|-----------------------------------------------------------------------| 8 | Last Index | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The PLAY AUDIO - TRACK / INDEX command requests that the device start an audio playback operation. Playback begins at the first audio sector with the Starting Track and Starting Index values. The playback operation will continue until the last audio sector with track and index values equal to the Last Track and Last Index has been played. The audio signals are output as specified by the audio control parameters. Valid values for the track and index fields are 1 to 99. A Starting Index value of one specifies that playback is to start with the first audio sector of the track following the (optional) pause. A Last Index value of 99 specifies that playback continues through the last sector of the track. If the Starting Index is greater than the largest index value on the Starting Track and the Continue bit of the Audio Control Mode parameters is a zero, the playback will not begin and the command will complete with a CHECK CONDITION. If the Continue bit is set, the playback operation will start at the beginning of the next track. This situation is not an error. If the Last Track is greater than the last information track on the media, this will cause the playback to continue until the last track is complete. This is not considered an error. If the Repeat bit of the Audio Control Mode is set the playback will be repeated. If the Last Index is greater than the largest value on the Last Track, the playback will continue until this track is complete then terminate. This is not considered an error. If Repeat is set the playback will be repeated. The requested playback operation will be repeated and/or be terminated or repeated early based on the Repeat and Continue bits of the current Audio Control Mode. If the immediate bit of the current Audio Control Mode is a zero, the requested playback operation terminates before the command completes and ending status is returned. If the Immediate bit is a one, the command returns the ending status byte and COMMAND COMPLETE message when the playback operation has started. If the starting address is not found, if the address is not within an audio track, or if the drive is not ready, a CHECK CONDITION status will be returned and the appropriate sense key set. 13.2.5. PLAY - TRACK RELATIVE Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-9: PLAY - TRACK RELATIVE -10 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (47h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Track Relative Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB)| -----|-----------------------------------------------------------------------| 6 | Starting Track | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The PLAY - TRACK RELATIVE command requests that the device begin an audio playback operation. The playback is to start with the audio block within the specified starting track with the specified Track Relative Logical Block Address. A negative value can be used to specify a starting location in the pause area (optionally present) at the beginning of an audio track. The audio signals are output as specified by the audio control parameters. The playback operation is to continue until Transfer Length Logical Blocks of audio data are played. If the requested Transfer Length causes the playback operation to continue past the last sector of the track and the Continue bit of the Audio Control parameters is zero, the operation will stop. In this situation, if the playback is not to be repeated (Repeat also zero), the command is terminated with CHECK CONDITION, a BLANK CHECK Sense Key is set and the Additional Sense Code indicates END OF USER AREA ENCOUNTERED ON THIS TRACK. However, if Repeat is set, the playback is repeated and no error is posted. Implementors Note: If the Logical Block Length is less than 2048, more than one logical block address will map to a single audio sector. In most CD-ROM drives, any of the logical addresses that map to a physical sector will cause playback to start with the beginning of that sector. Similarly, most CD-ROM devices will truncate any partial audio sector request at the end of a transfer. The requested playback operation will be repeated and/or be terminated or repeated early based on the Repeat and Continue bits of the current Audio Control Mode. If the immediate bit of the current Audio Control Mode is a zero, the requested playback operation terminates before the command completes. If the Immediate bit is a one, the command returns the ending status byte and COMMAND COMPLETE message when the playback operation has started. If the starting address is not found, if the address is not within an audio track, or if the drive is not ready, a CHECK CONDITION status will be returned and the appropriate sense key set. 13.2.5.1. PLAY - TRACK RELATIVE - 12 Byte Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-10: PLAY - TRACK RELATIVE - 12 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A7h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Track Relative Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB)| -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Starting Track | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The 12 byte version of PLAY - TRACK RELATIVE command requests that the device begin an audio playback operation. The operation is the same as the 10 byte command described above. The 12 byte format allows a longer Transfer Length. 13.2.6. READ Command Peripheral Device Type: Read Only (CD-ROM) Operation Code Type: Optional Table 13-11: READ-6 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (08h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | (MSB) | -----|------------------------------ ---| 2 | Logical Block Address | -----|--- ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | Transfer Length | -----|-----------------------------------------------------------------------| 5 | Control Byte | ============================================================================== The READ-6 command (Table 13-11) requests that the target transfer data to the initiator. The Logical Block Address field specifies the logical block at which the read operation shall begin. The Transfer Length field specifies the number of contiguous logical blocks of data to transferred. A transfer length of zero indicates that 256 logical blocks shall be transferred. Any other value indicates the number of logical blocks that shall be transferred. Cache control bits (see section 6.2.4) are not provided for this command. Targets with cache memory may have default values for these bits, however no default value is defined by this standard. If explicit control is required, the READ-10 or READ-12 commands should be used. This command shall be terminated with a RESERVATION CONFLICT status if any reservation access conflict (see section 8.1.16) exists and no data shall be read. If any of the following conditions occur, this command shall be terminated with a CHECK CONDITION status, and if sense is implemented, the sense key shall be set as indicated in the following table. This table does not provide an exhaustive enumeration of all conditions that may cause the CHECK CONDITION status. Condition Sense Key ---------------------------------------------- ---------------------------- Invalid logical block address ILLEGAL REQUEST (see note 1) Target reset or medium change since last command from this initiator UNIT ATTENTION Unrecoverable read error MEDIUM ERROR Recovered read error RECOVERED ERROR Overrun or other error that might be resolved by repeating the command ABORTED COMMAND Attempt to read a blank or previously unwritten block BLANK CHECK (see note 2) ---------------------------------------------- ---------------------------- NOTES: (1) The sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first blank block encountered. The data read up to that block shall be transferred (optical memory and write once read multiple devices only). Special error situations for Read Only Direct Access / CD-ROM devices. In the following cases the sense key will be set to BLANK CHECK and the additional sense code set to END OF USER AREA ENCOUNTERED ON THIS TRACK. 1) A post-gap area is encountered. (i.e. a data block with CD-ROM mode 0.) 2) A pre-gap area is encountered. (i.e. a block with index equal to 0.) 3) The information type (data vs. audio) changes. If the logical block address requested is not within a data track the command will be terminated with a CHECK CONDITION status. The sense key will be set to BLANK CHECK and the additional sense code set to ILLEGAL MODE FOR THIS TRACK. This applies to to mixed-mode and CD audio media. 13.2.6.1. READ Command - 10 Byte Peripheral Device Type: Read Only Operation Code Type: Mandatory Table 13-12: READ-10 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (28h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | - - -|- - Logical Block Address - -| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Transfer Length | 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The READ-10 command (Table 13-12) requests that the target transfer data to the initiator. The Logical Block Address field specifies the logical block at which the read operation shall begin. The Transfer Length field specifies the number of contiguous logical blocks of data that shall be transferred. A transfer length of zero indicates that no logical blocks shall be transferred. This condition shall not be considered as an error. Any other value indicates the number of logical blocks that shall be transferred. See section 6.2.4 for a description of the cache control bits (DPO and FUA). See section 6.2.5 for a description of the relative address bit (RelAdr). This command shall be terminated with a RESERVATION CONFLICT status if any reservation access conflict (see section 8.1.16) exists and no data shall be read. If any of the following conditions occur, this command shall return a CHECK CONDITION status and the sense key shall be set as indicated in the following table. This table does not provide an exhaustive enumeration of all conditions that may cause the CHECK CONDITION status. Condition Sense Key ---------------------------------------------- ---------------------------- Invalid logical block address ILLEGAL REQUEST (see note 1) Target reset or medium change since last command from this initiator UNIT ATTENTION Unrecoverable read error MEDIUM ERROR Recovered read error RECOVERED ERROR Overrun or other error that might be resolved by repeating the command ABORTED COMMAND Attempt to read a blank or previously unwritten block BLANK CHECK (see note 2) ---------------------------------------------- ---------------------------- NOTES: (1) The sense information bytes shall be set to the logical block address of the first invalid address. (2) The extended sense information bytes shall be set to the logical block address of the first blank block encountered. The data read up to that block shall be transferred. Special error situations for Read Only Direct Access / CD-ROM devices. In the following cases the sense key will be set to BLANK CHECK and the additional sense code set to END OF USER AREA ENCOUNTERED ON THIS TRACK. 1) A post-gap area is encountered. (i.e. a data block with CD-ROM mode 0.) 2) A pre-gap area is encountered. (i.e. a block with index equal to 0.) 3) The information type (data vs. audio) changes. If the logical block address requested is not within a data track the command will be terminated with a CHECK CONDITION status. The sense key will be set to BLANK CHECK and the additional sense code set to ILLEGAL MODE FOR THIS TRACK. This applies to to mixed-mode and CD audio media. 13.2.6.2. READ - 12 Byte Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-13: READ - 12 Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (A8h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | DPO | FUA | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB)| -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- ---| 7 | | -----|--- Transfer Length ---| 8 | | -----|--- ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | Reserved (0) | -----|-----------------------------------------------------------------------| 11 | Control Byte | ============================================================================== The 12 byte version of the READ command requests that the device transfer data to the initiator. The operation is the same as the 10 byte READ command described above. The 12 byte format allows a longer Transfer Length. 13.2.7. READ CD-ROM CAPACITY Command Peripheral Device Type: Read-Only Direct Access (CD-ROM) Operation Code Type: Mandatory Table 13-14: READ CD-ROM CAPACITY Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (25h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | RelAdr | -----|-----------------------------------------------------------------------| 2 | (MSB) | - - -|- - - -| 3 | | - - -|- - Logical Block Address - -| 4 | | - - -|- - - -| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Reserved | -----|-----------------------------------------------------------------------| 8 | Reserved | PMI | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The READ CD-ROM CAPACITY command (Table 13-14) provides a means for the initiator to request information regarding the capacity of the logical unit. IMPLEMENTORS NOTE: This command has the same operation code (25h) as the READ CAPACITY command defined in Section 8.1.8. The general function is the same but the exact definitions of the returned Logical Block Address is modified to allow returning a value based on CD-ROM Table of Contents data. In many CD-ROM implementations, this implementation allows a quicker response. The device implementer should be sure to return a Logical Block Address greater than the last readable or playable block even if the TOC information is not exact. (If the lead-out track is encoded as an audio track the starting address as recorded in the TOC has a +/- 75 sector tolerance.) The system implementer should be aware that the Logical Block Address returned may be approximate. A Partial Medium Indicator (PMI) bit of zero indicates that the information returned in the READ CD-ROM CAPACITY data shall be the logical block address and block length (in bytes) of the last valid logical block of the logical unit for seek operations. This address may be in a transition area beyond the last valid logical block for read or audio play operations. The logical block address in the command descriptor block shall be to set zero for this option. A PMI bit of one indicates that the information returned shall be the logical block address and block length (in bytes) of the last logical block address after which a substantial delay in data transfer will be encountered. This logical block address shall be greater than or equal to the logical block address specified in the command descriptor block. On CD-ROM media, this is interpreted to be the last readable or playable logical block of the information area containing or immediately following the specified logical block address. IMPLEMENTORS NOTE: This option may take several seconds to complete on CD- ROM media. See section 6.2.5 for a description of the relative address bit (RelAdr). The eight bytes of READ CD-ROM CAPACITY data shown in Table 13-15 shall be sent during the DATA IN phase of the command. Table 13-15: READ CAPACITY Data ============================================================================== Byte | Description | ============================================================================== 0 | (MSB) | - - -|- - Logical Block Address - -| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | (MSB) | - - -|- - Block Length - -| 7 | (LSB) | ============================================================================== 13.2.8. READ HEADER Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-16: READ HEADER Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (44h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | M/S/F |Reserved| -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- ---| 3 | | -----|--- Logical Block Address ---| 4 | | -----|--- ---| 5 | (LSB) | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Allocation Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The READ HEADER command requests that the device return the CD-ROM data block address header of the requested logical block. The allocation length will specify the number of bytes that the initiator has allocated for returned data. An allocation length of zero indicates that no data will be transferred. Any other value indicates the maximum number of bytes that will be transferred. The controller terminates the DATA IN phase when allocation length bytes have been transferred or when all available data have been transferred to the initiator, whichever is less. See the READ command for exception handling. If the logical block size is less than 2048 bytes, it will be mapped into the appropriate physical block from which the data would have been read. Table 13-17: Header Data Format ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | CD-ROM Mode | -----|-----------------------------------------------------------------------| 1 | M/S/F | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | (MSB) | - - -|- - - - Absolute CD-ROM Address - - - -| 7 | (LSB) | ============================================================================== The CD-ROM Mode field specifies the CD-ROM mode of the logical blocks in this sector of data. The values in this field are defined in Table 13-18. The M/S/F bit specifies the format of the Absolute CD-ROM Address field. If the M/S/F bit is zero, the Absolute CD-ROM Address field gives the Logical Block Address of the first logical block in the physical sector where the data for the requested Logical Block Address is found. If the M/S/F bit is one, the Absolute CD-ROM Address field gives the physical M/S/F address of the physical sector where the data for the requested Logical Block Address is found. (See 13.1.5.) Table 13-18: Definition of CD-ROM Mode ============================================================================== Mode User Data Field Auxiliary Field (2048 bytes) (288 bytes) ------ ------------------------- -------------------------- 0 All bytes zero All bytes zero 1 User Data L-EC symbols 2 User Data User Data ============================================================================== Note: Values greater than 2 are reserved. 13.2.9. READ SUB-CHANNEL Command Peripheral Device Type: Read-Only Direct Access (CD-ROM) Operation Code Type: Optional Table 13-19: READ SUB-CHANNEL Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (42h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | M/S/F |Reserved| -----|-----------------------------------------------------------------------| 2 |Reserved| Sub Q | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Allocation Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The READ SUB-CHANNEL command requests that the target return the requested sub-channel data of the current block plus the state of an on-going audio play operation. The Sub Q bit set to one requests the target return the Q sub-channel data. The Sub Q bit set to zero requests that no sub-channel data be returned. NOTE: The other bits in this byte are reserved for use in requesting other sub-channel data. The bits occur in the sub-channel in P Q R S T U V W order. At present, sub-channels R, S, T, U, V and W are not used. The allocation length specifies the number of bytes that the initiator has allocated for returned data. An allocation length of zero indicates that no data will be transferred. Any other value indicates the maximum number of bytes to be transferred. The controller terminates the DATA IN phase when allocation length bytes have been transferred or when all available data have been transferred to the initiator, whichever is less. If the drive is not in the ready condition the command will be terminated with a CHECK CONDITION status. The sense key will be set to NOT READY and the appropriate additional sense code set. Table 13-20: Sub-channel Data Format ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | CD Audio State | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Sub-Channel Data Length ---| 3 | (LSB) | -----|-----------------------------------------------------------------------| 4 | M/S/F | Reserved | -----|-----------------------------------------------------------------------| 5 | ADR | Control | -----|-----------------------------------------------------------------------| 6 | Track Number | -----|-----------------------------------------------------------------------| 7 | Index Number | -----|-----------------------------------------------------------------------| 8 | (MSB) | - - -|- - - - Absolute CD-ROM Address - - - -| 11 | (LSB) | -----|-----------------------------------------------------------------------| 12 | (MSB) | - - -|- - - - Track Relative CD-ROM Address - - - -| 15 | (LSB) | -----|-----------------------------------------------------------------------| 16 |MC Valid| | -----|-----------------------------------------------------------------------| 17 | | - - -|- - - - Media Catalog Number (UPC/Bar Code) - - - -| 31 | | -----|-----------------------------------------------------------------------| 32 |TC Valid| | -----|-----------------------------------------------------------------------| 33 | | | - - -|- - - - Track International-Standard-Recording-Code (ISRC) - - - -| 47 | | ============================================================================== The Sub-channel Data format consists of a 4 byte header followed by the Sub- channel data area. The header gives the CD Audio State byte and the Sub- channel Data Length field. If the Sub-Q bit of the CDB is zero, the Sub- channel data length is zero and only the header is returned. The CD Audio State field indicates the current state of the drive. CD Audio State values are defined in Table 13-21. Table 13-21: CD Audio State ============================================================================== Status Description | ----------|------------------------------------------------------------------| 00h | CD Audio State byte not supplied or not valid | ----------|------------------------------------------------------------------| 01h | Audio play operation in progress. | ----------|------------------------------------------------------------------| 02h | Audio play operation paused. | ----------|------------------------------------------------------------------| 03h | Audio play operation successfully completed. | ----------|------------------------------------------------------------------| 04h | Audio play operation stopped due to error. | ----------|------------------------------------------------------------------| 05h | No audio play operation to report. Drive Ready. | ============================================================================== The following information is obtained from the Q Sub-channel information of the current block. The M/S/F bit indicates the format of the Absolute CD-ROM Address and Track Relative CD-ROM Address fields. The ADR field gives the type of information encoded in the Q Sub-channel of this block. ADR = 0 -- Q Sub-channel mode information not supplied. ADR = 1 -- Q Sub-channel encodes current position data. (Track, Index, Absolute Address, Relative Address.) ADR = 2 -- Q Sub-channel encodes Media Catalog Number. ADR = 3 -- Q Sub-channel encodes ISRC. Other values are reserved. The control bits are defined in Table 13-24. The Track Number specifies the current track number. The Index Number specifies the index number in the current track. The Absolute CD-ROM Address field gives the current location relative to the logical beginning of the media. If the M/S/F bit of the CDB is zero, this field is a Logical Block Address. If the M/S/F bit is set, this field is an Absolute M/S/F Address. (See 13.1.5.) The Track Relative CD-ROM Address field gives the current location relative to the logical beginning of the current track. If the M/S/F bit of the CDB is zero, this field is a Track Relative Logical Block Address. (This will be a negative value, expressed as a twos complement number, if the current block is in the pre-gap area of a track. See 13.1.5.) If the M/S/F bit is set, this field is the Relative M/S/F Address from the Q Sub-channel. The MC Valid bit is set when the Media Catalog Number field contains valid data. The Media Catalog Number field contains the identifying number of this media according to the Universal Product Code convention (UPC/EAN Bar Coding) expressed in ASCII. The TC Valid bit is set when the Track ISRC field contains valid data for the current track. The Track International-Standard-Recording-Code (ISRC) field contains the identifying number of this media according to the ISRC standards (DIN-31-621) expressed in ASCII. 13.2.10. READ TOC Command Peripheral Device Type: Read-Only (CD-ROM) Operation Code Type: Optional Table 13-22: READ TOC Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (43h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | M/S/F |Reserved| -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | Track Number | -----|-----------------------------------------------------------------------| 7 | (MSB) | -----|--- Allocation Length ---| 8 | (LSB) | -----|-----------------------------------------------------------------------| 9 | Control Byte | ============================================================================== The READ TOC command transfers data from the table of contents (TOC) on the CD media. The data is returned in format specified in Table 13-23 TOC Data Format. The track number field specifies the starting track number for which the data will be returned. If this value is zero, the Table of Contents data will begin with the first track on the media. The data is returned in contiguous ascending order. If the track number field is not valid for the current media the command shall be terminated with a CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST and the additional sense code set to ILLEGAL VALUE IN CDB. The allocation length specifies the number of bytes that the initiator has allocated for returned data. An allocation length of zero indicates that no data will be transferred. Any other value indicates the maximum number of bytes that will be transferred. The controller terminates the DATA IN phase when allocation length bytes have been transferred or when all available data have been transferred to the initiator, whichever is less. The maximum TOC data length possible is 804 bytes. Table 13-23: TOC Data Format ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | (MSB) | -----|--- TOC Data Length ---| 1 | (LSB) | -----|-----------------------------------------------------------------------| 2 | First Track Number | -----|-----------------------------------------------------------------------| 3 | Last Track Number | ============================================================================== TOC Track Descriptor ============================================================================== 0 | M/S/F | Reserved | -----|-----------------------------------------------------------------------| 1 | ADR | Control | -----|-----------------------------------------------------------------------| 2 | Track Number | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | (MSB) | - - -|- - - - Absolute CD-ROM Address - - - -| 7 | (LSB) | ============================================================================== The TOC data returned is a four byte header followed by one or more (up to 100) TOC track descriptors. The last track descriptor is for the lead-out area. The TOC data length specifies the length in bytes of the available table of contents data. The value of TOC data length does not include itself. The maximum value is 802d (0322h). This value is not modified when the Allocation length is insufficient to return all the TOC data available. The first track number field indicates the first track number in the table of contents. Implementers note: The first track number is not required to be one. A disc may start at any valid track number. The track numbers between the first track number and the last track number are required to be in contiguous ascending order. The last track number field indicates the last track number in the table of contents before the lead-out track number. The M/S/F bit specifies the format of the Absolute CD-ROM Address field. The track number field indicates the track number for which the data in the TOC track descriptor is valid. A Track Number value of 0AAh will be supplied for the lead-out track. The ADR field gives the type of information encoded in the Q Sub-channel of the block where this TOC entry was found. TOC information is encoded with an ADR value of one. ADR = 0 -- Q Sub-channel mode information not supplied. ADR = 1 -- Q Sub-channel encodes track TOC data. (Track, Control (track information type), Track Absolute Start Address.) The control field indicates the attributes of the track. These are defined in Table 13-24. Table 13-24: Definition of Control Bits ============================================================================== Bit equals zero equals one ------ -------------------------- ------------------------------- 0 Audio without pre-emphasis Audio with pre-emphasis 1 Digital copy prohibited Digital copy permitted 2 Audio track Data track 3 Two channel audio Four channel audio ============================================================================== If the M/S/F bit is zero, the Absolute CD-ROM Address field gives the Logical Block Address of the first information block of the referenced track as read from the TOC data. If the M/S/F bit is one, the Absolute CD-ROM Address field gives the physical M/S/F address of the first information block for the referenced track as read from the TOC data. (See 13.1.5.) Implementors Note: The Starting Logical Block Address value recovered from the TOC has a tolerance of zero for data tracks and plus or minus 75 CD sectors for audio tracks. This tolerance is multiplied by 1, 2, 4, or 8 Blocks per sector depending on the Logical Block Length. 13.3. Page Descriptions for Read Only Direct Access Devices 13.3.1. MODE SELECT Pages Table 13-25: Mode Select Page Codes ============================================================================== Page Code Description ---------- -------------------------------------------- 01h Read Error Recovery Parameters 02h Disconnect/Reconnect Control Parameters 07h Verify Error Recovery Parameters 08h CD-ROM Parameters 09h CD-ROM Audio Control Parameters 0Bh Medium Types Supported Parameters 03h - 06h, 0Ah, 0Ch - 1Fh, 3Fh Reserved 00h, 20h - 3Eh Vendor Unique ============================================================================== 13.3.2. MODE SENSE Pages Table 13-26: Mode Sense Page Codes ============================================================================== Page Code Description ---------- -------------------------------------------- 01h Read Error Recovery Parameters 02h Disconnect/Reconnect Control Parameters 07h Verify Error Recovery Parameters 08h CD-ROM Parameters 09h CD-ROM Audio Control Parameters 0Bh Medium Types Supported Parameters 3Fh Return All Supported Mode Sense Pages 03h - 06h, 0Ah, 0Ch - 1Fh Reserved 00h, 20h - 3Eh Vendor Unique ============================================================================== 13.3.3. Definitions of Mode Select / Mode Sense Pages 13.3.3.1. Read Error Recovery Parameters Table 13-27: Page Code One: Read Error Recovery Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (01h) | -----|-----------------------------------------------------------------------| 1 | Parameter Length (06h) | -----|-----------------------------------------------------------------------| 2 | Error Recovery | -----|-----------------------------------------------------------------------| 3 | Read Retry Count | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Reserved | ============================================================================== The implementation of error recovery procedures for CD-ROM devices is markedly different than those used for magnetic medium disk drives. At least one level of error correction (i.e. CIRC) is required to transfer the the data stream. Therefore the performance of the drive may differ substantially from what would be expected by sending the same error recovery parameters to a magnetic medium device. The AWRE, ARRE and RC bits in the Error Recovery parameters defined for Direct Access devices do not apply to Read-Only devices. These bits shall be zero. The EER bit shall be defined as it is for Direct Access devices (See Table 8-16.) For Read Only CD-ROM devices this bit is advisory to the target. The correlation of the error recovery parameter and the bit settings defined for Direct Access devices is given in Table 13-28. The interpretation of these bit settings for CD-ROM devices is given in Table 13-29. If the error recovery parameter is set to any other value the command will be terminated with a CHECK CONDITION status. The sense key will be set to ILLEGAL REQUEST and the additional sense code set to ILLEGAL VALUE IN PARAMETER LIST. The read retry count field specifies the number of times that the controller will attempt its read recovery algorithm. Table 13-28: Error Recovery Byte Bit Settings ======================================================= |value| Error Recovery | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | | | | TB | | EER | PER | DTE | DCR | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 00 | 0 X 0 0 0 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 01 | 0 X 0 0 1 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 04 | 0 X 1 0 0 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 05 | 0 X 1 0 1 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 06 | 0 X 1 1 0 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 07 | 0 X 1 1 1 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 20 | 1 X 0 0 0 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 21 | 1 X 0 0 1 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 26 | 1 X 1 1 0 | |-----+-----+-----+-----+-----+-----+-----+-----+-----| | 27 | 1 X 1 1 1 | ======================================================= A CIRC recovered data error is defined as a block for which the CIRC based error correction algorithm was unsuccessful for a read attempt, but on a subsequent read operation no error was reported. The number of subsequent read operations is limited to the read retry count. Layered error correction was not used. A CIRC unrecovered data error is defined as a block for which the CIRC based error correction algorithm was unsuccessful on all read attempts up to the read retry count. Layered error correction was not used. An L-EC recovered data error is defined as a block for which the CIRC based error correction algorithm was unsuccessful but the layered error correction was able to correct the block within the read retry count. An L-EC uncorrectable data error is defined as a block which could not be corrected by layered error correction within the read retry count. Table 13-29: CD-ROM Error Recovery Procedures ============================================================================== Error Recovery Description ------------------------------------------------------------------------------ 00h The maximum error recovery procedures available are used. If an error occurs which is uncorrectable with the error correction codes (ECC) on the media, data transfer is terminated with a CHECK CONDITION status. The block with the error is not transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to L-EC UNCORRECTABLE DATA ERROR or CIRC UNRECOVERED DATA ERROR depending on the highest level of ECC information available. The information bytes give the address of the block where the unrecovered error was detected. Recovered errors are not reported. 01h Only retries of the read operation and CIRC are used (layered error correction is not used). Only CIRC unrecovered data errors are reported. If an CIRC unrecovered data error occurs data transfer is terminated with a CHECK CONDITION status. The block with the error is not transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to CIRC UNRECOVERED DATA ERROR. The information bytes give the address of the block where the unrecovered error was detected. Recovered errors are not reported. 04h The maximum error recovery procedures available are used. Recovered data errors are reported. If a recovered data error occurs data transfer is not terminated. However, when the data transfer has completed a CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR or L-EC RECOVERED DATA ERROR. The information bytes give the address of the last block where a recovered data error was detected. If an data error occurs which is uncorrectable with the ECC information available on the media data transfer is terminated and CHECK CONDITION status is reported. The block with the error is not transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to L-EC UNCORRECTABLE DATA ERROR or CIRC UNRECOVERED DATA ERROR depending on the highest level of ECC information available. The information bytes give the address of the block where the uncorrectable error was detected. ============================================================================== CD-ROM Error Recovery Procedures (continued) ============================================================================== Error Recovery Description ------------------------------------------------------------------------------ 05h Only retries of the read operation and CIRC are used (layered error correction is not used). Recovered data errors are reported. If a recovered data error occurs data transfer is not terminated. However, when the data transfer has completed a CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR. The information bytes give the address of the last block where an CIRC recovered data error was detected. If an unrecovered data error occurs data transfer is terminated and CHECK CONDITION status is reported. The block with the error is not transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to CIRC UNRECOVERED DATA ERROR. The information bytes give the address of the block where the unrecovered error was detected. 06h The maximum error recovery procedures are used. Recovered data errors are reported. If a recovered data error occurs data transfer is terminated and CHECK CONDITION status is reported. The block with the recovered error is not transferred. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR or L-EC RECOVERED DATA depending on the algorithm used to recover the data block reported in the information bytes. The information bytes give the address of the block where the recovered data error was detected. If a data error occurs which is uncorrectable with the ECC information on the media, data transfer is terminated with a CHECK CONDITION status. The block with the error is not transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to L-EC UNCORRECTABLE DATA ERROR or CIRC UNRECOVERED DATA ERROR depending on the highest level of ECC information available. The information bytes give the address of the block where the uncorrectable error was detected. 07h Only retries of the read operation are used (layer error correction is not used). CIRC recovered data errors are reported. If a CIRC recovered data error occurs data transfer is terminated with a CHECK CONDITION status. The block with the recovered error is not transferred. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR. The information bytes give the address of the block where the recovered data error was detected. If an CIRC unrecovered data error occurs data transfer is terminated with a CHECK CONDITION status. The block with the error is not transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to CIRC UNRECOVERED DATA ERROR. The information bytes give the address of the block where the unrecovered error was detected. ============================================================================== CD-ROM Error Recovery Procedures (continued) ============================================================================== Error Recovery Description ------------------------------------------------------------------------------ 20h The maximum error recovery procedures available are used. If an error occurs which is uncorrectable with the error correction codes (ECC) on the media, data transfer is terminated with a CHECK CONDITION status. The block with the error is transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to L-EC UNCORRECTABLE DATA ERROR or CIRC UNRECOVERED DATA ERROR depending on the highest level of ECC information available. The information bytes give the address of the block where the unrecovered error was detected. Recovered errors are not reported. 21h Only retries of the read operation and CIRC are used (layered error correction is not used). Only CIRC unrecovered data errors are reported. If an CIRC unrecovered data error occurs data transfer is terminated with a CHECK CONDITION status. The block with the error is transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to CIRC UNRECOVERED DATA ERROR. The information bytes give the address of the block where the unrecovered error was detected. Recovered errors are not reported. 24h The maximum error recovery procedures available are used. Recovered data errors are reported. If a recovered data error occurs data transfer is not terminated. However, when the data transfer has completed a CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR or L-EC RECOVERED DATA ERROR. The information bytes give the address of the last block where a recovered data error was detected. If an data error occurs which is uncorrectable with the ECC information available on the media data transfer is terminated and CHECK CONDITION status is reported. The block with the error is transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to L-EC UNCORRECTABLE DATA ERROR or CIRC UNRECOVERED DATA ERROR depending on the highest level of ECC information available. The information bytes give the address of the block where the uncorrectable error was detected. ============================================================================== CD-ROM Error Recovery Procedures (continued) ============================================================================== Error Recovery Description ------------------------------------------------------------------------------ 25h Only retries of the read operation and CIRC are used (layered error correction is not used). Recovered data errors are reported. If a recovered data error occurs data transfer is not terminated. However, when the data transfer has completed a CHECK CONDITION status is reported. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR. The information bytes give the the address of the last block where an CIRC recovered data error was detected. If an unrecovered data error occurs data transfer is terminated and CHECK CONDITION status is reported. The block with the error is transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to CIRC UNRECOVERED DATA ERROR. The information bytes give the address of the block where the unrecovered error was detected. 26h The maximum error recovery procedures are used. Recovered data errors are reported. If a recovered data error occurs data transfer is terminated and CHECK CONDITION status is reported. The block with the recovered error is transferred. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR or L-EC RECOVERED DATA depending on the algorithm used to recover the data block reported in the information bytes. The information bytes give the address of the block where the recovered data error was detected. If a data error occurs which is uncorrectable with the ECC information on the media, data transfer is terminated with a CHECK CONDITION status. The block with the error is transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to L-EC UNCORRECTABLE DATA ERROR or CIRC UNRECOVERED DATA ERROR depending on the highest level of ECC information available. The information bytes give the address of the block where the uncorrectable error was detected. 27h Only retries of the read operation are used (layer error correction is not used). CIRC recovered data errors are reported. If a CIRC recovered data error occurs data transfer is terminated with a CHECK CONDITION status. The block with the recovered error is transferred. The sense key is set to RECOVERED ERROR and the additional sense code is set to CIRC RECOVERED DATA ERROR. The information bytes give the address of the block where the recovered data error was detected. If an CIRC unrecovered data error occurs data transfer is terminated with a CHECK CONDITION status. The block with the error is transferred. The sense key is set to MEDIUM ERROR and the additional sense code is set to CIRC UNRECOVERED DATA ERROR. The information bytes give the address of the block where the unrecovered error was detected. ============================================================================== NOTE: EER is assumed zero in the code values given in the above table. 13.3.3.2. Verify Error Recovery Parameters Table 13-30: Page Code Seven: Verify Error Recovery Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (07h) | -----|-----------------------------------------------------------------------| 1 | Parameter Length (06h) | -----|-----------------------------------------------------------------------| 2 | Error Recovery | -----|-----------------------------------------------------------------------| 3 | Verify Retry Count | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Reserved | -----|-----------------------------------------------------------------------| 6 | Reserved | -----|-----------------------------------------------------------------------| 7 | Reserved | ============================================================================== The implementation of error recovery procedures for verification operations is the same as for read operations on CD-ROM devices. 13.3.3.3. CD-ROM Device Parameters Table 13-31: Page Code Eight: CD-ROM Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (08h) | -----|-----------------------------------------------------------------------| 1 | Parameter Length (02h) | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | Inactivity Timer Multiplier | ============================================================================== The Inactivity Timer Multiplier sets the length of time that the drive will remain in the hold track state after completion of a seek or read operation. See Table 13-32. IMPLEMENTORS NOTE: Higher values in this parameter may have an adverse effect on the drive MTBF. Table 13-32: Inactivity Timer Multiplier Values ============================================================================= Inactivity Timer Minimum Time in Inactivity Timer Minimum Time in Multiplier Hold Track State Multiplier Hold Track State ---------------- ---------------- ---------------- ---------------- 0h infinite 8h 16 Seconds 1h 125 milli Seconds 9h 32 Seconds 2h 250 milli Seconds Ah 1 Minute 3h 500 milli Seconds Bh 2 Minutes 4h 1 Second Ch 4 Minutes 5h 2 Seconds Dh 8 Minutes 6h 4 Seconds Eh 16 Minutes 7h 8 Seconds Fh 32 Minutes ============================================================================= 13.3.3.4. CD-ROM Audio Control Parameters A MODE SELECT command CD-ROM Audio Control Parameters page sets modes and controls for subsequent PLAY AUDIO commands and any current audio playback operation. A MODE SENSE command requesting this page will receive the current settings. Table 13-33: Page Code Nine: CD-ROM Audio Control Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Reserved | Page Code (09h) | -----|-----------------------------------------------------------------------| 1 | Parameter Length (0Ah) | -----|-----------------------------------------------------------------------| 2 | Reserved | Immed |Continue| Repeat | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | TValid | Reserved | Format of LBAs / Sec. | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- Logical Blocks per Second of Audio Playback ---| 7 | (LSB)| -----|-----------------------------------------------------------------------| 8 | Reserved | Output Port 0 Channel Selection | -----|-----------------------------------------------------------------------| 9 | Output Port 0 Volume | -----|-----------------------------------------------------------------------| 10 | Reserved | Output Port 1 Channel Selection | -----|-----------------------------------------------------------------------| 11 | Output Port 1 Volume | -----|-----------------------------------------------------------------------| 12 | Reserved | Output Port 2 Channel Selection | -----|-----------------------------------------------------------------------| 13 | Output Port 2 Volume | -----|-----------------------------------------------------------------------| 14 | Reserved | Output Port 3 Channel Selection | -----|-----------------------------------------------------------------------| 15 | Output Port 3 Volume | ============================================================================== The Immediate (Immed), Continue and Repeat bits are defined in Table 13-34. These bits modify the function of current or following PLAY AUDIO commands. The TValid bit value of one indicates that the Format of LBAs / Sec and Logical Blocks per Second of Audio Playback fields are valid. The Format of LBAs / Sec field gives the multiplier to be used with the Logical Blocks per second of Audio Playback. Defined values are 0 and 8; other values are reserved. =================================================================== Format of LBAs / Sec value Multiplier for LBAs / Sec field ------------------------------ ---------------------------------- 0 1 8 1/256 =================================================================== The Logical Blocks per Second of Audio Playback field gives the relationship between time and the duration of play per Logical Block Address. The value in this field is to be multiplied by 1 or 1/256 depending on the value in Format of LBAs / Sec field. IMPLEMENTORS NOTE: The Logical Blocks per Second of Audio Playback field and its companion Format of LBAs / Sec field will not be supported by most current CD-ROM devices as a modifiable Mode Select parameter. The output port channel selection specifies the audio channels from the disc to which this output port should be connected. See Table 13-35. Only one channel may be connected to an output port. More than one output port may be connected to an audio channel. (For instance, channel one may be connected to both output to ports zero and one.) The channel volume control indicates the relative volume level for this audio output port. A value of zero indicates the output is muted, a value of FFh indicates maximum volume level. Implementors Note: If volume controls are implemented, the default volume level should be no more than 25% of the maximum level (i.e. no more than 6.25% of the maximum output power.) Table 13-34: Audio Control Mode Bits ============================================================================== Bit Value Definition ----- ----- ---------------------------------------------------------- Immediate Bit 0 0 PLAY AUDIO commands will not send completion status until the operation is terminated. 1 PLAY AUDIO commands will send completion status as soon as the playback operation has been started. Continue Bit 1 0 Audio playback operations will stop when the transfer length is satisfied. Multiple tracks will be played as necessary. Periods encoded as audio pause/silence at the beginning of tracks, (index 0,) will also be played. 1 Audio playback operations will terminate when the beginning of a following track is encountered. This situation is not considered an error for the purposes of the repeat bit. If the repeat bit is zero, sense data with a BLANK CHECK Sense Key and an END OF USER AREA ENCOUNTERED ON THIS TRACK Additional Sense Code is posted. Repeat Bit 2 0 Audio playback operations requested by a PLAY AUDIO command will occur once and the operation will terminate. 1 The audio playback operations requested by a PLAY AUDIO command will be repeated until terminated by the PLAYBACK STOP command, by an error, by an ABORT or a BUS DEVICE RESET message, or by a hard reset condition. Note that if this bit is 1 and the immediate bit is 0 a reset may be needed to stop the playback. ============================================================================== Table 13-35: Output Port Channel Selection ============================================================================== 0000 output port muted 0001 connect channel 0 to this output port 0010 connect channel 1 to this output port 0100 connect channel 2 to this output port 1000 connect channel 3 to this output port ============================================================================== 13.3.4. MODE SELECT/MODE SENSE Block Descriptor The Density Code field for this Peripheral Device Type indicates the data types to be read from physical sectors for CD-ROM type devices. Table 13-36: Density Codes for CD-ROM Devices ============================================================================= Density Code Data types to be transferred from each CD-ROM Sector ----------------------------------------------------------------------------- 0 Unspecified - Device Default 1 User Data Only - 2048 Bytes per sector 2 User Data plus Auxiliary Data field - 2336 bytes per sector 3 4 Byte Tag Field, User Data plus Auxiliary Data - 2340 bytes per sector 4 Audio Information Only (1/75th of a second per Logical Block) ============================================================================= The number of bytes per sector specified by this parameter is used with the Block Length to map CD-ROM sectors to Logical Block Addresses. 13.4. Error Codes for Read Only Direct Access Devices Table 13-37: Additional Sense Code Descriptions ============================================================================== | For Sense Key NO SENSE (0h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 00 xx No additional sense information (See 13.1.3 and Table 13-21.) | | For Sense Key RECOVERED ERROR (1h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 17 00 Recovered data error (with CIRC and/or with retries) | | 18 00 ECC recovered data error (on CD-ROM the L-EC codes) | | For Sense Key NOT READY (2h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 04 00 Device Not Ready (cause unspecified) | | 04 yy Unit off line [See 87-147r1. prb] | | 04 zz Media not inserted in drive | | 53 00 Media load/eject failed | | 57 00 Unable to recover TOC | | For Sense Key MEDIUM ERROR (3h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 11 00 Unrecovered read error | | 11 01 L-EC uncorrectable data error (L-EC codes present and L-EC on) | | 11 02 CIRC unrecovered data error (L-EC unavailable or off) | | 15 00 Seek positioning error | ============================================================================== Additional Sense Code Descriptions (continued) ============================================================================== | For Sense Key HARDWARE ERROR (4h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 08 00 Logical unit communication failure | | 09 00 Track/Data following error | | 09 01 Tracking servo failure | | 09 02 Focus servo failure | | 09 03 Spindle servo failure | | 40 00 Data buffer failure | | 41 00 Data path diagnostic failure | | 42 00 Power on failure | | 44 00 Target internal parity or hardware failure | | 47 00 Interface parity error | | For Sense Key ILLEGAL REQUEST (5h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 20 00 Invalid command operation code | | 21 00 Logical block address not valid | | 22 00 Illegal function for device type | | 24 00 Illegal value in CDB field other than op-code or LBA | | 25 00 Invalid logical unit number | | 26 00 Invalid field in parameter list | | For Sense Key UNIT ATTENTION (6h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 28 00 Not ready to ready transition (cartridge inserted) | | 29 00 Power on, reset or BUS DEVICE RESET occurred | | 2A 00 Mode select parameters changed | | For Sense Key BLANK CHECK (8h): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 61 00 Illegal mode for this track | | 62 00 End of user area encountered on this track | ============================================================================== Additional Sense Code Descriptions (continued) ============================================================================== | For Sense Key ABORTED COMMAND (Bh): | | | | Bytes | | 12 13 Description | | --- --- ---------------------------------------------------------------- | | 43 00 Unsuccessful message retry | | 45 00 Reselect failure | | 48 00 Initiator detected error | | 49 00 Message out error | | 4E 00 Overlapped commands attempted | ============================================================================== 13.5. Glossary for Read Only Direct Access Devices 13.5.1. CD-ROM Terminology. CD-ROM Control Field - a four bit field in the Q sub-channel data indicating the type of information encoded on the current track. Indicates audio vs. data and the type of audio encoding, etc. The control field is also found in the Table of Contents entries. See Table 13-24. CD-ROM Data Mode - a byte in the header of CD-ROM data sectors. This indicates if data is present and if Layered Error Correction information is present. See table 13-18. CIRC - Cross Interleaved Reed-Solomon Code. The error detection and correction technique used within small frames of audio or data. The CIRC bytes are present in all CD-ROM modes. The error correction procedure which uses the CIRC bytes is referred to as the CIRC based algorithm. In most CD- ROM drives, this function is implemented in hardware. L-EC - Layered Error Correction. The error correction technique used with CD- ROM mode one data sectors. In such sectors, 276 bytes of the auxiliary data field contain L-EC bytes. The algorithm which uses these bytes to perform error correction is often implemented in the drive firmware. Blocks per Sector -- The number of Logical Blocks read from each CD-ROM physical sector. The value depends on the Logical Block Length as defined in the Mode Select / Mode Sense Block Descriptor. The value for blocks per Sector is: 1 if the Logical Block Length is 2048, 2 if the Logical Block Length is 1024, 4 if the Logical Block Length is 512, and 8 if the Logical Block Length is 256 bytes. (Assumes a Density Code of 1 - transfer User Data Only - 2048 bytes of data per sector.) Output Port - a means for connecting the audio signal being played to equipment outside the CD-ROM device. Track Relative Logical Address - An offset from the beginning of the recorded information on a track expressed in units of the Logical Block Length. The value is used to address relative to the beginning of a track using the Relative M/S/F address encoded in the CD-ROM Q sub-channel. Lead-in Area - The area on a CD-ROM disc prior to Track one. The main channel in the Lead-in Area contains Audio or Data null information. This area is coded as Track zero but is not addressable via the SCSI command set The Q sub-channel in this area is coded with the Table of Contents information. Lead-out Area - The area on a CD-ROM disc beyond the last information track. The main channel in the Lead-out Area contains Audio or Data null information. This area is coded as Track AAbcd but is not addressable via the SCSI command set. The Read CD-ROM Capacity data is the first Logical Block Address of this area minus one. Transition Area - Sectors at the beginning or end of tracks coded with null information. Where required by the media standards, these areas have minimum lengths of 1 or 2 seconds. The maximum lengths are not specified. Transition areas at the beginning of a track are encoded with Index zero. Addresses within transition areas may not be read. Pre-gap Area - A transition area at the beginning of a data track encoded with null information. This transition area is required where the data track immediately follows an audio track. Post-gap Area - A transition area at the end of a data track encoded with null information. This transition area is required where the data track immediately precedes an audio track. Pause Area - A transition area at the beginning or end of an audio track encoded with audio silence. This transition area is required where the audio track immediately precedes a data track. CD-ROM - Compact Disc Read Only Memory. CD-ROM is a standardized media for recording digitized audio and digital data. The CD-ROM standards were developed by N.V. Philips & Sony Corporation. The 'RED BOOK' - CD- Digital Audio and 'YELLOW BOOK' (or IEC 908) - CD-ROM standards describe the medium. CD-ROM is sometimes used to describe media with digital data rather than discs which encode audio only. CD-DA - Compact Disc - Digital Audio. The standardized media for recording digital audio information. The 'RED BOOK' defines CD-DA media. Sub-channel - The compact disc has a main channel and a sub-channel. The sub- channel area has eight parts called P, Q, R, S, T, U, V, and W. The Q- sub-channel contains useful information, such as the control field and M/S/F addresses. The data rate of each sub-channel (P, Q, etc.) is 1/192nd of that of the main channel. Track - Track Number. A track is a sub-division of the CD-ROM media. A disc has from one to ninety-nine tracks. The data within a track is always of the same type. A track can contain be either CD-ROM or CD-Audio. A disc can start at any track number. Index - Index Number. An Index is a subdivision of a CD-ROM track. A track can have from 1 to 99 index numbers. Index numbers within a track are sequential starting with 1. TOC - The Table Of Contents has information on the type of disc and the starting address of the tracks. This information is encoded in the Q Sub-channel. BCD - Binary Coded Decimal is the number system used on compact discs. Numbers that are use this notation have the 'bcd' suffix attached. A byte has two four-bit values each of which can have a value from 0 to 9. The maximum value is 99bcd (99 decimal). Hence the maximum number of tracks is 99bcd. Example: 00 01 02 03 04 05 06 07 08 09 10 11 ... 19 20 21 ... 98 99. HEX - Hexadecimal is a base sixteen number system used to express some values defined in this document. Numbers that use this notation have the 'h' suffix attached. This number system differs from 'bcd' in that the it uses the first five letters of the alphabet. The maximum value is FFh (255 decimal). Example: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 ... FF M/S/F Address - Minutes / Seconds / Frames. The physical address written on CD-ROM discs. Expressed in a time value relative to either the beginning of the media (absolute) or to the beginning of the current track (relative). Aminutes - The minutes part of the absolute time from the beginning of the disc. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 74bcd. Aseconds - The seconds part of the absolute time from the beginning of the disc. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 59bcd. AFrame - The sub-division of the seconds part of the absolute time from the beginning of the disc. One second of elapsed time equals 75 frames. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 74bcd. RMinutes - The relative time in minutes from the beginning of the track. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 74bcd. RSeconds - The relative time in seconds from the beginning of the track. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 59bcd. RFrame - The sub-division of the seconds part of the relative time from the beginning of this track. One second of elapsed time equals 75 frames. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 74bcd. Frame - The frame number within a one second duration of the CD-ROM media. Written on CD-ROM media in binary coded decimal notation. The value is from 00bcd to 74bcd. One second of elapsed time equals 75 frames. The term Frame is also used in the CD-ROM model to describe the amount of data received between synchronization patterns. 98 of these frames make a sector. This sort of frame will be referred to as 'small frames' where the meaning is not clear from context. Sector - refers to the data contained during one frame time (1/75th of a second). In the CD-ROM standard document the term block is used for this unit. There may be more than one Logical Block per sector. Similarly, a single Logical Block may map to multiple sectors. Block - The term block refers to the data in one Logical Block - the number of bytes defined by the Logical Block Length in the Mode Select / Mode Sense Block Descriptor. Hold Track State - When a CD-ROM device enters the hold track state the optical pick-up is maintained at an approximately constant position on the media. This allows a paused operation to be resumed without latency due to seeking. (Rotational latency may be incurred, however.) END OF DOCUMENT