2009-01-14

Copy Audio CDs

In the church I'm attending (Evangelische Gemeinschaft Marburg-Süd) we just started recording the sermon on CD in addition to cassette tape. These CDs are likely to be popular, so we'll need a method of duplicating them easily and quickly. I wanted to determine, how to do that on my PC (Debian Linux Testing, currently 5.0 "Lenny").

This may sound trivial to some people, but I had some special requirements:
  • Command line only, so I can create a script to fully automate the process.
  • There must not be any audible pause between tracks. Recording is done on an appliance type CD-recorder. Track marks are created by pushing the "record" button while a recording is under way. This is done live during the sermon and thus, more often than not, in the middle of a sentence - just after me noticing that a new logical section has begun.
  • We need multiple copies of a single master. Ripping the master CD-RW to computer files is permitted to take a while, but burning the copies afterwards should be fast.
I was suprised, how straightforward the solution is:


Ripping the Master CD-RW to files
  1. Create the desired target directory and cd to it. It should be blank in order to accept files with a very generic name without conflict. I chose something like /backup/mr-sued/2009-01-11
  2. Insert the master CD-RW into any suitable drive. I have a DVD-ROM and a CD-RW drive. I inserted the master CD into the DVD-ROM.
  3. execute cdparanoia -B
    No other parameters reqiured.
The audio tracks of the CD end up in the current directory with names track01.cdda.wav, track02.cdda.wav etc.

That's it.


Burning the Copies

Because burning CDs requires enhanced privilieges (write access to a device, assigning processes high priority in order to avoid buffer underruns), I did these steps as root. Burning as an ordinary user may or may not work, depending on your distribution and setup.

You need to know the Linux device name. I assigned /dev/cdrw to my CD-RW drive, so I knew I could use that. If you know less about your hardware, you can execute wodim -scanbus (some distributions might have cdrecord instead of wodim). This shows you a list of devices. Mine was
scsibus1000:
1000,0,0 100000) *
1000,1,0 100001) *
1000,2,0 100002) 'HL-DT-ST' 'DVD-ROM GDR8160B' '0013' Removable CD-ROM
1000,3,0 100003) 'AOPEN ' 'CD-RW CRW3248 ' '1.10' Removable CD-ROM
1000,4,0 100004) *
1000,5,0 100005) *
1000,6,0 100006) *
1000,7,0 100007) *
The burning itself was easy, after an extended read of man wodim:

wodim dev=/dev/cdrw -dao -audio -copy -eject *.wav

Of course you should insert a blank CD-R (or a blanked CD-RW) before and you should be in the directory of the audio wav files.
If you are doing this for the first time on your computer, everybody recommends a test-run with an additional option -dummy.

The option -dao sets wodim in disk-at-once mode, as opposed to track-at-once. Disk-at-once ensures that there are no audible gaps between the tracks.
-audio makes sure you'll write audio tracks as opposed to data tracks. CD players can only play audio tracks.
-copy sets a permission bit to make arbitrary generations of digital copies of these tracks. We want to distribute the message. Your organisational situation may be different.
-eject is optional fun, but somewhat comfortable: eject the finished CD after it has been burnt.

Happy Hacking!

0 comments:

Post a Comment