CDR Recording under Linux, Tutorials


Table of Contents

MKISOFS AND CDRECORD 
Data CDs 
On the fly 
Audio CDs 
CD burning for dummies (SCSI Emulation - Standard Method) 
The Underlying Problem 
Prerequisites/Setup 
Getting It Working 
Getting It Working 
Getting It Working 

MKISOFS AND CDRECORD 

https://www.linux-magazine.com/issue/10/mkisofs_cdrecord.pdf

BURNING BY COMMAND CDs written fast on the command line

The graphical user interface may be the user friendly way of burning audio and data to disc, but for pure speed the command line simply can't be beaten.

Data CDs 

On the fly 

It is also possible to burn a directory directly onto the CD, without taking up 650MB of disk space first. Output from mkisofs is simply transferred via a pipe to cdrecord; mkisofs is called up without specifying an output file (-o file) and simply writes the ISO image in the standard output:

mkisofs -r /tmp/cddata | cdrecord -v fs=6m speed=4 dev=0,4,0 -

The minus sign at the end of the command is necessary so that cdrecord reads the data from the standard input and does not attempt to read from a file.

A buffer of 6MB (option fs=6m) should prevent buffer underrun. But such buffer underruns (which result in the destruction of the blank) are highly unlikely under Linux anyway, as the operating system has a good multitasking function. Even with the most vigorous activities being performed by other programs, we have never known cdrecord to miss a stroke. In operating systems with less powerful multitasking, burnt out blanks are commonplace - even the screensaver kicking in can cause problems.

It is only on very low-powered or very heavily overloaded computers that this type of failure would be conceivable under Linux, and the industry has created a remedy for this scenario: devices with BURN-Proof technology reliably prevent buffer underruns. cdrecord supports this technology.

Audio CDs 

Since audio CDs do not contain a file system, mkisofs is not needed for them. The tracks are simply written one after another onto the CD. As with data CDs, cdrecord is used for the burn procedure, with a few modifications. The sample command from the start of the article now becomes

cdrecord -v -audio -pad dev=0,4,0 speed=4 /tmp/track*.wav

The dev and speed options have not been altered, but two new ones have been added:

  • -audio tells the burn software that an audio CD is to be burned.
  • -pad is less obvious. Audio CDs include tracks in accordance with the CD-DA (Compact-Disc Digital-Audio) standard, and tracks with this specification need a few special characteristics. They need a sampling rate of 44,100 samples per second and their file size must be a multiple of 2352 bytes. Since the wav or au files available for burning do not, as a rule, comply with this file size requirement, the -pad option is needed to add an appropriate number of zeros to the end of the file.

It is also possible to create audio CDs incrementally. The additional option -nofix is used to do so. The following three commands each burn two tracks onto the CD and only fix the blank on the third write procedure, thus finishing it off completely:

cdrecord -v -audio -pad -nofix dev=0,4,0 speed=4 t1.wav t2.wav
cdrecord -v -audio -pad -nofix dev=0,4,0 speed=4 t3.wav t4.wav
cdrecord -v -audio -pad dev=0,4,0 speed=4 t5.wav t6.wav

A CD which has not been fixed can only be played back in CD burners and not in simple CD- ROM drives or audio CD players. You can finish these discs off at any time using the -fix option:

cdrecord -v -fix dev=0,4,0

Sometimes the resultant CD is missing some audio tracks - with noise taking their place. This is due to the structure of your wav files - the byte sequence of the audio coding is wrong; The sequence can be Little Endian or Big Endian. To get rid of this very strange phenomenon (and to correct the byte sequence), use the -swab (SWAp Bytes) option.

LINUX MAGAZINE 10 - 2001