Hi all,
here's a diff against abcde v2.1.19. It adds the Test & Copy functionality to abcde. If you're interested there are also some cdparanoia hints at the bottom of this post.
Test & Copy only works when using cdparanoia as ripping software. It doesn't work with any other ripper or in case abcde is used with the parameter '-1' ("Encode the whole CD in a single file").
It needs the md5sum program, so you got to have it installed. But I guess everyone has md5sum.
It works quite simple: Reads the track, gets the MD5 sum, rereads the track, gets the MD5 sum, compares the two MD5 sums. If they don't match, abcde aborts, otherwise it continues.
There's a new option. It's called "CDPARANOIA_TEST_N_COPY". It defaults to 'n', so in order to actually use Test & Copy you have to say so in your config file.
CDPARANOIA_TEST_N_COPY=y
As an alternative you can start abcde with the new parameter '-2'. It doesn't have an (optional) argument.
abcde -2 [other options]
This should work with newer abcde versions, too, but there's a possibility you have to adapt the patch a little.
Cheers
mic
--- abcde.old 2006-03-25 12:46:59.000000000 +0100
+++ abcde 2006-03-25 12:47:06.000000000 +0100
@@ -1483,7 +1483,33 @@
echo "Grabbing track $UTRACKNUM..." >&2
fi
case "$CDROMREADERSYNTAX" in
- cdparanoia) nice $READNICE $CDROMREADER -d $CDROM $UTRACKNUM "$WAVDATA" >&2;;
+ cdparanoia)
+ if [ "$CDPARANOIA_TEST_N_COPY" = "y" ]; then
+ nice $READNICE $CDROMREADER -d $CDROM $UTRACKNUM "$WAVDATA" >&2
+ RETURN=$?
+ if [ "$RETURN" != "0" ]; then
+ false
+ else
+ MD5_1=`nice $READNICE $MD5SUM "$WAVDATA"`
+ nice $READNICE $CDROMREADER -d $CDROM $UTRACKNUM "$WAVDATA" >&2
+ RETURN=$?
+ if [ "$RETURN" != "0" ]; then
+ false
+ else
+ MD5_2=`nice $READNICE $MD5SUM "$WAVDATA"`
+ if [ "$MD5_1" != "$MD5_2" ]; then
+ echo "MD5 sum of track $UTRACKNUM doesn't match after reripping." >&2
+ echo "Encoding the remainder of the properly ripped tracks (if any)." >&2
+ echo >&2
+ false
+ fi
+ fi
+ fi
+ else
+ nice $READNICE $CDROMREADER -d $CDROM $UTRACKNUM "$WAVDATA" >&2
+ fi
+ ;;
+
cdda2wav)
if [ "$OSFLAVOUR" = "OSX" ]; then
# Hei, we have to unmount the device before running anything like cdda2wav in OSX
@@ -1586,7 +1612,7 @@
CDDBCOPYLOCAL="n"
CDDBLOCALDIR="$HOME/.cddb"
CDDBUSELOCAL="n"
-
+CDPARANOIA_TEST_N_COPY="n"
# If using scsi devices, cdda2wav needs a CDROMID, instead of a device node
# i.e. CDROMID="1,0,0"
CDROMID=""
@@ -1740,11 +1766,14 @@
fi
fi
# Parse command line options
#while getopts 1a:bc:C:d:Dhj:klLnNo:pr:S:t:T:vVx opt; do
-while getopts 1a:bc:C:d:Dhj:klLnNo:pr:S:vVx opt; do
+while getopts 12a:bc:C:d:Dhj:klLnNo:pr:S:vVx opt; do
case "$opt" in
1) ONETRACK=y;;
+ 2) CDPARANOIA_TEST_N_COPY=y;;
a) ACTIONS="$OPTARG";;
b) BATCH=y;;
c) if [ -e "$OPTARG" ]; then . "$OPTARG"; else echo "abcde error: config file \"$OPTARG\" cannot be found." >&2; exit 1; fi;;
cdparanoia hints
- cdparanoia is able to correct your cdrom reader offset. Use the '-O' (e.g. '-O 6') parameter for this. If you don't know your drives offset have look at the AccurateRip database. Chances are you'll find it there.
Note: In case your cdrom drive can't read into the Lead-Out (positive offset correction) or Lead-In (negative offset correction), consider not using '-O'. cdparanoia can't append silence in case your drive can't read into the Lead-Out/Lead-In. E.g. using a drive which needs a positve offset correction and is unable to read into the Lead-Out you'll see this at the end of the last track most of the time:
(== PROGRESS == [ !*| 186674 00 ] == :^D * ==)
Allthough the MD5 sums will match (given there aren't other errors), your copy won't be perfect.
- some other interesting options are '-z' and '-X'.
-z --never-skip[=max_retries]
Do not accept any skips; retry forever if needed. An optional maximum number of retries can be specified; for comparison,
default without -z is currently 20.
-X --abort-on-skip
If the read skips due to imperfect data, a scratch, whatever, abort reading this track. If output is to a file, delete the
partially completed file.
- you can specify your cdparanoia options in '~/.abcde.conf' like this:
CDPARANOIAOPTS='-O6 -z -X'
- if you're using an ATAPI cdrom reader and you run a recent kernel (>kernel-2.6. you should apply Peter Jones' cdparanoia patches, which introduce SG_IO to cdparanoia. SG_IO is a transport for SCSI commands. Without them chances are that the quality of audio extraction will completely depend on your drive and cdparanoia won't be able to detect read errors. Some people have experienced problems using SG_IO with kernels older than 2.6.15. So I think it would be best to use a kernel >=2.6.15.
You can find the patches at http://people.redhat.com/pjones/cdparanoia/. Or you can grab them in a single archieve from here: Link
In case you're a Gentoo addict all you have to do is unmask 'media-sound/cdparanoia-3.9.8-r3' and emerge it. But you have to run at least kernel 2.6.15, otherwise the ebuild won't apply the patches.