If you need to
rip a CD
from a command-line interface (CLI) on a
CentOS Linux
system,
cdparanoia will allow you to do so. The cdparanoia
CD ripper
program will allow you to produce Waveform Audio File Format, i.e., .WAV, files
from the tracks on a CD. You can use the
yum package management software to install the software
with by issuing the command yum install cdparanoia
from the
root account.
# yum install cdparanoia Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirror.umd.edu * epel: mirror.umd.edu * extras: mirror.umd.edu * updates: mirror.umd.edu Resolving Dependencies --> Running transaction check ---> Package cdparanoia.x86_64 0:10.2-17.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: cdparanoia x86_64 10.2-17.el7 base 55 k Transaction Summary ================================================================================ Install 1 Package Total download size: 55 k Installed size: 124 k Is this ok [y/d/N]: y Downloading packages: cdparanoia-10.2-17.el7.x86_64.rpm | 55 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : cdparanoia-10.2-17.el7.x86_64 1/1 Verifying : cdparanoia-10.2-17.el7.x86_64 1/1 Installed: cdparanoia.x86_64 0:10.2-17.el7 Complete! #
When it is installed, you can see information on the cdparanoia
package
using the command rpm -qi cdparanoia
.
$ rpm -qi cdparanoia Name : cdparanoia Version : 10.2 Release : 17.el7 Architecture: x86_64 Install Date: Sat 09 Mar 2019 02:41:29 PM EST Group : Applications/Multimedia Size : 127427 License : GPLv2 and LGPLv2 Signature : RSA/SHA256, Thu 03 Jul 2014 08:56:13 PM EDT, Key ID 24c6a8a7f4a80eb5 Source RPM : cdparanoia-10.2-17.el7.src.rpm Build Date : Tue 10 Jun 2014 01:14:59 AM EDT Build Host : worker1.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS URL : http://www.xiph.org/paranoia/index.html Summary : Compact Disc Digital Audio (CDDA) extraction tool (or ripper) Description : Cdparanoia (Paranoia III) reads digital audio directly from a CD, then writes the data to a file or pipe in WAV, AIFC or raw 16 bit linear PCM format. Cdparanoia doesn't contain any extra features (like the ones included in the cdda2wav sampling utility). Instead, cdparanoia's strength lies in its ability to handle a variety of hardware, including inexpensive drives prone to misalignment, frame jitter and loss of streaming during atomic reads. Cdparanoia is also good at reading and repairing data from damaged CDs. $
You can see information on a CD in the CD/DVD drive by issuing the command
cdparanoia -vsQ
. Note: you will need to issue the command from the
root account. For the CD checked below, there is only one track.
# cdparanoia -vsQ cdparanoia III release 10.2 (September 11, 2008) Using cdda library version: 10.2 Using paranoia library version: 10.2 Checking /dev/cdrom for cdrom... Testing /dev/cdrom for SCSI/MMC interface SG_IO device: /dev/sr0 CDROM model sensed sensed: TSSTcorp CD/DVDW SH-S182M SB02 Checking for SCSI emulation... Drive is ATAPI (using SG_IO host adaptor emulation) Checking for MMC style command set... Drive is MMC style DMA scatter/gather table entries: 1 table entry size: 131072 bytes maximum theoretical transfer: 55 sectors Setting default read size to 27 sectors (63504 bytes). Verifying CDDA command set... Expected command set reads OK. Attempting to set cdrom to full speed... drive returned OK. Table of contents (audio tracks only): track length begin copy pre ch =========================================================== 1. 231538 [51:27.13] 0 [00:00.00] OK no 2 TOTAL 231538 [51:27.13] (audio only) #
If the command isn't issued from the root account, you may see output like that shown below for the same CD.
$ cdparanoia -vsQ cdparanoia III release 10.2 (September 11, 2008) Using cdda library version: 10.2 Using paranoia library version: 10.2 Checking /dev/cdrom for cdrom... Testing /dev/cdrom for SCSI/MMC interface Could not access device /dev/sr0 to test for SG_IO support: Perm ission denied no SG_IO support for device: /dev/sr0 Could not access device /dev/sr0: Permission denied Testing /dev/cdrom for cooked ioctl() interface /dev/sr0 is not a cooked ioctl CDROM. Checking /dev/cdroms/cdrom0 for cdrom... Could not stat /dev/cdroms/cdrom0: No such file or directory Checking /dev/cdroms/cdroma for cdrom... Could not stat /dev/cdroms/cdroma: No such file or directory Checking /dev/cdroms/cdrom1 for cdrom... Could not stat /dev/cdroms/cdrom1: No such file or directory Checking /dev/cdroms/cdromb for cdrom... Could not stat /dev/cdroms/cdromb: No such file or directory Checking /dev/cdroms/cdrom2 for cdrom... Could not stat /dev/cdroms/cdrom2: No such file or directory Checking /dev/cdroms/cdromc for cdrom... Could not stat /dev/cdroms/cdromc: No such file or directory Checking /dev/cdroms/cdrom3 for cdrom... Could not stat /dev/cdroms/cdrom3: No such file or directory Checking /dev/cdroms/cdromd for cdrom... Could not stat /dev/cdroms/cdromd: No such file or directory Checking /dev/hd0 for cdrom... Could not stat /dev/hd0: No such file or directory Checking /dev/hda for cdrom... Could not stat /dev/hda: No such file or directory Checking /dev/hd1 for cdrom... Could not stat /dev/hd1: No such file or directory Checking /dev/hdb for cdrom... Could not stat /dev/hdb: No such file or directory Checking /dev/hd2 for cdrom... Could not stat /dev/hd2: No such file or directory Checking /dev/hdc for cdrom... Could not stat /dev/hdc: No such file or directory Checking /dev/hd3 for cdrom... Could not stat /dev/hd3: No such file or directory Checking /dev/hdd for cdrom... Could not stat /dev/hdd: No such file or directory Checking /dev/sg0 for cdrom... Testing /dev/sg0 for SCSI/MMC interface Could not access device /dev/sg0 to test for SG_IO support: Perm ission denied no SG_IO support for device: /dev/sg0 Could not access device /dev/sg0: Permission denied generic device: /dev/sg0 ioctl device: not found Could not open generic SCSI device /dev/sg0: Permission denied Testing /dev/sg0 for cooked ioctl() interface /dev/sg0 is not a cooked ioctl CDROM. Checking /dev/sga for cdrom... Could not stat /dev/sga: No such file or directory Checking /dev/sg1 for cdrom... Testing /dev/sg1 for SCSI/MMC interface Could not access device /dev/sg1 to test for SG_IO support: Perm ission denied no SG_IO support for device: /dev/sg1 Could not access device /dev/sg1: Permission denied generic device: /dev/sg1 ioctl device: not found Could not open generic SCSI device /dev/sg1: Permission denied Testing /dev/sg1 for cooked ioctl() interface /dev/sg1 is not a cooked ioctl CDROM. Checking /dev/sgb for cdrom... Could not stat /dev/sgb: No such file or directory Checking /dev/sg2 for cdrom... Could not stat /dev/sg2: No such file or directory Checking /dev/sgc for cdrom... Could not stat /dev/sgc: No such file or directory Checking /dev/sg3 for cdrom... Could not stat /dev/sg3: No such file or directory Checking /dev/sgd for cdrom... Could not stat /dev/sgd: No such file or directory Checking /dev/cdu31a for cdrom... Could not stat /dev/cdu31a: No such file or directory Checking /dev/cdu535 for cdrom... Could not stat /dev/cdu535: No such file or directory Checking /dev/sbpcd for cdrom... Could not stat /dev/sbpcd: No such file or directory Checking /dev/sbpcd0 for cdrom... Could not stat /dev/sbpcd0: No such file or directory Checking /dev/sbpcda for cdrom... Could not stat /dev/sbpcda: No such file or directory Checking /dev/sbpcd1 for cdrom... Could not stat /dev/sbpcd1: No such file or directory Checking /dev/sbpcdb for cdrom... Could not stat /dev/sbpcdb: No such file or directory Checking /dev/sbpcd2 for cdrom... Could not stat /dev/sbpcd2: No such file or directory Checking /dev/sbpcdc for cdrom... Could not stat /dev/sbpcdc: No such file or directory Checking /dev/sbpcd3 for cdrom... Could not stat /dev/sbpcd3: No such file or directory Checking /dev/sbpcdd for cdrom... Could not stat /dev/sbpcdd: No such file or directory Checking /dev/sonycd for cdrom... Could not stat /dev/sonycd: No such file or directory Checking /dev/mcd for cdrom... Could not stat /dev/mcd: No such file or directory Checking /dev/sjcd for cdrom... Could not stat /dev/sjcd: No such file or directory Checking /dev/cm206cd for cdrom... Could not stat /dev/cm206cd: No such file or directory Checking /dev/gscd for cdrom... Could not stat /dev/gscd: No such file or directory Checking /dev/optcd for cdrom... Could not stat /dev/optcd: No such file or directory No cdrom drives accessible to joe found. $
To rip an entire CD, use the command cdparanoia -B
. Issue
the command from the root account. For information on why you may need to issue
the command from the root account, see
#71237 -
cdparanoia: cannot use cdparanoia 'out of the box' as a non-root user.
- Debian Bug report logs.
# cdparanoia -B cdparanoia III release 10.2 (September 11, 2008) Ripping from sector 0 (track 1 [0:00.00]) to sector 231537 (track 1 [51:27.12]) outputting to track01.cdda.wav (== PROGRESS == [ | 231537 00 ] == :^D * ==) Done. # file track01.cdda.wav track01.cdda.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz #
To view help information for the utility, you can issue the command,
cdparanoia -h
. Or you can view the cdparanoia man page with the command man
cdparanoia
.
$ cdparanoia -h cdparanoia III release 10.2 (September 11, 2008) (C) 2008 Monty <monty@xiph.org> and Xiph.Org Report bugs to paranoia@xiph.org http://www.xiph.org/paranoia/ USAGE: cdparanoia [options] <span> [outfile] OPTIONS: -A --analyze-drive : run and log a complete analysis of drive caching, timing and reading behavior; verifies that cdparanoia is correctly modelling a sprcific drive's cache and read behavior. Implies -vQL -v --verbose : extra verbose operation -q --quiet : quiet operation -e --stderr-progress : force output of progress information to stderr (for wrapper scripts) -l --log-summary [<file>] : save result summary to file, default filename cdparanoia.log -L --log-debug [<file>] : save detailed device autosense and debugging output to file, default filename cdparanoia.log -V --version : print version info and quit -Q --query : autosense drive, query disc and quit -B --batch : 'batch' mode (saves each track to a seperate file. -s --search-for-drive : do an exhaustive search for drive -h --help : print help -p --output-raw : output raw 16 bit PCM in host byte order -r --output-raw-little-endian : output raw 16 bit little-endian PCM -R --output-raw-big-endian : output raw 16 bit big-endian PCM -w --output-wav : output as WAV file (default) -f --output-aiff : output as AIFF file -a --output-aifc : output as AIFF-C file -c --force-cdrom-little-endian : force treating drive as little endian -C --force-cdrom-big-endian : force treating drive as big endian -n --force-default-sectors <n> : force default number of sectors in read to n sectors -o --force-search-overlap <n> : force minimum overlap search during verification to n sectors -d --force-cdrom-device <dev> : use specified device; disallow autosense -k --force-cooked-device <dev> : use specified cdrom device and force use of the old 'cooked ioctl' kernel interface. -k cannot be used with -d or -g. -g --force-generic-device <dev> : use specified generic scsi device and force use of the old SG kernel interface. -g cannot be used with -k. -S --force-read-speed <n> : read from device at specified speed; by default, cdparanoia sets drive to full speed. -t --toc-offset <n> : Add <n> sectors to the values reported when addressing tracks. May be negative -T --toc-bias : Assume that the beginning offset of track 1 as reported in the TOC will be addressed as LBA 0. Necessary for some Toshiba drives to get track boundaries correct -O --sample-offset <n> : Add <n> samples to the offset when reading data. May be negative. -z --never-skip[=n] : never accept any less than perfect data reconstruction (don't allow 'V's) but if [n] is given, skip after [n] retries without progress. -Z --disable-paranoia : disable all paranoia checking -Y --disable-extra-paranoia : only do cdda2wav-style overlap checking -X --abort-on-skip : abort on imperfect reads/skips OUTPUT SMILIES: :-) Normal operation, low/no jitter :-| Normal operation, considerable jitter :-/ Read drift :-P Unreported loss of streaming in atomic read operation 8-| Finding read problems at same point during reread; hard to correct :-0 SCSI/ATAPI transport error :-( Scratch detected ;-( Gave up trying to perform a correction 8-X Aborted (as per -X) due to a scratch/skip :^D Finished extracting PROGRESS BAR SYMBOLS: <space> No corrections needed - Jitter correction required + Unreported loss of streaming/other error in read ! Errors are getting through stage 1 but corrected in stage2 e SCSI/ATAPI transport error (corrected) V Uncorrected error/skip SPAN ARGUMENT: The span argument may be a simple track number or a offset/span specification. The syntax of an offset/span takes the rough form: 1[ww:xx:yy.zz]-2[aa:bb:cc.dd] Here, 1 and 2 are track numbers; the numbers in brackets provide a finer grained offset within a particular track. [aa:bb:cc.dd] is in hours/minutes/seconds/sectors format. Zero fields need not be specified: [::20], [:20], [20], [20.], etc, would be interpreted as twenty seconds, [10:] would be ten minutes, [.30] would be thirty sectors (75 sectors per second). When only a single offset is supplied, it is interpreted as a starting offset and ripping will continue to the end of he track. If a single offset is preceeded or followed by a hyphen, the implicit missing offset is taken to be the start or end of the disc, respectively. Thus: 1:[20.35] Specifies ripping from track 1, second 20, sector 35 to the end of track 1. 1:[20.35]- Specifies ripping from 1[20.35] to the end of the disc -2 Specifies ripping from the beginning of the disc up to (and including) track 2 -2:[30.35] Specifies ripping from the beginning of the disc up to 2:[30.35] 2-4 Specifies ripping from the beginning of track two to the end of track 4. Don't forget to protect square brackets and preceeding hyphens from the shell... A few examples, protected from the shell: A) query only with exhaustive search for a drive and full reporting of autosense: cdparanoia -vsQ B) extract up to and including track 3, putting each track in a seperate file: cdparanoia -B -- "-3" C) extract from track 1, time 0:30.12 to 1:10.00: cdparanoia "1[:30.12]-1[1:10]" Submit bug reports to paranoia@xiph.org $
References: