burncd block size

2003-11-07 Thread Dag-Erling Smørgrav
I've been having a variety of problems burning CDs with atang:

 - burncd consistently failing in exactly the same spot in the ISO,
   and reporting only wrote 0 of 32768 bytes: Unknown error: 0

 - burncd failing right at the start with only wrote -1 of 32768
   bytes: Input/output error (this generally happens after a couple
   of the previous, and once it starts happening I have to reboot)

 - burncd getting stuck in acdcld for a long time while fixating

 - a *lot* of sensekey=ILLEGAL REQUEST error=4ABORTED; fixating a
   CD causes about half a dozen TEST_UNIT_READY failures, and I
   occasionally get READ_BIG, START_STOP, PREVENT_ALLOW and SET_SPEED
   failures as well, all of them with status=51READY,DSC,ERROR
   sensekey=ILLEGAL REQUEST error=4ABORTED

I've discovered that reducing the buffer size in burncd fixes at least
the first problem, and possibly the second, but not the third.  I've
attached a patch that adds a command-line option for that (the default
will still be 16 blocks at a time, but you can specify anything from 1
to 64 on the command line)

The drive is an LG 8400B with which I've previously had little or no
trouble; prior to atang, it burned CDs just fine at 40x with a failure
rate of precisely 0.

# dmesg | grep acd
acd0: CDRW HL-DT-ST GCE-8400B at ata1-master WDMA2
# atacontrol info ata1
Master: acd0 HL-DT-ST GCE-8400B/1.00 ATA/ATAPI rev 0
Slave:   no device present
# atacontrol cap ata1 0
ATA channel 1, Master, device acd0:

ATA/ATAPI revision0
device model  HL-DT-ST GCE-8400B
serial number
firmware revision 1.00
cylinders 0
heads 0
sectors/track 0
lba supported
lba48 not supported
dma supported
overlap not supported

Feature  Support  EnableValue   Vendor
write cacheno   no
read ahead no   no
dma queued no   no  0/0x00
SMART  no   no
microcode download no   no
security   no   no
power management   no   no
advanced power management  no   no  0/0x00
automatic acoustic management  no   no  0/0x00  0/0x00

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]

Index: burncd.c
===
RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v
retrieving revision 1.37
diff -u -r1.37 burncd.c
--- burncd.c	26 Jul 2003 12:14:58 -	1.37
+++ burncd.c	6 Nov 2003 22:01:00 -
@@ -45,7 +45,8 @@
 #include sys/param.h
 #include arpa/inet.h
 
-#define BLOCKS	16
+#define DEFAULT_BLOCKS 16
+#define MAX_BLOCKS 64
 
 struct track_info {
 	int	file;
@@ -58,6 +59,7 @@
 };
 static struct track_info tracks[100];
 static int global_fd_for_cleanup, quiet, verbose, saved_block_size, notracks;
+static int blocks = DEFAULT_BLOCKS;
 
 void add_track(char *, int, int, int);
 void do_DAO(int fd, int, int);
@@ -81,8 +83,15 @@
 	if ((dev = getenv(CDROM)) == NULL)
 		dev = /dev/acd0;
 
