Menu

#80 cdemu-daemon advertises SAO, but does not support it

None
open
None
cdemu-daemon
default
2015-02-12
2014-07-16
No

Using cdemu-daemon 3.0.0 and vhba 20140629, I loaded a blank into the slot using the commands listed in the manpage.

$ cdemu create-blank --writer-id=WRITER-TOC --medium-type=dvd+r --param="writer.write_raw=1" --param="writer.write_subchannel=1" 0 x.toc

Then, executing cdrecord shows:

# cdrecord -dev=/dev/sr0 -atip
23:38 wrgstfl:~ # cdrecord -dev=/dev/sr0 -atip
Cdrecord-ProDVD-ProBD-Clone 3.01a24 (x86_64-unknown-linux-gnu) Copyright (C) 1995-2014 Joerg Schilling
scsidev: '/dev/sr0'
devname: '/dev/sr0'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.9'.
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   : 
Vendor_info    : 'CDEmu   '
Identifikation : 'Virt. CD/DVD-ROM'
Revision       : '1.10'
Device seems to be: Generic mmc2 DVD-R/DVD-RW/DVD-RAM.
Using generic SCSI-3/mmc-3 DVD+R driver (mmc_dvdplusr).
Driver flags   : NO-CD DVD MMC-3 SWABAUDIO 
Supported modes: SAO
cdrecord: Warning: Cannot read drive buffer.
cdrecord: Warning: The DMA speed test has been skipped.
rzone size:         48
rzone number:       1
border number:      1
ljrs:               0
track mode:         7 copy: 0
damage:             0
reserved track:     0 blank: 1 incremental: 0 fp: 0
data mode:          1
lra valid:          0
nwa valid:          1
rzone start:        0
next wr addr:       0
free blocks:        2294954
blocking factor:    0
rzone size:         2294954
last recorded addr: 0
read compat lba:    0
next layerjmp addr: 0
last layerjmp addr: 0

Meanwhile, cdemu-daemon emits this:

cdemu0: Recording: unhandled recording mode: 4; resetting to TAO!

But the drive did not even advertise TAO to begin with, leaving writer programs in a confused state, leading to more errors down the road:

# cdrecord -dev=/dev/sr0 blabla.mp4
[...]
Starting to write CD/DVD/BD at speed 16 in real SAO mode for single session.
Last chance to quit, starting real write    0 seconds. Operation starts.
cdrecord: Input/output error. write_g1: scsi sendcmd: no error
CDB:  2A 00 00 00 00 00 00 00 10 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 00 00 00 00 00 0A 00 00 00 00 00 15 00 00
Sense Key: 0x0 No Additional Sense, Segment 0
Sense Code: 0x00 Qual 0x15 (no current audio status to return) Fru 0x0
Sense flags: Blk 0 (not valid) 
cmd finished after 0.000s timeout 200s
write track data: error after 0 bytes
cdrecord: A write error occured.
cdrecord: Please properly read the error message above.

cdemu emits:

cdemu0: DAO recording: no open track; there should be one opened by a call to RESERVE TRACK!

Discussion

  • Jan Engelhardt

    Jan Engelhardt - 2014-07-16

    For a cdr74 + SAO, it goes a bit different.

    The create command:

    cdemu create-blank --writer-id=WRITER-TOC --medium-type=cdr74 --param="writer.write_raw=1" --param="writer.write_subchannel=1" 0 x.toc
    

    Messages that appear repeatedly during track write:

    cdemu0: Sector: raw sectors require 2352 bytes of data!
    cdemu0: SAO recording: failed to feed sector for writing: Raw sectors require 2352 bytes of data!!
    

    cdrecord seems to have completed ok:

    # cdrecord -dev=/dev/sr0 -speed=1 cstep*
    cdrecord: No write mode specified.
    cdrecord: Assuming -sao mode.
    cdrecord: If your drive does not accept -sao, try -tao.
    cdrecord: Future versions of cdrecord may have different drive dependent defaults.
    Cdrecord-ProDVD-ProBD-Clone 3.01a24 (x86_64-unknown-linux-gnu) Copyright (C) 1995-2014 Joerg Schilling
    scsidev: '/dev/sr0'
    devname: '/dev/sr0'
    scsibus: -2 target: -2 lun: -2
    Warning: Open by 'devname' is unintentional and not supported.
    Linux sg driver version: 3.5.27
    Using libscg version 'schily-0.9'.
    Device type    : Removable CD-ROM
    Version        : 0
    Response Format: 2
    Capabilities   : 
    Vendor_info    : 'CDEmu   '
    Identifikation : 'Virt. CD/DVD-ROM'
    Revision       : '1.10'
    Device seems to be: Generic mmc2 DVD-R/DVD-RW/DVD-RAM.
    Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
    Driver flags   : MMC-3 SWABAUDIO 
    Supported modes: TAO SAO SAO/R96R RAW/R16 RAW/R96R
    cdrecord: Warning: Cannot read drive buffer.
    cdrecord: Warning: The DMA speed test has been skipped.
    Starting to write CD/DVD/BD at speed 1 in real SAO mode for single session.
    Last chance to quit, starting real write    0 seconds. Operation starts.
    
    WARNING: padding up to secsize (by 71 bytes).
    Track 01: Total bytes read/written: 54548409/54548480 (26635 sectors).
    
    WARNING: padding up to secsize (by 1741 bytes).
    Track 02: Total bytes read/written: 62308659/62310400 (30425 sectors).
    
    WARNING: padding up to secsize (by 376 bytes).
    Track 03: Total bytes read/written: 87340680/87341056 (42647 sectors).
    

    But the tracks are empty (and the original files certainly aren't):

    # hexdump -C x-01.bin
    00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    00000930  00 40 00 00 00 00 00 40  00 00 00 00 00 00 00 40  |.@.....@.......@|
    00000940  00 00 00 00 00 00 00 40  00 00 00 00 00 00 00 00  |.......@........|
    00000950  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    00000970  00 00 00 00 00 00 40 00  00 00 00 00 00 00 00 00  |......@.........|
    00000980  00 00 40 00 40 00 00 00  00 00 40 40 00 00 40 00  |..@.@.....@@..@.|
    00000990  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    000012c0  00 40 00 00 00 00 00 40  00 00 00 00 00 00 00 40  |.@.....@.......@|
    000012d0  00 00 00 00 00 00 00 40  00 00 00 00 00 00 00 00  |.......@........|
    000012e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 40  |...............@|
    000012f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00001300  00 00 00 00 00 00 40 00  00 00 00 00 00 00 00 40  |......@........@|
    00001310  40 00 00 40 00 00 40 00  00 40 00 00 00 00 40 00  |@..@..@..@....@.|
    00001320  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    
     
  • Rok Mandeljc

    Rok Mandeljc - 2014-07-16
    • assigned_to: Rok Mandeljc
    • Group: unassigned --> cdemu-daemon
    • Milestone: -->
     
  • Rok Mandeljc

    Rok Mandeljc - 2014-07-18

    Thanks for testing the recording! As you can see, it is still in experimental state...

    SAO mode with CD-R was failing due to an oversight in the check that determined whether RAW SAO or (cooked) SAO was being used, which caused the mode to be mis-identified as RAW SAO - hence the warning message about raw data, and failure to write sector's data.

    For DVD+R, the code was expecting a RESERVE TRACK command before any WRITE - this is the way it is done by cdrkit's cdrecord/wodim (which is what I was testing against), but not by cdrtools' cdrecord (nor by Alchohol 120%). I have changed that bit of code to open the track as necessary instead.

    Both fixes have been pushed to git, so you can give them a try.

    PS: TOC writer should probably not be used for DVD+R, since cdrdao supports only CDs, and same goes for write_raw and wrute_subchannel options - at some point, writers' parameter validation code will need to be expanded to verify the medium type as well

     
  • Jan Engelhardt

    Jan Engelhardt - 2014-07-19

    Does the absence of the RESERVE TRACK command for DVDs as issued by cdrecord may simply be due to the fact that DVDs, broadly speaking, only permit one track (and that's data) per session anyway?

    Do also note that cdrkit has not seen an update for 3.7 years, so there may be additional bugs.

     
  • Rok Mandeljc

    Rok Mandeljc - 2014-07-19

    It could be, although RESERVE TRACK is valid for DVDs as well. It is just that recording software does not need to use it (neither for DVDs, nor CDs), and in fact so far I have only seen it used by wodim with DVD+R; meaning that, for example, we currently do not implement support for it in CD TAO recording, although according to specs, it should be allowed as well.

    Indeed, cdrkit and cdrtools do behave differently. And as long as they both produce valid media on real hardware, it means we have two test cases...

     

Log in to post a comment.