diff options
author | wiz <wiz@pkgsrc.org> | 2002-03-23 02:22:59 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2002-03-23 02:22:59 +0000 |
commit | 672215ec861f0e08861c82363b782f2e321c09bd (patch) | |
tree | 9d91d9629ccdfceac2fadc6025fd29bbda8b76c6 /audio/csound-bath | |
parent | 7205db5124228458f2b53fa6a36a7337787446df (diff) | |
download | pkgsrc-672215ec861f0e08861c82363b782f2e321c09bd.tar.gz |
Update to 4.18, provided by Ben Collver in pkg/14630.
Changes are unknown. Package changes:
* the c-preprocessor should now correctly chose whether to build big-endian
or little-endian specific code
* added support for NetBSD native audio API
Diffstat (limited to 'audio/csound-bath')
-rw-r--r-- | audio/csound-bath/Makefile | 22 | ||||
-rw-r--r-- | audio/csound-bath/PLIST | 4 | ||||
-rw-r--r-- | audio/csound-bath/distinfo | 28 | ||||
-rw-r--r-- | audio/csound-bath/files/rtNetBSD.c | 309 | ||||
-rw-r--r-- | audio/csound-bath/files/rtNetBSD.h | 20 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-aa | 37 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ab | 22 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ac | 13 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ae | 22 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-af | 25 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ag | 20 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ai | 2 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-aj | 26 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ak | 19 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-an | 22 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ao | 22 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-ap | 36 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-aq | 21 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-as | 9 | ||||
-rw-r--r-- | audio/csound-bath/patches/patch-at | 25 |
20 files changed, 510 insertions, 194 deletions
diff --git a/audio/csound-bath/Makefile b/audio/csound-bath/Makefile index 1c294f1de07..810c086d478 100644 --- a/audio/csound-bath/Makefile +++ b/audio/csound-bath/Makefile @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.4 2002/03/12 22:30:10 jmc Exp $ +# $NetBSD: Makefile,v 1.5 2002/03/23 02:22:59 wiz Exp $ # -DISTNAME= Csound4.12 -PKGNAME= csound-bath-4.12 +DISTNAME= Csound4.18 +PKGNAME= csound-bath-4.18 CATEGORIES= audio -MASTER_SITES= ftp://ftp.maths.bath.ac.uk/pub/dream/newest/ +MASTER_SITES= ftp://ftp.cs.bath.ac.uk/pub/dream/newest/ -MAINTAINER= collver@softhome.net +MAINTAINER= collver@linuxfreemail.com HOMEPAGE= http://www.csound.org COMMENT= software synthesizer and sequencer @@ -19,15 +19,7 @@ WRKSRC= ${WRKDIR} DIST_SUBDIR= csound CONFLICTS= csound-4* -#pre-build: -# ${CHMOD} -R 644 ${WRKDIR} - -#do-install: -# ${INSTALL_DATA_DIR} ${PREFIX}/share/csound -# ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/csound -# ${INSTALL_DATA} ${WRKSRC}/csound.txt ${PREFIX}/share/csound/ -# for i in `${FIND} ${WRKDIR} -type f -perm 755`; do \ -# ${INSTALL_PROGRAM} $${i} ${PREFIX}/bin ; \ -# done +pre-patch: + ${CP} ${FILESDIR}/rtNetBSD.c ${FILESDIR}/rtNetBSD.h ${WRKSRC} .include "../../mk/bsd.pkg.mk" diff --git a/audio/csound-bath/PLIST b/audio/csound-bath/PLIST index 43a8187a904..4e085fed820 100644 --- a/audio/csound-bath/PLIST +++ b/audio/csound-bath/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.1 2001/11/01 00:15:35 zuntum Exp $ +@comment $NetBSD: PLIST,v 1.2 2002/03/23 02:22:59 wiz Exp $ bin/csound bin/hetro bin/lpanal @@ -15,7 +15,7 @@ bin/pvlook bin/srconv bin/dnoise bin/sdif2ad -share/csound/csound.txt +share/csound/csound.xmg include/cscore.h lib/libcsound.a lib/libcscore.a diff --git a/audio/csound-bath/distinfo b/audio/csound-bath/distinfo index 090f3b83f39..bc992b8be4a 100644 --- a/audio/csound-bath/distinfo +++ b/audio/csound-bath/distinfo @@ -1,20 +1,20 @@ -$NetBSD: distinfo,v 1.2 2002/01/21 11:28:16 wiz Exp $ +$NetBSD: distinfo,v 1.3 2002/03/23 02:22:59 wiz Exp $ -SHA1 (csound/Csound4.12.tar.gz) = 5f8b6d70c5373f95f69689c724e124457f7a9f7d -Size (csound/Csound4.12.tar.gz) = 893317 bytes -SHA1 (patch-aa) = 336b2fc76c21993817c190e8b708eaa61321d697 -SHA1 (patch-ab) = 144e538a12127d6ea5c29fe0e64771164d17346c +SHA1 (csound/Csound4.18.tar.gz) = 79c0f9c6bc47efe38290b6bf5f5b39f09b4c3db7 +Size (csound/Csound4.18.tar.gz) = 1024507 bytes +SHA1 (patch-aa) = e6d0bc9090c3683a01b793cd31893bf69eb971c6 +SHA1 (patch-ab) = ad9694c7ce5c3f99a10f49c6c0903fb76e561262 +SHA1 (patch-ac) = 183386b90a0aabb3d8f4d6c80b430e4db565c396 SHA1 (patch-ad) = a09ad93b20b367d74e441736dfe267a9f4e30df5 -SHA1 (patch-ae) = 68689eea46c27ff27c0bac9cb341d22567a735a7 -SHA1 (patch-af) = c298bf79b7d81d986c0e88b1c3349c9ce83bc034 -SHA1 (patch-ag) = ad644879744664669cb1316be0851463e93af3de +SHA1 (patch-ae) = c9806815a5a1599d9d0f173138a59d68c31d7a54 +SHA1 (patch-af) = fa3bb19ec3b47bbf8797323f89e593b2bdab0821 +SHA1 (patch-ag) = 08d3ab428b82927095de3611800724bd5f5c9649 SHA1 (patch-ai) = 7766101a8943fd66bf5b50c2aebefc741feb0c45 -SHA1 (patch-aj) = cd6796b3fc7016b815632336b32831b37b6cb678 -SHA1 (patch-ak) = af233b89afa2b9b4ba2473dc8f33472e9a630ca2 +SHA1 (patch-ak) = fe5588a4157d6900f102678043df4bac7beab663 SHA1 (patch-al) = b4e8ec2ba935e205bd28aa7ffdfe4d0def7dc4dc SHA1 (patch-am) = f925c70452402bf90f63b953fa1b6ef02480d912 -SHA1 (patch-an) = c0d2052fef1eb16a88c14e3c7cc6471b9a15dcf8 -SHA1 (patch-ao) = f8e2d2ea177d0f5fa97aa3a04e0775dcc50b179d -SHA1 (patch-ap) = 183386b90a0aabb3d8f4d6c80b430e4db565c396 -SHA1 (patch-aq) = 9ec7d7250fac2a34f210ceab43b475cf41fa5f80 +SHA1 (patch-ap) = 1d7bcb4313f6b89e69ff8f87df31ce4f35dbb5f1 +SHA1 (patch-aq) = ba44c4a8fb1ccb3bde72d1a28a7943b08e418bc2 SHA1 (patch-ar) = f57ecfcd3481c22f949c749e4f4b20f05b2f9c9b +SHA1 (patch-as) = a3c0097b29188c82432a07de9e5ef8ca7492feaf +SHA1 (patch-at) = 18dfab013d17e29583bdf74c59383a56d67a1e86 diff --git a/audio/csound-bath/files/rtNetBSD.c b/audio/csound-bath/files/rtNetBSD.c new file mode 100644 index 00000000000..abc066f9d89 --- /dev/null +++ b/audio/csound-bath/files/rtNetBSD.c @@ -0,0 +1,309 @@ +/* + --- rtNetBSD.c --- + + Native NetBSD audio support. + + Ben Collver, collver@linuxfreemail.com +*/ + +#include <sys/types.h> +#include <sys/audioio.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include <stdio.h> +#include <unistd.h> + +#include "cs.h" +#include "soundio.h" +#include "rtNetBSD.h" + +static int dspfd; + +static int ishift = 0, oshift = 0, oMaxLag; +extern long nrecs; + long inrecs; +extern OPARMS O; +extern int Linefd; +#ifdef PIPES +extern FILE* Linepipe; +# define _pclose pclose +#endif + +static int getshift(int dsize) /* turn sample- or frame-size into shiftsize */ +{ + switch(dsize) { + case 1: return(0); + case 2: return(1); + case 4: return(2); + case 8: return(3); + default: die("rtaudio: illegal dsize"); + return(-1); /* Not reached */ + } +} + + +void display_audio_info( + int fd, + const char *message, + audio_info_t *info) +{ + audio_encoding_t encoding; + char *encoding_name; + + encoding.index = info->play.encoding; + if (ioctl(fd, AUDIO_GETENC, &encoding) == -1) { + asprintf(&encoding_name, "%d", info->play.encoding); + } else { + encoding_name = strdup(encoding.name); + } + printf("%-9s\n", message); + printf(" info.play.precision = %d\n", info->play.precision); + printf(" info.play.encoding = %s\n", encoding_name); + printf(" info.play.channels = %d\n", info->play.channels); + printf(" info.play.sample_rate = %d\n", info->play.sample_rate); + printf(" info.blocksize = %d\n\n", info->blocksize); + free(encoding_name); +} + +void setsndparms( + int fd, + int format, + int nchnls, + MYFLT esr, + unsigned bufsiz) +{ + audio_info_t info; + int count; + int frag_size; + + AUDIO_INITINFO(&info); + + switch (format) { + case AE_UNCH: + info.play.precision = 8; + info.play.encoding = AUDIO_ENCODING_ULINEAR; + break; + case AE_CHAR: + info.play.precision = 8; + info.play.encoding = AUDIO_ENCODING_SLINEAR; + break; + case AE_ULAW: + info.play.precision = 8; + info.play.encoding = AUDIO_ENCODING_ULAW; + break; + case AE_ALAW: + info.play.precision = 8; + info.play.encoding = AUDIO_ENCODING_ALAW; + break; + case AE_SHORT: + /* audio(4) says AUDIO_ENCODING_SLINEAR uses platform's + byte order, so the below will automatically be BE on + a BE system, and LE on a LE system. Good/Bad/Ok? */ + + info.play.precision = 16; + info.play.encoding = AUDIO_ENCODING_SLINEAR; + break; + case AE_LONG: + info.play.precision = 32; + info.play.encoding = AUDIO_ENCODING_SLINEAR; + break; + case AE_FLOAT: + die("NetBSD audio does not support floating-point samples"); + default: + die("unknown sample format"); + } + + info.play.channels = nchnls; + info.play.sample_rate = (unsigned int) esr; + + /* set DMA buffer fragment size to Csound's output buffer size */ + /* + * The or'ing is ABSOLUTELY crucial to obtaining quick response + * of csound to MIDI input - Please don't touch this line unless + * you know you can do better (in terms of MIDI response) + * [nicb@axnet.it] + */ + frag_size = 16; + count = 4; + while (frag_size < bufsiz && count < 18) { + frag_size <<= 1; + count++; + } + count |= 0x0020000; /* Larry Troxler's Idea */ + info.blocksize = frag_size; + + /* from ossaudio.c ioctl SNDCTL_DSP_SETFRAGMENT */ + info.hiwat = ((unsigned)count >> 16) & 0x7fff; + if (info.hiwat == 0) + info.hiwat = 65536; + + if (ioctl(fd, AUDIO_SETINFO, &info) == -1) { + display_audio_info(fd, "requested", &info); + if (ioctl(fd, AUDIO_GETINFO, &info) != -1) + display_audio_info(fd, "got", &info); + die("unable to configure soundcard"); + } +} + +int find_mixer_label(int fd, int class, const char *name) +{ + int i; + int mclass; + int retval = -1; + mixer_devinfo_t info; + + for (i = 0; ; i++) { + info.index = i; + if (ioctl(fd, AUDIO_MIXER_DEVINFO, &info) < 0) + break; + mclass = info.mixer_class; + if ((info.index == mclass || class == mclass) && + !strcmp(info.label.name, name)) + { + retval = i; + } + } + return retval; +} + +void setvolume(unsigned volume) +{ + int fd; + int i; + int output_class; + int vol_output; + mixer_devinfo_t info; + mixer_ctrl_t value; + + /* volume must be between 0 and 255 */ + + if ((fd = open(NETBSD_MIXER, O_WRONLY)) == -1) + die("unable to open soundcard mixer for setting volume"); + + output_class = find_mixer_label(fd, 0, "outputs"); + vol_output = find_mixer_label(fd, output_class, "master"); + + if (vol_output == -1) + die("Could not find mixer control for audio output."); + + + info.index = vol_output; + ioctl(fd, AUDIO_MIXER_DEVINFO, &info); + + value.dev = vol_output; + value.type = info.type; + value.un.value.num_channels = 2; + if (ioctl(fd, AUDIO_MIXER_READ, &value) < 0) { + value.un.value.num_channels = 1; + if (ioctl(fd, AUDIO_MIXER_READ, &value) < 0) + die("unable to read mixer on soundcard"); + } + + value.un.value.level[0] = 192; + value.un.value.level[1] = 192; + if (ioctl(fd, AUDIO_MIXER_WRITE, &value) < 0) { + die("unable to set output volume on soundcard"); + } +} + + +void NetBSD_open(int nchnls, int dsize, MYFLT esr, int scale, int audio_mode) +{ + int dup; + int wbufsiz; + int audio_props; + audio_device_t device_info; +#ifdef USE_SETSCHEDULER + extern void setscheduler(void); +#endif + + oMaxLag = O.oMaxLag; /* import DAC setting from command line */ + if (oMaxLag <= 0) /* if DAC sampframes ndef in command line */ + oMaxLag = IODACSAMPS; /* use the default value */ + wbufsiz = oMaxLag * O.insampsiz; + switch (audio_mode) { + case NETBSD_RECORD: + if ((dspfd = open(NETBSD_SAMPLER, O_RDONLY)) == -1) + die("error while opening soundcard for audio input"); + setsndparms(dspfd, O.informat, nchnls, esr, wbufsiz); + ishift = getshift(dsize); + break; + case NETBSD_PLAY: + if ((dspfd = open(NETBSD_SAMPLER, O_WRONLY)) == -1) { + perror("foo"); + die("error while opening soundcard for audio output"); + } + setsndparms(dspfd, O.outformat, nchnls, esr, wbufsiz); + /* 'oshift' is not currently used by the Linux driver, but... */ + oshift = getshift(nchnls * dsize); + break; + case NETBSD_DUPLEX: + if ((dspfd = open(NETBSD_SAMPLER, O_RDWR)) == -1) + die("error during soundcard duplex mode query:"); + ioctl(dspfd, AUDIO_GETPROPS, &audio_props); + if (!(audio_props | AUDIO_PROP_FULLDUPLEX)) + die("hardware does not support full duplex mode"); + setsndparms(dspfd, O.outformat, nchnls, esr, wbufsiz); + if (ioctl(dspfd, AUDIO_SETFD, audio_props) == -1) + die("error setting hardware to full duplex mode"); + /* are these functions both required? */ + oshift = getshift(nchnls * dsize); + ishift = getshift(dsize); + break; + default: + fprintf(stderr, "mode specification error in NetBSD_open: "); + fprintf(stderr, "unknown argument %d\n", audio_mode); + exit(1); + } + + ioctl(dspfd, AUDIO_GETDEV, &device_info); + fprintf(stderr, "NetBSD audio info: %s, %s, %s\n", + device_info.name, + device_info.version, + device_info.config); +#ifdef USE_SETSCHEDULER + setscheduler(); +#endif +} + +int rtrecord(char *inbuf, int nbytes) /* get samples from ADC */ +{ + /* J. Mohr 1995 Oct 17 */ + if ( (nbytes = read(dspfd, inbuf, nbytes)) == -1 ) + die("error while reading DSP device for audio input"); + return(nbytes); +} + +void rtplay(char *outbuf, int nbytes) /* put samples to DAC */ + /* N.B. This routine serves as a THROTTLE in Csound Realtime Performance, */ + /* delaying the actual writes and return until the hardware output buffer */ + /* passes a sample-specific THRESHOLD. If the I/O BLOCKING functionality */ + /* is implemented ACCURATELY by the vendor-supplied audio-library write, */ + /* that is sufficient. Otherwise, requires some kind of IOCTL from here. */ + /* This functionality is IMPORTANT when other realtime I/O is occurring, */ + /* such as when external MIDI data is being collected from a serial port. */ + /* Since Csound polls for MIDI input at the software synthesis K-rate */ + /* (the resolution of all software-synthesized events), the user can */ + /* eliminate MIDI jitter by requesting that both be made synchronous with */ + /* the above audio I/O blocks, i.e. by setting -b to some 1 or 2 K-prds. */ +{ + long sampframes = nbytes >> oshift; + /* J. Mohr 1995 Oct 17 */ + if (write(dspfd, outbuf, nbytes) < nbytes) + printf("/dev/audio: couldn't write all bytes requested\n"); + nrecs++; +} + +void rtclose(void) /* close the I/O device entirely */ +{ /* called only when both complete */ + /* J. Mohr 1995 Oct 17 */ + if (close(dspfd) == -1) + die("unable to close DSP device"); + if (O.Linein) { +#ifdef PIPES + if (O.Linename[0]=='|') _pclose(Linepipe); + else +#endif + if (strcmp(O.Linename, "stdin")!=0) close(Linefd); + } +} diff --git a/audio/csound-bath/files/rtNetBSD.h b/audio/csound-bath/files/rtNetBSD.h new file mode 100644 index 00000000000..c57ac466386 --- /dev/null +++ b/audio/csound-bath/files/rtNetBSD.h @@ -0,0 +1,20 @@ +/* rtNetBSD.h */ + +#ifndef _RTNETBSD_INCLUDED +#define _RTNETBSD_INCLUDED + +#define NETBSD_RECORD 0 +#define NETBSD_PLAY 1 +#define NETBSD_DUPLEX 2 + +#undef USE_SETSCHEDULER + +#define NETBSD_MIXER "/dev/mixer0" +#define NETBSD_SAMPLER "/dev/sound0" + +#define recopen(a,b,c,d) NetBSD_open(a,b,c,d,NETBSD_DUPLEX) +#define playopen(a,b,c,d) NetBSD_open(a,b,c,d,NETBSD_PLAY) + +extern void NetBSD_open(int, int, MYFLT, int, int); + +#endif /* _RTNETBSD_INCLUDED */ diff --git a/audio/csound-bath/patches/patch-aa b/audio/csound-bath/patches/patch-aa index c45bfe1c06e..b404790345e 100644 --- a/audio/csound-bath/patches/patch-aa +++ b/audio/csound-bath/patches/patch-aa @@ -1,6 +1,6 @@ -$NetBSD: patch-aa,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +$NetBSD: patch-aa,v 1.2 2002/03/23 02:23:00 wiz Exp $ ---- Makefile.orig Sun Mar 25 18:53:17 2001 +--- Makefile.orig Thu Jan 31 00:58:43 2002 +++ Makefile @@ -1,11 +1,11 @@ # Csound Makefile @@ -24,7 +24,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ # $(CC) $(CFLAGS) -c $*.c -o $@ -DEFINES = -DWINDOWS -DRTAUDIO -DSFIRCAM -DSYS5 -DLINUX -DPIPES -DMACROS -DTCLTK -+DEFINES = -DRTAUDIO -DSFIRCAM -DSYS5 -DLINUX -DPIPES -DMACROS -DBSD -DPREFIX=\"$(PREFIX)\" ++DEFINES = -DNETBSDRTAUDIO -DRTAUDIO -DSFIRCAM -DSYS5 -DLINUX -DPIPES -DMACROS -DBSD -DPREFIX=\"$(PREFIX)\" # choose any of - # -DSYS5 invoke System 5 headers (e.g. 'string.h' for 'strings.h') # -DWINDOWS include window system calls (X11, SGI, or FG graphics) @@ -32,21 +32,21 @@ $NetBSD: patch-aa,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ # Be sure to include 'LINUXaudio.o' under 'AUDOBJ' below as well. # -- Jonathan Mohr 1995 Oct 17 --CFLAGS = -O2 $(RPM_OPT_FLAGS) $(DEFINES) +-CFLAGS = -O2 -march=i686 -malign-loops=4 -malign-jumps=4 -DWITHx87 $(RPM_OPT_FLAGS) $(DEFINES) +CFLAGS = $(RPM_OPT_FLAGS) $(DEFINES) # -O Simple optimisation # -O2 to be more specific about the optimization level # -f compile single-precision floats (4.3,VAX,DEC-RISC) -@@ -73,7 +73,7 @@ +@@ -76,7 +76,7 @@ # -I/usr/openwin/include Solaris openwin interface # -I/usr/demo/SOUND/include Solaris sound interface --LIBS = -L /usr/X11R6/lib -lX11 -lbsd -ltcl -ltk -lm -+LIBS = $(LDFLAGS) -lossaudio -lm +-LIBS = -L /usr/X11R6/lib -lX11 -ltcl -ltk -lm ++LIBS = $(LDFLAGS) -lm # -lefence # -lm required # -lX11 for X window calls -@@ -90,8 +90,8 @@ +@@ -93,16 +93,16 @@ # -L/usr/demo/SOUND/lib on Solaris 2.4 # -L/usr/X11R6/li on LINUX @@ -57,7 +57,17 @@ $NetBSD: patch-aa,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ # ;if WINDOWS enabled in DEFINES, choose one of - # winX11.o for X11 window graphics # winSGI.o for SGI window graphics -@@ -335,15 +335,15 @@ + # winfg.o for PC Flash Graphics + + +-AUDSRC = rtlinux.c LINUXaudio.c +-AUDOBJ = rtlinux.o LINUXaudio.o ++AUDSRC = rtNetBSD.c ++AUDOBJ = rtNetBSD.o + # ;if RTAUDIO enabled in DEFINES, include one of + # rtaudio.o general interface to audio handlers & libraries + # rtDEC.c rtSGI.c rtHP.c rtSUN.c +@@ -342,13 +342,13 @@ cd midifils; rm -f *.bak *~ cd cscofils; rm -f *.bak *~ @@ -66,18 +76,15 @@ $NetBSD: patch-aa,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ - /usr/local/bin/scsort /usr/local/bin/extract /usr/local/bin/sndinfo \ - /usr/local/bin/scale /usr/local/bin/mixer /usr/local/bin/extractor \ - /usr/local/bin/envext /usr/local/bin/pvlook /usr/local/bin/sdif2ad \ -- /usr/local/bin/dnoise /usr/local/bin/srconv /usr/local/lib/csound.txt +- /usr/local/bin/dnoise /usr/local/bin/srconv - (cd /usr/local/bin; tar cvzf ~/csound/CSLinux.bin.tgz csound \ +CSNetBSD.bin.tgz: $(PREFIX)/bin/csound $(PREFIX)/bin/hetro \ + $(PREFIX)/bin/lpanal $(PREFIX)/bin/pvanal $(PREFIX)/bin/scot \ + $(PREFIX)/bin/scsort $(PREFIX)/bin/extract $(PREFIX)/bin/sndinfo \ + $(PREFIX)/bin/scale $(PREFIX)/bin/mixer $(PREFIX)/bin/extractor \ + $(PREFIX)/bin/envext $(PREFIX)/bin/pvlook $(PREFIX)/bin/sdif2ad \ -+ $(PREFIX)/bin/dnoise $(PREFIX)/bin/srconv $(PREFIX)/lib/csound.txt ++ $(PREFIX)/bin/dnoise $(PREFIX)/bin/srconv + (cd $(PREFIX)/bin; tar cvzf ~/csound/CSLinux.bin.tgz csound \ hetro lpanal pvanal scot scsort extract sndinfo scale mixer \ -- extractor envext pvlook sdif2ad dnoise srconv -C /usr/local/lib csound.txt) -+ extractor envext pvlook sdif2ad dnoise srconv -C $(PREFIX)/lib csound.txt) + extractor envext pvlook sdif2ad dnoise srconv) - Csound.tar.gz: all_files \ - $(CSRCS) $(HDRS) \ diff --git a/audio/csound-bath/patches/patch-ab b/audio/csound-bath/patches/patch-ab index 9e1463ada83..1afc711b297 100644 --- a/audio/csound-bath/patches/patch-ab +++ b/audio/csound-bath/patches/patch-ab @@ -1,23 +1,15 @@ -$NetBSD: patch-ab,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +$NetBSD: patch-ab,v 1.2 2002/03/23 02:23:00 wiz Exp $ ---- getstring.c.orig Sat May 13 08:52:27 2000 -+++ getstring.c Thu Apr 5 14:12:02 2001 -@@ -99,14 +99,14 @@ +--- getstring.c.orig Sat Jan 26 03:52:46 2002 ++++ getstring.c +@@ -145,8 +145,8 @@ db = fopen(name, "rb"); } if (db == NULL) { -- strcpy(name, "/usr/local/lib/csound.txt"); -- db = fopen("/usr/local/lib/csound.txt", "rb"); +- strcpy(name, "/usr/local/lib/csound.xmg"); +- db = fopen("/usr/local/lib/csound.xmg", "rb"); + sprintf(name, "%s/share/csound/csound.txt", PREFIX); + db = fopen(name, "rb"); } + #ifdef mills_macintosh if (db == NULL) { - fprintf(stderr, "failed to find Strings DataBase file.\n" - "Use the CSSTRNGS environment variable or you must put the \n" -- "file \"csound.txt\" in your local, SFDIR, SADIR, SSDIR or \n" -- "system directories for csound to work\n"); -+ "file \"csound.txt\" in your %s/share/csound, SFDIR, SADIR, SSDIR or \n" -+ "system directories for csound to work\n", PREFIX); - exit(1); - } - err_printf("Using %s\n", name); diff --git a/audio/csound-bath/patches/patch-ac b/audio/csound-bath/patches/patch-ac new file mode 100644 index 00000000000..f0392aa9399 --- /dev/null +++ b/audio/csound-bath/patches/patch-ac @@ -0,0 +1,13 @@ +$NetBSD: patch-ac,v 1.1 2002/03/23 02:23:00 wiz Exp $ + +--- anal/lpc/makef.orig Sun May 16 20:04:06 1999 ++++ anal/lpc/makef +@@ -6,7 +6,7 @@ + + OBJS = main.o $T/lpanal.o $T/lptrkfns.o $T/filopen.o $T/sfheader.o \ + $T/soundin.o $T/ulaw.o $T/aiff.o $T/wave.o $T/ieee80.o \ +- $T/memalloc.o $T/window.o $T/winX11.o $T/winascii.o $T/winEPS.o \ ++ $T/memalloc.o $T/window.o $T/winascii.o $T/winEPS.o \ + $T/aifc.o $T/getstring.o + + lpcs: lpanal diff --git a/audio/csound-bath/patches/patch-ae b/audio/csound-bath/patches/patch-ae index 9cb86c77e30..32d92e35b70 100644 --- a/audio/csound-bath/patches/patch-ae +++ b/audio/csound-bath/patches/patch-ae @@ -1,17 +1,25 @@ -$NetBSD: patch-ae,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +$NetBSD: patch-ae,v 1.2 2002/03/23 02:23:00 wiz Exp $ ---- midisend.c.orig Sun Oct 15 13:29:23 2000 -+++ midisend.c Sat Dec 16 21:52:52 2000 -@@ -16,8 +16,10 @@ +--- midisend.c.orig Sun Nov 18 09:05:57 2001 ++++ midisend.c +@@ -16,8 +16,18 @@ #include <ctype.h> #include <sys/ioctl.h> #include <fcntl.h> -#ifdef FREE_BSD -# include <sys/soundcard.h> +#ifdef BSD -+# include <soundcard.h> -+#define SEQ_DEFINEBUF(x); /*SEQ_DEFINEBUF(x)*/ -+#define SEQ_MIDIOUT(x,y); /*SEQ_MIDIOUT(x,y)*/ ++#include <sys/midiio.h> ++#define SEQ_MIDIPUTC SEQOLD_MIDIPUTC ++#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0 ++#define _SEQ_ADVBUF(len) _seqbufptr += len ++#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump() ++#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\ ++ _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\ ++ _seqbuf[_seqbufptr+1] = (byte);\ ++ _seqbuf[_seqbufptr+2] = (device);\ ++ _seqbuf[_seqbufptr+3] = 0;\ ++ _SEQ_ADVBUF(4);} #else # include <linux/soundcard.h> #endif diff --git a/audio/csound-bath/patches/patch-af b/audio/csound-bath/patches/patch-af index 3906fb89660..28890967f8f 100644 --- a/audio/csound-bath/patches/patch-af +++ b/audio/csound-bath/patches/patch-af @@ -1,16 +1,13 @@ -$NetBSD: patch-af,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +$NetBSD: patch-af,v 1.2 2002/03/23 02:23:00 wiz Exp $ ---- LINUXaudio.c.orig Sat Dec 16 21:44:39 2000 -+++ LINUXaudio.c Sat Dec 16 21:46:10 2000 -@@ -21,7 +21,11 @@ - - #include <unistd.h> - #include <sys/ioctl.h> -+#ifdef BSD -+#include <soundcard.h> -+#else - #include <sys/soundcard.h> -+#endif - #include "cs.h" - #include "soundio.h" +--- anal/pvoc/makef.orig Sun Aug 19 21:49:21 2001 ++++ anal/pvoc/makef +@@ -7,7 +7,7 @@ + OBJS = main.o $T/pvanal.o $T/pvxanal.o $T/pvfileio.o $T/filopen.o \ + $T/sfheader.o $T/mxfft.o \ + $T/soundin.o $T/ulaw.o $T/aiff.o $T/wave.o $T/ieee80.o $T/memalloc.o \ +- $T/pvoc.o $T/fft.o $T/dsputil.o $T/window.o $T/winX11.o $T/winascii.o \ ++ $T/pvoc.o $T/fft.o $T/dsputil.o $T/window.o $T/winascii.o \ + $T/winEPS.o $T/aifc.o $T/getstring.o + pvocs: pvanal diff --git a/audio/csound-bath/patches/patch-ag b/audio/csound-bath/patches/patch-ag index f1b342e51fb..0461ec5d522 100644 --- a/audio/csound-bath/patches/patch-ag +++ b/audio/csound-bath/patches/patch-ag @@ -1,7 +1,7 @@ -$NetBSD: patch-ag,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +$NetBSD: patch-ag,v 1.2 2002/03/23 02:23:01 wiz Exp $ ---- extract.c.orig Sat Dec 16 21:46:53 2000 -+++ extract.c Sat Dec 16 21:47:36 2000 +--- extract.c.orig Tue Nov 6 13:23:36 2001 ++++ extract.c @@ -6,7 +6,7 @@ static char inslst[INSMAX]; /* values set by readxfil */ static int onsect, offsect; /* " " " */ @@ -12,14 +12,14 @@ $NetBSD: patch-ag,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ static SRTBLK *frstout, *prvout; /* links for building new outlist */ @@ -56,7 +56,7 @@ - for(ip = &inslst[0]; ip < &inslst[INSMAX]; *ip++ = 1); - } - ontime = a0.newp3 = a0.p3val = onbeat; -- offtime = f0.newp2 = f0.p2val = offbeat; -+ cs_offtime = f0.newp2 = f0.p2val = offbeat; + for(ip = &inslst[0]; ip < &inslst[INSMAX]; *ip++ = 1); + } + ontime = a0.newp3 = a0.p3val = onbeat; +- offtime = f0.newp2 = f0.p2val = offbeat; ++ cs_offtime = f0.newp2 = f0.p2val = offbeat; } - void extract(void) /* extract instr events within the time period */ + void extract(void) /* extract instr events within the time period */ @@ -101,7 +101,7 @@ if (sectno == onsect && warped) ontime = a0.newp3 = realt(onbeat); @@ -30,7 +30,7 @@ $NetBSD: patch-ag,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ break; case 't': @@ -110,7 +110,7 @@ - case 'f': + case 'f': casef: if (sectno == onsect && bp->newp2 < ontime) bp->newp2 = ontime; - else if (sectno == offsect && bp->newp2 > offtime) diff --git a/audio/csound-bath/patches/patch-ai b/audio/csound-bath/patches/patch-ai index 84a4f4b45c8..b9c536efdf0 100644 --- a/audio/csound-bath/patches/patch-ai +++ b/audio/csound-bath/patches/patch-ai @@ -1,4 +1,4 @@ -$NetBSD: patch-ai,v 1.2 2002/01/21 11:28:16 wiz Exp $ +$NetBSD: patch-ai,v 1.3 2002/03/23 02:23:01 wiz Exp $ --- anal/adsyn/makef.orig Tue Aug 15 12:28:17 2000 +++ anal/adsyn/makef diff --git a/audio/csound-bath/patches/patch-aj b/audio/csound-bath/patches/patch-aj deleted file mode 100644 index 756667a4f55..00000000000 --- a/audio/csound-bath/patches/patch-aj +++ /dev/null @@ -1,26 +0,0 @@ -$NetBSD: patch-aj,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ - ---- DECplay.c.orig Thu Apr 5 13:20:06 2001 -+++ DECplay.c Thu Apr 5 13:25:46 2001 -@@ -245,10 +245,11 @@ - if ((void *)LoFiOpen("/dev/lofi") == NULL) - { err_printf(Str(X_211,"Cannot open LoFi\n")); - return(0); } -- if ((loddir = getenv("LODDIR")) == NULL) -+ if ((loddir = strdup(getenv("LODDIR"))) == NULL) - { - /* err_printf("no LODDIR env variable\n"); return(0); */ -- loddir = "/usr/local/lib/lod"; /* give it a go if no env */ -+ loddir = malloc(strlen(PREFIX) + 9); -+ sprintf(loddir, "%s/lib/lod", PREFIX); /* give it a go if no env */ - } - /* assume only decaudio supported. Choose poss sampling rate */ - if (srate > 26000) { bootFile = "play44ext.lod"; -@@ -259,6 +260,7 @@ - usPerFrame = 90.703; } - - sprintf(bootPath,"%s/%s",loddir,bootFile); -+ free(loddir); - err_printf(Str(X_618,"bootfile: %s\n"),bootPath); /* */ - - LoFiSetCSR(FED, 0); /* disable DSP */ diff --git a/audio/csound-bath/patches/patch-ak b/audio/csound-bath/patches/patch-ak index 5c62272dec8..d010d96e391 100644 --- a/audio/csound-bath/patches/patch-ak +++ b/audio/csound-bath/patches/patch-ak @@ -1,12 +1,9 @@ -$NetBSD: patch-ak,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +$NetBSD: patch-ak,v 1.2 2002/03/23 02:23:01 wiz Exp $ ---- aops.c.orig Thu Apr 5 13:41:56 2001 -+++ aops.c Thu Apr 5 13:42:30 2001 -@@ -1,8 +1,13 @@ - #include "cs.h" /* AOPS.C */ - #include "aops.h" --#include <math.h>
-+#include <math.h> +--- aops.c.orig Wed Feb 13 13:25:18 2002 ++++ aops.c +@@ -3,6 +3,11 @@ + #include <math.h> #include <time.h> +#ifdef LINUX @@ -14,10 +11,10 @@ $NetBSD: patch-ak,v 1.1.1.1 2001/04/27 17:17:17 wiz Exp $ +#include <unistd.h> +#endif + - static double eipt3=8.3333333, oct; - #define logtwo (0.693147) + static double eipt3=8.3333333, oct; + #define logtwo (0.693147) -@@ -421,8 +426,6 @@ +@@ -433,8 +438,6 @@ #ifdef LINUX void rtclock(EVAL *p) { diff --git a/audio/csound-bath/patches/patch-an b/audio/csound-bath/patches/patch-an deleted file mode 100644 index b1d8d806f69..00000000000 --- a/audio/csound-bath/patches/patch-an +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-an,v 1.1.1.1 2001/04/27 17:17:18 wiz Exp $ - ---- rtaudio.c.orig Thu Apr 5 14:29:45 2001 -+++ rtaudio.c Thu Apr 5 14:30:08 2001 -@@ -45,7 +45,7 @@ - #ifdef LINUX /* Jonathan Mohr 1995 Oct 17 */ - #include <unistd.h> - #include <fcntl.h> --#define DSP_NAME "/dev/dsp" -+#define DSP_NAME "/dev/audio" - static int dspfd; - void setsndparms(int, int, int, float, unsigned); - void setvolume(unsigned); -@@ -688,7 +688,7 @@ - - #ifdef LINUX /* J. Mohr 1995 Oct 17 */ - if (write(dspfd, outbuf, nbytes) < nbytes) -- printf(Str(X_177,"/dev/dsp: couldn't write all bytes requested\n")); -+ printf(Str(X_177,"/dev/audio: couldn't write all bytes requested\n")); - #endif - #ifdef __BEOS__ - while (nbytes > 0) { diff --git a/audio/csound-bath/patches/patch-ao b/audio/csound-bath/patches/patch-ao deleted file mode 100644 index 0d40d8fbdae..00000000000 --- a/audio/csound-bath/patches/patch-ao +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-ao,v 1.1.1.1 2001/04/27 17:17:18 wiz Exp $ - ---- rtlinux.c.orig Thu Apr 5 14:30:43 2001 -+++ rtlinux.c Thu Apr 5 14:30:57 2001 -@@ -10,7 +10,7 @@ - - #include <unistd.h> - #include <fcntl.h> --#define DSP_NAME "/dev/dsp" -+#define DSP_NAME "/dev/audio" - static int dspfd; - void setsndparms(int, int, int, MYFLT, unsigned); - void setvolume(unsigned); -@@ -111,7 +111,7 @@ - long sampframes = nbytes >> oshift; - /* J. Mohr 1995 Oct 17 */ - if (write(dspfd, outbuf, nbytes) < nbytes) -- printf(Str(X_177,"/dev/dsp: couldn't write all bytes requested\n")); -+ printf(Str(X_177,"/dev/audio: couldn't write all bytes requested\n")); - nrecs++; - } - diff --git a/audio/csound-bath/patches/patch-ap b/audio/csound-bath/patches/patch-ap index 475a791fc33..2e798dba2c6 100644 --- a/audio/csound-bath/patches/patch-ap +++ b/audio/csound-bath/patches/patch-ap @@ -1,13 +1,29 @@ -$NetBSD: patch-ap,v 1.1 2002/01/21 11:28:16 wiz Exp $ +$NetBSD: patch-ap,v 1.2 2002/03/23 02:23:01 wiz Exp $ ---- anal/lpc/makef.orig Sun May 16 20:04:06 1999 -+++ anal/lpc/makef -@@ -6,7 +6,7 @@ +--- cs.h.orig Sat Jan 26 05:29:36 2002 ++++ cs.h +@@ -18,6 +18,24 @@ - OBJS = main.o $T/lpanal.o $T/lptrkfns.o $T/filopen.o $T/sfheader.o \ - $T/soundin.o $T/ulaw.o $T/aiff.o $T/wave.o $T/ieee80.o \ -- $T/memalloc.o $T/window.o $T/winX11.o $T/winascii.o $T/winEPS.o \ -+ $T/memalloc.o $T/window.o $T/winascii.o $T/winEPS.o \ - $T/aifc.o $T/getstring.o + #include "version.h" - lpcs: lpanal ++/* __BIG_ENDIAN__ is used various places in csound ++ BIG_ENDIAN is used by the sdif code ++ in NetBSD, (BIG|LITTLE)_ENDIAN is defined by sys/endian.h ++ included in sys/types included in stdlib.h ++*/ ++#ifdef __NetBSD__ ++#undef BIG_ENDIAN ++#undef LITTLE_ENDIAN ++#if _BYTE_ORDER == _BIG_ENDIAN ++#define __BIG_ENDIAN__ ++#define BIG_ENDIAN ++#else ++#define __LITTLE_ENDIAN__ ++#define LITTLE_ENDIAN ++#endif /* _BYTE_ORDER */ ++#endif /* __NetBSD__ */ ++ ++ + #define VMSGS 1 + #if VMSGS + #define VMSG(x) if (odebug) x diff --git a/audio/csound-bath/patches/patch-aq b/audio/csound-bath/patches/patch-aq index 45b467ade0e..a440d44a614 100644 --- a/audio/csound-bath/patches/patch-aq +++ b/audio/csound-bath/patches/patch-aq @@ -1,13 +1,14 @@ -$NetBSD: patch-aq,v 1.1 2002/01/21 11:28:16 wiz Exp $ +$NetBSD: patch-aq,v 1.2 2002/03/23 02:23:01 wiz Exp $ ---- anal/pvoc/makef.orig Sun May 16 20:04:33 1999 -+++ anal/pvoc/makef -@@ -6,7 +6,7 @@ +--- sdif.h.orig Fri Jan 25 05:02:59 2002 ++++ sdif.h +@@ -53,7 +53,8 @@ + #ifndef __SDIF_H + #define __SDIF_H - OBJS = main.o $T/pvanal.o $T/filopen.o $T/sfheader.o \ - $T/soundin.o $T/ulaw.o $T/aiff.o $T/wave.o $T/ieee80.o $T/memalloc.o \ -- $T/pvoc.o $T/fft.o $T/dsputil.o $T/window.o $T/winX11.o $T/winascii.o \ -+ $T/pvoc.o $T/fft.o $T/dsputil.o $T/window.o $T/winascii.o \ - $T/winEPS.o $T/aifc.o $T/getstring.o +- ++#include "cs.h" ++#undef printf - pvocs: pvanal + /****************************************************/ + /* Create 32-bit and 64-bit int and float typedefs. */ diff --git a/audio/csound-bath/patches/patch-as b/audio/csound-bath/patches/patch-as new file mode 100644 index 00000000000..81d7393dbcd --- /dev/null +++ b/audio/csound-bath/patches/patch-as @@ -0,0 +1,9 @@ +$NetBSD: patch-as,v 1.1 2002/03/23 02:23:01 wiz Exp $ + +--- sftype.h.orig Mon Jan 28 02:02:01 2002 ++++ sftype.h +@@ -1,3 +1,4 @@ ++#include "cs.h" + + #if !defined(_SFTYPE_H) + #ifdef __GNUC__ diff --git a/audio/csound-bath/patches/patch-at b/audio/csound-bath/patches/patch-at new file mode 100644 index 00000000000..ddb40006b54 --- /dev/null +++ b/audio/csound-bath/patches/patch-at @@ -0,0 +1,25 @@ +$NetBSD: patch-at,v 1.1 2002/03/23 02:23:02 wiz Exp $ + +--- soundio.c.orig Thu Jan 24 03:32:47 2002 ++++ soundio.c +@@ -82,6 +82,9 @@ + # define _pclose pclose + # endif + #endif ++#ifdef NETBSDRTAUDIO ++#include "rtNetBSD.h" ++#endif + void (*spinrecv)(void), (*spoutran)(void), (*nzerotran)(long); + static void byterecv(void), charrecv(void), alawrecv(void), ulawrecv(void), + shortrecv(void),longrecv(void), floatrecv(void); +@@ -481,6 +484,10 @@ + || strncmp(O.outfilename,"dac", 3) ==0 + # ifdef LINUX + || strcmp(O.outfilename,"/dev/dsp") ==0 ++# endif ++# ifdef BSD ++ || strncmp(O.outfilename,"/dev/audio",10) ==0 ++ || strncmp(O.outfilename,"/dev/sound",10) ==0 + # endif + || strcmp(O.outfilename,"dac") == 0) { + #ifdef WIN32 |