-	while ((ch = getopt(argc, argv, def:Flmnpqs:tv)) != -1) {
+	while ((ch = getopt(argc, argv, b:def:Flmnpqs:tv)) != -1) {
 		switch (ch) {
+		case 'b':
+			blocks = atoi(optarg);
+			if (blocks  0)
+blocks = 1;
+			if (blocks  MAX_BLOCKS)
+blocks = MAX_BLOCKS;
+			break;
 		case 'd':
 			dao = 1;
 			break;
@@ -94,7 +103,7 @@
 		case 'f':
 			dev = optarg;
 			break;
-	
+
 		case 'F':
 			force = 1;
 			break;
@@ -136,7 +145,7 @@
 			verbose = 1;
 			break;
 
-		default: 
+		default:
 			usage();
 		}
 	}
@@ -149,11 +158,11 @@
 	if ((fd = open(dev, O_RDWR, 0))  0)
 		err(EX_NOINPUT, open(%s), dev);
 
-	if (ioctl(fd, CDRIOCGETBLOCKSIZE, saved_block_size)  0) 
-   		err(EX_IOERR, ioctl(CDRIOCGETBLOCKSIZE));
+	if (ioctl(fd, CDRIOCGETBLOCKSIZE, saved_block_size)  0)
+		err(EX_IOERR, ioctl(CDRIOCGETBLOCKSIZE));
 
-	if (ioctl(fd, CDRIOCWRITESPEED, speed)  0) 
-   		err(EX_IOERR, ioctl(CDRIOCWRITESPEED));
+	if (ioctl(fd, CDRIOCWRITESPEED, speed)  0)
+		err(EX_IOERR, ioctl(CDRIOCWRITESPEED));
 
 	global_fd_for_cleanup = fd;
 	err_set_exit(cleanup);
@@ -164,26 +173,26 @@
 			break;
 		}
 		if (!strcasecmp(argv[arg], msinfo)) {
-		struct ioc_read_toc_single_entry entry;
+			struct ioc_read_toc_single_entry entry;
 			struct ioc_toc_header header;
 
-			if (ioctl(fd, CDIOREADTOCHEADER, header)  0) 
+			if (ioctl(fd, CDIOREADTOCHEADER, header)  0)
 err(EX_IOERR, ioctl(CDIOREADTOCHEADER));
 			bzero(entry, sizeof(struct ioc_read_toc_single_entry));
 			entry.address_format = CD_LBA_FORMAT;
 			entry.track = header.ending_track;
-			if (ioctl(fd, CDIOREADTOCENTRY, entry)  0) 
+			if (ioctl(fd, CDIOREADTOCENTRY, entry)  0)
 err(EX_IOERR, ioctl(CDIOREADTOCENTRY));
-			if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, addr)  0) 
+			if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, addr)  0)
 err(EX_IOERR, ioctl(CDRIOCNEXTWRITEABLEADDR));
