View this PageEdit this PageUploads to this PageVersions of this PageHomeRecent ChangesSearchHelp Guide

informacion adicional cdrw

Linux Notes: CD Ripping, Recording, and Audio Mastering


Last modified: 03/19/2003



Contents



Ripping


"Ripping" means transfering an audio track from an audio CD to the hard drive. This is challenging because the OS cannot receive the audio data in real time, and repositioning the laser accurately is difficult. The CD format was designed for real time streaming access, not random access.

To rip audio tracks, use cdparanoia
  • To query the table of contents: cdparanoia -Q
  • To copy a track to hard drive: cdparanoia n [filename.wav] where "n" is the track number, and output is to a .wav file.
  • Copy tracks n through m: cdparanoia --batch n-m [filename.wav]
  • Use -d [device] to specify something other than /dev/cdrom. My Plextor drive is /dev/cdrom1.

Reading the cdparanoia animated output: spaces and happy faces are good, a dash is acceptable.

To rip an entire ISO filesystem from a CD-ROM:
dd if=/dev/cdrom of=my_cdrom.iso



Warning


When burning a multi-session audio or data CD, disable auto-mounting. If enabled, the OS will try to both read and write to the CD at the same time, and will cause either a miswrite or will deadlock the kernel. See: Nautilus > Peripherals > CD Properties > (Audio CD > Auto-play) and (Data CD > Auto-mount).


General Hints


  • Enable "BURN-Proof".
  • Run cdrecord in "dummy" mode first.
  • For repeatability, put the recording commands into a shell script.
  • Practice writing to a CD-RW before committing to CD-R.


Media Write Speeds


Media speeds for my CD writer, Plextor 16/10/40A:

Imation CD-R 24xspeed=16
Memorex CD-RW 4xspeed=4


Burning a Data CD


  1. Assemble data into a single directory tree.
  2. Create an ISO image with:
        mkisofs -o cd.iso -R -J -r dir
  3. Verify/browse ISO image with:
        isoinfo -i cd.iso -f -R -J  | less

    Or mount as a read-only file system with:
        mount cd.iso /mnt/dir -t iso9660 -o ro,loop
  4. Write CD with:
        cdrecord -v speed=16 dev=0,0,0 -data cd.iso

Use:
  • Run cdrecord -scanbus to determine the CD drive device parameters.
  • Use the "-dummy" option to test the settings.

A script fragment to help manage ISO contents (where "cd" is the directory with the contents):


if [ ! -e mixed_mode.iso -o -n "`find cd -newer mixed_mode.iso`" ]; then
    echo "Cleaning..."
    find cd \( -name '*~' -o -name '*.bak' -o -type d -name '.*' -prune \) \
         -print -exec rm -rf '{}' \;
    echo
    echo "Link check..."
    html_link_check -start cd/READ-ME.html
    echo
    echo "Building ISO image..."
    mkisofs -o mixed_mode.iso -R -J -r cd
    echo
    echo "Contents:"
    isoinfo -i mixed_mode.iso -f -R -J
    echo
fi



Downloading and Burning ISO images from RedHat


RedHat distributes OS as ISO images that can be directly written to CD-R.

  1. Download the ISO images. These are available from one of the RedHat mirror sites. Use NcFTP for best results.
  2. Verify the integrity of each image with "md5sum iso-image" and compare with the MD5 sum posted on the FTP site.
  3. Write each CD with:
        cdrecord -v speed=16 dev=0,0,0 -data iso-image


Burning an Audio CD


  • Tracks may be .wav or .au files.
  • .wav files must be 2 channel (not mono). Convert from mono to stereo with:
        sox mono.wav -c 2 stereo.wav
  • Burn the CD with:
    cdrecord -v speed=12 dev=0,0,0 driveropts=burnproof \
             -audio -pad -eject \
             [files...]


Additional cdrecord options:

  • Use -shorttrack before tracks shorter than 4 seconds.
  • Use the -dao option to eliminate the 2 second gap between tracks. DAO = Disk-At-Once. The default is TAO = Track-At-Once. TAO necessitates a 2 second gap between tracks. DAO is not supported on all CD writers, but it is on mine, and probably most modern ones.


On-The-Fly Copying


On-the-fly copying means that the two CD drives are operating at the same time: the first one reads the source, and the second one writes onto the blank.

  • X-CD-Roast will do on-the-fly copying for data CDs, but not for audio CDs.
  • cdrdao will do on-the-fly copying for audio CDs.
  • If both CD drives are on the same ATAPI (IDE) interface, forget about on-the-fly copying. It causes too much traffic on one ATAPI interface. My Plextor with BurnProof was able to handle it, but the transfer buffer was approximately 3% full most of the time -- not where you want to be.

Copy an audio CD with this command. It operates in two phases: first copying the audio to a disk file, and then writing to the CD blank.

   cdrdao copy --device 0,0,0 --source-device 0,1,0 \
            --source-driver generic-mmc \
            --eject --reload -v 1 -n \
            --datafile /media/tmp/cdrdao.bin



Burning a Mixed-mode CD


A mixed-mode CD has both data and audio. It is a single session CD. The data is visible as a file system to a computer, and the audio is visible to CD players. The drawback to mixed mode is that the data track is visible to CD players, and some will even try to play it, and of course it does not sound good.

