CD-ROM - INFORMATION OVERKILL - Part 5 Supplied by Brian Burke @~Continued from last issue 32. How do I write an MSDOS program that can access a CD-ROM using MSCDEX? The MSCDEX interface documentation is available on the Microsoft Programmer's Library CD-ROM. This also has detailed specifications for drivers that talk to MSCDEX. It even provides solutions to a number of sticky problems. The file mscdex21.zip contains Microsoft's info on how to talk to the CD-ROM extensions (MSCDEX.EXE) and a sample DOS application which is crude but effective in playing audio tracks. MSCDEX programming information can be found in INTER31?.ZIP. Ralf Brown's interrupt bible. The information is very complete. There is a book by Ray Duncan (Microsoft Press) detailing all extensions to Dos (XMS, LIM EMS, MSCDEX etc..) which should be available in book stores. The title is "MS-DOS EXTENSIONS" ISBN 1-55615-212-4. ================================================================== 33. How do I use a CD-ROM with OS/2? What you need to do to make your CD-ROM drive work under os/2 is: 1) make a bootable MSDOS floppy disk which is configured so that you can use the CD_ROM after booting from this floppy. 2) copy the files fsaccess.sys and fsfilter.sys onto the floppy and then add DEVICE= statements to the CONFIG.SYS for the floppy. 3) copy the floppy disk to the OS/2 hard disk using the VDISK command. 4) create an icon with the "boot from drive" option set to the name of the file created by the VDISK command. 5) Click on the icon. OS/2 has built in support for IBM drives, and for SCSI third party drives. The Sony CDU 541 works well. What you need to do if you don't have one of the supported drives, is use the OS/2 command VMDISK to create a bootable "diskette image" on your hard disk. On the diskette image file, you will copy a CONFIG.SYS file, an AUTOEXEC.BAT, and the drivers you require for your CDROM. This feature allows you use any driver with OS/2. The down side is that you can't access the device in the image box from any OS/2 window. You have to use the bootable image box to copy files back and forth between the image box and any other. If you have one of the supported drives, you can access it from any box. The VMDISK technique is only needed for unsupported, mainly non-SCSI drives. Some unsupported SCSI drives, such as the NEC CDR-84, work fine with OS/2. The only thing to do in order to make some unsupported SCSI CD-ROM drives work (as a data CD-ROM, MM is another problem) is to patch the vendor ID string into \OS2\CDROM.SYS. Simply replace "TOSHIBA " by "NEC ", etc. i.e. with blank-padding to eight characters. This is known to work with NEC and SONY drives. It does not work with some Matsushita (Panasonic) drives. Systems Integration Technologies sells a Mitsumi CD-ROM Device Driver for OS/2. The price is $10+S/H for text only, and $25+S/H for the future enhanced driver. ================================================================== 34. Which CD-ROM Drives will work with MicroSoft Windows-NT? The Microsoft(R) Windows NT(TM) operating system is designed to support a broad range of hardware. This is a preliminary list of hardware that we have run Windows NT on to date. This is a subset of the hardware we expect to support in the final product. The following hardware has undergone preliminary testing for this release. We have not tested every machine and/or device in all possible configurations. Microsoft makes no warranties express or implied in this document. Disk Controllers: 100% Register Compatible with WD1003 - ESDI, IDE, WD1003 Compaq Intelligent Drive Array SCSI(R) Adaptec AHA-1540b, AHA-1542b, AHA-1640, AHA-1740 Future Domain TMC-845, TMC-850, TMC-850M(ER), MCS-700 (7), TMC-1660 (7) TMC-1680 (7), TMC-7000EX IBM SCSI Host Adapter (10) Maynard 16 Bit SCSI Adapter (11) NCR 53C700 Olivetti ESC - 1 Adapter Built-in SCSI on MIPS ARC/R4000 systems from : Acer, MIPS and Olivetti CD-ROM devices: CD Technology CD Porta-Drive T-3301 Chinon CDX-431 Denon(R) DRD 253 Hitachi(R) CDR-1750S NEC Intersect CDR-73(M), Intersect CDR-84 Pioneer(R) DRM-600 Sony(R) CDU-541, CDU-6211, CDU-7211 Toshiba XM-3201, TXM-3301 (7) A driver that supports both Setup and File I/O for the Future Domain MCS-700, and TMC-16X0 series controllers will be posted to CompuServe in the WINNT forum, Lib 2 "Fixes and Updates". (10) Earlier versions of this controller have proven to have problems with various CD-Rom drives. The Chinon CDX-431 and NEC Intersect CDR-73 are known to work with this version of controller. (11) The Maynard SCSI Adapter can be used as a general purpose SCSI controller for all tasks but graphical setup. ================================================================== 35. How do I read an audio CD track as digital data? Most CD-ROM drives cannot decode audio information. There are firmware and data path reasons why it doesn't work. The drive vendors could make drives that allow this feature. There are only a few drives with the capability to read audio tracks as data: The AppleCD 300 (which is a Sony 8003), the Sony CDU-561 and the CD-ROM drive sold by Silicon Graphics for use with their Indigo workstation. The SGI drive is a modified Toshiba 3301B. For the Toshiba drives, you issue a MODE SELECT command with density code 0x82 and then all reads with an lba inside a digital audio track will return 2352 bytes audio samples / block. Both Sony and Toshiba may support reading audio (red book) CDs on their next generation drives (the dual speed ones), at least, as an option. There are several ways to read digital audio from Sony CDU 561 and Sony CDU 8003 mechanisms. Note that the technique of merely setting the density (0x82) using MODE SELECT SCSI command as on Toshiba 3401s will not work. Here are three ways to read digital audio Red Book standard audio track data across the SCSI bus into your computer complete with all sound processing already performed (For example the CIRC routine already run and the output is LRLRLR pairs of 16 bit digital audio samples 2352 bytes per CD-ROM block). Method 1 : READ CD-DA scsi command 0xD8 Byte 0: D8 1: 0 2: <4th most significant byte of logical block address> 3: <3rd byte> 4: <2nd> 5: <1st, lowest of the address> 6: <4th most significant byte of transfer length 7: <3rd byte> 8: <2nd> 9: <1st, lowest of the number of contiguos blocks to transfer> 10: (0 == normal 2352, other values are 01, 02, 03) 11: Method 2 : READ CD-DA MSF scsi command 0xD9 byte 0: D9 1: 0 2: 0 3: 4: 5: 6: 0 7: 8: 9: 10: (0 == normal 2352 each, other values are 01, 02, 03) 11: For this one you will need to remember how to convert MSF to logical (LBA) address to set the SCSI transfer length correctly to avoid the Mac SCSI manager reporting a phase error. to calculate the number of bytes total you will get use the formula: ((Me-Ms)*60*75 + (Se-Ss) * 75 + (Fe-Fs)) * (2352) Method 3 : MODE SELECT (6) 0x15 This is a very complex topic to discuss, but if you know how to use the SCSI mode select page commands the third more direct (and jitter filled) method to get digital audio across the SCSI bus on the new SONY devices is to set the block length of the volatile settings in the 6th 7th and 8th bytes of the Block descriptor section of a MODE select list with 0 or more pages (12 bytes for none) to a setting of either 2352, 2368, or 2448. You want 2352, but I have not tried this technique and Sony recommends the special streaming commands. WARNING: for high quality use large transfers but QUICKLY re-issue another command as soon as a command is completed. The head must never come to a rest for 100% pure results. The format of a CD-DA sector, that the Toshiba XM-3401 returns, is not too complicated: each sector contains 2352 bytes, these are devided into 588 16-bit signed stereo samples of 4 bytes each. The 16-bit samples are returned in 'low byte first' (i386, ...) byte order. The 16-bit samples in the sector are intended alternating for the left and right channel, starting with the left channel. struct cdda_sector { struct cdda_sample { char left_channel_lsb; char left_channel_msb; char right_channel_lsb; char right_channel_msb; } samples[588]; }; ================================================================== 36. Why do CD-ROMs cost so much? Here are several answers, take your pick: A. Because too many people are willing to pay the high prices. B. They are not really very expensive when you consider how much data they contain. Even the most expensive CD-ROMs are often cheaper than the least expensive floppies when you figure the cost per byte. C. Because there isn't enough competition. The prices will come down when more people buy drives, and more CD-ROM titles are available. ================================================================== 37. Why do all the bundle deals require me to buy a drive? What if I already have a drive? Many disc producers sell outdated or surplus discs at steep discounts to be bundled with new drives. The theory is that the new drive owner will find the discs useful, and order the latest version at full price. There are some bundle deals that do not require you to buy a new drive. For instance, the CD-ROM User's Group (see earlier) has a bundle of ten discs for $99. ================================================================== 38. What is the shelf-life of a CD-ROM? If a CD-ROM is not manufactured properly, the lifetime can be very short, perhaps only a few years. This can happen if the edge of the disc is not properly sealed, and oxygen reaches the metal surface. If the disc is manufactured properly, it will last a very long time. Most CD-ROMs should last for more than a human lifetime. Philips has proposed new standards for testing CD-ROMs that are expected to result in discs that will enjoy a life span of more than a thousand years. For more information see Fox, Barry "CD Makers Perform in Unison to Stop the Rot" New Scientist 134(1815) (April 4, 1992):19. The laser used in a CD-ROM drive is very low power, and does not harm the disc in any way. Reading the disc will not shorten the lifetime. ================================================================== 39. How should I handle my CD-ROMs? How do I clean them? The following guidelines represent the current thinking for the care and handling of CD-ROM discs, by a number of CD-ROM disc and drive manufacturers. The validity and usefulness of most of these guidelines have not been substantiated by government testing and therefore are presented for information only. Wash your hands before contact with the disc. If available, wear lint-free cloth gloves, finger cots, or talc-free latex gloves. If you must wipe the disc, do so with a soft, dry, lint-free cloth in a radial motion - that is from the inner to the outer hub - not in a circular motion around the disc like you might do for a phonograph record. The most devastating scratches are those which occur along a circular arc of the disc which can obscure a long stream of pits. Certain cleaning agents and solvents can damage the discs. Some of these include: gasoline, paint thinners, benzine, acetone, carbon tetrachloride, chlorinated cleaning solvents, ammonia, and household detergents which contain ammonia. Do not clean with a water soaked cloth. The use of Isopropyl alcohol, the ingredient in many commercial CD cleaning products, as well as certain waxes and acrylic liquids, is still questionable. Do not clean the label side of the disc. Use of a CD-ROM caddy is highly recommended during transport and operation. Limit the amount of physical contact with the disc. Always handle the disc by the outer edge and/or the inner (hole) edge. Never touch the data surface. Discs like to "live" in the same conditions that people do; that is: They don't like to be manhandled They don't like exposure to temperature extremes They don't like exposure to excess humidity They don't like exposure to high intensity UV light Ron Kushnier, Chairman Compact Disc-Reliability & Integrity of Media Working Group of The Special Interest Group on CD-ROM Applications and Technology Code 5053 Naval Air Warfare Center Warminster, PA. 18974 (215) 441-1624 FAX (215) 441-7271 @~The conclusion of this article will be in the next issue - o -