-			fprintf(stdout, %d,%d\n, 
+			fprintf(stdout, %d,%d\n,
 

Re: burncd block size

2003-11-07 Thread Jeremy Messenger
On Fri, 07 Nov 2003 10:10:40 +0100, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:

I've been having a variety of problems burning CDs with atang:

 - burncd consistently failing in exactly the same spot in the ISO,
   and reporting only wrote 0 of 32768 bytes: Unknown error: 0
 - burncd failing right at the start with only wrote -1 of 32768
   bytes: Input/output error (this generally happens after a couple
   of the previous, and once it starts happening I have to reboot)
Whew, glad that I am not only one.. I *just* have wasted two of my blank 
CD in like fifteen minutes ago, I keep wondering if I created the ISO 
files in the wrong way or was it burncd's fault.. Until now here..

I get like this:
=
# burncd -f /dev/acd0 -e -s 6 data NT2004.iso fixate
next writeable LBA 0
writing from file NT2004.iso size 662576 KB
written this track 410656 KB (61%) total 410656 KB
only wrote 4096 of 32768 bytes: Unknown error: 0
fixating CD, please wait..
=
I tried the another ISO and I get the same thing by stopped at 32768 bytes.

I am going to use cdrecord for now, hope it will work ok.

Cheers,
Mezz
 - burncd getting stuck in acdcld for a long time while fixating

 - a *lot* of sensekey=ILLEGAL REQUEST error=4ABORTED; fixating a
   CD causes about half a dozen TEST_UNIT_READY failures, and I
   occasionally get READ_BIG, START_STOP, PREVENT_ALLOW and SET_SPEED
   failures as well, all of them with status=51READY,DSC,ERROR
   sensekey=ILLEGAL REQUEST error=4ABORTED
I've discovered that reducing the buffer size in burncd fixes at least
the first problem, and possibly the second, but not the third.  I've
attached a patch that adds a command-line option for that (the default
will still be 16 blocks at a time, but you can specify anything from 1
to 64 on the command line)
The drive is an LG 8400B with which I've previously had little or no
trouble; prior to atang, it burned CDs just fine at 40x with a failure
rate of precisely 0.
# dmesg | grep acd
acd0: CDRW HL-DT-ST GCE-8400B at ata1-master WDMA2
# atacontrol info ata1
Master: acd0 HL-DT-ST GCE-8400B/1.00 ATA/ATAPI rev 0
Slave:   no device present
# atacontrol cap ata1 0
ATA channel 1, Master, device acd0:
ATA/ATAPI revision0
device model  HL-DT-ST GCE-8400B
serial number
firmware revision 1.00
cylinders 0
heads 0
sectors/track 0
lba supported
lba48 not supported
dma supported
overlap not supported
Feature  Support  EnableValue   Vendor
write cacheno   no
read ahead no   no
dma queued no   no  0/0x00
SMART  no   no
microcode download no   no
security   no   no
power management   no   no
advanced power management  no   no  0/0x00
automatic acoustic management  no   no  0/0x00  0/0x00
DES


--
bsdforums.org 's moderator, mezz.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: burncd block size

2003-11-07 Thread Soren Schmidt
It seems Jeremy Messenger wrote:
 On Fri, 07 Nov 2003 10:10:40 +0100, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:
 
  I've been having a variety of problems burning CDs with atang:
 
   - burncd consistently failing in exactly the same spot in the ISO,
 and reporting only wrote 0 of 32768 bytes: Unknown error: 0
 
   - burncd failing right at the start with only wrote -1 of 32768
 bytes: Input/output error (this generally happens after a couple
 of the previous, and once it starts happening I have to reboot)
 
 Whew, glad that I am not only one.. I *just* have wasted two of my blank 
 CD in like fifteen minutes ago, I keep wondering if I created the ISO 
 files in the wrong way or was it burncd's fault.. Until now here..

This is fallout from getting atapi-cd under GEOM. GEOM wasn't designed
to handle medias of size 0 and where the sizes can change during an
open. I just committed a fix that has solved the issue here (and its ugly).

-Søren
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: burncd block size

2003-11-07 Thread Jeremy Messenger
On Fri, 7 Nov 2003 10:28:42 +0100 (CET), Soren Schmidt 
[EMAIL PROTECTED] wrote:

It seems Jeremy Messenger wrote:
On Fri, 07 Nov 2003 10:10:40 +0100, Dag-Erling Smørgrav [EMAIL PROTECTED] 
wrote:

 I've been having a variety of problems burning CDs with atang:

  - burncd consistently failing in exactly the same spot in the ISO,
and reporting only wrote 0 of 32768 bytes: Unknown error: 0

  - burncd failing right at the start with only wrote -1 of 32768
bytes: Input/output error (this generally happens after a couple
of the previous, and once it starts happening I have to reboot)
Whew, glad that I am not only one.. I *just* have wasted two of my blank
CD in like fifteen minutes ago, I keep wondering if I created the ISO
files in the wrong way or was it burncd's fault.. Until now here..
This is fallout from getting atapi-cd under GEOM. GEOM wasn't designed
to handle medias of size 0 and where the sizes can change during an
open. I just committed a fix that has solved the issue here (and its 
ugly).
Thanks! /me goes to update his -CURRENT...

Cheers,
Mezz
-Søren


--
bsdforums.org 's moderator, mezz.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: burncd block size

2003-11-07 Thread Jeremy Messenger
On Fri, 7 Nov 2003 10:28:42 +0100 (CET), Soren Schmidt 
[EMAIL PROTECTED] wrote:

It seems Jeremy Messenger wrote:
On Fri, 07 Nov 2003 10:10:40 +0100, Dag-Erling Smørgrav [EMAIL PROTECTED] 
wrote:

 I've been having a variety of problems burning CDs with atang:

  - burncd consistently failing in exactly the same spot in the ISO,
and reporting only wrote 0 of 32768 bytes: Unknown error: 0

  - burncd failing right at the start with only wrote -1 of 32768
bytes: Input/output error (this generally happens after a couple
of the previous, and once it starts happening I have to reboot)
Whew, glad that I am not only one.. I *just* have wasted two of my blank
CD in like fifteen minutes ago, I keep wondering if I created the ISO
files in the wrong way or was it burncd's fault.. Until now here..
This is fallout from getting atapi-cd under GEOM. GEOM wasn't designed
to handle medias of size 0 and where the sizes can change during an
open. I just committed a fix that has solved the issue here (and its 
ugly).
It's fixed, now I am able to burn it full on CD. I get the new messages 
(see bottom) when it boot, but it seems to be harmless since I can use 
anything and work ok. Does this messages mean I need to give the 
SCSI_DELAY more time?

==
Nov  7 13:21:43 mezz kernel: acd0: CDRW CD-W516EB at ata0-master PIO4
Nov  7 13:21:43 mezz kernel: Waiting 5 seconds for SCSI devices to settle
Nov  7 13:21:43 mezz kernel: GEOM: create disk cd0 dp=0xc2e44e00
Nov  7 13:21:43 mezz kernel: GEOM: create disk da0 dp=0xc2e36450
Nov  7 13:21:43 mezz kernel: da0 at ahc0 bus 0 target 0 lun 0
Nov  7 13:21:43 mezz kernel: da0: SEAGATE ST336706LW 0109 Fixed Direct 
Access SCSI-3 device
Nov  7 13:21:43 mezz kernel: da0: 160.000MB/s transfers (80.000MHz, offset 
63, 16bit), Tagged Queueing Enabled
Nov  7 13:21:43 mezz kernel: da0: 35003MB (71687370 512 byte sectors: 255H 
63S/T 4462C)
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): Recovered Sense
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): READ CD RECORDED CAPACITY. 
CDB: 25 0 0 0 0 0 0 0 0 0
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): CAM Status: SCSI Status 
Error
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): SCSI Status: Check Condition
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): NOT READY asc:3a,0
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): Medium not present
Nov  7 13:21:43 mezz kernel: cd0 at ata0 bus 0 target 0 lun 0
Nov  7 13:21:43 mezz kernel: cd0: TEAC CD-W516EB 1.0A Removable CD-ROM 
SCSI-0 device
Nov  7 13:21:43 mezz kernel: cd0: 16.000MB/s transfers
Nov  7 13:21:43 mezz kernel: cd0: Attempt to query device size failed: NOT 
READY, Medium not present
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): Recovered Sense
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): READ CD RECORDED CAPACITY. 
CDB: 25 0 0 0 0 0 0 0 0 0
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): CAM Status: SCSI Status 
Error
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): SCSI Status: Check Condition
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): NOT READY asc:3a,0
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): Medium not present
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): Recovered Sense
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): READ CD RECORDED CAPACITY. 
CDB: 25 0 0 0 0 0 0 0 0 0
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): CAM Status: SCSI Status 
Error
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): SCSI Status: Check Condition
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): NOT READY asc:3a,0
Nov  7 13:21:43 mezz kernel: (cd0:ata0:0:0:0): Medium not present
Nov  7 13:21:43 mezz kernel: Mounting root from ufs:/dev/da0s1a
==

