[vox-tech] Burning CD's in Linux

Mike Simons vox-tech@lists.lugod.org
Wed, 05 Mar 2003 11:47:31 -0500


On Tue, Mar 04, 2003 at 05:30:38PM -0800, Michael J Wenk wrote:
> the general command I use is:
> cdrecord dev=0,0,0 speed=8 -data -dao /tmp/myiso.iso
[...] 
> (my windows burner is also quite a bit faster than
> my linux one, though I don't make as many coasters with linux.)

Mike,

Two things:
- When you say the windows burner is faster, do you mean actual burn
  time or your time spent to get a burn setup?
- When you say you make coasters under Linux is that because the
  cdrecord couldn't keep up with the data needs of the drive, or 
  because you selected the wrong set of files?

... 

  If the windows software actually burns to disk faster, it seems you
should raise the "speed" option higher... to whatever your drive's rated
speed is.  If the cdrecord is told to burn at the same speed as the
windows software the burn time should be within a few seconds of each
other.

  Perhaps you lowered the burn speed because you are making coasters,
and are making toasters due to buffer underruns... there are two options
to look into to fix this:

- cdrecord uses a buffer to send things to the drive, the default size 
  4meg is the _minimum_ recommended size, it should be increased if you
  are running high speed burns... check out the "fs" option.  The man
  page talks about correct sizing of this buffer... then doing a number
  of test runs (--dummy) to verify the speed and buffer are working
  together.

- cdrecord will run as a real-time process which will prevent other
  normal CPU load from interfering with a data burn (*).  However,
  in order to raise the scheduling mode from normal to real-time
  the cdrecord process must be running as root.  If you normally run 
  burns as a user you should try having cdrecord run as root even when
  normal users run it... with chmod and such (example below).

*: massive amounts of disk activity could still interfere with retrieving
  the data from disk enough to cause buffer underruns.


To SUID root the cdrecord command:

  Add the following line to 

/etc/groups
===
cdrw:x:USER1,USER2,USER3
===

  You will need to log out and log back in as whichever user you want to
do the burning, for the change to /etc/group to take effect.


Run the following commands as root:
===
chown root `which cdrecord`
chgrp cdrw `which cdrecord`
chmod 4710 `which cdrecord`
===

    Later,
      Mike Simons


>From the cdrecord man page:
#        On SVr4 compliant systems, cdrecord uses the the real time
#        class to get the highest scheduling priority that is  pos-
#        sible (higher than all kernel processes).  On systems with
#        POSIX  real  time  scheduling  cdrecord  uses  real   time
#        scheduling  too,  but  may  not be able to gain a priority
#        that is higher than all kernel processes.
[...]
#        You should run several tests in all  supported  speeds  of
#        your  drive  with  the  -dummy option turned on if you are
#        using cdrecord on an unknown system. Writing  a  CD  is  a
#        realtime  process.


#        fs=#   Set  the fifo (ring buffer) size to #.
[...]
#               If a  number  is  fol-
#               lowed  directly by the letter `b', `k', `m', `s' of
#               `f',  the  size  is  multiplied   by   512,   1024,
#               1024*1024,  2048  or 2352.
[...]
#               The size specified by the fs= argument includes the
#               shared  memory  that  is needed for administration.
#               This is at least one page of  memory.   If  no  fs=
#               option  is  present,  cdrecord  will try to get the
#               fifo size value from the CDR_FIFOSIZE  environment.
#               The default fifo size is currently 4 MB.
# 
#               The fifo is used to increase buffering for the real
#               time writing process.  It allows to run a pipe from
#               mkisofs  directly  into  cdrecord.   If the fifo is
#               active and a pipe from  mkisofs  into  cdrecord  is
#               used  to  create a CD, cdrecord will abort prior to
#               do any modifications on the disk  if  mkisofs  dies
#               before  it  starts  writing.   The recommended fifo
#               size is between 4 and 32  MBytes.   As  a  rule  of
#               thumb,  the  fifo  size should be at least equal to
#               the size of the internal buffer of the  CD-Recorder
#               and no more than half of the physical amount of RAM
#               available in the machine.  If the fifo size is  big
#               enough, the fifo statistics will print a fifo empty
#               count of zero and the fifo min fill  is  not  below
#               20%.
[...]
#               It is not wise to use too much space for the
#               fifo. If you need more than 8 MB to write a  CD  on
#               an  idle  machine, your machine is either underpow-
#               ered, has hardware problems or  is  mis-configured.
[...]
#               If you have buffer underruns  or  similar  problems
#               and observe a zero fifo empty count, you have hard-
#               ware problems. The fifo size in this case is suffi-
#               cient.
===

  I suspect this last section (buffer over 8 Megs) was written when 
much slower burner drives existed, and may not be correct anymore.
Note it's talking about an idle machine, and a little seeking on the
hard disk (from other processes) can really cut into transfer rates 
from the drive.