rhcoe@violin.austin.ibm.com (Rich Coe/65536) (05/01/90)
/* * PLAY PROGRAM * This program is executed from the comamnd line by: * * "play /dev/rcd? track#" * * where /dev/rcd? is the special file name of the cdrom and track number * is the track where play is to begin. This program will exit and leave * the cdrom playing. */ #include <stdio.h> #include "fcntl.h" #include <sys/ioctl.h> #include <sys/cdrom.h> int fd,rc; extern errno; uchar track; int getdecnum(strg) char *strg; { int r = 0; char ic; ic = *strg++; while (ic != '\0') { if (ic < '0' || ic > '9') return(-1); else { r *= 10; r += ic - '0'; } ic = *(strg++); } if (r > 9) r+=6; return(r); } int pass_thru(track) uchar track; { struct sc_iocmd pt; char menuopt; int i, rc; /* Issue 2 test unit ready's */ for (i=0 ; i<2 ; i++) { pt.command_length = 0x06; pt.scsi_cdb[0] = 0x00; pt.scsi_cdb[1] = 0x00; pt.scsi_cdb[2] = 0x00; pt.scsi_cdb[3] = 0x00; pt.scsi_cdb[4] = 0x00; pt.scsi_cdb[5] = 0x00; pt.flags = 0x00; pt.buffer = 0x00; pt.data_length = 0x00; pt.timeout_value = 0x05; pt.status_validity = 0x00; pt.scsi_bus_status = 0x00; pt.adapter_status = 0x00; rc = ioctl(fd, CDIOCMD, &pt); } if (rc == -1) { printf("\nioctl failed. errno = %d", errno); printf("\n\nstatus_validity = %.2X",pt.status_validity); printf("\nscsi_bus_status = %.2X", pt.scsi_bus_status); printf("\nadapter_status = %.2X", pt.adapter_status); return(rc); } /* issue the play command */ pt.command_length = 0x0A; pt.scsi_cdb[0] = 0xC0; pt.scsi_cdb[1] = 0x01; pt.scsi_cdb[2] = track; for (i = 3 ; i < 9 ; i ++) { pt.scsi_cdb[i] = 0x00; } pt.scsi_cdb[9] = 0x80; pt.flags = SC_ASYNC; pt.buffer = 0x00; pt.data_length = 0x00; pt.timeout_value = 0x05; pt.status_validity = 0x00; pt.scsi_bus_status = 0x00; pt.adapter_status = 0x00; rc = ioctl(fd, CDIOCMD, &pt); if (rc == -1) { printf("\nioctl failed. errno = %d", errno); printf("\n\nstatus_validity = %.2X",pt.status_validity); printf("\nscsi_bus_status = %.2X", pt.scsi_bus_status); printf("\nadapter_status = %.2X", pt.adapter_status); } return(rc); } main(argc,argv) int argc; char * argv[]; { if (argc != 3) { printf("\nIncorrect number of paramaters.\n"); printf("Format: play special_file_name track_number\n"); } else { if ( (fd = openx(argv[1], O_RDONLY, NULL, SC_DIAGNOSTIC)) < 0) { return(99); } track = getdecnum(argv[2]); if (track > 9) track+=6; if (track != -1) { rc = pass_thru(track); } else printf("\nError in track number.\n"); } }
cryun@sdrc.UUCP (Yun-Seng Chao) (05/08/90)
From article <18261@rpp386.cactus.org>, by jfh@rpp386.cactus.org (John F. Haugh II): > In article <1361@sdrc.UUCP> cryun@sdrc.UUCP (Yun-Seng Chao) writes: >>I thought this only played 1 test track? Nobody (support people) seems to >>know down in Austin. > > No, this should play the entire CD. Back before anyone had the > CD player program that is how we listened to CDs. Now there are > several programs running around, including a Motif icon version, Well, I set switch 6 on. But got only 1 track continuously. (Boring). I can't set the SCSI ID to 0, the 2 disks are at 0 and 1 and I don't know where the address jumpers/dip switches are on those disks. (No manuals or docs of any kind on the hardware). Could someone tell me where some of these CD player programs are located. I'll be glad to send media and postage to get hold of it. Thanks! Yun Chao -- ------------------------------------------------------------------------ Yun-seng Chao {uunet, cinnet.com}!sdrc!cryun SDRC; Milford, Ohio
jcz@britten.unx.sas.com (John Carl Zeigler) (05/29/90)
.In article <1386@sdrc.UUCP> cryun@sdrc.UUCP (Yun-Seng Chao) writes: .>From article <18261@rpp386.cactus.org>, by jfh@rpp386.cactus.org (John F. Haugh II): .>> In article <1361@sdrc.UUCP> cryun@sdrc.UUCP (Yun-Seng Chao) writes: .>> No, this should play the entire CD. Back before anyone had the .>> CD player program that is how we listened to CDs. Now there are >> several programs running around, including a Motif icon version, How do I get the CD player program???? --jcz -- --jcz John Carl Zeigler SAS Institute Inc. (919) 467-8000 Manager, UNIX Host R&D PoB 8000, Cary, NC 27512 ...!mcnc!rti!sas!jcz