Cheers,
Mezz
-Søren


--
bsdforums.org 's moderator, mezz.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: burncd block size

2003-11-07 Thread slave-mike
Does this *fix* atapicam?

Or is atapicam still only about 50% operational?

I can't get atapicam to work with my atapi tape drive at all.
And power calibrations malfunction via atapicam with cdrdao and cdrecord.
And if I blank a cd-rw, the atapicam'ed programs return after like 2S,
*THEN* it seems the commands make it to the cd burner and *THEN* it 
starts blanking!

Argh!

Soren Schmidt wrote:
It seems Jeremy Messenger wrote:

On Fri, 07 Nov 2003 10:10:40 +0100, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:


I've been having a variety of problems burning CDs with atang:

- burncd consistently failing in exactly the same spot in the ISO,
  and reporting only wrote 0 of 32768 bytes: Unknown error: 0
- burncd failing right at the start with only wrote -1 of 32768
  bytes: Input/output error (this generally happens after a couple
  of the previous, and once it starts happening I have to reboot)
Whew, glad that I am not only one.. I *just* have wasted two of my blank 
CD in like fifteen minutes ago, I keep wondering if I created the ISO 
files in the wrong way or was it burncd's fault.. Until now here..


This is fallout from getting atapi-cd under GEOM. GEOM wasn't designed
to handle medias of size 0 and where the sizes can change during an
open. I just committed a fix that has solved the issue here (and its ugly).
-Søren
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]