                      DVDDAO (c) 2004-2008 by nickk
                      _____________________________


CONTENTS
________

 1. Introduction
 2. Installation
 3. Usage
 4. Config file
 5. Bugs And Limitations
 6. LICENSE
 7. Supporting the project
 8. Author
 9. Changelog

1. Introduction
_______________

DVDDAO is a simple command line tool to burn various CD/DVD/HDDVD/BluRay disks.

DVDDAO supports writing to CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, DVD+R DL, 
 DVD+RW, DVD-RAM, BDR, BDRE.

DVDDAO supposed to support writing to HD DVD-R, HD DVD-RW, HD DVD-RAM disks, 
but its untested.

Currently DVDDAO does not support multisession.

DVDDAO writes to CD/DVD/HDDVD/BluRay the image file containing the desired 
filesystem, not the arbitrary files. To create such image one can use i.e. 
mkisofs utility.

Also DVDDAO can copy image from CD/DVD/HDDVD/BluRay to hdd, verify your media, 
do the read quality check, copy from one CD/DVD/HDDVD/BluRay RW device to 
another CD/DVD/HDDVD/BluRay RW device on-the-fly and finaly copy files 
accross ordinal partitions with splitting and joining ;) 

2. Installation
_______________

DVDDAO may use several interfaces to work with RW device. It can work
either through aspinkk.sys (included in this package) or aspirout.sys 1.1b5 
(or newer) from Paul Ratcliffe or via OS2CDROM driver with support of ExecCMD
feature. 
When you specify standart scsi device descriptor [bus,]id[,lun] in command 
line, DVDDAO will work with aspinkk.sys driver. If you want to use aspirout.sys,
use --aspidriver aspirou$ command line switch. When you specify the drive 
letter in device descriptor (i.e. -d x, where x is your DVDRW letter),
DVDDAO will work via OS2CDROM driver. Each OS2CDROM driver hash its own bugs 
and stupidities ;(, so this method may not work on your system or work with
errors.

Your config.sys should contain the following lines to ensure the proper
work of DVDDAO:

To work via aspinkk.sys or aspirout.sys:

  For SCSI systems:

REM The driver for your SCSI adapter
BASEDEV=SYM_HI.ADD
BASEDEV=OS2ASPI.DMD /ALL
DEVICE=D:\OS2\BOOT\ASPINKK.SYS
 or/and
DEVICE=D:\OS2\BOOT\ASPIROUT.SYS

  For IDE systems:

BASEDEV=DANIS506.ADD
BASEDEV=DANIATAPI.FLT
BASEDEV=OS2ASPI.DMD /ALL
DEVICE=D:\OS2\BOOT\ASPINKK.SYS
 or/and
DEVICE=D:\OS2\BOOT\ASPIROUT.SYS

To work via OS2CDROM ensure that your config.sys has also:

DEVICE=D:\OS2\BOOT\OS2CDROM.DMD

You can have all this drivers installed and working simultaneously.

To install DVDDAO itself just unpack it from zip to any desired path.

3. Usage
________

To burn CD/DVD/HDDVD/BluRay disk run:

dvddao.exe [option/s] <source1> [<source2> ...]

where source1, source2, ... - the data sources to write to CD/DVD/HDDVD/BluRay as 
single track. I.e. if you run dvddao.exe source1 source2, the data from source1 
and source2 will be concatenated to a single image file and will be written to 
CD/DVD/HDDVD/BluRay.
DVDDAO correctly handles files over 2gb.

The source could be:
   - regular file name : 'x:\path\filename[:start-stop]'
   - regular file name mask : 'x:\path\*', etc.
   - the stdin stream : '-'. If so, stdin stream should be the only specified 
     source.
   - the CD/DVD/HDDVD/BluRay reader device : 'scsi:[bus,]id[,lun][:start-stop]' 
     ([] means not mandatory).
     The data will be read from the specified device. This can be used to copy
     CD/DVD/HDDVD/BluRay on-the-fly if you have separate CD/DVD/HDDVD/BluRay 
     reader and CD/DVD/HDDVD/BluRay writer devices.

Start and stop means start and stop borders and data to be read from given 
source. The valid start and stop values has the same format as --size option
values (see below).

You can set the size of resulting track explicitly with -S/--size option. If you 
wish to create this track with mkisofs utility, run mkisofs -print-size to get 
the size of the resulting image in blocks of 2048 bytes.

If there are no files specified DVDAO will just print some information about
selected device and currently inserted media and will do blanking/formating/closing
of track/session if the corresponding action was requested by the options.

The available options are:

 -v, --verbose <level>         Set verbose level. When no such key is given,
                               verbose level 2 is used.
 -L, --log <file>              Redirect all output to given file or pipe.
                               <file> could be 'stdout' to print all to stdout
                               and 'stderr' to print all to stderr.
     --stdout                  Print all output also to stdout regardless of 
                               -L key.
     --blank <type>            Blank DVD-RW media prior to write any data to disk.
                               --blank help shows available blank modes.
     --format <type>           Format media prior to write any data to disk.
                               --format help shows available format types.
     --formatdescr <num>       Choose <num> format capacity descriptor when 
                               formatting. The num should be > 0 and < number of
                               available format capacities. You can use 
                               '--formatdescr max' which means the format 
                               descriptor of given (in --format switch) format 
                               type with maximum capacity will be choosen.
                               To view available format descriptors for the
                               inserted media, use '--formatdescr help'
                               Do not use it if you don't know what is it ;)
     --formatsub <subtype>     Choose format sub-type for BD-RE formatting 
                               (valid only for --format bdrewithspare 
                               or --format bdrewospare).
                               Type --formatsub help to get list of available
                               format sub-types.
     --stopformat              Stop background format before exit. This will 
                               correctly finalize written dvd+rw on some
                               misbehaved devices if dvd+rw format was previously
                               issued.
     --packetsize <count>      Number of sectors in packet to use for CDRW 
                               formatting.
 -s, --speed <speed>           Set speed of writing device
     --source-speed <speed>    Set speed of reading device
 -d, --device <[bus,]id[,lun]> Writing device (def: 1,4,0)
    or <driveletter>           Writing device (working through OS2CDROM 
                               interface) (i.e. -d R - write to device attached 
                               under letter R)
    or <file:x:\path\fname>    Output file ( - for stderr )
    or <null:> or <n:>         /dev/null device
     --source-device <dev>     Default device for s: "source" specifier (def: 1,5,0)
                               If will be used when you write scsi: or s: as 
                               a source (without actual device name)
 -b, --bufcnt <num>            Number of buffer chunks (def: 64)
 -f, --bufsize <size>          Size of buffer chunk in bytes (def: 256k)
 -S, --size <size>             Size of source data in bytes or blocks of 2048 bytes
                               (suffix s) or kilobytes (suffix k) or megabytes (suffix M)
                               or gigabytes (suffix G)
                               (i.e. 100000s means 100000 * 2048 bytes).
                               This will limit the ammount of data read from source
                               stream/files.
     --split-output <size>     Split output file (if any) to chunks of specified
                               size (safe format as in --size option)
     --l0size <sectors>        Size in sectors of first layer on DL disks
     --close <trackno>         Close track <trackno> and then last session prior
                               to write any data to disk.
 -D, --dummy                   Try to simulate writing whenever possible. 
                               Usually impossible ;), so most likely that your 
                               device will really burn the disk even if you have
                               specified this option.
     --priority <c,d>          Set priority to 'c' class and 'd' delta (def: 3,31)
     --lock <letters>          Lock specified drive letters during DVDDAO operation
     --close <trackno>         Close track <trackno> and then last session
     --closefunction <num>     Issue mmcclose command with function number <num>.
                               Useful only for troubleshooting purposes.
 -r, --retry <count>           Do count of retries on read error
     --ts <sectors>            Specify maximum transfer size in sectors of 2040b
                               to/from CD/DVD/HDDVD/BluRay media in 
                               single SCSI command
     --ets <sectors>           Specify maximum transfer size in sectors of 2040b
                               from CD/DVD/HDDVD/BluRay media in single SCSI command 
                               when read errors occur. Should be <= ts.
 -e, --eject                   Eject media after work is finished. Its affected
                               both reader and writer devices.
     --noeject                 Do not eject media after work is finished. Its affected
                               both reader and writer devices.
 -n, --nopause                 Do not pause for 10 seconds before start writing
     --nomedialock             Do not lock inserted media during dvddao operation
     --nogetperf               Do not issue get performance command. 
                               This solves the problem with hanging SCSI bus
                               when ARS-2000FW  IDE->wSCSI adapter is used.
     --noopc                   Do not issue OPC command. Use this switch if you
                               encounter problems with OPC. I.e. OS2CDROM
                               breaks writing process sometimes after OPC.
     --notitle                 Do not display progress in window switch entry
     --force                   Ignore some errors during program run
     --nohash                  Do not compute hash of disk data when  
                               reading/writing. The DVDDAO wont compute and 
                               print out MD5 hash of source data. This key
                               won't work of --verify is specified.
     --verify                  Verify written data. DVDDAO will read back 
                               previously written data, compute it MD5 hash and
                               compare with MD5 hash of source data that was
                               written on CD/DVD/HDDVD/BluRay media.
     --hashchunk <size>        Compute and print hash of each <size> chunk of 
                               data of given size (should be multiple to 1M).
     --noverify                Do not verify written data
 -t, --test                    Test quality of dvd media. This will scan DVD media
                               after writing and verifying (if any) for 
                               PI/PIF/... errors (google for more info about the
                               meaning of this errors).
     --notest                  Do not test quality of dvd media
     --tester <name>           Name of tester driver. Use this key if dvddao fails
                               to automatically detect the corresponding driver 
                               by your device inquiry data (i.e. your device is
                               to new or rebranded).
                               Use --tester help to get list of available testers.
     --testflags <flag>        Flags to pass to tester driver.
                               Use --testflags help to get list of available flags.
     --testprintnl             Print new-line after each testing report line.
     --keepregion              Keep video dvd region when ripping
     --reload                  Reload disk before verify. Some devices reads just
                               recorded discs wrong before media reload. If you
                               got verification failed every time, try to use 
                               this key.
     --noreload                Do not reload disk before verify or testing.
     --nobeep                  Do not beep when reading/writing/verification fails.
     --aspidriver <name>       Name of aspidriver to use. Default is aspinkk$.
                               Use this key if you want to switch manually
                               between new aspi routing driver aspinkk.sys
                               (aspinkk$) and aspirout.sys (aspirou$).
     --writesleep <ms>         Number of ms to sleep between write requests.
                               Use this to tune writing performance (i.e. when
                               reader and writer devices are on the same ide channel)
     --config <file>           Load default command line options from <file>
     --noconfig                Do not try to load config file
 -h, --help                    Display usage information
 -V, --version                 Display program version

If -d file:x:\path\fname or -d f:x:\path\fname specified, the data will be 
written to specified file instead of CD/DVD/HDDVD/BluRay disk. 

If --split-output key used, the resulting file will be split in chunks of 
given size. If fname contains '#' characters, they will be replaced by the 
chunk number with leading zeroes (if number of adjacent # chars is greater 
then number of digits in chunk number). If fname contains '#' chars less then 
number of digits in chunk number, there will be error. 
If fname contains no '#' characters, the chunks will be names as 
x:\path\fname.X, where X is the chunk number.

If -d file:- or -d f:- specified, it will out data to stderr stream. 
This can be used to copy CD/DVD/HDDVD/BluRay content to image on harddisk.

If -d null: or -d n: specified, the data read from source wont be written 
anywhere. Use this options if you want just to test reading from specified 
source and/or compute MD5 on it.

Note, that stuff which <> brackets is mandatory, in [] brackets is optional.

Valid format types are :

        full            Full format for DVD-RAM or DVD-RW
        sparearea       Spare Area expansion for DVD-RAM
        zonereformat    Zone reformat for DVD-RAM
        zoneformat      Zone format for DVD-RAM
        dvdrwfull       CD/DVD-RW full format (packet mode)
        dvdrwgrow       CD/DVD-RW grow session (packet mode)
        dvdrwadd        CD/DVD-RW add session (packet mode)
        dvdrwquickgrow  DVD-RW quick grow last session
        dvdrwquickadd   DVD-RW quick add last session
        dvdrwquick      DVD-RW quick format
	hddvdrtest	HD DVD-R expand test zone
	fullwithspare	full (HD) DVD-RAM format with sparing params
        dvd+rw          DVD+RW format
	bdrewithspare	BD-RE with spare area
	bdrewospare	BD-RE without spare area

Valid blank modes are :

	full		Blank the disk entirely
	fast		Minimally blank a disk
	unreserve	Un-reserve a last uncompleted track
	trail		Blank a track trail
	unclose		Unclose a last complete session
	session		Blank last complete session

Valid format sub types for BD-RE are :
	quick		Quick reformat
	nocert		No certification
	fullcert	Full ceritifcation
	quickcert	Quick certification

Probably not all format types and blank modes will suit your device and/or media.
Format and blank options are mutual exclusive.

Available tester interfaces :
	pioneer
	nec
	liteon
	benq
	plextor

Available testflags are :
        pio_111		Pioneer 111+ mode
        px_sum8		Plextor SUM8 test mode
        px_sum1		Plextor SUM1 test mode
        px_burst	Plextor BURST test mode

For Plextor PX-755 and PX-760 devices you may need to upgrade firmware first 
to use quality test feature. See pxtool package for firmware info.

4. Config file
______________

The default settings for DVDDAO can be put in config file of the following 
format:

; comment
*: <options>
<device specifier1>: <options>
<device specifier2>: <options>
...

When you specify <device specifier1> as -d in dvddao command line, all the 
<options> in <device specifier1>: line will be used. The options from *: line 
will be used everytime you run dvddao.

The <options> are the same as described in chapter 3.Usage.

By default DVDDAO tries to load %ETC%\dvddao.cfg config file, unless the config
file is given with --config option.

Example of config file:

; options to be used everytime
*: -n --source-device 1,5,0 --eject
; options to be used when dvddao is run with -d 1,4,0
1,4,0: --lock l --speed 8
; options to be used when dvddao is run with -d 1,5,0
1,5,0: --lock m --speed 16

5. Bugs And Limitations
_______________________

DVD-R[W] track and session closing returns an error, however the disks seems
to be properly closed and can be read on DVD-ROM and DVD players.
Some DVD readers report wrong size (full 4.5GB instead of actually written data
size) for written DVD media when reading. Use -S key to limit the size of data
to be read.
Some DVD readers fails to read DVD media reporting some errors. If it occurs on
your device, run the command it fails with -v 10 option added and send me its
output.

6. License
__________

Use this software for free.

And, of course:

THIS SOFTWARE IS PROVIDED BY THE AUTHOR OR CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, SEX OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE, SHIT ON CARPET OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.

7. Supporting the project
_________________________

If you want to support this project, please, make your donation on
BMT Micro site at https://secure.bmtmicro.com/ECommerce-OffSite/11980001.html
or on Mensys at http://shop.mensys.nl/uk/security2.

8. Author
_________

 nickk, dev.nul@mail.ru

 Feel free to send author bugreports and suggestions about dvddao, but first,
 please, make sure that your email provider accepts emails from mail.ru domain.
 Or you may never receive the response.

 Big thanks for testing to all those brave guys who did it ;)

9. Changelog
____________

0.0.1
  Initial release

0.0.2
  Fixed the bug with zero size file specified in source file list.
  Added -S/--size switch.
  Added reading source data from stdin.
  Added -n/--nopause option.

0.0.3
  Added printing of disk manufacturer id
  Added reading source data from DVD (see scsi:bus,id,lun)
  Added writing to file instead of DVD (see -d file:x:\path\fname)
  Added --split-output option

0.0.4 
  Added bailing out if media size not enough to fit the requested data
  Added --force key
  Added file mask support for data source specifiers

0.0.5
  Added -e/--eject option
  Added media locking during dvddao operation
  Added --nomedialock key

0.0.6
  Fixed some minor bugs
  Changed dvddao output a bit

0.0.7
  Added -r/--retry key
  Fixed hang on read errors during DVD grabbing
  Added some support for DVD+R DualLayer media (not fully tested, not available here yet ;))
  Added --nogetperf lock to solve SCSI bus locking when ARS-2000FW IDE->SCSI adapter with LG GSA-4040B is used

0.0.8
  --force key now ignores read errors on DVD media
  Added --ts key to specify maximum transfer size in 2048b blocks to/from DVD media in single command
  Added printing of MD5 hash of written data after write process is complete
  Added --verify key to verify written data using MD5 hash
  Changed progress messages and switch title. Now it contains current operation
  Added printing spent time messages after blanking, formating and finalizing
  Improved support of DVD+R DualLayer on some misbehaved devices
  Added explicit padding of last ECC block when DVD+R media burning 

0.0.9
  Fixed speed setting on some misbehaved devices
  Added --source-speed key
  Increased default buffer count. Now dvddao consumes 16MB memory for buffers by default instead of 4MB

0.0.10
  Added reporting of total corrupred blocks during read of bad dvd media
  Added reducing transfer size to --ets blocks (default 1) of 2048b on read errors
  Added :start-stop modifier to source values to limit reading range from given sources
  Internal version

1.0.0
  Fixed some typos in readme
  Fixed typo in --lock parameter parser

1.0.1
  Changed dvddao return code to 0 when disk successfully written even if buffer underruns occured

1.0.2
  Added --stopformat key to stop backgroup dvd+rw format on some misbehaved devices
  Added printing of inquiry data with -v 2 or higher
  Added -L/--log parameter
  Set minimal allowed buffer count to 2, minimal allowed buffer size to 2048 bytes
  If --force key given, DVDDAO will start writing even if there were read errors during buffer initial fill
  Internal version

1.1.0
  Added printing of SCSI error descriptions at last...
  Added burn.cmd 'frontend' ;) perl script

1.1.1
  Fixed some things in readme and dvddao help screen
  Changed DVD+R closing strategy to improve reading on old devices
  Added --closefunction key (for testing/troubleshooting purposes)
  Added printing of "Src:" header for each message from source dvd device
    (device which is used to copy dvd image from, i.e. with 'dvddao -d file:image.iso scsi:0,1,0' command)

1.1.2
  Included another 'frontend' script writedvd.cmd written by Yuri Efimov
  DVDDAO will now run on systems without 64bit file API. In this case you should
    use --split-output key for dvddao and mkisofs to handle dvds over 2gb in size.
  Added --stdout key to print all output also to stdout even if -L key is given.
    Use this key along with -L if you want to make dvddao output both to logfile
    and stdout.

1.1.3
  Added printing of full track list of inserted DVD media
  Added --nohash key
  Added retrying of SCSI command if LUN is busy
  Added some constants for DVD-R DL, DVD+RW DL, Blu-Ray disks (which does not
    mean they will be successfully written - i have no such hardware for tests).
  Added --aspidriver key
  Moved to aspinkk.sys driver (included in this package)
  Added 'bdrewithspare' and 'bdrewospare' format types for BD-RE
  Fixed free/written capacity detection on written DVD-RAM media
 
1.2.0
  Added support of OS2CDROM interface. To work through OS2CDROM use -d <drive letter>.
  Added --noopc key to overcome OS2CDROM stupidity
  Fixed error with dvd+rw formatting introduced in 1.1.3
  Added --formatdescr key (not for general use)
  Fixed dvd-ram formatting
  Included DVD-RAM.txt by Ingo Steiner (big thanks!) with detailed description
     of DVD-RAM formatting issues.

1.2.1
  Added printing of written data size in sectors (of 2048 byte) after write is complete.
  Treat DVD-ROM media as DVD-R when printing disk manufacturer info
  Added new blank modes
  Added printing of DVDDAO's version on normal program run with verbose level 1
  Added null:/n: device specifier to write data to /dev/null device. Usefull to
     test reading from DVD, compute MD5 on it.
  Added negative values for -v/--verbose key to allow to cut off error reporting.

1.3.0
  Changed verbose level of MD5 printing to 1 from 2.
  Changed media loading and drive locking sequence. It will load media before locking driver letter if --lock specified.
  Added configuration file (see chapter 4 of readme for details).
  Added --config option to specify config file location.
  Added --source-device to specify the default source device (useful in config file)

1.3.1
  Fixed stdin source recognition bug introduced in 1.3.0

1.3.2
  Fixed readme table of content ;)
  Fixed dvd formatting bug introduced in 1.3.0

1.3.3
  Fixed more bugs introduced in 1.3.0 (i.e. error 87 after blanking/formatting)
    Bunch of bugs left to speed up further releases ;)
  Added --noconfig option. Effective being set in command line only.
  Added beeping on verification failures,
  Added --nobeep key to switch of beeping on verification failures.

1.3.4
  Added --reload key to reload media before verifying (some devices read just
    recorded disc wrong before media reload).
  Added --noverify key. Usefull to switch off verifying sometimes when --verify
    key is used config file as default behaviour.
  Added making video dvd image region free when reading dvd
  Added --keepregion key to preserve original region setting for video dvd image
   when reading dvd.

1.3.5
  Fixed --ets key, was ignored previously.
  Fixed -v key processing in config file. Was ignored previously.
  Added --hashchunk key to compute hash for each chunk of data of given size.
  Added --writesleep key
  Added beeping on read/write failures,
  Added reading/writing single track CD mode 1 form 1 (2048 byte sector) in SAO
   mode by numerous user requests ;). Dont expect full cdrdao functionality 
   here, it just for those who like to burn dvd and simple data cd by one tool ;)

1.3.6
  Fixed trap when --formatdescr help specified without --format <type>.
  Changed progress string to be more compact. Sorry to frontend writers 
   for possible inconvenience ;)
  Added read buffer fill percentage to progress string.
  Added new writing strategy to avoid buffer underruns when read and write 
   devices on the same ide channel. See --buffer-check option.
  Fixed wrong media size reporting on some DVD-R with multiple tracks.
  Changed --ets parameter - it now accepts any count of 2048 blocks to skip
   on read errors.

1.3.7
  Added filename templates when --split-output key is given (see -d file:
description in section 3). This can be usefull i.e. for splitting one big VOB
file to 1Gb chunks for dvd-video:
dvddao -d f:VTS_04_#.VOB --split-output 1G bigbig.vob
  Added --l0size key to set manually size in sectors of first layer in DL disks.

1.3.8
  Added --exactspeed key to try to set writing speed to the exact value given
in --speed key. Otherwise it will be set to the closest supported speed
to the value of --speed key.
  Ported to linux.

2.0.0
  Added testing DVD media for quality, see --test, --tester and --testflags keys.

2.0.1
  Added support for --dummy on DVD+R for some plextor devices.
  Added --noreload key to not reload disc before testing and verifying.
  Fixed speed selection error

2.0.2
  Fixed CD-R media size recognition on some devices.
  Added --noeject key.
  Fixed l0 size setting error processing.

2.0.3
  Added printing DVD book type, number of layers, disk size, first layer size.
  Added --packetsize flag

2.0.4
  Added progress indicators for blanking and formatting media.
    Note: this will work not on every device. Some devices do not honor 
    corresponding flag in scsi commands.
  Fixed minor linux port issues.
  Added --formatsub key to specify format sub-type for BD-RE specific format.
  Fixed some media recognition issues for BD-RE disks.
  Fixed setting l0 size error on some devices.
  Added support of HD media.
  Fixed a couple of readme typos.
  Changed 'test ready' retry count from 20 to 30.

2.0.5
  Fixed written dvd+r recognition issue for Memorex DVD+-RAM 525G writer.

2.0.6
  Fixed liteon media tester.
  Fixed speed setting issue on NEC based drives.
