This page was created from the Ubuntu Forums guide: Howto: Duplicate Audio CDs using cdrdao, where support is still available for this wiki page, and also draws heavily from this commandline burning guide: CD and DVD Writing from the Linux Command Line. Thanks to the author of both of these guides for his kind permission to use the material on this page!

Introduction

This guide aims to show how to duplicate audio cds from the command line using one of my favourite programs: cdrdao. I have used this program countless times to make legal backups of my own audio cds, please only do so yourself if this is legal in your country. cdrdao is used by countless gui burning applications, the best known of which is k3b.

Website: http://cdrdao.sourceforge.net/

Preparation

First install cdrdao:

sudo apt-get install cdrdao

Next cdrdao needs to know where to find your drive and the following command will give you the required information. I show the results from my own computer, your results will of course differ slightly:

andrew@corinth:~$ sudo cdrdao scanbus
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0 : Optiarc , DVD RW AD-7590A , 1.52

So my device address for my drive is /dev/sr0 and since this is a single drive computer it will be both the source and destination drive in my command line.

Required settings

With the drive and the driver successfully identified it remains only to decide on a few other elements to form our command line:

  • Write speed: There are a thousand theories regarding the correct speed to burn an audio cd. I prefer to burn slowly so I have selected a speed of 8.

  • Buffers: This specifies the number of buffers available to prevent under-run. Each buffer holds 1 second of audio data so divide the buffers by the write speed to give the maximum time for which reading of audio data may be stalled. With buffers of 128, as I have selected, and write speed of 8 this gives 16 seconds before under-run will occur..

  • Error Checking: It is possible to set error checking for the digital audio extraction and I prefer to set this to maximum. This slows the whole process down a little but guarantees better quality.

So now all the settings are decided and it is time to assemble the command line.

Doing it the easy way

If you really want you can type out the whole command line each time you want to duplicate an audio cd but there is a easier way. First create the following file:

touch $HOME/.cdrdao

Next open it with your favourite text editor and then simply add all the settings that we have discussed above into this file in the following format:

#---$HOME/.cdrdao --#
write_buffers: 128
write_device: "/dev/sr0"
write_driver: "generic-mmc"
read_device: "/dev/sr0"
read_driver: "generic-mmc"
read_paranoia_mode: 3
write_speed: 8

Now when you wish to duplicate an audio cd place the source cd in your drive and use the following command:

sudo cdrdao copy

And the rest of the process will continue with the only intervention required by you being the replacement of the source cd with a blank, writeable cd when prompted. How cool is that!

Doing it the hard way

If however you wish to have a little more 'hands-on' control of the process you can use a full command line and duplicate the audo cd in two steps. The first step rips the audio cd to the computer and generates a table of contents (TOC):

sudo cdrdao read-cd --source-device /dev/sr0 --driver generic-mmc \
                      --paranoia-mode 3 audiocd.toc

This gives you the opportunity to alter the TOC if you wish. Now a second command is required to burn the generated files data.bin and audiocd.toc to your blank, writeable cd:

sudo cdrdao write  --device /dev/sr0 --driver generic-mmc \
                     --buffers 128 --speed 8 audiocd.toc

You can use whichever technique you are most comfortable with. Certainly the 'hard way' will give a little more flexibility and room for experimentation. I use both techniques depending on how much time I have to spend setting the burn up and how involved I want to be in the process.

Other useful commands

The man page for cdrdao is well written and quite comprehensive and I strongly suggest that you read it well. Below are a few 'high points', options that may be useful with the syntax above:

  • --keepimage: If you are using the 'copy' command the cd image is automatically removed at the completion of the write process. This option allows the image to remain and to then be written to another cd if you wish.

  • --simulate: Used in the writing process as: 'sudo cdrdao write --simulate'. This will perform the write process fully but in simulation only. Very useful to test settings.

  • --blank-mode minimal: Add this option in to blank your cd quickly. If you wish to blank the cd completely use the option '--blank-mode full'.

cdrdao does a great deal more than I have described above and I encourage you to explore the program fully. You will find it an amazingly robust and efficient little program and when you get to know it well you will rarely, if ever, produce a coaster instead of a clean, high quality burn.

External Links


CategorySoftware

cdrdao (last edited 2012-04-09 22:50:12 by andrew.46)