Article ID 20010920A
Subject Mixed Mode CD Copying Made Easy
Concept A Quicker way to copy those mixed-mode CD's
OS FreeBSD

Required Parts

o Running FreeBSD Preferably 4.x-STABLE
o Enough disk space for audio tracks
o A CD recorder
o cdrecord port installed (/usr/ports/sysutils/cdrecord)
o dagrab port installed (/usr/ports/audio/dagrab)


Mixed Mode CD-Copying

CDRECORD has been a part of my unix arsenal for a while now. I am proud to show my "winders" using counterpoints how easy it is for me to create and copy just about any kind of CD from the unix command line. But when it can to making mixed mode cd's thats where I struggled. Mixed mode cds are cds that contain 1 data track and multiple audio tracks. A good portion of games out today use this format. Actually creating mixed mode cds are quiet easy, just use a line like:

cdrecord -v dev=0,6,0 speed=6 -data track1.iso -audio track2.wav track3.wav track4.wav

Will do the trick, pretty easy eh?. Using mkisofs to create the track1.iso and making sure that the audio tracks are 44.1khz 16 bit audio and viola, you have a mixed mode cd. Copying data cd's are pretty easy, just issuing the command:

cdrecord -v dev=0,6,0 speed=6 -isosize /dev/cdrom

Assuming that you have a cdrecorder and a cdrom drive, this will "read in" the data track off of the cdrom and write it directly to the cdr. This is a lot quicker than copying the track to disk (using dd) and then burning the file back to a cdr, not to mention saving the ~650mb of disk space needed for the iso image. Now copying audio CD's is little more tricky. As far as I know, there is no way to "read in" the audio tracks like you can for a data track in cdrecord (please email me if you know how!). So basically I use a "cd ripper" to grab the audio tracks and put onto disk. So to copy a 10 track audio cd, I would perform the following steps:

dagrab -f "%d.wav" 1 2 3 4 5 6 7 8 9 10
cdrecord -v dev=0,6,0 speed=6 -audio 1.wav 2.wav 3.wav 4.wav 5.wav 6.wav 7.wav 8.wav 9.wav 10.wav


The dagrab option -f "%d.wav" will name the tracks by track number (the $d variable), man dagrab for more information. Now that we know how to copy data cds and create audio cds, we can combine the two operations to copy a mixed mode cd. First we need to find out the number of tracks, so using dagrab issue the command:

dagrab -i

track    start   length  type  duration   MB
    1      150   257653  data  00:57:15  577
    2   257803     7709 audio  00:01:42   17
    3   265512     2449 audio  00:00:32    5
    4   267961     2123 audio  00:00:28    4
    5   270084     2787 audio  00:00:37    6
    6   272871    12421 audio  00:02:45   27
    7   285292     9349 audio  00:02:04   20
    8   294641     9972 audio  00:02:12   22
    9   304613     3204 audio  00:00:42    7
   10   307817     2835 audio  00:00:37    6
   11   310652     2996 audio  00:00:39    6
   12   313648     3239 audio  00:00:43    7
   13   316887     2885 audio  00:00:38    6
   14   319772     3365 audio  00:00:44    7
  170   323137        - leadout

CDDB DISCID: xxxxxxxx

Looking at the output, we see track 1 is a data track and tracks 2 - 14 are audio tracks. The first step is copying those audio tracks off onto disk. Change directory to an appropriate place with enough disk space for the audio tracks, in this case we need ~140mb of disk space. Issue the command:

dagrab -f "%d.wav" 2 3 4 5 6 7 8 9 10 11 12 13 14

Now we have 13 wav files in our current directory. Now the second and final step is copying the data track then adding the audio tracks afterword. We can do this with the following command:

cdrecord -v dev=0,6,0 speed=6 -isosize /dev/cdrom -audio 2.wav 3.wav 4.wav 5.wav \
6.wav 7.wav 8.wav 9.wav 10.wav 11.wav 12.wav 13.wav 14.wav


And in no time, we have a copy of a mixed mode cd. Now this wont get around any copy-protection enabled cds, but this works better than most windows programs ;)





Back to Articles



©2004-2017 Paul Boehmer