On Wed, Feb 20, 2002 at 11:17:22PM +0100, Oliver Fromme wrote:
> Sascha Holzleiter <sh(at)root-login.org> wrote:
>  > ich habe gerade bemerken müssen, dass es extrem störend ist, eine MP3 CD
>  > im Plextor 40x Laufwerk laufen zu lassen :)
> 
> Da kann ich nur empfehlen, bei eBay ein Double-Speed-Lauf-
> werk (o.ä.) für 'nen Appel und 'n Ei zu erwerben.  ;-)
Oder ein ATAPI-Laufwerk. ;->
CDIOCREADSPEED steht zwar in cdrio.h, aber es gilt auch für CD-ROM-
Laufwerke. (Wobei meines dann auch beim "play"-Kommando, also beim
Abspielen von Audio-CDs, die neu eingestellte Geschwindigkeit benutzt,
obwohl laut Standard die eingestellte Geschwindigkeit nur für
CD-ROM und eben nicht für "play" gilt.)
In sys/cam/scsi/scsi_all.c sind die SCSI-Kommandos "SET CD SPEED"
und "SET CD-ROM SPEED" übrigens schon eingetragen, aber als "proposed"
markiert. Und code, der CDIOCREADSPEED oder andere ioctl-requests auf
diese SCSI-Kommandos umsetzen würde, fehlt auch.
Tschüß, Philipp
Index: cdcontrol.1
===================================================================
RCS file: /ncvs/src/usr.sbin/cdcontrol/cdcontrol.1,v
retrieving revision 1.32
diff -u -r1.32 cdcontrol.1
--- cdcontrol.1	15 Jul 2001 08:01:46 -0000	1.32
+++ cdcontrol.1	21 Feb 2002 09:25:21 -0000
@@ -156,6 +156,11 @@
 Set LBA ioctl mode.
 .It Cm quit
 Quit the program.
+.It Cm speed Op Ar s
+Set the highest speed that the drive should use (default is the maximum
+speed supported by the drive).
+This command is currently only supported on ATAPI drives.
+On ATAPI drives this command may apply only to data CDs but not to audio CDs.
 .El
 .Sh ENVIRONMENT
 The following environment variables affect the execution of
Index: cdcontrol.c
===================================================================
RCS file: /ncvs/src/usr.sbin/cdcontrol/cdcontrol.c,v
retrieving revision 1.36
diff -u -r1.36 cdcontrol.c
--- cdcontrol.c	9 Dec 2001 19:34:11 -0000	1.36
+++ cdcontrol.c	21 Feb 2002 08:43:48 -0000
@@ -24,6 +24,7 @@
 #endif /* not lint */
 
 #include <sys/cdio.h>
+#include <sys/cdrio.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
 #include <sys/param.h>
@@ -72,6 +73,7 @@
 #define CMD_CDID	15
 #define CMD_NEXT	16
 #define CMD_PREVIOUS	17
+#define CMD_SPEED	18
 #define STATUS_AUDIO	0x1
 #define STATUS_MEDIA	0x2
 #define STATUS_VOLUME	0x4
@@ -103,6 +105,7 @@
 { CMD_STOP,	"stop",		3, "" },
 { CMD_VOLUME,	"volume",	1,
       "<l> <r> | left | right | mute | mono | stereo" },
+{ CMD_SPEED,	"speed",	2, "[speed]" },
 { CMD_CDID,	"cdid",		2, "" },
 { 0,		NULL,		0, NULL }
 };
@@ -276,7 +279,7 @@
 
 int run (int cmd, char *arg)
 {
-	int l, r, rc;
+	int l, r, rc, speed;
 
         switch (cmd) {
 
@@ -424,6 +427,26 @@
 
                 return setvol (l, r);
 
+	case CMD_SPEED:
+		if (fd < 0 && ! open_cd ())
+			return (0);
+
+		rc=sscanf (arg, "%d", &speed);
+		switch (rc) {
+			case EOF:
+				speed = 0xFF;
+				break;
+			case 1:
+				speed = speed & 0xFF;
+				break;
+			default:
+				warnx("invalid command arguments");
+				return (0);
+		}
+		rc = ioctl (fd, CDRIOCREADSPEED, &speed);
+
+		return (rc);
+		
         default:
         case CMD_HELP:
                 help ();
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Thu 21 Feb 2002 - 10:30:55 CET