From owner-freebsd-hackers Sun Aug 18 16:21:02 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA20251 for hackers-outgoing; Sun, 18 Aug 1996 16:21:02 -0700 (PDT) Received: from sgiblab.sgi.com (sgiblab.SGI.COM [192.82.208.3]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id QAA20243 for ; Sun, 18 Aug 1996 16:21:00 -0700 (PDT) Received: from bazooka.amb.org by sgiblab.sgi.com via UUCP (940816.SGI.8.6.9/911001.SGI) id QAA22745; Sun, 18 Aug 1996 16:20:59 -0700 Received: by bazooka.amb.org (Sendmail 5.65/AMB-1.4) id AA11587; Sun, 18 Aug 96 14:36:57 -0700 From: xmcd@bazooka.amb.org (Xmcd Admin) Message-Id: <9608182136.AA11587@bazooka.amb.org> Subject: Re: XMCD problem on FreeBSD 2.1.5 To: joerg_wunsch@uriah.heep.sax.de Date: Sun, 18 Aug 1996 14:36:56 -0700 (PDT) Cc: freebsd-hackers@freebsd.org, bwithrow@BayNetworks.com In-Reply-To: <199608180719.JAA15260@uriah.heep.sax.de> from "J Wunsch" at Aug 18, 96 09:19:48 am X-Mailer: ELM [version 2.4 PL22] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk J Wunsch writes: > > While xmcd does support using the CD-audio ioctls under FreeBSD, > > if you have a SCSI CD-ROM drive you lose a couple of features > > when running in that mode. Namely, the SCSI pass-through method > > gives you channel routing and caddy lock/unlock capabilities. > > If you miss some features, they should better be implemented on the > ioctl level, instead of going the other way round. I have no idea > what you mean by `channel routing', "Channel routing" refers to the xmcd controls for stereo/reverse stereo/ mono L/mono R/mono L+R. There is currently no ioctl() command implemented in FreeBSD (or for that matter, SunOS, Linux or other OSes that use ioctls for CD-audio). > I consider using direct SCSI commands the most ugly method to use, > though of course, for many operating systems it's your only chance. That is a matter of opinion... :-) In the shoes of a CD-audio application programmer like myself, I prefer the direct SCSI commands method for several reasons: 1. It allows me to support features that are otherwise not available via the ioctls. The channel routing features in xmcd is an example of this. Now you might argue that adding an ioctl would accomplish the same thing, but keep in mind that xmcd currently support 22 different OS variants and adding an ioctl to all these platforms is not something that can be easily accomplished. Using direct SCSI allows me to support this feature uniformly across all these platforms without being restricted by the limitations imposed by the OS ioctls. In the future I have plans to add support to CD-ROM changers and there is yet another area where using direct SCSI commands is going to be a big win. 2. It allows me to support SCSI-1 and other CD-ROM drives that implement non-standard command sets. Currently the OS ioctl method will only work with SCSI-2 drives that adhere strictly to the SCSI-2 command set. While many drives do claim conformance to SCSI-2, they do not implement all of SCSI-2 documented audio- related command in a uniform way. Xmcd maximized such support by allowing the user to specify the drive and its characteristics, and thus can customize its behavior to match the drive. Xmcd can support many older SCSI-1 drives, as well as support "SCSI-2" drives that have certain idiosyncracies. For example, the software volume is controlled via the Mode Select(6) SCSI command on SCSI-2 drives. But some drives must have the DBD (disable block descriptor) bit set while others must have it cleared (and yet others support both ways). If the command is not sent in a way that drive likes then we get a check condition failure. Xmcd actually can deal with this. The OS ioctl method doesn't. This is just one of many examples of such idiosyncracies... there are many others, notably with the Play Audio Track Index(10) command, the Start/Stop Unit(6) command, and Read Subchannel(10) command. 3. It actually allows me to write code to implement features in xmcd in a more portable way. While there are differences amongst different OSes in how a direct SCSI command is sent, that difference can be isolated into a very small region of code. This allows maximum common and portable code. Indeed, if you were to examine xmcd's source code you will see that the OS-dependent portion of the SCSI pass-through code is very small. Without the use of direct SCSI-passthrough, xmcd would not be able to provide full support of such a wide array of CD-ROM drives. See the xmcd docs for the list of drives. I think you'd agree... At any rate, I don't want to start a big discussion about the benefits of ioctls vs. SCSI pass-through with respect to CD-audio control, but here are my experiences; and I just wanted to share them so you all know where I come from... Cheers, -Ti -- \\ // XMCD - Motif CD player / CDA - Command line CD player \\/ Ti Kan / AMB Research Laboratories //\ E-mail: xmcd@amb.org // \\ URL: http://sunsite.unc.edu/~cddb/xmcd/