To create a mixed-mode CD, create an ISO image as for Burning a Data CD, and collect the audio tracks. Run cdrecord with the like this:
   cdrecord "$@" speed=$SPEED dev=0,0,0 driveropts=burnproof -eject \
  -data             \
    mixed_mode.iso  \
  -pad  -audio      \
    song1.wav       \
    song2.wav       \
    (etc.)



Burning an Enhanced CD (A.K.A CD-Plus, or CD-ROM XA mode 2)


Similar to a mixed-mode CD, an enhanced CD also has both data and audio, and is a multi-session CD. The audio is written in the first session, and the data is written in the second session. Most CD players can only see tracks in the first session, effectively hiding the data track. The drawback to enhanced format is that some CD players cannot read multi-session CDs at all. See this entry in the CD-Writing HOW-TO on creating multi-session CDs (http://www.tldp.org/HOWTO/CD-Writing-HOWTO-4.html#ss4.18).

To create an enhanced CD, arrange the data for an ISO image as for Burning a Data CD, and collect the audio tracks.

  • 1. Write the audio tracks. Be sure to specify the -multi flag:
    cdrecord "$@" speed=$SPEED dev=0,0,0 driveropts=burnproof \
      -multi -audio -pad \
        song1.wav        \
        song2.wav

  • 2. Determine where the free space on the CD begins with:
    NEXT_TRACK=`cdrecord -msinfo`

  • 3. Create an ISO image using the two numbers returned in step 2:
    mkisofs -o cd_plus.iso -R -J -C $NEXT_TRACK -r cd

  • 4. Verify the ISO image with:
    isoinfo -i cd_plus.iso -f -R -J -N ${NEXT_TRACK/*,}

  • 5. Write the data track:
    cdrecord "$@" speed=$SPEED dev=0,0,0 driveropts=burnproof -eject \
      -data -pad \
        cd_plus.iso


Here is a script to help manage ISO contents (where "cd" is the directory with the contents):


# Default speed
SPEED=10

# Process arguments. Identify speed and "blank" directives.
SESSION_1_ARGS=
SESSION_2_ARGS=
for A in "$@"; do
    if [ "blank=" = "${A:0:6}" ]; then
        # Erase only before first session.
       SESSION_1_ARGS="$SESSION_1_ARGS $A"
    elif [ "speed=" = "${A:0:6}" ]; then
        SPEED=${A#speed=}
    else
        SESSION_1_ARGS="$SESSION_1_ARGS $A"
 SESSION_2_ARGS="$SESSION_2_ARGS $A"
    fi
done

# Audio session.
cdrecord $SESSION_1_ARGS speed=$SPEED dev=0,0,0 driveropts=burnproof \
  -multi -audio -pad \
    cd/song1.wav     \
    cd/song2.wav


# Figure out if the ISO image should be remade.
# Note that audio files are stored inside the 'cd' directory.
if [ ! -e cd_plus.iso -o -n "`find cd -newer cd_plus.iso`" ]; then
    echo "Cleaning..."
    find cd \( -name '*~' -o -name '*.bak' -o -type d -name '.*' -prune \) \
         -print -exec rm -rf '{}' \;
    echo
    echo "Link check..."
    html_link_check -start cd/READ-ME.html
    echo
    echo "Building ISO image..."
    NEXT_TRACK=`cdrecord -msinfo`
    echo $NEXT_TRACK > cd_plus_msinfo
    mkisofs -o cd_plus.iso -R -J -C $NEXT_TRACK -r cd
    echo
    echo "Contents:"
    isoinfo -i cd_plus.iso -f -R -J -N ${NEXT_TRACK/*,}
    echo
fi


# Data session.
cdrecord $SESSION_2_ARGS speed=$SPEED dev=0,0,0 driveropts=burnproof -eject   \
  -data -pad    \
    cd_plus.iso




Recording Live Audio


  • Use Gnome Sound Recorder (Programs -> Multimedia -> Sound Recorder) or Audacity to record. With Sound Recorder, record in stereo, not mono (it messes up mono recording). Use 16-bit PCM, 44.1 KHz, stereo mode.
  • Convert to mono with sox:
    for F in `*.st.wav`; do
      G=${F%.st.wav};
      echo $G;
      sox $F -c 1 $G.wav;
    done

  • Edit waveform using Audacity waveform editor. Export to .wav format.


Converting to MP3


Use lame to convert to mp3 format with:

lame -q 0 -V 0 --vbr-new -m m -c -p --strictly-enforce-ISO  \
  --tt 'track title' --tn <track-number>      \
  --ta 'author'                                     \
  --tl 'album title'                                \
  --ty <year-of-issue> --tc <comment>   \
  file.wav  file.mp3

Where:
  • Change the "-m m" option to "-m j" for highly correlated stereo, or to "-m s" for uncorrelated stereo.
  • <year-of-issue> is 1 to 9999.
  • I have been using the comment field for the date on which I converted the file.



Copyright © 2002 Craig Lawson
(Fuente: http://216.239.33.100/search?q=cache:K6QR8ntXHVEJ:pages.sbcglobal.net/craig.lawson/linux_notes/cds.html&hl=en&ie=UTF-8)
(Conversion a SWiki por Dario)

Link to this Page

  • cdrw en seraphim last edited on 12 February 2010 at 7:05:03 pm by salchicha.sico.local