Re: New ioctl to support Enhanced CD (or Extra CD)

From: Fabian Keil <freebsd-listen_at_fabiankeil.de>
Date: Sat, 11 Apr 2009 13:55:13 +0200
Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org> wrote:

> Enhanced CD (or Extra CA) is an Audio CD with an additionnal data track
> at the end. Audio tracks belong to the first session while the data
> track belongs to the second session. Therefore the last audio track ends
> way before the data track start.
> 
> The first consequence is that the duration of the last audio track isn't
> reported correctly. Here is the output of cdcontrol(1) with such a CD[1]:
>     $ cdcontrol info
>     ...
>     12  46:03.67   9:54.43  207142   44593  audio
>     13  55:58.35   6:38.51  251735   29901   data
> 
> The expected output is:
>     $ cdcontrol info
>     ...
>     12  46:03.67   7:22.43  207142   33193  audio
>     13  55:58.35   6:38.51  251735   29901   data
> 
> A more "audible" consequence is that cdparanoia(1) copies 9'54" of data
> instead of 7'22". The end of the ripped file is full of garbage.
> 
> I made a patch (attached) that adds a new ioctl to query the start
> address of the last session. This new ioctl is named
> CDIOREADLASTSESSIONADDR. The patch also includes changes to cdcontrol(1).
> 
> I added a new member at the end of struct acd_softc to store the last
> session address. I don't know if this causes ABI breakage.
> 
> Linux' corresponding ioctl is CDROMMULTISESSION. Beside this address, it
> returns a flag named "xa_flag". Currently, I don't understand what it is
> but it may be useful to add it to our ioctl too if someone knows its
> purpose.
> 
> Before I spend some time to teach cdparanoia(1) about this new ioctl,
> I'd like some feedback on this patch, especially the name and the struct
> ioc_read_last_session_addr. I would appreciate some test reports too! :)

Does cdda2wav fail to rip the disc, too?

I always rip CDs with cdda2wav and don't remember ever having
problems with Audio CDs with additional data tracks on them.

Here's an example:

fk_at_TP51 /tank/iriver-spiegel/vorbis $cdrecord dev=1,0,0 -toc
Cdrecord-ProDVD-ProBD-Clone 2.01.01a58 (i386-unknown-freebsd8.0) Copyright (C) 1995-2009 Jörg Schilling
scsidev: '1,0,0'
scsibus: 1 target: 0 lun: 0
Using libscg version 'schily-0.9'.
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   : 
Vendor_info    : 'HL-DT-ST'
Identifikation : 'RW/DVD GCC-4241N'
Revision       : '1.04'
Device seems to be: Generic mmc2 DVD-ROM.
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE 
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
cdrecord: Warning: The DMA speed test has been skipped.
first: 1 last 16
track:   1 lba:         0 (        0) 00:02:00 adr: 1 control: 0 mode: -1
track:   2 lba:     18082 (    72328) 04:03:07 adr: 1 control: 0 mode: -1
track:   3 lba:     31630 (   126520) 07:03:55 adr: 1 control: 0 mode: -1
track:   4 lba:     46795 (   187180) 10:25:70 adr: 1 control: 0 mode: -1
track:   5 lba:     63665 (   254660) 14:10:65 adr: 1 control: 0 mode: -1
track:   6 lba:     80502 (   322008) 17:55:27 adr: 1 control: 0 mode: -1
track:   7 lba:     86587 (   346348) 19:16:37 adr: 1 control: 0 mode: -1
track:   8 lba:    109885 (   439540) 24:27:10 adr: 1 control: 0 mode: -1
track:   9 lba:    119572 (   478288) 26:36:22 adr: 1 control: 0 mode: -1
track:  10 lba:    130400 (   521600) 29:00:50 adr: 1 control: 0 mode: -1
track:  11 lba:    147227 (   588908) 32:45:02 adr: 1 control: 0 mode: -1
track:  12 lba:    165110 (   660440) 36:43:35 adr: 1 control: 0 mode: -1
track:  13 lba:    175982 (   703928) 39:08:32 adr: 1 control: 0 mode: -1
track:  14 lba:    202420 (   809680) 45:00:70 adr: 1 control: 0 mode: -1
track:  15 lba:    228530 (   914120) 50:49:05 adr: 1 control: 4 mode: 2
track:  16 lba:    255626 (  1022504) 56:50:26 adr: 1 control: 4 mode: 2
track:lout lba:    316474 (  1265896) 70:21:49 adr: 1 control: 4 mode: -1

