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

Re: Spare Tables error on format



Sorry, it does not work:
Cloned from here: https://salsa.debian.org/optical-media-team/dvd-rw-tools
And applied all the patches
dvdrwtools/dvd-rw-tools$ for file in debian/patches/* ; do patch -p1 < "$file"; done
patching file growisofs_mmc.cpp
patching file growisofs.1
patching file growisofs_mmc.cpp
patching file Makefile.m4
patching file growisofs.c
patching file transport.hxx
patching file growisofs.c
patching file growisofs.c
patching file growisofs.1
patching file index.html
patching file transport.hxx
patching file transport.hxx
patching file growisofs_mmc.cpp
patching file growisofs_mmc.cpp
Hunk #1 succeeded at 814 (offset 58 lines).
patching file growisofs.c
patching file transport.hxx
patching file growisofs_mmc.cpp

# make

user@mtrog64:~/Documentos/db/dvdrwtools/dvd-rw-tools$ ./dvd+rw-format /dev/sr1 -force=full -ssa=min
* BD/DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 7.1.
* 23.7GB BD media detected.
* formatting 0.0%:-[ FORMAT UNIT failed with SK=5h/INVALID FIELD IN PARAMETER LIST]: Input/output error
user@mtrog64:~/Documentos/db/dvdrwtools/dvd-rw-tools$ ./dvd+rw-format /dev/sr1 -force=full -ssa=max
* BD/DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 7.1.
* 23.7GB BD media detected.
* formatting .:-[ FORMAT UNIT failed with SK=5h/INVALID FIELD IN PARAMETER LIST]: Input/output error

Also commenting out the block for Quick Certification, does not work.

So, perhaps something is wrong in the FIELD construction.

Wondering how you printf f[0]..f[7] I've tried as char and int, and I've got different values per run.

Kind regards

On Mon, Oct 25, 2021 at 7:33 AM Thomas Schmitt <scdbackup@gmx.net> wrote:
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: