Index: head/audio/portaudio/Makefile =================================================================== --- head/audio/portaudio/Makefile (revision 474828) +++ head/audio/portaudio/Makefile (revision 474829) @@ -1,81 +1,72 @@ # Created by: michaelnottebrock@gmx.net and lioux@FreeBSD.org # $FreeBSD$ PORTNAME= portaudio DISTVERSION= 19_20140130 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= audio MASTER_SITES= http://www.portaudio.com/archives/ DISTNAME= pa_stable_v${DISTVERSION} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= tobik@FreeBSD.org COMMENT= Portable cross-platform Audio API LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.txt USES= autoreconf dos2unix gmake localbase:ldflags libtool pathfix \ pkgconfig tar:tgz -GNU_CONFIGURE= yes -CONFIGURE_ARGS= PKG_CONFIG_LIBDIR=${PREFIX}/libdata/pkgconfig \ - --without-alsa USE_LDCONFIG= yes +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --without-alsa WRKSRC= ${WRKDIR}/${PORTNAME} -PORTDOCS= * -PORTEXAMPLES= * - -DOCSRCDIR1= ${WRKSRC} -DOC_FILES1= README.txt index.html - OPTIONS_DEFINE= DOCS DOXYGEN EXAMPLES JACK PATEST SNDIO +OPTIONS_SUB= yes PATEST_DESC= PortAudio Test Programs -DOXYGEN_DESC= Install API documentation (requires DOCS) -OPTIONS_SUB= yes +PORTDOCS= * +DOXYGEN_IMPLIES= DOCS +DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen + +PORTEXAMPLES= * + JACK_LIB_DEPENDS= libjack.so:audio/jack JACK_CONFIGURE_WITH= jack -PATEST_BIN= pa_m* paqa_* patest* - SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_CONFIGURE_WITH= sndio -DOXYGEN_IMPLIES= DOCS -DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen - post-extract: @${MKDIR} ${WRKSRC}/src/hostapi/sndio @${CP} ${FILESDIR}/pa_sndio.c ${WRKSRC}/src/hostapi/sndio post-patch: - @${REINPLACE_CMD} -e 's|machine/soundcard.h|sys/soundcard.h|' ${WRKSRC}/configure.in \ - ${WRKSRC}/src/hostapi/oss/pa_unix_oss.c ${WRKSRC}/src/SConscript - @${REINPLACE_CMD} -e 's|PACKAGE_NAME=|PACKAGE_NAME=portaudio2|' ${WRKSRC}/configure @${REINPLACE_CMD} -i '' '/EXAMPLES =/,/bin\/paex_write_sine_nonint/s/^/#/' \ ${WRKSRC}/Makefile.in post-install: @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libportaudio.so + ${INSTALL_DATA} ${FILESDIR}/pa_unix_oss.h ${STAGEDIR}${PREFIX}/include -post-install-PATEST-on: -.for f in ${PATEST_BIN} - ${STRIP_CMD} ${WRKSRC}/bin/.libs/${f} - ${INSTALL_PROGRAM} ${WRKSRC}/bin/.libs/${f} ${STAGEDIR}${PREFIX}/bin/ -.endfor - post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} README.txt index.html ${STAGEDIR}${DOCSDIR} post-install-DOXYGEN-on: @cd ${WRKSRC} && doxygen - @(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} html ${STAGEDIR}${DOCSDIR}) + @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} html ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: - (cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) + @cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} + +post-install-PATEST-on: +.for f in pa_m* paqa_* patest* + ${STRIP_CMD} ${WRKSRC}/bin/.libs/${f} + ${INSTALL_PROGRAM} ${WRKSRC}/bin/.libs/${f} ${STAGEDIR}${PREFIX}/bin/ +.endfor .include Index: head/audio/portaudio/files/pa_unix_oss.h =================================================================== --- head/audio/portaudio/files/pa_unix_oss.h (nonexistent) +++ head/audio/portaudio/files/pa_unix_oss.h (revision 474829) @@ -0,0 +1,52 @@ +#ifndef PA_UNIX_OSS_H +#define PA_UNIX_OSS_H + +/* + * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $ + * PortAudio Portable Real-Time Audio Library + * OSS-specific extensions + * + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * Any person wishing to distribute modifications to the Software is + * requested to send the modifications to the original developer so that + * they can be incorporated into the canonical version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/** @file + * OSS-specific PortAudio API extension header file. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +const char *PaOSS_GetStreamInputDevice( PaStream *s ); + +const char *PaOSS_GetStreamOutputDevice( PaStream *s ); + +#ifdef __cplusplus +} +#endif + +#endif Property changes on: head/audio/portaudio/files/pa_unix_oss.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/audio/portaudio/files/patch-include_portaudio.h =================================================================== --- head/audio/portaudio/files/patch-include_portaudio.h (revision 474828) +++ head/audio/portaudio/files/patch-include_portaudio.h (revision 474829) @@ -1,13 +1,29 @@ $OpenBSD: patch-include_portaudio_h,v 1.2 2013/03/12 00:59:50 brad Exp $ ---- include/portaudio.h.orig 2016-06-22 08:28:31 UTC +--- include/portaudio.h.orig 2018-07-17 06:55:08 UTC +++ include/portaudio.h @@ -236,7 +236,8 @@ typedef enum PaHostApiTypeId paWDMKS=11, paJACK=12, paWASAPI=13, - paAudioScienceHPI=14 + paAudioScienceHPI=14, + paSndio=15 } PaHostApiTypeId; +@@ -1144,6 +1145,15 @@ signed long Pa_GetStreamReadAvailable( PaStream* strea + error is encountered. + */ + signed long Pa_GetStreamWriteAvailable( PaStream* stream ); ++ ++ ++/** Retrieve the host type handling an open stream. ++ ++ @return Returns a non-negative value representing the host API type ++ handling an open stream or, a PaErrorCode (which are always negative) ++ if PortAudio is not initialized or an error is encountered. ++*/ ++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ); + + + /* Miscellaneous utilities */ Index: head/audio/portaudio/files/patch-src_common_pa__front.c =================================================================== --- head/audio/portaudio/files/patch-src_common_pa__front.c (nonexistent) +++ head/audio/portaudio/files/patch-src_common_pa__front.c (revision 474829) @@ -0,0 +1,47 @@ +--- src/common/pa_front.c.orig 2018-07-17 06:44:39 UTC ++++ src/common/pa_front.c +@@ -1216,8 +1216,10 @@ PaError Pa_OpenStream( PaStream** stream, + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); + +- if( result == paNoError ) ++ if( result == paNoError ) { + AddOpenStream( *stream ); ++ PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type; ++ } + + + PA_LOGAPI(("Pa_OpenStream returned:\n" )); +@@ -1729,6 +1731,32 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stre + return result; + } + ++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ) ++{ ++ PaError error = PaUtil_ValidateStreamPointer( stream ); ++ PaHostApiTypeId result; ++ ++#ifdef PA_LOG_API_CALLS ++ PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" ); ++ PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); ++#endif ++ ++ if( error == paNoError ) ++ { ++ result = PA_STREAM_REP(stream)->hostApiType; ++ } ++ else ++ { ++ result = (PaHostApiTypeId) error; ++ } ++ ++#ifdef PA_LOG_API_CALLS ++ PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" ); ++ PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); ++#endif ++ ++ return result; ++} + + PaError Pa_GetSampleSize( PaSampleFormat format ) + { Property changes on: head/audio/portaudio/files/patch-src_common_pa__front.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/audio/portaudio/files/patch-src_common_pa__stream.c =================================================================== --- head/audio/portaudio/files/patch-src_common_pa__stream.c (nonexistent) +++ head/audio/portaudio/files/patch-src_common_pa__stream.c (revision 474829) @@ -0,0 +1,11 @@ +--- src/common/pa_stream.c.orig 2018-07-17 06:44:39 UTC ++++ src/common/pa_stream.c +@@ -93,6 +93,8 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStre + streamRepresentation->streamInfo.inputLatency = 0.; + streamRepresentation->streamInfo.outputLatency = 0.; + streamRepresentation->streamInfo.sampleRate = 0.; ++ ++ streamRepresentation->hostApiType = 0; + } + + Property changes on: head/audio/portaudio/files/patch-src_common_pa__stream.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/audio/portaudio/files/patch-src_common_pa__stream.h =================================================================== --- head/audio/portaudio/files/patch-src_common_pa__stream.h (nonexistent) +++ head/audio/portaudio/files/patch-src_common_pa__stream.h (revision 474829) @@ -0,0 +1,10 @@ +--- src/common/pa_stream.h.orig 2018-07-17 06:44:39 UTC ++++ src/common/pa_stream.h +@@ -152,6 +152,7 @@ typedef struct PaUtilStreamRepresentation { + PaStreamFinishedCallback *streamFinishedCallback; + void *userData; + PaStreamInfo streamInfo; ++ PaHostApiTypeId hostApiType; + } PaUtilStreamRepresentation; + + Property changes on: head/audio/portaudio/files/patch-src_common_pa__stream.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c =================================================================== --- head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (revision 474828) +++ head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (revision 474829) @@ -1,35 +1,66 @@ ---- src/hostapi/oss/pa_unix_oss.c.orig 2013-06-08 19:30:41 UTC +--- src/hostapi/oss/pa_unix_oss.c.orig 2018-07-17 07:24:21 UTC +++ src/hostapi/oss/pa_unix_oss.c @@ -62,6 +62,9 @@ #include #include #include +#ifdef __FreeBSD__ +#include +#endif #ifdef HAVE_SYS_SOUNDCARD_H # include -@@ -525,6 +528,13 @@ static PaError BuildDeviceList( PaOSSHos +@@ -525,7 +528,14 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta int i; int numDevices = 0, maxDeviceInfos = 1; PaDeviceInfo **deviceInfos = NULL; + int defaultDevice = 0; -+ + +#ifdef __FreeBSD__ + size_t len = sizeof(defaultDevice); + if (sysctlbyname("hw.snd.default_unit", &defaultDevice, &len, NULL, 0) == -1 || len != 4) + defaultDevice = 0; +#endif - ++ /* These two will be set to the first working input and output device, respectively */ commonApi->info.defaultInputDevice = paNoDevice; -@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHos + commonApi->info.defaultOutputDevice = paNoDevice; +@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta PaDeviceInfo *deviceInfo; int testResult; - if( i == 0 ) + if( i == defaultDevice ) snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); else snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); +@@ -2041,5 +2051,29 @@ static signed long GetStreamWriteAvailable( PaStream* + error: + return result; + #endif ++} ++ ++const char *PaOSS_GetStreamInputDevice( PaStream* s ) ++{ ++ PaOssStream *stream = (PaOssStream*)s; ++ ++ if( stream->capture ) ++ { ++ return stream->capture->devName; ++ } ++ ++ return NULL; ++} ++ ++const char *PaOSS_GetStreamOutputDevice( PaStream* s ) ++{ ++ PaOssStream *stream = (PaOssStream*)s; ++ ++ if( stream->playback ) ++ { ++ return stream->playback->devName; ++ } ++ ++ return NULL; + } + Index: head/audio/portaudio/files/patch-src_os_unix_pa__unix__hostapis.c =================================================================== --- head/audio/portaudio/files/patch-src_os_unix_pa__unix__hostapis.c (revision 474828) +++ head/audio/portaudio/files/patch-src_os_unix_pa__unix__hostapis.c (revision 474829) @@ -1,26 +1,26 @@ $OpenBSD: patch-src_os_unix_pa_unix_hostapis_c,v 1.2 2013/03/12 00:59:50 brad Exp $ Difference to OpenBSD patch: PA_USE_SNDIO has been moved before PA_USE_OSS, so that portaudio prefers the sndio output. ---- src/os/unix/pa_unix_hostapis.c.orig 2016-06-22 08:28:31 UTC +--- src/os/unix/pa_unix_hostapis.c.orig 2018-07-17 07:08:09 UTC +++ src/os/unix/pa_unix_hostapis.c @@ -44,6 +44,7 @@ PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); +PaError PaSndio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); /* Added for IRIX, Pieter, oct 2, 2003: */ PaError PaSGI_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); -@@ -69,6 +70,10 @@ PaUtilHostApiInitializer *paHostApiIniti +@@ -68,6 +69,10 @@ PaUtilHostApiInitializer *paHostApiInitializers[] = + #endif #else /* __linux__ */ - ++ +#ifdef PA_USE_SNDIO + PaSndio_Initialize, +#endif -+ + #if PA_USE_OSS PaOSS_Initialize, - #endif Index: head/audio/portaudio/pkg-plist =================================================================== --- head/audio/portaudio/pkg-plist (revision 474828) +++ head/audio/portaudio/pkg-plist (revision 474829) @@ -1,40 +1,41 @@ %%PATEST%%bin/pa_minlat %%PATEST%%bin/paqa_devs %%PATEST%%bin/paqa_errs %%PATEST%%bin/paqa_latency %%PATEST%%bin/patest1 %%PATEST%%bin/patest_buffer %%PATEST%%bin/patest_callbackstop %%PATEST%%bin/patest_clip %%PATEST%%bin/patest_dither %%PATEST%%bin/patest_hang %%PATEST%%bin/patest_in_overflow %%PATEST%%bin/patest_latency %%PATEST%%bin/patest_leftright %%PATEST%%bin/patest_longsine %%PATEST%%bin/patest_many %%PATEST%%bin/patest_maxsines %%PATEST%%bin/patest_mono %%PATEST%%bin/patest_multi_sine %%PATEST%%bin/patest_out_underflow %%PATEST%%bin/patest_prime %%PATEST%%bin/patest_ringmix %%PATEST%%bin/patest_sine8 %%PATEST%%bin/patest_sine_channelmaps %%PATEST%%bin/patest_sine_formats %%PATEST%%bin/patest_sine_srate %%PATEST%%bin/patest_sine_time %%PATEST%%bin/patest_start_stop %%PATEST%%bin/patest_stop %%PATEST%%bin/patest_stop_playout %%PATEST%%bin/patest_toomanysines %%PATEST%%bin/patest_two_rates %%PATEST%%bin/patest_underflow %%PATEST%%bin/patest_wire %%JACK%%include/pa_jack.h +include/pa_unix_oss.h include/portaudio.h lib/libportaudio.a lib/libportaudio.so lib/libportaudio.so.2 lib/libportaudio.so.2.0.0 libdata/pkgconfig/portaudio-2.0.pc