📄 readme
字号:
Hi dear cdrom drive users,This README describes hardware related matters as well as the installation of cdda2wav, the sampling utility.The last big change was the inclusion in Joerg Schillings cdrecord packageas you may have noticed :-)That means most of the cdrecord interfacing applies for cdda2wav as well.I decided to retire the standalone version slowly, and to do all newdevelopment in this bundled variant.Requirements============For SCSI cdroms and CD-writers, as well as SCSI-emulated ATAPIS and parallel port drives1s. kernel support for SCSI, the host adapter, SCSI cdroms and the generic SCSI interface (if under Linux). You need to have the proper device descriptors (get them under Linux with the MAKEDEV script from /dev).For ATAPI cdroms under Linux1a. kernel support for the ATAPI cdrom driver or alternatively ide-scsi emulation. You need to have the proper device descriptors (get them with the MAKEDEV script from /dev).For parallel port cdroms under Linux With newer kernels cdda2wav uses the same parallel port access as does cdrecord. Please refer additionally to the cdrecord documentation. There are generally two drivers to access the cdrom through the parallel port: the ATAPI cd emulation (called pcd), and the SCSI device emulation (called pg). The pcd driver does NOT support cdda reading (kernel 2.2.12), while the pg driver has no restriction. So you have to use pg for that.For cdrom drives with proprietary busses under Linux1p. Please check the CDROM-HOWTO for features of the respective drivers. The sbpcd driver is very demanding due to the lack of interrupts.optionally currently for Solaris and all platforms running 4frontsOpenSoundSystems:2. kernel sound card support.Recommendations for higher throughput on Linux SCSI systems===========================================================Higher throughput will give better chances for non-interruptedsampling. This should avoid typical interruption errors (cracklingsat buffer boundaries).1. Increase SG_BIG_BUFF to (128*1024) in /usr/src/linux/include/scsi/sg.h (and recompile your kernel and boot it :-).NOTE: Some kernel configurations will lead to 'out of kernel memory' errors. If you encounter this message regularly, better leave SG_BIG_BUFF at 32768.1a.There is a patch for multiple sg device access under Linux. It uses up to 128 K buffer for each device. See here:ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha/sg*2. Ensure your harddisk has write cache enabled (For SCSI hard disks I switched it on with the scsiinfo program from tsx-11.mit.edu), but enable this only if it is correctly working ;-)This has boosted the throughput of cdda2wav considerably.Supported interfaces====================Non SCSI drives (Linux only): ATAPI: The greatest group nowadays are ATAPI (EIDE) cdrom drives. Support is only limited by the drive. Kernel and cdda2wav are ready for them (unless the drive uses a very uncommon method). Newer kernels can do an scsi emulation for ATAPI devices. This interface is supported. Parallel port interface: There is a driver that maps the parallel port driver to an generic scsi like driver. Should work with newer kernels. Proprietary interfaces: Older drives with proprietary interfaces are supported only if the kernel driver allows reading cdda audio data via ioctl(). Currently only Eberhard Moenkeberg's sbpcd and Corey Minyard's cdu31a driver do allow this. The sbpcd driver of kernels earlier than 2.0.30 and 2.1.57 needs a patch before satisfying output can be obtained (see README.sbpcd).SCSI drives: For these drives the SCSI library from Joerg Schilling is used. Thus we need kernel support (compiled-in or as a module) for it. The generic SCSI interface allows multi sector transfers (max. 128 KB) which lowers cpu load considerably. ** NEW ** I added a script 'scsi_scan.linux' to find the generic devices for all SCSI CDROM- or WORM-type drives.Configuration=============There are some adjustable parameters in the beginning of the Makefile(which is called local.cnf.in) . They describe default settings of cdda2wav:INTERFACE: How the cdrom is accessed. Choose one method for INTERFACE.DEVICE: The default cdrom device is set in DEF_DEVICE.SOUND FILE FORMAT DEFAULTS:The default format can be 'wav', 'sun pcm au', 'aiff', 'aifc', or'raw bigendian samples'.It is determined by the Makefile variable DEF_TYPE.AUDIO FILENAME:The default filename is given by DEF_FILE. Unless 'cdr' format is being used,this name is appended with '.wav', '.au', '.aiff' or '.aifc'.RATE: the default rate is given by setting DEF_UNDERSAMPLING to the divisorfor the audio cd sampling frequency (44100 Hz). RATE = 44100 Hz / DEF_UNDERSAMPLINGDEF_UNDERSAMPLING can be any multiple of a half greater than one half.DYNAMIC: The default dynamic range of one sample in one channel is defined in DEF_BITS which can be one of 8, 12 or 16.CHANNELS: set DEF_CHANNELS to 1 for mono and 2 for stereo.RECORDING TIME: set DEF_TIME to the amount of seconds to record (or 0 forthe whole track).SOUND DEVICE: set SOUND_DEVICE to the device name of your sound card. The line containing HAVESOUND should be uncommented also, if you want the option to hear what you record.All of those values can be overridden by command line parameters.Compiling cdda2wav==================Adjust the Makefile (named local.cnf.in) for your cdrom interface anddevice setting first.Then type makeand as root make installThis will compile cdda2wav and copy the binary to /usr/local/bin and theman page to /usr/local/man/man1 (defaults).Privileges==========You can setgid the binary, if you want to allow access to a CDROM'sscsi_generic interface for cdda2wav but not for arbitrary programs.Giving away permissions to send SCSI commands directly to a device isnot something you want to do lightly on a multi-user server system.The setgid privileges will only be used to access the scsi genericinterface; for cooked_ioctl, the setgid privileges are not necessaryand they are simply dropped.Previous versions of cdda2wav had to be setuid to root. Such privilegesare no longer necessary and will be dropped if present.Select device=============By default cdda2wav uses the generic SCSI interface and a device tripel forSCSI bus, id, and lun.This setting can be overridden by specifying '-Iinterface' and'-D cdromdevice'.The following command line example uses the generic_scsi interface and the SCSI device with bus 1, id 2 and lun 3:cdda2wav -Igeneric_scsi -D1,2,3The shell script 'scan_scsi.linux' will report the generic devices forall SCSI cdrom drives.If you need to use another interface, check the device setting also as theyneed to fit together.Here is an example for an ATAPI cdrom using the cooked_ioctl interface andthe cdrom device /dev/hdb:cdda2wav -Icooked_ioctl -D/dev/hdbFeatures========I added an optional on-the-fly correction for pre-emphasized samples(available for original CDDA format only).If the -T option is given, the samples will be filtered before theyare written to disk. The samples then have a linear frequency response again.When recording in mono, both channels are summed with halved amplitude.Undersampling is done by summing several samples with reduced amplitude toprevent overflows. This damps higher freqencies as well. Compared toexact resampling cdda2wav does not use a very sophisticated (expensive)filter algorithm. It currently uses quadratic interpolation fornoninteger subsampling factors.Sampling can be aborted by pressing the Interrupt-Key (eg control-C)at anytime. Unless streaming to a pipe, the wav header will be updatedto contain the actual length of the sample. The same will happen, ifdisk space becomes exhausted.Fast options============The options can also influence the performance greatly.The fastest case is given when the samples don't need to be changed fromtheir original form or analysed, that is the output format uses the sameparameters as the drive: 16-bit samples, stereo at 44100 Hz sample rateAND with the same endianess (-Cbig and -Ebig, or -Clittle and -Elittle).To be sure all parameters can be given explicitly on the command line.This avoids an analysis of cdda2wav.cdda2wav -P0 -q -S<maximum speed> run as root will read with maximum speed and copy its output into thewav file, taking advantage of realtime scheduling as well.For throughput testing the additional option -N can be used. Writeoperations will be suppressed then.Options that slow down initially================================-v<level> needs some time for analysis before the actual sampling startsOptions that slow down during sampling======================================-P1 causes overlap reading, the slowdown depends on the amount of jitter-e synchronous output to a sound card slows down to onefold speedOptions that need more cpu power================================-p<rate> resamples the output send to the sound card-M<count> calculates checksums-T on-the-fly preemphasis filtering-F checking for extremal samples-G checking for differences in both channels-C<endianess> if a conversion is required (see below)-E<endianess> if a conversion is required (see below)-Oaudiotype if a conversion is required (see below)-c 1-c s-m-b 8-b 12-a <not 1>-r <not 44100>When are one or two endianess (byte order) conversions required?================================================================There are three stages where the endianess matters:1.) on the input side the cd drive can deliver in two flavors (called F1). When the flavor is unknown, cdda2wav needs to find out the endianess. A simple voting method is used. Successive samples are compared in both flavors and the flavor with the statistically smaller changes is taken. The flavor can be defined with the -C option, avoiding the analysis. 2.) For any calculation with samples (and echoing to the sound card), the samples are needed in the byte order of the machine (in this case I set 'need_host_order' to yes). The flavor of the machine endianess is called F2.3.) Finally, there are two flavors of output sound formats (called F3): wav uses little endian samples cdr and au use big endian samples
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -