Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Mar 2002 14:34:18 -0500 (EST)
From:      The Anarcat <anarcat@anarcat.dyndns.org>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        anarcat@anarcat.dyndns.org
Subject:   ports/35591: audio/ripit patch to make use of new acdXtY interface
Message-ID:  <200203051934.g25JYIP04681@lenny.anarcat.dyndns.org>

next in thread | raw e-mail | index | archive | help

>Number:         35591
>Category:       ports
>Synopsis:       audio/ripit patch to make use of new acdXtY interface
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 06 05:00:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     The Anarcat
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Nada, Inc
>Environment:
System: FreeBSD lenny.anarcat.dyndns.org 4.5-STABLE FreeBSD 4.5-STABLE #0: Mon Mar 4 12:16:06 EST 2002 anarcat@lenny.anarcat.dyndns.org:/usr/src/sys/compile/LENNY i386

>Description:

Following discussiongs on freebsd-multimedia, it became clear that the
new way of using CDDA on an IDE interface for systems > 4.3 is really:

dd if=/dev/acdXtY of=out.raw

A patch has been posted on freebsd-multimedia to make the ripit port
compatible with this, so I file it here so it is not forgotten.

Reference:

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3718+0+archive/2002/freebsd-multimedia/20020203.freebsd-multimedia

>How-To-Repeat:

n/a.

>Fix:

Note that to be complete, the patch should include a check of the
system's version to verify that this method is indeed available (a
simple uname or __FreeBSD__ check should be enough).

include this as a patchfile in audio/ripit/files/

--- /usr/local/bin/ripit.pl	Fri Jan 18 12:47:51 2002
+++ ripit.pl	Mon Jan 28 15:06:15 2002
@@ -25,6 +25,7 @@
 #	--numcpu [cpus]		- Number of parallel encoders to run
 #
 # Version 2.0 20/08/01 - Simon Quinn
+# Ripping via FreeBSD's "dd" command - Lars Eggert <larse@isi.edu>
 #
 # Usage: ripit.pl [--halt] [--bitrate rate] [--year year] [--genre genre]
 #		  [--device cddevice] [--encopt options] [--encoder encoder]
@@ -43,7 +44,8 @@
 $encopt		= "";			# options for mp3 encoder
 $cdripper	= 0;			# 0 - dagrab,
 					# 1 - cdparanoia, 2 - cdda2wav,
-					# 3 - tosha, 4 - cdd
+					# 3 - tosha, 4 - cdd,
+                                        # 5 - dd (FreeBSD-4.4 and higher)
 $cdopt		= "";			# options for cdaudio ripper
 $numcpu		= 1;			# Number of parallel encoders to run
 
@@ -110,7 +112,7 @@
                 [--device cddevice] [--encopt options] [--encoder encoder]
 		[--cdripper cdripper] [--cdopt options] [--outputdir dir] 
 		[--numcpu cpus] [start_track]
-Rippers: 0 - dagrab, 1 - cdparanoia, 2 - cdda2wav, 3 - tosha, 4 - cdd
+Rippers: 0 - dagrab, 1 - cdparanoia, 2 - cdda2wav, 3 - tosha, 4 - cdd, 5 - dd
 Encoders: 0 - Lame, 1 - Gogo, 2 - OggVorbis
 ";
    exit 1;
@@ -391,6 +393,33 @@
         &printflush(RIPLOG,"cdd failed on $tracklist[$_ - 1]\n");
         kill 1, @encoders;
         die "cdd failed on $tracklist[$_ - 1]";
+      }
+    }
+    elsif ($cdripper == 5) {
+      # Rip via FreeBSD's "dd" command and the associated CDDA devices
+      # under /dev. Requires 4.4-RELEASE or higher.
+      my $cdd_dev = $cddev;
+      if ($cdd_dev =~ /^\/dev\/(.*)/) { $cdd_dev = $1; }
+      die "dd extraction only works with ATAPI devices" unless $cddev =~ /acd/;
+      # See if the device corresponding to the track already exists...
+      my $trackdev = $cdd_dev;
+      $trackdev =~ s/(.*)c/$1/;
+      $trackdev .= "t$riptrackno";
+      unless (-b "/dev/$trackdev") {
+	# ...no, it doesn't. Create it.
+	&printflush(RIPLOG, "CDDA track device /dev/$trackdev, doesn't ".
+		    "exist, creating...\n");
+	my $cwd = `pwd`;
+	chdir "/dev";
+	system("sh MAKEDEV $trackdev") == 0 or die "cannot make $trackdev";
+	chdir $cwd;
+      }
+      # Ready to extract the data. Also do endian conversion.
+      if (system("dd if=/dev/$trackdev conv=swab bs=2352 ".
+		 "of=\"$riptrackname.rip\" 2> /dev/null")) {
+	&printflush(RIPLOG,"cdd failed on $tracklist[$_ - 1]\n");
+        kill 1, @encoders;
+	die "cannot rip track $riptrackno";
       }
     }
     else {


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203051934.g25JYIP04681>