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

Re: Spare Tables error on format



Hi,

if you can afford to wait the up to 5000 seconds for a full format,
then try

  dvd+rw-format -force=full /dev/sr0 -ssa=min

-------------------------------------------------------------------------
Long story:

I found an old modified dvd+rw-tools directory which i used to spy on
growisofs when i noticed behavior differences between it and libburn.
(Substantial parts of libburn's DVD and BD knowledge was learned from
dvd+rw-tools. But the need to see its actual SCSI transactions came up
later when supporting growisofs users.)

The failing SCSI command transaction is

  FORMAT UNIT
  04 11 00 00 00 00
  To drive: 12b
  00 82 00 08 00 b8 74 00 c3 00 10 00
  +++ key=5  asc=26h  ascq=00h   (     4 ms)

FOV bit and Immed bit are set in the Format List Header.
8 bytes are announced for the Format Descriptor, which requests 0xb87400
= 12088320 blocks, which is indeed the largest possible payload and thus
requests the smallest possible size of the Spare Area.
Format Type is 0x30 (BD-R or BD-RE with spares).
Format-Subtype is 3 (Quick Certification).
Type Dependend Parameter is 0x00 0x010 0x00.

Spying on libburn by

  xorriso -scsi_log on -outdev /dev/sr4 -format fast_by_index_3 \
    2>&1 | tee -i /tmp/xorriso.log

yields this successful transaction

  FORMAT UNIT
  04 11 00 00 00 00
  To drive: 12b
  00 82 00 08 00 b8 74 00 c0 00 10 00

The only difference to dvd+rw-format is the Format-Subtype:
0 (Quick Reformat) instead of 3 (Quick Certification).


Now i begin to find traces in libburn. A comment from 2008 says
   LG GGW-H20L YL03 refuses on 0x30 with
   "Quick certification". dvd+rw-format
   does 0x00 by default and succeeds quickly.
Newer is a test for the Quick Certification flag in feature 23h,
which would prevent Sub-type 3 if not set.

Looking at
  https://sources.debian.org/src/dvd+rw-tools/7.1-14/dvd%252Brw-format.cpp/#L791
which has

	if (full && (formats[i+4+4]>>2)!=0x31)
	    formats[i+4+4] |= 2;// "Full Certificaton"
	else if ((formats[i+4+4]>>2)==0x30)
	    formats[i+4+4] |= 3;// "Quick Certification"

gives the idea that a run of

  dvd+rw-format -force=full /dev/sr0 -ssa=min

might succeed.

(My test BD-RE currently gets a -format by_index_3 run of xorriso and
will be ready for more experiments in an hour and a half ...)

----------------------------------------------------------------------------

If -force=full helps, then a patch candidate would be to replace

            formats[i+4+4] |= 3;// "Quick Certification"

by a no-op (the 0 is already written to formats[i+4+4]):

            ; // "Quick Reformat" because "Quick Certification" often fails

I am not sure whether this will work with all drives.
Maybe better would be to inquire bit 2 of byte 4 of feature 23h from the
GET CONFIGURATION command which already inquires the mmc_profile, i.e.
the current media type and personality.
If that bit is not set, then libburn uses Format Sub-Type 0 instead of 3
or 2 ("Full Certification").


Further i will have to find out why both softwares send a Type Dependend
Parameter that is not all 0. Might be debris from the Format Descriptors
which gets sent back to the drives. Only good that they gracefully ignore
that 0x10 byte.


Have a nice day :)

Thomas


Reply to: