[Abcde-users] how to better cope with broken tracks?

Tom Roche Tom_Roche at pobox.com
Sun Nov 1 20:18:17 GMT 2015


summary: how to cope with one or a few broken tracks on an otherwise-good CD? E.g., can one tell `abcde` to not even try to rip a given track? or to resume after a broken track? If not, should this be a feature request, or is such functionality out-of-scope?

details:

$ date
> Sat Oct 31 16:29:54 MST 2015
$ lsb_release -ds
> LMDE 2 Betsy
$ cat /etc/debian_version
> 8.2
$ uname -rv
> 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04)
$ gcc --version | head -n 1
> gcc (Debian 4.9.2-10) 4.9.2
$ abcde -v
> Looking at EXTRAVERBOSE ()
> This is abcde v2.6.
> ...
$ cdparanoia -V
> cdparanoia III release 10.2 (September 11, 2008)

$ cat ~/.config/abcde/abcde-MP3.conf
> ### adapted from http://www.andrews-corner.org/abcde.html#mp3 by Andrew Strong
>
> # Specify the method to use to retrieve the track information: consider setting 'musicbrainz' instead, which is my own preferred option
> # CDDBMETHOD=cddb
> CDDBMETHOD=musicbrainz
>
> # Specify the encoder to use for MP3. In this case the alternatives are gogo, bladeenc, l3enc, xingmp3enc, mp3enc
> MP3ENCODERSYNTAX=lame
>
> # Specify the path to the selected encoder unless it's in your path.
> LAME=lame
>
> # Specify your required encoding options here. Multiple options can be selected as '--preset standard --another-option' etc.
> # The '-V 2' option gives VBR encoding between 170-210 kbits/s.
> LAMEOPTS='-V 2'
>
> # Output type for MP3.
> OUTPUTTYPE="mp3"
>
> # The CD-ripping program to use. There are a few choices here: cdda2wav, dagrab, cddafs (Mac OS X only) and flac.
> CDROMREADERSYNTAX=cdparanoia
>
> # Give the location of the ripping program and pass any extra options:
> CDPARANOIA=cdparanoia
> CDPARANOIAOPTS="--never-skip=10"
>
> # Give the location of the CD identification program:
> CDDISCID=cd-discid
>
> # Give the base directory/folder for output
> OUTPUTDIR="$HOME/music/downloaded"
>
> # The default actions that abcde will take.
> ACTIONS=cddb,playlist,read,encode,tag,move,clean
>
> # Decide here how you want the tracks labelled for
> # * a standard 'single-artist', multi-track encode
> #OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}_${TRACKFILE}'
> #${OUTPUT} == 'mp3'
> OUTPUTFORMAT='${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}_${TRACKFILE}'
> # * a multi-track, 'various-artist' encode:
> VAOUTPUTFORMAT='Various-${ALBUMFILE}/${TRACKNUM}_${ARTISTFILE}-${TRACKFILE}'
> # (Create a single-track encode with 'abcde -1' from the commandline.)
> # * a standard 'single-artist', single-track encode
> ONETRACKOUTPUTFORMAT='${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}'
> # * a single-track 'various-artist' encode.
> VAONETRACKOUTPUTFORMAT='Various-${ALBUMFILE}/${ALBUMFILE}'
>
> # Create playlists for single and various-artist encodes?
> # Playlists are easy enough to generate with emacs, anyway.
> # PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u'
> # VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u'
>
> # Put spaces in the filenames instead of the more correct underscores:
> mungefilename ()
> {
>   echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\]
> }
>
> # What extra options?
> MAXPROCS=2       # Run a few encoders simultaneously
> PADTRACKS=y      # Makes tracks 01 02 not 1 2
> # EXTRAVERBOSE=2   # Useful for debugging
> EJECTCD=y        # Eject CD when finished, same as commandline `-x`

I have previously used `abcde` (called with `abcde -c ~/.config/abcde/abcde-MP3.conf`) to successfully rip several tens of audio CDs to MP3, without undue difficulty, and have documented this @ https://wiki.debian.org/Ripping#ripping_audio_CDs_to_MP3s_with_abcde . (And now that my new players nominally support Ogg, I should try that soon.) However I am now trying to rip some rather-less-good-condition CDs and am having a problem with 2. I'll use first case (a commercially-released (2004) copy of "Give" by The Bad Plus) as an example. In that case, ripping succeeds (e.g., the resultant files sound correct) until track#=10, which hangs with errors:

$ abcde -c ~/.config/abcde/abcde-MP3.conf
...
> Grabbing track 10: Neptune (The Planet)...
> cdparanoia III release 10.2 (September 11, 2008)
>
> Encoding track 09 of 11: Dirty Blonde...
> Ripping from sector  183670 (track 10 [0:00.00])
>           to sector  208479 (track 10 [5:30.59])
>
> outputting to /home/me/abcde.ZixoEptDp9A6DJAhBhu6trztHl4-/track10.wav
>
>  (== PROGRESS == [    >                         | 185997 00 ] == :-) O ==)   Tagging track 09 of 11: Dirty Blonde...
>  (== PROGRESS == [                 +V+>         | 199200 00 ] == :-P o ==)   ^C

In this case, the script seems to hang until forced to abend; the hang is definitely reproducible (on same hardware) despite my efforts to clean the disc. So I wanted to tell `abcde`, "just skip the @#$%^&! track 10! It's broken! Quit trying!" But the following efforts were unsuccessful:

1. Just restarting `abcde`: always fails like

$ date ; abcde -c ~/.config/abcde/abcde-MP3.conf ; date
> Looking at EXTRAVERBOSE ()
> Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11
> abcde: attempting to resume from /home/me/abcde.ZixoEptDp9A6DJAhBhu6trztHl4-..
> Creating playlist...
> Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): 
> Grabbing track 10: Neptune (The Planet)...
> cdparanoia III release 10.2 (September 11, 2008)

> Ripping from sector  183670 (track 10 [0:00.00])
>           to sector  208479 (track 10 [5:30.59])

> outputting to /home/me/abcde.ZixoEptDp9A6DJAhBhu6trztHl4-/track10.wav

>  (== PROGRESS == [               + +V+>         | 199125 00 ] == :-P 0 ==)   ^C

   after hanging as previous (though apparently not in exactly the same spot).

2. Attempting to drive ripping program via envvar=CDPARANOIAOPTS. The CD in this usecase has 11 tracks, track#s=1..9 rip correctly, and track#=10 reproducibly fails, so I wanted to tell the ripper=cdparanoia to rip only track=11. After much debugging and reading, I created 

$ diff -uwB ~/.config/abcde/abcde-MP3.conf ~/.config/abcde/abcde-MP3-junk_error_correction.conf
> --- /home/me/.config/abcde/abcde-MP3.conf                        2015-10-31 17:03:29.021190560 -0700
> +++ /home/me/.config/abcde/abcde-MP3-junk_error_correction.conf  2015-10-31 17:03:03.161514312 -0700
> @@ -1,4 +1,7 @@
> -### adapted from http://www.andrews-corner.org/abcde.html#mp3 by Andrew Strong
> +### Adapted from ~/.config/abcde/abcde-MP3.conf
> +### Sole non-comment change is 
> +### - CDPARANOIAOPTS="--never-skip=10"
> +### + CDPARANOIAOPTS="--never-skip=10 11"
> 
>  # Specify the method to use to retrieve the track information: consider setting 'musicbrainz' instead, which is my own preferred option
>  # CDDBMETHOD=cddb
> @@ -22,7 +25,9 @@
> 
>  # Give the location of the ripping program and pass any extra options:
>  CDPARANOIA=cdparanoia
> -CDPARANOIAOPTS="--never-skip=10"
> +#CDPARANOIAOPTS="--never-skip=10"
> +# rip only track#=11 (1-9=previously ripped, 10=defective)
> +CDPARANOIAOPTS="--never-skip=10 11"
> 
>  # Give the location of the CD identification program:
>  CDDISCID=cd-discid

   then did

$ abcde -c ~/.config/abcde/abcde-MP3-junk_error_correction.conf
> Looking at EXTRAVERBOSE ()
> Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11
> Retrieved 1 Musicbrainz match...done.
> ---- The Bad Plus / Give ----
> 1: 1979 Semi-Finalist
> 2: Cheney Piñata
> 3: Street Woman
> 4: And Here We Test Our Powers of Observation
> 5: Frog and Toad
> 6: Velouria
> 7: Layin' a Strip for the Higher-Self State Line
> 8: Do Your Sums-Die Like a Dog-Play for Home
> 9: Dirty Blonde
> 10: Neptune (The Planet)
> 11: Iron Man
>
> Edit selected CDDB data [y/N]? N 
> Is the CD multi-artist [y/N]? N
> Creating playlist...
> Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): 
> Grabbing track 01: 1979 Semi-Finalist...

note that message could also be improved

> cdparanoia III release 10.2 (September 11, 2008)
>
> Ripping from sector  208480 (track 11 [0:00.00])
>           to sector  235634 (track 11 [6:02.04])
>
> outputting to 01

also this name-handling

>  (== PROGRESS == [                              | 235634 00 ] == :^D * ==)   
>
> Done.
>
>
> [ERROR] abcde: The following commands failed to run:
> readtrack-01: cdparanoia --never-skip=10 11 returned code 73
> Finished. Not cleaning /home/me/abcde.ZixoEptDp9A6DJAhBhu6trztHl4-.

The second case is very similar to the first, except for

* a different CD and track#

* `abcde` abends itself, rather than requiring me to C-c.

However, instead of abending the failing track and continuing to the next (what I want), `abcde` abends the entire job, returning to the commandline.

So my current questions are:

1. How can I correctly drive the ripper for usecase={one track fails, rest are good}?

2. Is there currently A Better Way to tell `abcde` to punt on a failing track, but continue to attempt to rip the rest on the CD?

3. If (there is) not (currently A Better Way to tell `abcde` ...), should this be a feature request, or is this functionality out-of-scope for `abcde`?

TIA, Tom Roche <Tom_Roche at pobox.com>



More information about the Abcde-users mailing list