cdcontrol reports an incorrect duration for track 14:

fk_at_TP51 /tank/iriver-spiegel/vorbis $cdcontrol info
Starting track = 1, ending track = 16, TOC size = 138 bytes
track     start  duration   block  length   type
-------------------------------------------------
    1   0:02.00   4:01.07       0   18082  audio
    2   4:03.07   3:00.48   18082   13548  audio
    3   7:03.55   3:22.15   31630   15165  audio
    4  10:25.70   3:44.70   46795   16870  audio
    5  14:10.65   3:44.37   63665   16837  audio
    6  17:55.27   1:21.10   80502    6085  audio
    7  19:16.37   5:10.48   86587   23298  audio
    8  24:27.10   2:09.12  109885    9687  audio
    9  26:36.22   2:24.28  119572   10828  audio
   10  29:00.50   3:44.27  130400   16827  audio
   11  32:45.02   3:58.33  147227   17883  audio
   12  36:43.35   2:24.72  165110   10872  audio
   13  39:08.32   5:52.38  175982   26438  audio
   14  45:00.70   5:48.10  202420   26110  audio
   15  50:49.05   6:01.21  228530   27096   data
   16  56:50.26  13:31.23  255626   60848   data
  170  70:21.49         -  316474       -      -

But cdda2wav gets it right and rips the audio tracks correctly:

fk_at_TP51 /tank/iriver-spiegel/vorbis $cdda2wav -B dev=1,0,0 -paranoia
Type: ROM, Vendor 'HL-DT-ST' Model 'RW/DVD GCC-4241N' Revision '1.04' MMC+CDDA
307200 bytes buffer memory requested, transfer size 65536 bytes, 4 buffers, 27 sectors
#Cdda2wav version 2.01.01a58_freebsd_8.0_i386_i386, real time sched., soundcard, libparanoia support
AUDIOtrack pre-emphasis  copy-permitted tracktype channels
      1-14           no              no     audio    2
 DATAtrack recorded      copy-permitted tracktype
     15-16 uninterrupted             no      data
Table of Contents: total tracks:16, (total time 70:19.49)
  1.( 4:01.07),  2.( 3:00.48),  3.( 3:22.15),  4.( 3:44.70),  5.( 3:44.37),
  6.( 1:21.10),  7.( 5:10.48),  8.( 2:09.12),  9.( 2:24.28), 10.( 3:44.27),
 11.( 3:58.33), 12.( 2:24.72), 13.( 5:52.38), 14.| 3:16.10|, 15.[ 6:01.21],
 16.[19:32.44]

Table of Contents: starting sectors
  1.(       0),  2.(   18082),  3.(   31630),  4.(   46795),  5.(   63665),
  6.(   80502),  7.(   86587),  8.(  109885),  9.(  119572), 10.(  130400),
 11.(  147227), 12.(  165110), 13.(  175982), 14.(  202420), 15.(  228530),
 16.(  255626), lead-out(  316474)
CDINDEX discid: kbNkxvXP4ppH.K8LpGB5MxaqEp0-
CDDB discid: 0xc9107b10
CD-Text: detected
CD-Extra: not detected
Album title: 'FASHION NUGGET'   [from CAKE]
Track  1: 'FRANK SINATRA'
[...]
Track 14: 'SAD SONGS AND WALTZES'
samplefile size will be 510689804 bytes.
recording 2895.0666 seconds stereo with 16 bits _at_ 44100.0 Hz ->'audio'...
using lib paranoia for reading.
cdda2wav: Operation not permitted. cannot set posix realtime scheduling policy
percent_done:
100%  track  1 'FRANK SINATRA' recorded successfully
100%  0 rderr, 0 skip, 0 atom, 0 edge, 0 drop, 0 dup, 0 drift
100%  241 overlap(0.5 .. 0.5)
[...]
100%  track 14 'SAD SONGS AND WALTZES' recorded successfully
100%  0 rderr, 0 skip, 0 atom, 0 edge, 0 drop, 0 dup, 0 drift
100%  200 overlap(0.5 .. 0.5)

I never understood why people are still using cdparanoia ...

Fabian

Received on Sat Apr 11 2009 - 09:56:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:46 UTC