PDA

View Full Version : Howto: Duplicate Audio CDs using cdrdao


andrew.46
May 15th, 2008, 10:40 AM
=============
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.

=====================
Identify your drive
=====================

First of all 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@skamandros:~$ sudo cdrdao scanbus
[sudo] password for andrew:
Cdrdao version 1.2.2 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

1,0,0 : Optiarc , DVD+-RW AD-5560A, DD11

So the scsi address for my drive is 1,0,0 for bus,id,lun and since this is a single drive computer it will be both the source and destination drive in my command line. The results of this command give a hint as well concerning the driver that cdrdao will use. Have a look at the URL given and see if your drive is mentioned there but you will probably find that the generic-mmc driver will work well enough with most modern drives.

======================
All the other 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 easy way. First create the following file:

$ sudo touch /etc/cdrdao.conf

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:

#---- cdrdao.conf ----#
write_buffers: 128
write_device: "1,0,0"
write_driver: "generic-mmc"
read_device: "1,0,0"
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 1,0,0 --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 1,0,0 --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'.


It is a great man page, make sure to read it from end to end and experiment a little with a few settings. Support is always more cheerfully given if the documentation has been read first (http://xkcd.com/293/) :-).

====================
And in conclusion ...
====================

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.

October 23rd, 2008
Andrew Strong

rosencrantz
December 16th, 2008, 08:30 AM
Great post, just a quick note: The ATA syntax is obsolete (see http://markmail.org/message/b7yf4kkdnywqijpb), so try
the wodim --devices output to get the correct device (something like --device /dev/scd0)

andrew.46
December 16th, 2008, 03:27 PM
Hi rosencrantz,

Great post, just a quick note: The ATA syntax is obsolete (see http://markmail.org/message/b7yf4kkdnywqijpb), so try
the wodim --devices output to get the correct device (something like --device /dev/scd0)

Thanks for your post. I will admit to not having used wodim that much, I tend to use Jorg Schilling's cdrecord as a deliberate choice. cdrecord uses the same scsi syntax though. I have not tested the wodim syntax, does it work with cdrdao? Burning on my system has been flawless with the scsi address given in this guide.

Andrew

rosencrantz
December 16th, 2008, 05:31 PM
Hi Andrew,
yep, sorry - evil SuSE user, so I wrote wodim kind of automatically. Considering the fact that I have a compatibility package symlinking cdrecord directly to wodim, I suppose they kept the syntax the same after the fork - naturally, I have no way to test that assumption. AFAIK, cdrdao is not affected by the fork.
Fiddling with cdrdao copy on SuSE 11, I tried both the SCSI specs from cdrdao scanbus, which didn't work and the /dev/cdr0 from cdrecord --devices, which did.
Update: cdrdao scanbus warns me: "the ATA: method is considered deprecated on modern kernels! Use --devices to display the native names."
Kernel 2.6.25 - are you using an older one or is this some weird distro/fork-specific issue?


Greets rosencrantz

andrew.46
December 17th, 2008, 02:26 AM
Hi,

Ubuntu also uses wodim instead of cdrecord with a similar symlinking device, it is actually only me who uses the real cdrecord on Ubuntu :-).

But I am not one to ignore advice so I tested on my freshly reloaded Ubuntu Intrepid Ibex system with the default cdrdao and wodim installed. Forgive me if this reply is somewhat long-winded but I have investigated this thoroughly:

andrew@skamandros:~$ sudo cdrdao scanbus
Cdrdao version 1.2.2 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

1,0,0 : Optiarc , DVD+-RW AD-5560A, DD11


and with wodim:

andrew@skamandros:~$ wodim --devices
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
0 dev='/dev/scd0' rwrw-- : 'Optiarc' 'DVD+-RW AD-5560A'
-------------------------------------------------------------------------


which all looks reasonable. So to try the wodim syntax with cdrdao:

andrew@skamandros:~/Desktop$ sudo cdrdao read-cd --source-device /dev/scd0 --driver generic-mmc \
> --paranoia-mode 3 audiocd.toc
Cdrdao version 1.2.2 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

/dev/cdrw: Optiarc DVD+-RW AD-5560A Rev: DD11
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track Mode Flags Start Length
------------------------------------------------------------
1 AUDIO 0 00:00:32( 32) 04:19:63( 19488)
2 AUDIO 0 04:20:20( 19520) 02:47:45( 12570)
3 AUDIO 0 07:07:65( 32090) 04:17:65( 19340)
4 AUDIO 0 11:25:55( 51430) 03:35:70( 16195)
5 AUDIO 0 15:01:50( 67625) 03:43:45( 16770)
6 AUDIO 0 18:45:20( 84395) 03:51:65( 17390)
7 AUDIO 0 22:37:10(101785) 03:02:62( 13712)
8 AUDIO 0 25:39:72(115497) 04:37:35( 20810)
9 AUDIO 0 30:17:32(136307) 02:24:33( 10833)
10 AUDIO 0 32:41:65(147140) 03:06:40( 13990)
11 AUDIO 0 35:48:30(161130) 03:34:17( 16067)
12 AUDIO 0 39:22:47(177197) 04:07:00( 18525)
13 AUDIO 0 43:29:47(195722) 03:26:18( 15468)
14 AUDIO 0 46:55:65(211190) 03:16:70( 14770)
15 AUDIO 0 50:12:60(225960) 04:57:27( 22302)
16 AUDIO 0 55:10:12(248262) 02:18:15( 10365)
17 AUDIO 0 57:28:27(258627) 03:28:28( 15628)
Leadout AUDIO 0 60:56:55(274255)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-17: start 00:00:00, length 60:56:55 to "data.bin"...
Track 1...


And this works perfectly, as does the syntax that I give in the guide:

andrew@skamandros:~/Desktop$ sudo cdrdao read-cd --source-device 1,0,0 --driver generic-mmc \
> --paranoia-mode 3 audiocd.toc
Cdrdao version 1.2.2 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

/dev/cdrw: Optiarc DVD+-RW AD-5560A Rev: DD11
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track Mode Flags Start Length
------------------------------------------------------------
1 AUDIO 0 00:00:32( 32) 04:19:63( 19488)
2 AUDIO 0 04:20:20( 19520) 02:47:45( 12570)
3 AUDIO 0 07:07:65( 32090) 04:17:65( 19340)
4 AUDIO 0 11:25:55( 51430) 03:35:70( 16195)
5 AUDIO 0 15:01:50( 67625) 03:43:45( 16770)
6 AUDIO 0 18:45:20( 84395) 03:51:65( 17390)
7 AUDIO 0 22:37:10(101785) 03:02:62( 13712)
8 AUDIO 0 25:39:72(115497) 04:37:35( 20810)
9 AUDIO 0 30:17:32(136307) 02:24:33( 10833)
10 AUDIO 0 32:41:65(147140) 03:06:40( 13990)
11 AUDIO 0 35:48:30(161130) 03:34:17( 16067)
12 AUDIO 0 39:22:47(177197) 04:07:00( 18525)
13 AUDIO 0 43:29:47(195722) 03:26:18( 15468)
14 AUDIO 0 46:55:65(211190) 03:16:70( 14770)
15 AUDIO 0 50:12:60(225960) 04:57:27( 22302)
16 AUDIO 0 55:10:12(248262) 02:18:15( 10365)
17 AUDIO 0 57:28:27(258627) 03:28:28( 15628)
Leadout AUDIO 0 60:56:55(274255)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-17: start 00:00:00, length 60:56:55 to "data.bin"...
Track 1...


So on an Ubuntu Intrepid Ibex system both types of syntax will work. This is probably not a huge suprise when I looked more closely at the man pages and found:

--device [prot:]bus,id,lun
Sets the SCSI address of the CD-recorder in form of a bus/id/lun triple, e.g. ’0,2,0’ for the
logical unit 0 of SCSI device with ID 2 on bus 0. ATAPI devices can be specified by using the
prefix ’ATAPI:’, e.g. ’ATAPI:0,0,0’. On some systems a device node may be specified directly,
e.g. ’/dev/sg0’ on Linux systems. Linux 2.6 users may also try the newer ATAPI interface with
the ’ATA:’ prefix.


You will note the slight difference between the ATA syntax you have spoken of and the scsi syntax I demonstrate in the guide.

So my conclusion is that in Ubuntu at least both the scsi syntax and the device address specified by wodim can be successfully used with cdrdao. The ATA style syntax also works on my machine but this may not be the case universally I suspect.

As for one being deprecated in favour of the other, this is a battle that Jorg Schilling and Debian can continue to fight out without me :-).

All the best,

Andrew Strong

rosencrantz
December 17th, 2008, 07:59 AM
Thorough indeed ;-) and good to know.
Thanks

rosencrantz