Application Examples

Here are some applications of cdrdao:

Copying of an Audio CD

  1. Extract the structure of the source CD with:
    cdrdao read-toc cd.toc
    This will retrieve following information and store them in the file cd.toc:

      A toc-file might look as follows:

    CATALOG "3984203282000"
    TRACK AUDIO
    NO COPY
    NO PRE_EMPHASIS
    TWO_CHANNEL_AUDIO
    ISRC "DEA629762290"
    FILE "data.wav" 00:00:00 05:37:26

    TRACK AUDIO
    NO COPY
    NO PRE_EMPHASIS
    TWO_CHANNEL_AUDIO
    ISRC "DEA629762300"
    FILE "data.wav" 05:37:26 03:40:07

    ...
  2. Extract the audio data with cdparanoia or cdda2wav or any other suitable tool:
    cdparanoia 1- data.wav
    or
    cdda2wav -t1 -d5000 data.wav
  3. Write the CD-R with:
    cdrdao write cd.toc

 


Copying of a Mixed Mode CD

  1. Create images of all data tracks of the source CD and the corresponding toc-file. All data tracks will be referenced with the name given as argument to option --datafile stripped from the extension and extended by the actual track number (in this case it will be "cddata_1"). A continues range of audio tracks is referenced by inserting the track range before the extension, e.g. "cdddata_2-6.wav". If only one continues range of audio tracks exists the name will be used as specified on the command line.
    cdrdao read-cd --datafile cddata.wav cd.toc
  2. Copy the audio tracks (if any). In this example it is assumed that there is only one audio track range starting at track 2 so that the toc-file will reference "cddata.wav":
    cdda2wav -t 2 -d 6000 cddata.wav
    or
    cdparanoia 2- cddata.wav
  3. Write the CD:
    cdrdao write cd.toc

 


Creation of a CD with Live Music

Assume you have a WAVE file live.wav that contains several minutes of live music and you want to divide it in tracks every 5 minutes with further subdivisions by index marks. You will have to create following toc-file live.toc:
TRACK AUDIO
FILE "live.wav" 0 5:0:0
INDEX 3:0:0

TRACK AUDIO
FILE "live.wav" 5:0:0 5:0:0

TRACK AUDIO
FILE "live.wav" 10:0:0 5:0:0
INDEX 2:0:0

...
Then use
cdrdao write live.toc
to create a CD without any pre-gaps between the tracks.

 


Creation of a CD with a "Secret" Pre-gap before 1st Track

The toc-file
TRACK AUDIO
FILE "secret-pregap.wav"
START
FILE "track1.wav"

TRACK AUDIO
FILE "track2.wav"

...
will create a CD with a pre-gap before track 1 that contains audio data from file secret-pregap.wav. You will have to scan backwards when playing the first track with your CD player to hear the "secret" music.

 


On-The-Fly Copying

Audio CDs may be copied without storing the audio data on a hard disk by piping the extracted audio data directly to cdrdao. A fast and reliable source CD-ROM drive is required to avoid buffer under runs. It is also not worth to try on-the-fly copying with scratched source CDs.

The standard generic SCSI interface of the Linux kernel cannot handle multiple commands in parallel. Since cdda2wav/cdparanoia and cdrdao both use the generic SCSI interface mutual blocking will occur. This results in low fill rates of cdrdao's ring buffer and very likely produces buffer under runs. To avoid these problems you should apply Heiko Eißfeldt's sg-buffer patch. It is available for 2.0.x and 2.1.x kernels. For 2.2.x kernels the SG-2.2.tar.gz patch should be used. Kernel versions >= 2.2.6 do not need any patch.

I strongly recommend to perform some simulation runs before trying a real write.

Here is the command sequence:

  1. Extract a toc-file for on-the-fly copying. The option '--datafile -' indicates that the special STDIN file "-" should be used for each FILE statement in cd.toc.
    cdrdao read-toc --datafile - cd.toc
  2. Copy the CD with:
    cdda2wav -q -t 1 -d 5000 -O cdr -E big - | cdrdao write --buffers 64 cd.toc
    or
    cdparanoia -q -R 1- - | cdrdao write --buffers 64 cd.toc
    The option '--buffers' is used to adjust the ring buffer size. Each buffer holds 1 second audio data. Dividing the specified number of buffers by the writing speed gives the approx. time for which data input my be stalled, e.g. 64 buffers and writing at 4x speed results in 16 seconds.

    Note that cdparanoia needs a fast machine for performing audio ripping on-the-fly. I have to disable all paranoia checking with option -Z on my Pentium-166. Otherwise it is too slow and a buffer under run occurs just after the write process started.

 

o Home o Supported Drives o Download o Links

 


Last update: Jul/22/1999