diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/Makefile | 3 | ||||
-rw-r--r-- | audio/ossplay/DESCR | 9 | ||||
-rw-r--r-- | audio/ossplay/Makefile | 24 | ||||
-rw-r--r-- | audio/ossplay/PLIST | 6 | ||||
-rw-r--r-- | audio/ossplay/distinfo | 8 | ||||
-rw-r--r-- | audio/ossplay/files/Makefile | 16 | ||||
-rw-r--r-- | audio/ossplay/patches/patch-cmd_ossplay_ossplay.c | 89 | ||||
-rw-r--r-- | audio/ossplay/patches/patch-cmd_ossplay_ossplay.h | 30 |
8 files changed, 184 insertions, 1 deletions
diff --git a/audio/Makefile b/audio/Makefile index 0c6dca60c13..9a4df2d4709 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.631 2021/05/09 08:27:21 nia Exp $ +# $NetBSD: Makefile,v 1.632 2021/05/09 09:06:58 nia Exp $ # COMMENT= Audio tools, players, and libraries @@ -354,6 +354,7 @@ SUBDIR+= opus-tools SUBDIR+= opusfile SUBDIR+= ossinfo SUBDIR+= ossmix +SUBDIR+= ossplay SUBDIR+= osstest SUBDIR+= ossxmix SUBDIR+= p5-Audio-CD diff --git a/audio/ossplay/DESCR b/audio/ossplay/DESCR new file mode 100644 index 00000000000..1fc9e67f5ed --- /dev/null +++ b/audio/ossplay/DESCR @@ -0,0 +1,9 @@ +ossrecord records audio in Microsoft RIFF (wav) format. + +ossplay plays raw PCM, Microsoft RIFF (.wav), Sun ULaw (.au), Mac AIFF (.aif) +and other types of audio files. By default the application will try to +determine the audio file's format and play audio based on the stored +inforation about sample format, number of channels and sampling rate. + +NOTE: On NetBSD, use audioplay(1) and audiorecord(1) instead. +This package primarily exists to test OSSv4 compatibility. diff --git a/audio/ossplay/Makefile b/audio/ossplay/Makefile new file mode 100644 index 00000000000..cac5763ca51 --- /dev/null +++ b/audio/ossplay/Makefile @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.1 2021/05/09 09:06:58 nia Exp $ + +.include "../../audio/ossinfo/Makefile.common" + +PKGNAME= ossplay-${DISTNAME:S/oss-v//1:S/-src-bsd//1:S/-/./g} +CATEGORIES= audio + +MAINTAINER= nia@NetBSD.org +COMMENT= Command line programs for playing/recording from OSSv4 devices + +SUBST_CLASSES+= oss +SUBST_STAGE.oss= pre-configure +SUBST_MESSAGE.oss= Correcting the path to the OSS device. +SUBST_FILES.oss+= cmd/ossplay/ossplay.c +SUBST_SED.oss+= -e "s,/dev/dsp,${DEVOSSAUDIO},g" + +install-ossrecord: .PHONY + cd ${DESTDIR}${PREFIX}/bin && ${LN} -sf ossplay ossrecord + ${INSTALL_DATA} ${WRKSRC}/cmd/ossrecord/ossrecord.man \ + ${DESTDIR}${PREFIX}/share/doc/${PKGBASE} + +do-install: install-ossrecord + +.include "../../mk/bsd.pkg.mk" diff --git a/audio/ossplay/PLIST b/audio/ossplay/PLIST new file mode 100644 index 00000000000..267f6201377 --- /dev/null +++ b/audio/ossplay/PLIST @@ -0,0 +1,6 @@ +@comment $NetBSD: PLIST,v 1.1 2021/05/09 09:06:58 nia Exp $ +bin/ossplay +bin/ossrecord +share/doc/ossplay/COPYING +share/doc/ossplay/ossplay.man +share/doc/ossplay/ossrecord.man diff --git a/audio/ossplay/distinfo b/audio/ossplay/distinfo new file mode 100644 index 00000000000..478b8f48e3c --- /dev/null +++ b/audio/ossplay/distinfo @@ -0,0 +1,8 @@ +$NetBSD: distinfo,v 1.1 2021/05/09 09:06:58 nia Exp $ + +SHA1 (oss-v4.2-build2019-src-bsd.tar.bz2) = f6e03cbb5b5010aa48dd6d963b7e68c991c7d7dc +RMD160 (oss-v4.2-build2019-src-bsd.tar.bz2) = be04756160843acdaacbb610d5e8ebd9f7acf572 +SHA512 (oss-v4.2-build2019-src-bsd.tar.bz2) = 9d43fa3e3abe4cf006cabfedf2c9fc51372f8cbe499c2e4bee6ba489291c31eb93b66b312054bcf92fc26df329bc3c7ef14a633fece8af38256bc7198d0c1556 +Size (oss-v4.2-build2019-src-bsd.tar.bz2) = 1723557 bytes +SHA1 (patch-cmd_ossplay_ossplay.c) = 021c3e80e2fa75b5761e15914011b57be86b538e +SHA1 (patch-cmd_ossplay_ossplay.h) = f955e7468c1f1fc7eacb2fe13b2e0c8f38e362d4 diff --git a/audio/ossplay/files/Makefile b/audio/ossplay/files/Makefile new file mode 100644 index 00000000000..7e742031e48 --- /dev/null +++ b/audio/ossplay/files/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.1 2021/05/09 09:06:58 nia Exp $ + +CFLAGS+= -DLOCAL_BUILD + +OBJS= ossplay.o ossplay_console.o ossplay_decode.o +OBJS+= ossplay_parser.o ossplay_wparser.o + +PROG= ossplay + +all: ${PROG} + +.c.o: + ${CC} ${CFLAGS} -c ${.IMPSRC} + +${PROG}: ${OBJS} + ${CC} ${LDFLAGS} -o ${PROG} ${OBJS} diff --git a/audio/ossplay/patches/patch-cmd_ossplay_ossplay.c b/audio/ossplay/patches/patch-cmd_ossplay_ossplay.c new file mode 100644 index 00000000000..73d6c758faa --- /dev/null +++ b/audio/ossplay/patches/patch-cmd_ossplay_ossplay.c @@ -0,0 +1,89 @@ +$NetBSD: patch-cmd_ossplay_ossplay.c,v 1.1 2021/05/09 09:06:59 nia Exp $ + +Missing features in libossaudio... + +--- cmd/ossplay/ossplay.c.orig 2021-05-09 08:59:30.843013379 +0000 ++++ cmd/ossplay/ossplay.c +@@ -448,6 +448,7 @@ select_playtgt (dspdev_t * dsp) + int i, src; + oss_mixer_enuminfo ei; + ++#ifdef SNDCTL_DSP_GET_PLAYTGT_NAMES + if (ioctl (dsp->fd, SNDCTL_DSP_GET_PLAYTGT_NAMES, &ei) == -1) + { + perror_msg ("SNDCTL_DSP_GET_PLAYTGT_NAMES"); +@@ -491,6 +492,7 @@ select_playtgt (dspdev_t * dsp) + return; + } + } ++#endif + + print_msg (ERRORM, + "Unknown playback target name '%s' - use -o? to get the list\n", +@@ -509,6 +511,7 @@ select_recsrc (dspdev_t * dsp) + int i, src; + oss_mixer_enuminfo ei; + ++#ifdef SNDCTL_DSP_GET_RECSRC_NAMES + if (ioctl (dsp->fd, SNDCTL_DSP_GET_RECSRC_NAMES, &ei) == -1) + { + perror_msg ("SNDCTL_DSP_GET_RECSRC_NAMES"); +@@ -551,6 +554,7 @@ select_recsrc (dspdev_t * dsp) + return; + } + } ++#endif + + print_msg (ERRORM, + "Unknown recording source name '%s' - use -i? to get the list\n", +@@ -1048,6 +1052,7 @@ int + play (dspdev_t * dsp, int fd, big_t * datamark, big_t bsize, double total_time, + double constant, readfunc_t * readf, decoders_queue_t * dec, seekfunc_t * seekf) + { ++#ifdef SNDCTL_DSP_HALT_OUTPUT + #define EXITPLAY(code) \ + do { \ + ossplay_free (buf); \ +@@ -1057,6 +1062,16 @@ play (dspdev_t * dsp, int fd, big_t * da + errno = 0; \ + return (code); \ + } while (0) ++#else ++#define EXITPLAY(code) \ ++ do { \ ++ ossplay_free (buf); \ ++ ossplay_free (verbose_meta); \ ++ clear_update (); \ ++ errno = 0; \ ++ return (code); \ ++ } while (0) ++#endif + + big_t rsize = bsize; + big_t filesize = *datamark; +@@ -1151,6 +1166,7 @@ int + record (dspdev_t * dsp, FILE * wave_fp, const char * filename, double constant, + double datatime, big_t * data_size, decoders_queue_t * dec) + { ++#ifdef SNDCTL_DSP_HALT_INPUT + #define EXITREC(code) \ + do { \ + ossplay_free (buf); \ +@@ -1161,6 +1177,17 @@ record (dspdev_t * dsp, FILE * wave_fp, + ioctl (dsp->fd, SNDCTL_DSP_HALT_INPUT, NULL); \ + return (code); \ + } while(0) ++#else ++#define EXITREC(code) \ ++ do { \ ++ ossplay_free (buf); \ ++ ossplay_free (verbose_meta); \ ++ clear_update (); \ ++ if ((eflag) && (verbose)) \ ++ print_msg (VERBOSEM, "\nStopped (%d).\n", eflag-128); \ ++ return (code); \ ++ } while(0) ++#endif + + unsigned char * buf, * obuf; + ssize_t l, outl; diff --git a/audio/ossplay/patches/patch-cmd_ossplay_ossplay.h b/audio/ossplay/patches/patch-cmd_ossplay_ossplay.h new file mode 100644 index 00000000000..bb853fea6b8 --- /dev/null +++ b/audio/ossplay/patches/patch-cmd_ossplay_ossplay.h @@ -0,0 +1,30 @@ +$NetBSD: patch-cmd_ossplay_ossplay.h,v 1.1 2021/05/09 09:06:59 nia Exp $ + +Missing features in libossaudio... + +--- cmd/ossplay/ossplay.h.orig 2014-02-14 22:59:55.000000000 +0000 ++++ cmd/ossplay/ossplay.h +@@ -105,6 +105,23 @@ enum { + AFMT_DOUBLE64_BE, + AFMT_DOUBLE64_LE + }; ++ ++#ifndef AFMT_S24_PACKED ++#define AFMT_S24_PACKED (-300) ++#endif ++ ++#ifndef AFMT_FLOAT ++#define AFMT_FLOAT (-301) ++#endif ++ ++#ifndef AFMT_VORBIS ++#define AFMT_VORBIS (-302) ++#endif ++ ++#ifndef AFMT_SPDIF_RAW ++#define AFMT_SPDIF_RAW (-303) ++#endif ++ + #define AFMT_S24_PACKED_LE AFMT_S24_PACKED + + typedef struct { |