[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] solution: trouble burning DVD+R on a Pioneer drive


I got the same problem as Felix and Gadi had in January, but it
irritated me enough to solve it.  (quick hack only)

The problem was (just to remember) with different Pioneer drives, my
drive is a DVR-109 with firmware version 1.40 (the newest one, but the
problem was occurred with previous versions too).  When I write a
Philips 8x DVD+R disk with quite a lot data (my experiences shows,
that a test amount (say <1G) is not enough to reproduce the bug), the
write finishes OK, but when growisofs wants to close the disk, I got:

/dev/hdc: flushing cache
/dev/hdc: closing track
/dev/hdc: closing disc
:-[ CLOSE SESSION failed with SK=2h/ASC=04h/ACQ=07h]: Resource temporarily unavailable
/dev/hdc: reloading tray

and after this termination, the disk left in an unmountable state
(linux says, that media not found):
   ./dvd+rw-mediainfo /dev/sr0


INQUIRY:                [PIONEER ][DVD-RW  DVR-K14L][1.00]
 Mounted Media:         1Bh, DVD+R
 Current Write Speed:   4.0x1385=5540KB/s
 Write Speed #0:        4.0x1385=5540KB/s
 Write Speed #1:        2.4x1385=3324KB/s
 Speed Descriptor#0:    00/2295103 R@1.0x1385=1385KB/s W@4.0x1385=5540KB/s
 Speed Descriptor#1:    00/2295103 R@1.0x1385=1385KB/s W@2.4x1385=3324KB/s
 Media Book Type:       A1h, DVD+R book [revision 1]
 Media ID:              RITEK/R02
 Legacy lead-out at:    2295104*2KB=4700372992
 Disc status:           appendable
 Number of Sessions:    1
 State of Last Session: incomplete
 "Next" Track:          1
 Number of Tracks:      2
 Track State:           partial/complete
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            1889776*2KB
 Track State:           blank
 Track Start Address:   1889792*2KB
 Next Writable Address: 1889792*2KB
 Free Blocks:           405312*2KB
 Track Size:            405312*2KB
READ CAPACITY:          1*2048=2048

(Okay, this was copied from Felix, since I already fixed my disks with
NeroLINUX, but this at least shows that with RITEK/R02 it is also
buggy).  My Media ID is CMC MAG/E01.  Interestingly enough, a verbatim
dvd+r disk works great: MCC/004.

When I searched the specification for the meaning of
SK=2h/ASC=04h/ACQ=07h, I found, that it means something like 'drive
not ready', but not an error, just a query from the drive to wait a
minute and try again.

Of course this is a bug in a firmware, since growisofs waits with the
executing of this command, until the drive respond with an OK to the
TEST UNIT READY command.  Here is a workaround: 

diff -ur dvd+rw-tools- dvd+rw-tools- 
--- dvd+rw-tools-  2004-07-16 14:48:57.000000000 +0200
+++ dvd+rw-tools-	2005-04-09 18:16:09.000000000 +0200
@@ -1484,8 +1484,17 @@
 	cmd[1] = 0x01;		// "IMMED"
 	cmd[2] = mode;		// "Close session"
 	cmd[9] = 0;
-	if ((err=cmd.transport()))
-	    sperror ("CLOSE SESSION",err);
+	// it seems, that pioneer is a bit crappy
+	while (err=cmd.transport()) {
+	    if (SK(err)==0x2 && ASC(err)==0x04 && ASCQ(err)==0x07) {
+		    sperror ("CLOSE SESSION (but try to continue)",err);
+		    usleep(10000);
+	    } else {
+		    sperror ("CLOSE SESSION",err);
+		    break;
+	    }
+	}
 	if (wait_for_unit (cmd)) break;


Of course this is nothing more, than a quick hack, but it works.  I
think it would be generally better (in the whole code) to try to
execute the command, and if the drive says "please wait", then wait;
rather than asking the drive actively: "are you ready?" and when it
is, then executing a command.  But I'm not an expert in this area, so
this is only an idea.

Gadi, Felix: I ask you to probe out my patch and come back with the


PS: if someone doesn't like the ugly error like debug output, then
comment out the line which contains "but try to continue".

Reply to: