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

Re: How to "blank" / "zero out" / "nullify" a dvd-rw?



Hi,

Joerg Schilling:
> I am not sure if you know this but a DVD-RW needs to be blank before
> writing to it.

As does a CD-RW.
With all my drives it works fine to blank and burn
a CD-RW in the same cdrecord run.


> If I did ever see this problem, it would not exist.

Are you sure you tested this special use case ?

> Cdrtools is maintained software.

Sure it is. But this does not mean you already
explored all possible use cases of it.


I downloaded cdrtools-2.01.01a32.tar.gz :
  cd cdrtools-2.01.01
  make
  cdrecord/OBJ/athlon-linux-cc/cdrecord -version
Cdrecord-ProDVD-ProBD-Clone 2.01.01a32 (i686-pc-linux-gnu) Copyright (C) 1995-2007 Jörg Schilling

Now the test:
  dd if=/dev/zero bs=2048 count=$size | \
  cdrecord/OBJ/athlon-linux-cc/cdrecord \
     -v dev=0,0,0 blank=fast -sao tsize="$size"s -
Same failure.
  cdrecord/OBJ/athlon-linux-cc/cdrecord: Cannot write CD's >= 100 minutes.

I get curious:
  fgrep '100 minutes' cdrecord/*.[ch]
finds a match in cdrecord/cdrecord.c . 
That's in function checkdsize(), called by main().
Blanking happens later
  if ((*dp->cdr_blank)(scgp, dp, 0L, blanktype) < 0) {

So my timing impression was right.


But why does checkdsize() treat the media as CD ?
Probably because of
        if (dsp->ds_maxblocks > 0) {
hops to 
        } else {
                /*
                 * dsp->ds_maxblocks == 0 (disk capacity is unknown).
                 */
                if (endsec >= (405000-300)) {                   /*<90 min disk*/                        errmsgno(EX_BAD,
                                "Data will not fit on any disk.\n");
and then to

        if (dsp->ds_maxblocks < 449850) {
                if ((dsp->ds_flags & DSF_DVD) == 0) {   /* A CD and not a DVD */
                        if (endsec <= dsp->ds_maxblocks)
                                return (TRUE);
                        errmsgno(EX_BAD, "Cannot write more than remaining DVD capacity.\n");
                        return (FALSE);
                }
                /*
                 * Assume that this must be a CD and not a DVD.
                 */
                if (endsec > 449700) {
                        errmsgno(EX_BAD, "Cannot write CD's >= 100 minutes.\n");
                        return (FALSE);
                }
        }

Why does the first errmsgno() talk of DVD if it is
"A CD and not a DVD" ?
And why do you then again "Assume that this must be a CD" ?

I insert in line 3241:
                fprintf(stderr,"dsp->ds_maxblocks = %d  , (dsp->ds_flags & DSF_DVD) = %d \n",
                                (int) dsp->ds_maxblocks,
                                 dsp->ds_flags & DSF_DVD);
run make and the failing cdrecord run.
With a DAO filled DVD-RW it prints:
  dsp->ds_maxblocks = 0  , (dsp->ds_flags & DSF_DVD) = 256 
  /cdrecord/OBJ/athlon-linux-cc/cdrecord: Cannot write CD's >= 100 minutes.

A check with CD-RW (tsize=512000s) prints:
  sp->ds_maxblocks = -1  , (dsp->ds_flags & DSF_DVD) = 0
  cdrecord/OBJ/athlon-linux-cc/cdrecord: Cannot write more than remaining DVD capacity.


So function checkdsize() error messages really confuse
CD and DVD by misinterpreting the logics of cdrecord.
Not by getting deceived by the drive.

Nevertheless, this does only affect the error messages
and not the fundamental problem
  dsp->ds_maxblocks == 0
which leads to the error mesage
  Data will not fit on any disk.
There you have a hardcoded limit for CDs which does not
take into respect the higher standard capacity of DVD.


A remedy might be to put the call of checkdsize() after
blanking and to strive for a better recognition of media
which would be useable but are not in the right state yet.

As a proof of concept i change line 1098 to :
                if ((flags & F_BLANK) == 0 &&
                    !checkdsize(scgp, dp, tsize, flags))

This made the combined blank and burn run work with DVD-RW.

But now the size protection is gone completely for runs
which include blanking. So it is no real remedy.

After blanking one would have to newly determine the media
characteristics and to perform the omitted size check.
(I stop exploring now because i don't want to dig for your
 media assessment call.)


Have a nice day :)

Thomas



Reply to: