Subject: Re: hangs while trying to record a CD
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: current-users
Date: 05/15/2002 20:01:49
--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, May 15, 2002 at 12:41:36PM -0400, Nathan J. Williams wrote:
> Here's what I came up with (from a slightly different command,
> cdrecord -v blank=all):
> 
> cd0(pciide0:1:0):  sense debug information:
>         code 0x70 valid 0x0
>         seg 0x0 key 0x6 ili 0x0 eom 0x0 fmark 0x0
> 
> info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
>         extra: 0x0 0x0 0x0 0x0 0x29 0x0 0x0 0x0 0x0 0x0 
> cd0(pciide0:1:0):  sense debug information:
>         code 0x70 valid 0x0
>         seg 0x0 key 0x5 ili 0x0 eom 0x0 fmark 0x0
> 
> info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
>         extra: 0x0 0x0 0x0 0x0 0x64 0x0 0x0 0x0 0x0 0x0 
> cd0(pciide0:1:0): illegal request, data = 00 00 00 00 64 00 00 00 00 00
> cd0: dos partition I/O error
> wdc_atapi_intr: warning: reading only 1 of 2 bytes
> xs(0xc166b000): xs_control(0x00009018)xs_status(0x00000000)periph(0xc1546700)retr(0x0)timo(0x9c40)cmd(0xc166b088)len(0xc)data(0xe2df2c80)len(0x103)res(0x103)err(0x0)bp(0xc1639d08)cd0(pciide0:1:0):  command: 0x5a,0x0,0x3f,0x0,0x0,0x0,0x0,0x1,0x3,0x0,0x0,0x0-[259 bytes]

OK, the len is wrong. The command comes from cdrecord.
Can you try to remplace patch-aj by the one attached and rebuild cdrecord ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--

--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-aj

$NetBSD: patch-aj,v 1.2 2001/08/07 11:23:57 drochner Exp $

--- cdrecord/scsi_cdr.c.orig	Wed Apr 11 00:22:21 2001
+++ cdrecord/scsi_cdr.c	Wed May 15 19:55:52 2002
@@ -271,6 +271,12 @@
 request_sense(scgp)
 	SCSI	*scgp;
 {
+
+#ifdef __NetBSD__
+	/* request sense already done by kernel */
+	scg_prsense((Uchar *)scgp->scmd->u_sense.cmd_sense,
+	    scgp->scmd->sense_count);
+#else	
 		 char	sensebuf[CCS_SENSE_LEN];
 	register struct	scg_cmd	*scmd = scgp->scmd;
 
@@ -290,6 +296,7 @@
 	if (scg_cmd(scgp) < 0)
 		return (-1);
 	scg_prsense((Uchar *)sensebuf, CCS_SENSE_LEN - scg_getresid(scgp));
+#endif
 	return (0);
 }
 
@@ -1741,9 +1748,9 @@
 
 	fillbytes(mode, sizeof(mode), '\0');
 	scgp->silent++;
-	if (mode_sense(scgp, mode, 0xFF, 0x3F, current?0:2) < 0) {	/* All Pages */
+	if (mode_sense(scgp, mode, 0xFE, 0x3F, current?0:2) < 0) {	/* All Pages */
 		fillbytes(mode, sizeof(mode), '\0');
-		if (mode_sense(scgp, mode, 0xFF, 0, current?0:2) < 0)	{/* VU (block desc) */
+		if (mode_sense(scgp, mode, 0xFE, 0, current?0:2) < 0)	{/* VU (block desc) */
 			scgp->silent--;
 			return (-1);
 		}

--yrj/dFKFPuw6o+aM--