diff options
author | Luigi Rizzo <luigi@FreeBSD.org> | 1998-12-31 12:02:03 +0000 |
---|---|---|
committer | Luigi Rizzo <luigi@FreeBSD.org> | 1998-12-31 12:02:03 +0000 |
commit | 4d36880612caa98526c2d7e281e03497acc145b4 (patch) | |
tree | 8ec692da7f255d051f12beb0f34c1923945faed1 /audio | |
parent | 4b75a7913dbe1d7304b5cd5f62f389457f35c1c6 (diff) |
Notes
Diffstat (limited to 'audio')
-rw-r--r-- | audio/cdd/Makefile | 22 | ||||
-rw-r--r-- | audio/cdd/distinfo | 1 | ||||
-rw-r--r-- | audio/cdd/files/cdd_atapicmds.c | 165 | ||||
-rw-r--r-- | audio/cdd/files/cdd_atapicmds.h | 51 | ||||
-rw-r--r-- | audio/cdd/files/patch-aa | 37 | ||||
-rw-r--r-- | audio/cdd/files/patch-ab | 59 | ||||
-rw-r--r-- | audio/cdd/files/patch-ac | 49 | ||||
-rw-r--r-- | audio/cdd/files/patch-ad | 15 | ||||
-rw-r--r-- | audio/cdd/files/patch-ae | 47 | ||||
-rw-r--r-- | audio/cdd/files/patch-af | 5 | ||||
-rw-r--r-- | audio/cdd/pkg-comment | 1 | ||||
-rw-r--r-- | audio/cdd/pkg-descr | 3 | ||||
-rw-r--r-- | audio/cdd/pkg-plist | 1 |
13 files changed, 456 insertions, 0 deletions
diff --git a/audio/cdd/Makefile b/audio/cdd/Makefile new file mode 100644 index 000000000000..5601dc7e71a6 --- /dev/null +++ b/audio/cdd/Makefile @@ -0,0 +1,22 @@ +# New ports collection makefile for: cdd +# Version required: none +# Date created: Wed Dec 23 11:15:30 CET 1998 +# Whom: luigi@iet.unipi.it +# +# $Id$ +# + +DISTNAME= cdd-1.0 +CATEGORIES= audio +MASTER_SITES= http://www.iet.unipi.it/~luigi/cdd/ +EXTRACT_SUFX= .tgz + +MAINTAINER= luigi@iet.unipi.it + +post-extract: + ${cp}cp ${FILESDIR}/cdd_atapicmds.[ch] ${WRKSRC} + +do-install: + @${INSTALL_PROGRAM} ${WRKSRC}/cdd ${PREFIX}/bin + +.include <bsd.port.mk> diff --git a/audio/cdd/distinfo b/audio/cdd/distinfo new file mode 100644 index 000000000000..b87114ed6b9c --- /dev/null +++ b/audio/cdd/distinfo @@ -0,0 +1 @@ +MD5 (cdd-1.0.tgz) = 06794c27fb01facab7ce72c0e9d1cd1b diff --git a/audio/cdd/files/cdd_atapicmds.c b/audio/cdd/files/cdd_atapicmds.c new file mode 100644 index 000000000000..d8098ca1da98 --- /dev/null +++ b/audio/cdd/files/cdd_atapicmds.c @@ -0,0 +1,165 @@ +/***************************************************************************** +* CDD v1.0 Copyright (C) 1996-97, Charles R. Henrich, All Rights Reserved. * +* * +* Use in source and binary forms, with or without modification and * +* Redistribution without modification are permitted provided that the * +* following conditions are met: * +* * +* 1. Redistributions of source code must retain the above copyright * +* notice, all internal copyright notices, this list of conditions * +* and the following disclaimer. * +* 2. Redistributions in binary form must reproduce the above copyright * +* notice, this list of conditions and the following disclaimer in the * +* documentation and/or other materials provided with the distribution. * +* 3. All advertising materials mentioning features or use of this software * +* must display the following acknowledgement: * +* CDD was developed in 1996-97 by Charles Henrich * +* 4. Neither the name of this product (CDD) nor the name of the author * +* (Charles Henrich) may be used to endorse products that include this * +* product without specific prior written permission. * +* 5. No profit may be made from the inclusion, or distribution of this * +* product. Although a reasonable service charge for the distribution * +* of this product is permitted where appropriate. * +* * +* THIS SOFTWARE IS PROVIDED BY CHARLES HENRICH `` AS IS '' AND ANY EXPRESS * +* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL CHARLES HENRICH BE LIABLE FOR ANY DIRECT, * +* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * +* SUCH DAMAGE. * +* * +****************************************************************************** +* * +* Email: henrich@msu.edu * +* * +*****************************************************************************/ + +#include <stdio.h> +#include <string.h> +#include <sys/param.h> +#include <unistd.h> +#include <stdlib.h> +#include "cdd.h" +#include "cdd_cdcmds.h" +#include "cdd_util.h" + +#include <sys/cdio.h> + +int +atapi_cdrawread(char *buffer, int startlba, int blocksize, + int blockstoread, int scsifd) +{ + struct ioc_read_audio ira; + + if (blocksize/blockstoread != 2352) { + fprintf(stderr, "Ouch, only 2352 (%d)bytes allowed\n", + blocksize); + return -1 ; + } +#if 0 +fprintf(stderr, "reading %d blocks at %d\n", blockstoread, startlba); +#endif + + ira.address_format = CD_LBA_FORMAT; + ira.address.lba = startlba; + ira.nframes = blockstoread; + ira.buffer = buffer; + + if (ioctl(scsifd, CDIOCREADAUDIO, &ira) < 0) { + perror("CDIOREADAUDIO"); + exit(-1); + } + return SUCCESS ; +} + +int +atapi_getcdtoc(int scsifd, CDTOC * cdtoc) +{ + struct ioc_toc_header th; + struct ioc_read_toc_entry te; + struct cd_toc_entry *cte; + int i, tracks, ntracks; + + if (ioctl(scsifd, CDIOREADTOCHEADER, &th) < 0) { + perror("CDIOREADTOCHEADER"); + exit(-1); + } + ntracks = th.ending_track - th.starting_track + 2; + cte = (struct cd_toc_entry *)malloc(sizeof(*cte) * ntracks); + + tracks = ntracks ; + if (tracks > 100) + tracks = 101; + + te.address_format = CD_LBA_FORMAT; + te.starting_track = 0 ; + te.data_len = ntracks * sizeof(struct cd_toc_entry); + te.data = cte; + + if (ioctl(scsifd, CDIOREADTOCENTRYS, &te) < 0) { + perror("CDIOREADTOCENTRYS"); + exit(-1); + } +fprintf(stderr, "toclen %d\n", cdtoc->toclen); + cdtoc->numentries = tracks+1 ; + cdtoc->firsttrack = th.starting_track ; + cdtoc->lasttrack = th.ending_track ; + for (i = 0; i <= tracks; i++) { + cdtoc->tocents[i].absaddr = ntohl(cte[i-th.starting_track].addr.lba); + cdtoc->tocents[i].tracknumber = cte[i-th.starting_track].track; + if (i>0) + cdtoc->tocents[i-1].absendaddr = + cdtoc->tocents[i].absaddr ; + fprintf(stderr, "track %d %d start %8d ctrl 0x%x type 0x%x l %d\n", + i, + cte[i-th.starting_track].track, + ntohl(cte[i-th.starting_track].addr.lba), + cte[i-th.starting_track].control, + cte[i-th.starting_track].addr_type, + cdtoc->tocents[i-1].absendaddr); + } + return SUCCESS; +} + +int +atapi_cd_setblocksize(int scsifd, int bytessec) +{ + /* nop */ + return SUCCESS; +} + +int +atapi_cddaread(char *buffer, int startlba, + int blocksize, int blockstoread, int scsifd) +{ + return atapi_cdrawread(buffer, startlba, blocksize, blockstoread, scsifd); +} + +int +atapi_begin_cdda(int scsifd) +{ + return atapi_cd_setblocksize(scsifd, 2352); +} + +int +atapi_end_cdda(int scsifd) +{ + return atapi_cd_setblocksize(scsifd, 2048); +} + +int +atapi_initcd(int scsifd) +{ + return SUCCESS; +} + +int +atapi_resetcd(int scsifd) +{ + return SUCCESS; +} diff --git a/audio/cdd/files/cdd_atapicmds.h b/audio/cdd/files/cdd_atapicmds.h new file mode 100644 index 000000000000..2c5fe4326f28 --- /dev/null +++ b/audio/cdd/files/cdd_atapicmds.h @@ -0,0 +1,51 @@ + /***************************************************************************** + * CDD v1.0 Copyright (C) 1996-97, Charles R. Henrich, All Rights Reserved. * + * * + * Use in source and binary forms, with or without modification and * + * Redistribution without modification are permitted provided that the * + * following conditions are met: * + * * + * 1. Redistributions of source code must retain the above copyright * + * notice, all internal copyright notices, this list of conditions * + * and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * 3. All advertising materials mentioning features or use of this software * + * must display the following acknowledgement: * + * CDD was developed in 1996-97 by Charles Henrich * + * 4. Neither the name of this product (CDD) nor the name of the author * + * (Charles Henrich) may be used to endorse products that include this * + * product without specific prior written permission. * + * 5. No profit may be made from the inclusion, or distribution of this * + * product. Although a reasonable service charge for the distribution * + * of this product is permitted where appropriate. * + * * + * THIS SOFTWARE IS PROVIDED BY CHARLES HENRICH `` AS IS '' AND ANY EXPRESS * + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * + * DISCLAIMED. IN NO EVENT SHALL CHARLES HENRICH BE LIABLE FOR ANY DIRECT, * + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * + * SUCH DAMAGE. * + * * + ****************************************************************************** + * * + * Email: henrich@msu.edu * + * * + *****************************************************************************/ + +int atapi_getcdtoc(int scsifd, CDTOC *cdtoc); +int atapi_cd_setblocksize(int scsifd, int bytessec); +int atapi_cdrawread(char *buffer, int startlba, + int blocksize, int blockstoread, int scsifd); +int atapi_cddaread(char *buffer, int startlba, + int blocksize, int blockstoread, int scsifd); +int atapi_begin_cdda(int scsifd); +int atapi_end_cdda(int scsifd); +int atapi_initcd(int scsifd); +int atapi_resetcd(int scsifd); diff --git a/audio/cdd/files/patch-aa b/audio/cdd/files/patch-aa new file mode 100644 index 000000000000..b140990269f9 --- /dev/null +++ b/audio/cdd/files/patch-aa @@ -0,0 +1,37 @@ +--- Makefile.orig Sun May 18 22:34:28 1997 ++++ Makefile Thu Dec 31 12:06:38 1998 +@@ -1,11 +1,12 @@ + CC = cc +-CFLAGS = -O3 -Wall -DNETWORK_DB -I./st +-LDFLAGS = -lscsi +-STLIB = ./st/libst.a ++CFLAGS = -O3 -Wall -DNETWORK_DB -I./st -I. ++LDFLAGS = ++STLIB = st/libst.a + + CDD_OBJECTS = cdd.o cdd_util.o cdd_cdcmds.o cdd_xmcddiscid.o cdd_cddb.o \ + cdd_plextorcmds.o \ + cdd_hpcmds.o \ ++ cdd_atapicmds.o \ + cdd_toshibacmds.o + + PCMPLAY_OBJECTS = pcmplay.o +@@ -14,6 +15,9 @@ + + all: cdd pcmplay stripzeros + ++st/libst.a: ++ cd st ; make ++ + $(CDD_OBJECTS): cdd.h + + pcmplay: $(PCMPLAY_OBJECTS) +@@ -22,7 +26,7 @@ + stripzeros: $(STRIPZEROS_OBJECTS) + $(CC) $(CFLAGS) -o $@ $(STRIPZEROS_OBJECTS) $(LDFLAGS) + +-cdd: $(CDD_OBJECTS) ++cdd: $(CDD_OBJECTS) $(STLIB) + $(CC) $(CFLAGS) -o $@ $(CDD_OBJECTS) $(LDFLAGS) $(STLIB) -DDEBUG + + clean: diff --git a/audio/cdd/files/patch-ab b/audio/cdd/files/patch-ab new file mode 100644 index 000000000000..7cf1b172441d --- /dev/null +++ b/audio/cdd/files/patch-ab @@ -0,0 +1,59 @@ +--- cdd.c.orig Wed May 21 22:48:51 1997 ++++ cdd.c Thu Dec 31 12:10:02 1998 +@@ -60,6 +60,25 @@ + #include "cdd_cddb.h" + #endif + ++/* XXX some scsi->cam compatibility stuff... */ ++int scsi_open(char *buf, int mode) ++{ ++ return -1 ; ++} ++ ++#define DS(x, y) \ ++int x() \ ++{ fprintf(stderr, "--- %s not implemented\n", y); exit(-1); } ++ ++DS(scsireq_new, "scsireq_new") ++DS(scsireq_build, "scsireq_build") ++DS(scsireq_enter, "scsireq_enter") ++DS(scsireq_reset, "scsireq_reset") ++DS(scsireq_decode, "scsireq_decode") ++DS(scsireq_buff_decode, "scsireq_buff_decode") ++DS(scsireq_encode, "scsireq_encode") ++DS(scsi_debug, "scsi_debug") ++ + OPTS G_opts; + + int F_cdctlfd; +@@ -73,7 +92,7 @@ + int defaultdev=TRUE; + + strcpy(G_opts.workdir, "/tmp"); +-strcpy(G_opts.cddev, "cd0"); ++strcpy(G_opts.cddev, "wcd0"); /* XXX atapi */ + G_opts.onlyaudio = FALSE; + G_opts.onlydata = FALSE; + G_opts.track = -1; +@@ -200,8 +219,10 @@ + + if(F_cdctlfd < 0) + { +- fprintf(stderr,"Unable to open %s [%d]\n", buffer, errno); +- exit(0); ++ fprintf(stderr,"Unable to open %s [%d], try atapi\n", buffer, errno); ++ F_cdctlfd = F_cdfd ; ++ use_atapi(); ++ goto atapi; + } + + /* We're about to start sending SCSI commands directly to the device, lets be a +@@ -225,7 +246,7 @@ + close(F_cdfd); + exit(0); + } +- ++atapi: + if(getcdtoc(F_cdctlfd, &cdtoc) != SUCCESS) + { + fprintf(stderr,"Unable to read TOC\n"); diff --git a/audio/cdd/files/patch-ac b/audio/cdd/files/patch-ac new file mode 100644 index 000000000000..7032067a4ddb --- /dev/null +++ b/audio/cdd/files/patch-ac @@ -0,0 +1,49 @@ +--- cdd_cdcmds.c.orig Wed Aug 6 17:18:31 1997 ++++ cdd_cdcmds.c Thu Dec 31 12:09:33 1998 +@@ -48,6 +48,7 @@ + #include <scsi.h> + #include "cdd.h" + #include "cdd_cdcmds.h" ++#include "cdd_atapicmds.h" + #include "cdd_plextorcmds.h" + #include "cdd_toshibacmds.h" + #include "cdd_hpcmds.h" +@@ -178,6 +179,18 @@ + } + , + { ++ "ATAPI", ++ atapi_initcd, ++ atapi_resetcd, ++ atapi_getcdtoc, ++ atapi_cd_setblocksize, ++ atapi_cdrawread, ++ atapi_cddaread, ++ atapi_begin_cdda, ++ atapi_end_cdda ++ } ++ , ++ { + "END-OF-DEVICES", + unsupported, + unsupported, +@@ -189,6 +202,19 @@ + unsupported + } + }; ++ ++void ++use_atapi() ++{ ++ int count ; ++ ++ for(count=0; ++ strcasecmp(F_dtable[count].productid, "END-OF-DEVICES") != 0; ++ count++) { ++ if(strcasecmp(F_dtable[count].productid, "ATAPI") == 0) break; ++ } ++ F_pte = count ; ++} + + void doinquiry(int scsifd) + { diff --git a/audio/cdd/files/patch-ad b/audio/cdd/files/patch-ad new file mode 100644 index 000000000000..ab31b1462978 --- /dev/null +++ b/audio/cdd/files/patch-ad @@ -0,0 +1,15 @@ +--- st/st.h.orig Sat Nov 16 19:18:25 1996 ++++ st/st.h Wed Dec 23 11:00:43 1998 +@@ -27,10 +27,12 @@ + #define SOCKOPT_ERROR -14 + #define DES_SET_KEY_FAILURE -15 + ++#ifndef SUCCESS + #define SUCCESS 1 + #define TRUE 1 + #define FAILURE -1 + #define FALSE -1 ++#endif + #define MASSIVE_FAILURE -2 + + #define st_NEW_CONNECTION 0 diff --git a/audio/cdd/files/patch-ae b/audio/cdd/files/patch-ae new file mode 100644 index 000000000000..d56790c2781c --- /dev/null +++ b/audio/cdd/files/patch-ae @@ -0,0 +1,47 @@ +--- README.orig Wed Dec 23 11:02:06 1998 ++++ README Wed Dec 23 11:09:35 1998 +@@ -4,9 +4,8 @@ + flavors. CDD will do its best to copy CD audio data, CD-ROM data in both + raw and "cooked" forms to a directory of the users choice. + +- CDD has a very large limitation at present in that it will only work on +- SCSI CD-ROM devices manufactured by Plextor. If you run it on something +- else and it works, let me know. ++ CDD runs on a number of SCSI CD-ROM and, on FreeBSD, on ATAPI devices as ++ well. + + Why did you write it? + +@@ -36,17 +35,21 @@ + drive + + +- (*) Jitter correction is a method whereby extra effort is taken to ensure +- that the data retrieved off of the CD is clean. This is absolutely +- necessarily on older/cheaper mechs, however on the latest Plextor's +- you may get away without it. However, should the disc have any +- defects, or surface problems you could end up with a corrupted audio +- file. I.e. I never use this feature! Its only there for those who are +- impatient, because it can speed up the process by 2-5x depending on +- the hardware you have. If during normal audio grabs the overlap +- distance is ALWAYS 0 (except for the last frame) this may actually work +- for you. If this is NOT the case, do not use this feature, IT WILL NOT +- WORK! ++ (*) Jitter correction is a method whereby extra effort is taken ++ to ensure that the data retrieved off of the CD is clean. ++ It slows down reads considerably, however it is absolutely ++ necessarily on older/cheaper mechs which are unable to seek ++ precisely on audio tracks. Some modern drives (both SCSI ++ and ATAPI) support "streaming" reads from audio tracks, in ++ which case you may get away without it. However, should ++ the disc have any defects, or surface problems you could ++ end up with a corrupted audio file. I.e. I never use this ++ feature! Its only there for those who are impatient, ++ because it can speed up the process by 2-5x depending on ++ the hardware you have. If during normal audio grabs the ++ overlap distance is ALWAYS 0 (except for the last frame) ++ this may actually work for you. If this is NOT the case, ++ do not use this feature, IT WILL NOT WORK! + + Examples: + diff --git a/audio/cdd/files/patch-af b/audio/cdd/files/patch-af new file mode 100644 index 000000000000..6ae303249aab --- /dev/null +++ b/audio/cdd/files/patch-af @@ -0,0 +1,5 @@ +--- scsi.h.orig Thu Dec 31 12:14:37 1998 ++++ scsi.h Thu Dec 31 12:15:05 1998 +@@ -0,0 +1,2 @@ ++/* temporary placeholder for scsi.h awaiting for scsi->cam conversion */ ++#include <sys/scsiio.h> diff --git a/audio/cdd/pkg-comment b/audio/cdd/pkg-comment new file mode 100644 index 000000000000..793a6fdb533e --- /dev/null +++ b/audio/cdd/pkg-comment @@ -0,0 +1 @@ +A cd audio track extraction program from Charles Henrich. diff --git a/audio/cdd/pkg-descr b/audio/cdd/pkg-descr new file mode 100644 index 000000000000..56ff992c169d --- /dev/null +++ b/audio/cdd/pkg-descr @@ -0,0 +1,3 @@ +cdd is a program written by Charles Henrich to read audio tracks from CDs. +It includes "jitter correction" to work with a number of drives +which are not able to read reliably from audio disks. diff --git a/audio/cdd/pkg-plist b/audio/cdd/pkg-plist new file mode 100644 index 000000000000..5837b2cdc09b --- /dev/null +++ b/audio/cdd/pkg-plist @@ -0,0 +1 @@ +bin/cdd |