* Re: Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
@ 2021-04-09 13:06 ` ericonr
2021-04-09 21:42 ` prez
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: ericonr @ 2021-04-09 13:06 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#issuecomment-816668190
Comment:
The sndio patch is still necessary (if we want to keep the build option), given that it hasn't been upstreamed yet. Don't think it should be a blocker, though.
The Audacity one is relevant, though. Would be important to run a test build.
Are you sure you need to revbump all these packages? The soname isn't changing.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
2021-04-09 13:06 ` ericonr
@ 2021-04-09 21:42 ` prez
2021-04-17 22:57 ` [PR PATCH] [Updated] " prez
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-04-09 21:42 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 766 bytes --]
New comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#issuecomment-816987406
Comment:
@ericonr
> The sndio patch is still necessary (if we want to keep the build option), given that it hasn't been upstreamed yet. Don't think it should be a blocker, though.
Should I leave it as is or remove the build option then?
> The Audacity one is relevant, though. Would be important to run a test build.
Audacity fails to build without it on my machine due to a glib issue in the configure stage. Is there anything else I can do?
> Are you sure you need to revbump all these packages? The soname isn't changing.
I am not - I thought a rebuild would be necessary anyway. So nothing would need a revbump here?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR PATCH] [Updated] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
2021-04-09 13:06 ` ericonr
2021-04-09 21:42 ` prez
@ 2021-04-17 22:57 ` prez
2021-04-26 18:10 ` prez
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-04-17 22:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
There is an updated pull request by prez against master on the void-packages repository
https://github.com/prez/void-packages portaudio
https://github.com/void-linux/void-packages/pull/30108
Portaudio 19.7.0
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, (x86_64-musl)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
Edit: removed the audacity and sndio patches as they (potentially) need to be updated.
A patch file from https://github.com/void-linux/void-packages/pull/30108.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-portaudio-30108.patch --]
[-- Type: text/x-diff, Size: 39439 bytes --]
From 0a89c693effd58335f628497d786263c01edca16 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:23:05 +0200
Subject: [PATCH] portaudio: update to 19.7.0.
---
common/shlibs | 4 +-
.../portaudio/patches/audacity-compat.patch | 344 -------
srcpkgs/portaudio/patches/sndio.patch | 883 ------------------
srcpkgs/portaudio/template | 8 +-
4 files changed, 6 insertions(+), 1233 deletions(-)
delete mode 100644 srcpkgs/portaudio/patches/audacity-compat.patch
delete mode 100644 srcpkgs/portaudio/patches/sndio.patch
diff --git a/common/shlibs b/common/shlibs
index 296b93e5f22b..ddb32c84aca3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1757,8 +1757,8 @@ libxmlsec1-gcrypt.so.1 xmlsec1-1.2.31_2
libxmlsec1-gnutls.so.1 xmlsec1-1.2.31_2
libefivar.so.1 libefivar-31_1
libefiboot.so.1 libefivar-31_1
-libportaudio.so.2 portaudio-19.20140130_1
-libportaudiocpp.so.0 portaudio-cpp-19.20140130_1
+libportaudio.so.2 portaudio-19.7.0_1
+libportaudiocpp.so.0 portaudio-cpp-19.7.0_1
libdar.so.6000 libdar-2.6.6_1
libdar64.so.6000 libdar-2.6.6_1
libpython3.so python3-3.9.2_2
diff --git a/srcpkgs/portaudio/patches/audacity-compat.patch b/srcpkgs/portaudio/patches/audacity-compat.patch
deleted file mode 100644
index ef3b7a482419..000000000000
--- a/srcpkgs/portaudio/patches/audacity-compat.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-Source: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/portaudio-audacity-compat.patch
-Upstream: No
-Reason: Audacity needs Pa_GetStreamHostApiType to use system wide portaudio
-
-
-diff --git configure.in configure.in
-index 13816fb..83c239a 100644
---- configure.in
-+++ configure.in
-@@ -420,6 +420,7 @@ case "${host_os}" in
- DLL_LIBS="$DLL_LIBS -lossaudio"
- LIBS="$LIBS -lossaudio"
- fi
-+ INCLUDES="$INCLUDES pa_unix_oss.h"
- AC_DEFINE(PA_USE_OSS,1)
- fi
-
-diff --git include/pa_unix_oss.h include/pa_unix_oss.h
-new file mode 100644
-index 0000000..64e04cb
---- /dev/null
-+++ include/pa_unix_oss.h
-@@ -0,0 +1,104 @@
-+#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
-+#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
-diff --git include/pa_win_ds.h include/pa_win_ds.h
-index 5d38641..ba1c245 100644
---- include/pa_win_ds.h
-+++ include/pa_win_ds.h
-@@ -86,6 +86,21 @@ typedef struct PaWinDirectSoundStreamInfo{
-
- }PaWinDirectSoundStreamInfo;
-
-+/** Retrieve the GUID of the input device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
-+
-+/** Retrieve the GUID of the output device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
-
-
- #ifdef __cplusplus
-diff --git include/portaudio.h include/portaudio.h
-index 8a94aaf..9c8a295 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -1197,6 +1197,15 @@ signed long Pa_GetStreamReadAvailable( PaStream* stream );
- 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 */
-
-
-diff --git src/common/pa_front.c src/common/pa_front.c
-index 188cee9..52f44a6 100644
---- src/common/pa_front.c
-+++ src/common/pa_front.c
-@@ -1257,8 +1257,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" ));
-@@ -1770,6 +1772,32 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stream )
- 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 )
- {
-diff --git src/common/pa_stream.c src/common/pa_stream.c
-index 03a0ee6..c4376f9 100644
---- src/common/pa_stream.c
-+++ src/common/pa_stream.c
-@@ -93,6 +93,8 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe
- streamRepresentation->streamInfo.inputLatency = 0.;
- streamRepresentation->streamInfo.outputLatency = 0.;
- streamRepresentation->streamInfo.sampleRate = 0.;
-+
-+ streamRepresentation->hostApiType = 0;
- }
-
-
-diff --git src/common/pa_stream.h src/common/pa_stream.h
-index 678e2ad..70572c7 100644
---- src/common/pa_stream.h
-+++ src/common/pa_stream.h
-@@ -152,6 +152,7 @@ typedef struct PaUtilStreamRepresentation {
- PaStreamFinishedCallback *streamFinishedCallback;
- void *userData;
- PaStreamInfo streamInfo;
-+ PaHostApiTypeId hostApiType;
- } PaUtilStreamRepresentation;
-
-
-diff --git src/hostapi/alsa/pa_linux_alsa.c src/hostapi/alsa/pa_linux_alsa.c
-index 584cde8..558fb3d 100644
---- src/hostapi/alsa/pa_linux_alsa.c
-+++ src/hostapi/alsa/pa_linux_alsa.c
-@@ -621,6 +621,7 @@ typedef struct
- StreamDirection streamDir;
-
- snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
-+ int card;
- } PaAlsaStreamComponent;
-
- /* Implementation specific stream structure */
-@@ -1873,6 +1874,7 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- {
- PaError result = paNoError;
- PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
-+ snd_pcm_info_t* pcmInfo;
- assert( params->channelCount > 0 );
-
- /* Make sure things have an initial value */
-@@ -1900,6 +1902,9 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- self->device = params->device;
-
- PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
-+
-+ snd_pcm_info_alloca( &pcmInfo );
-+ self->card = snd_pcm_info_get_card( pcmInfo );
- self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
-
- PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
-@@ -4605,9 +4610,7 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->capture.card;
-
- error:
- return result;
-@@ -4624,9 +4627,7 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->playback.card;
-
- error:
- return result;
-diff --git src/hostapi/coreaudio/pa_mac_core_blocking.c src/hostapi/coreaudio/pa_mac_core_blocking.c
-index 679c6ba..a69e085 100644
---- src/hostapi/coreaudio/pa_mac_core_blocking.c
-+++ src/hostapi/coreaudio/pa_mac_core_blocking.c
-@@ -66,6 +66,9 @@
- #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
- # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
- # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
-+#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
-+# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
-+# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
- #else
- # include <libkern/OSAtomic.h>
- #endif
-diff --git src/hostapi/oss/pa_unix_oss.c src/hostapi/oss/pa_unix_oss.c
-index 51e9630..f257d80 100644
---- src/hostapi/oss/pa_unix_oss.c
-+++ src/hostapi/oss/pa_unix_oss.c
-@@ -2043,3 +2043,26 @@ error:
- #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;
-+}
diff --git a/srcpkgs/portaudio/patches/sndio.patch b/srcpkgs/portaudio/patches/sndio.patch
deleted file mode 100644
index 7e43e3fcedd3..000000000000
--- a/srcpkgs/portaudio/patches/sndio.patch
+++ /dev/null
@@ -1,883 +0,0 @@
-diff --git Makefile.in Makefile.in
-index 5e1a764..2747f73 100644
---- Makefile.in
-+++ Makefile.in
-@@ -44,7 +44,7 @@ PALIB = libportaudio.la
- PAINC = include/portaudio.h
-
- PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
-- -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS)_.*" \
-+ -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS|PaSndio)_.*" \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
- COMMON_OBJS = \
-@@ -146,6 +146,7 @@ SRC_DIRS = \
- src/hostapi/dsound \
- src/hostapi/jack \
- src/hostapi/oss \
-+ src/hostapi/sndio \
- src/hostapi/wasapi \
- src/hostapi/wdmks \
- src/hostapi/wmme \
-diff --git configure.in configure.in
-index 83c239a..db11d65 100644
---- configure.in
-+++ configure.in
-@@ -24,6 +24,10 @@ AC_ARG_WITH(alsa,
- AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
- [with_alsa=$withval])
-
-+AC_ARG_WITH(sndio,
-+ AS_HELP_STRING([--with-sndio], [Enable support for sndio @<:@autodetect@:>@]),
-+ [with_sndio=$withval])
-+
- AC_ARG_WITH(jack,
- AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
- [with_jack=$withval])
-@@ -120,6 +124,10 @@ have_alsa=no
- if test "x$with_alsa" != "xno"; then
- AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
- fi
-+have_sndio=no
-+if test "x$with_sndio" != "xno"; then
-+ AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
-+fi
- have_asihpi=no
- if test "x$with_asihpi" != "xno"; then
- AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
-@@ -406,6 +414,13 @@ case "${host_os}" in
- AC_DEFINE(PA_USE_ALSA,1)
- fi
-
-+ if [[ "$have_sndio" = "yes" -a "$with_sndio" != "no" ]] ; then
-+ DLL_LIBS="$DLL_LIBS -lsndio"
-+ LIBS="$LIBS -lsndio"
-+ OTHER_OBJS="$OTHER_OBJS src/hostapi/sndio/pa_sndio.o"
-+ AC_DEFINE(PA_USE_SNDIO,1)
-+ fi
-+
- if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
- DLL_LIBS="$DLL_LIBS $JACK_LIBS"
- CFLAGS="$CFLAGS $JACK_CFLAGS"
-@@ -510,6 +525,7 @@ case "$target_os" in
- ;;
- *)
- AC_MSG_RESULT([
-+ Sndio ....................... $have_sndio
- OSS ......................... $have_oss
- JACK ........................ $have_jack
- ])
-diff --git include/portaudio.h include/portaudio.h
-index 9c8a295..e535a02 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -287,7 +287,8 @@ typedef enum PaHostApiTypeId
- paWDMKS=11,
- paJACK=12,
- paWASAPI=13,
-- paAudioScienceHPI=14
-+ paAudioScienceHPI=14,
-+ paSndio=15
- } PaHostApiTypeId;
-
-
-diff --git src/hostapi/sndio/pa_sndio.c src/hostapi/sndio/pa_sndio.c
-new file mode 100644
-index 0000000..725ef47
---- /dev/null
-+++ src/hostapi/sndio/pa_sndio.c
-@@ -0,0 +1,768 @@
-+/*
-+ * Copyright (c) 2009 Alexandre Ratchov <alex@caoua.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+#include <sys/types.h>
-+#include <pthread.h>
-+#include <poll.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <sndio.h>
-+
-+#include "pa_util.h"
-+#include "pa_hostapi.h"
-+#include "pa_stream.h"
-+#include "pa_process.h"
-+#include "pa_allocation.h"
-+
-+#if 0
-+#define DPR(...) do { fprintf(stderr, __VA_ARGS__); } while (0)
-+#else
-+#define DPR(...) do {} while (0)
-+#endif
-+
-+/*
-+ * per-stream data
-+ */
-+typedef struct PaSndioStream
-+{
-+ PaUtilStreamRepresentation base;
-+ PaUtilBufferProcessor bufproc; /* format conversion */
-+ struct sio_hdl *hdl; /* handle for device i/o */
-+ struct sio_par par; /* current device parameters */
-+ unsigned mode; /* SIO_PLAY, SIO_REC or both */
-+ int stopped; /* stop requested or not started */
-+ int active; /* thread is running */
-+ unsigned long long realpos; /* frame number h/w is processing */
-+ char *rbuf, *wbuf; /* bounce buffers for conversions */
-+ unsigned long long rpos, wpos; /* bytes read/written */
-+ pthread_t thread; /* thread of the callback interface */
-+} PaSndioStream;
-+
-+/*
-+ * api "class" data, common to all streams
-+ */
-+typedef struct PaSndioHostApiRepresentation
-+{
-+ PaUtilHostApiRepresentation base;
-+ PaUtilStreamInterface callback;
-+ PaUtilStreamInterface blocking;
-+ /*
-+ * sndio has no device discovery mechanism and PortAudio has
-+ * no way of accepting raw device strings from users.
-+ * Normally we just expose the default device, which can be
-+ * changed via the AUDIODEVICE environment variable, but we
-+ * also allow specifying a list of up to 16 devices via the
-+ * PA_SNDIO_AUDIODEVICES environment variable.
-+ *
-+ * Example:
-+ * PA_SNDIO_AUDIODEVICES=default:snd/0.monitor:snd@remote/0
-+ */
-+#define PA_SNDIO_AUDIODEVICES_MAX 16
-+ PaDeviceInfo device_info[PA_SNDIO_AUDIODEVICES_MAX];
-+ PaDeviceInfo *infos[PA_SNDIO_AUDIODEVICES_MAX];
-+ char *audiodevices;
-+} PaSndioHostApiRepresentation;
-+
-+/*
-+ * callback invoked when blocks are processed by the hardware
-+ */
-+static void
-+sndioOnMove(void *addr, int delta)
-+{
-+ PaSndioStream *s = (PaSndioStream *)addr;
-+
-+ s->realpos += delta;
-+}
-+
-+/*
-+ * convert PA encoding to sndio encoding, return true on success
-+ */
-+static int
-+sndioSetFmt(struct sio_par *sio, PaSampleFormat fmt)
-+{
-+ switch (fmt & ~paNonInterleaved) {
-+ case paInt32:
-+ sio->sig = 1;
-+ sio->bits = 32;
-+ break;
-+ case paInt24:
-+ sio->sig = 1;
-+ sio->bits = 24;
-+ sio->bps = 3; /* paInt24 is packed format */
-+ break;
-+ case paInt16:
-+ case paFloat32:
-+ sio->sig = 1;
-+ sio->bits = 16;
-+ break;
-+ case paInt8:
-+ sio->sig = 1;
-+ sio->bits = 8;
-+ break;
-+ case paUInt8:
-+ sio->sig = 0;
-+ sio->bits = 8;
-+ break;
-+ default:
-+ DPR("sndioSetFmt: %x: unsupported\n", fmt);
-+ return 0;
-+ }
-+ sio->le = SIO_LE_NATIVE;
-+ return 1;
-+}
-+
-+/*
-+ * convert sndio encoding to PA encoding, return true on success
-+ */
-+static int
-+sndioGetFmt(struct sio_par *sio, PaSampleFormat *fmt)
-+{
-+ if ((sio->bps * 8 != sio->bits && !sio->msb) ||
-+ (sio->bps > 1 && sio->le != SIO_LE_NATIVE)) {
-+ DPR("sndioGetFmt: bits = %u, le = %u, msb = %u, bps = %u\n",
-+ sio->bits, sio->le, sio->msb, sio->bps);
-+ return 0;
-+ }
-+
-+ switch (sio->bits) {
-+ case 32:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt32;
-+ break;
-+ case 24:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = (sio->bps == 3) ? paInt24 : paInt32;
-+ break;
-+ case 16:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt16;
-+ break;
-+ case 8:
-+ *fmt = sio->sig ? paInt8 : paUInt8;
-+ break;
-+ default:
-+ DPR("sndioGetFmt: %u: unsupported\n", sio->bits);
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+/*
-+ * I/O loop for callback interface
-+ */
-+static void *
-+sndioThread(void *arg)
-+{
-+ PaSndioStream *s = (PaSndioStream *)arg;
-+ PaStreamCallbackTimeInfo ti;
-+ unsigned char *data;
-+ unsigned todo, rblksz, wblksz;
-+ int n, result;
-+
-+ rblksz = s->par.round * s->par.rchan * s->par.bps;
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+
-+ DPR("sndioThread: mode = %x, round = %u, rblksz = %u, wblksz = %u\n",
-+ s->mode, s->par.round, rblksz, wblksz);
-+
-+ while (!s->stopped) {
-+ if (s->mode & SIO_REC) {
-+ todo = rblksz;
-+ data = s->rbuf;
-+ while (todo > 0) {
-+ n = sio_read(s->hdl, data, todo);
-+ if (n == 0) {
-+ DPR("sndioThread: sio_read failed\n");
-+ goto failed;
-+ }
-+ todo -= n;
-+ data += n;
-+ }
-+ s->rpos += s->par.round;
-+ ti.inputBufferAdcTime =
-+ (double)s->realpos / s->par.rate;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ ti.outputBufferDacTime =
-+ (double)(s->realpos + s->par.bufsz) / s->par.rate;
-+ }
-+ ti.currentTime = s->realpos / (double)s->par.rate;
-+ PaUtil_BeginBufferProcessing(&s->bufproc, &ti, 0);
-+ if (s->mode & SIO_PLAY) {
-+ PaUtil_SetOutputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc,
-+ 0, s->wbuf, s->par.pchan);
-+ }
-+ if (s->mode & SIO_REC) {
-+ PaUtil_SetInputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc,
-+ 0, s->rbuf, s->par.rchan);
-+ }
-+ result = paContinue;
-+ n = PaUtil_EndBufferProcessing(&s->bufproc, &result);
-+ if (n != s->par.round) {
-+ DPR("sndioThread: %d < %u frames, result = %d\n",
-+ n, s->par.round, result);
-+ }
-+ if (result != paContinue) {
-+ break;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ n = sio_write(s->hdl, s->wbuf, wblksz);
-+ if (n < wblksz) {
-+ DPR("sndioThread: sio_write failed\n");
-+ goto failed;
-+ }
-+ s->wpos += s->par.round;
-+ }
-+ }
-+ failed:
-+ s->active = 0;
-+ DPR("sndioThread: done\n");
-+}
-+
-+static PaError
-+OpenStream(struct PaUtilHostApiRepresentation *hostApi,
-+ PaStream **stream,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate,
-+ unsigned long framesPerBuffer,
-+ PaStreamFlags streamFlags,
-+ PaStreamCallback *streamCallback,
-+ void *userData)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ PaSndioStream *s;
-+ PaError err;
-+ struct sio_hdl *hdl;
-+ struct sio_par par;
-+ unsigned mode;
-+ int inch, onch;
-+ PaSampleFormat ifmt, ofmt, siofmt;
-+ const char *dev;
-+
-+ DPR("OpenStream:\n");
-+
-+ mode = 0;
-+ inch = onch = 0;
-+ ifmt = ofmt = 0;
-+ sio_initpar(&par);
-+
-+ if (outputPar && outputPar->channelCount > 0) {
-+ if (outputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad output device\n", outputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (outputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: output specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, outputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ofmt = outputPar->sampleFormat;
-+ onch = par.pchan = outputPar->channelCount;
-+ mode |= SIO_PLAY;
-+ }
-+ if (inputPar && inputPar->channelCount > 0) {
-+ if (inputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad input device\n", inputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (inputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: input specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, inputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ifmt = inputPar->sampleFormat;
-+ inch = par.rchan = inputPar->channelCount;
-+ mode |= SIO_REC;
-+ }
-+ par.rate = sampleRate;
-+ if (framesPerBuffer != paFramesPerBufferUnspecified)
-+ par.round = framesPerBuffer;
-+
-+ DPR("OpenStream: mode = %x, trying rate = %u\n", mode, par.rate);
-+
-+ if (outputPar) {
-+ dev = sndioHostApi->device_info[outputPar->device].name;
-+ } else if (inputPar) {
-+ dev = sndioHostApi->device_info[inputPar->device].name;
-+ } else {
-+ return paUnanticipatedHostError;
-+ }
-+ hdl = sio_open(dev, mode, 0);
-+ if (hdl == NULL)
-+ return paUnanticipatedHostError;
-+ if (!sio_setpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sio_getpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sndioGetFmt(&par, &siofmt)) {
-+ sio_close(hdl);
-+ return paSampleFormatNotSupported;
-+ }
-+ if ((mode & SIO_REC) && par.rchan != inputPar->channelCount) {
-+ DPR("OpenStream: rchan(%u) != %d\n", par.rchan, inputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((mode & SIO_PLAY) && par.pchan != outputPar->channelCount) {
-+ DPR("OpenStream: pchan(%u) != %d\n", par.pchan, outputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((double)par.rate < sampleRate * 0.995 ||
-+ (double)par.rate > sampleRate * 1.005) {
-+ DPR("OpenStream: rate(%u) != %g\n", par.rate, sampleRate);
-+ sio_close(hdl);
-+ return paInvalidSampleRate;
-+ }
-+
-+ s = (PaSndioStream *)PaUtil_AllocateMemory(sizeof(PaSndioStream));
-+ if (s == NULL) {
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ PaUtil_InitializeStreamRepresentation(&s->base,
-+ streamCallback ? &sndioHostApi->callback : &sndioHostApi->blocking,
-+ streamCallback, userData);
-+ DPR("inch = %d, onch = %d, ifmt = %x, ofmt = %x\n",
-+ inch, onch, ifmt, ofmt);
-+ err = PaUtil_InitializeBufferProcessor(&s->bufproc,
-+ inch, ifmt, siofmt,
-+ onch, ofmt, siofmt,
-+ sampleRate,
-+ streamFlags,
-+ framesPerBuffer,
-+ par.round,
-+ paUtilFixedHostBufferSize,
-+ streamCallback, userData);
-+ if (err) {
-+ DPR("OpenStream: PaUtil_InitializeBufferProcessor failed\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return err;
-+ }
-+ if (mode & SIO_REC) {
-+ s->rbuf = malloc(par.round * par.rchan * par.bps);
-+ if (s->rbuf == NULL) {
-+ DPR("OpenStream: failed to allocate rbuf\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ if (mode & SIO_PLAY) {
-+ s->wbuf = malloc(par.round * par.pchan * par.bps);
-+ if (s->wbuf == NULL) {
-+ DPR("OpenStream: failed to allocate wbuf\n");
-+ free(s->rbuf);
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ s->base.streamInfo.inputLatency = 0;
-+ s->base.streamInfo.outputLatency = (mode & SIO_PLAY) ?
-+ (double)(par.bufsz + PaUtil_GetBufferProcessorOutputLatencyFrames(&s->bufproc)) / (double)par.rate : 0;
-+ s->base.streamInfo.sampleRate = par.rate;
-+ s->active = 0;
-+ s->stopped = 1;
-+ s->mode = mode;
-+ s->hdl = hdl;
-+ s->par = par;
-+ *stream = s;
-+ DPR("OpenStream: done\n");
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingReadStream(PaStream *stream, void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res, todo;
-+ void *buf;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ buf = s->rbuf;
-+ todo = n * s->par.rchan * s->par.bps;
-+ while (todo > 0) {
-+ res = sio_read(s->hdl, buf, todo);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ buf = (char *)buf + res;
-+ todo -= res;
-+ }
-+ s->rpos += n;
-+ PaUtil_SetInputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc, 0, s->rbuf, s->par.rchan);
-+ res = PaUtil_CopyInput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingReadStream: copyInput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingWriteStream(PaStream* stream, const void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ PaUtil_SetOutputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc, 0, s->wbuf, s->par.pchan);
-+ res = PaUtil_CopyOutput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingWriteStream: copyOutput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ res = sio_write(s->hdl, s->wbuf, n * s->par.pchan * s->par.bps);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ s->wpos += n;
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static signed long
-+BlockingGetStreamReadAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLIN);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLIN))
-+ return 0;
-+
-+ return s->realpos - s->rpos;
-+}
-+
-+static signed long
-+BlockingGetStreamWriteAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLOUT);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLOUT))
-+ return 0;
-+
-+ return s->par.bufsz - (s->wpos - s->realpos);
-+}
-+
-+static PaError
-+BlockingWaitEmpty( PaStream *stream )
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ /*
-+ * drain playback buffers; sndio always does it in background
-+ * and there is no way to wait for completion
-+ */
-+ DPR("BlockingWaitEmpty: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return paNoError;
-+}
-+
-+static PaError
-+StartStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned primes, wblksz;
-+ int err;
-+
-+ DPR("StartStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (!s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 0;
-+ s->active = 1;
-+ s->realpos = 0;
-+ s->wpos = 0;
-+ s->rpos = 0;
-+ PaUtil_ResetBufferProcessor(&s->bufproc);
-+ if (!sio_start(s->hdl))
-+ return paUnanticipatedHostError;
-+
-+ /*
-+ * send a complete buffer of silence
-+ */
-+ if (s->mode & SIO_PLAY) {
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+ memset(s->wbuf, 0, wblksz);
-+ for (primes = s->par.bufsz / s->par.round; primes > 0; primes--)
-+ s->wpos += sio_write(s->hdl, s->wbuf, wblksz);
-+ }
-+ if (s->base.streamCallback) {
-+ err = pthread_create(&s->thread, NULL, sndioThread, s);
-+ if (err) {
-+ DPR("SndioStartStream: couldn't create thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ DPR("StartStream: started...\n");
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+StopStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ void *ret;
-+ int err;
-+
-+ DPR("StopStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 1;
-+ if (s->base.streamCallback) {
-+ err = pthread_join(s->thread, &ret);
-+ if (err) {
-+ DPR("SndioStop: couldn't join thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ }
-+ if (!sio_stop(s->hdl))
-+ return paUnanticipatedHostError;
-+ return paNoError;
-+}
-+
-+static PaError
-+CloseStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ DPR("CloseStream:\n");
-+
-+ if (!s->stopped)
-+ StopStream(stream);
-+
-+ if (s->mode & SIO_REC)
-+ free(s->rbuf);
-+ if (s->mode & SIO_PLAY)
-+ free(s->wbuf);
-+ sio_close(s->hdl);
-+ PaUtil_TerminateStreamRepresentation(&s->base);
-+ PaUtil_TerminateBufferProcessor(&s->bufproc);
-+ PaUtil_FreeMemory(s);
-+ return paNoError;
-+}
-+
-+static PaError
-+AbortStream(PaStream *stream)
-+{
-+ DPR("AbortStream:\n");
-+
-+ return StopStream(stream);
-+}
-+
-+static PaError
-+IsStreamStopped(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamStopped: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->stopped;
-+}
-+
-+static PaError
-+IsStreamActive(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamActive: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->active;
-+}
-+
-+static PaTime
-+GetStreamTime(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ return (double)s->realpos / s->base.streamInfo.sampleRate;
-+}
-+
-+static PaError
-+IsFormatSupported(struct PaUtilHostApiRepresentation *hostApi,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate)
-+{
-+ return paFormatIsSupported;
-+}
-+
-+static void
-+Terminate(struct PaUtilHostApiRepresentation *hostApi)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ free(sndioHostApi->audiodevices);
-+ PaUtil_FreeMemory(hostApi);
-+}
-+
-+static void
-+InitDeviceInfo(PaDeviceInfo *info, PaHostApiIndex hostApiIndex, const char *name)
-+{
-+ info->structVersion = 2;
-+ info->name = name;
-+ info->hostApi = hostApiIndex;
-+ info->maxInputChannels = 128;
-+ info->maxOutputChannels = 128;
-+ info->defaultLowInputLatency = 0.01;
-+ info->defaultLowOutputLatency = 0.01;
-+ info->defaultHighInputLatency = 0.5;
-+ info->defaultHighOutputLatency = 0.5;
-+ info->defaultSampleRate = 48000;
-+}
-+
-+PaError
-+PaSndio_Initialize(PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ PaDeviceInfo *info;
-+ struct sio_hdl *hdl;
-+ char *audiodevices;
-+ char *device;
-+ size_t deviceCount;
-+
-+ DPR("PaSndio_Initialize: initializing...\n");
-+
-+ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) == NULL)
-+ return paNoError;
-+ sio_close(hdl);
-+ /* unusable APIs should return paNoError and a NULL hostApi */
-+ *hostApi = NULL;
-+
-+ sndioHostApi = PaUtil_AllocateMemory(sizeof(PaSndioHostApiRepresentation));
-+ if (sndioHostApi == NULL)
-+ return paNoError;
-+
-+ // Add default device
-+ info = &sndioHostApi->device_info[0];
-+ InitDeviceInfo(info, hostApiIndex, SIO_DEVANY);
-+ sndioHostApi->infos[0] = info;
-+ deviceCount = 1;
-+
-+ // Add additional devices as specified in the PA_SNDIO_AUDIODEVICES
-+ // environment variable as a colon separated list
-+ sndioHostApi->audiodevices = NULL;
-+ audiodevices = getenv("PA_SNDIO_AUDIODEVICES");
-+ if (audiodevices != NULL) {
-+ sndioHostApi->audiodevices = strdup(audiodevices);
-+ if (sndioHostApi->audiodevices == NULL)
-+ return paNoError;
-+
-+ audiodevices = sndioHostApi->audiodevices;
-+ while ((device = strsep(&audiodevices, ":")) != NULL &&
-+ deviceCount < PA_SNDIO_AUDIODEVICES_MAX) {
-+ if (*device == '\0')
-+ continue;
-+ info = &sndioHostApi->device_info[deviceCount];
-+ InitDeviceInfo(info, hostApiIndex, device);
-+ sndioHostApi->infos[deviceCount] = info;
-+ deviceCount++;
-+ }
-+ }
-+
-+ *hostApi = &sndioHostApi->base;
-+ (*hostApi)->info.structVersion = 1;
-+ (*hostApi)->info.type = paSndio;
-+ (*hostApi)->info.name = "sndio";
-+ (*hostApi)->info.deviceCount = deviceCount;
-+ (*hostApi)->info.defaultInputDevice = 0;
-+ (*hostApi)->info.defaultOutputDevice = 0;
-+ (*hostApi)->deviceInfos = sndioHostApi->infos;
-+ (*hostApi)->Terminate = Terminate;
-+ (*hostApi)->OpenStream = OpenStream;
-+ (*hostApi)->IsFormatSupported = IsFormatSupported;
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->blocking,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ BlockingReadStream,
-+ BlockingWriteStream,
-+ BlockingGetStreamReadAvailable,
-+ BlockingGetStreamWriteAvailable);
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->callback,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ PaUtil_DummyRead,
-+ PaUtil_DummyWrite,
-+ PaUtil_DummyGetReadAvailable,
-+ PaUtil_DummyGetWriteAvailable);
-+
-+ DPR("PaSndio_Initialize: done\n");
-+ return paNoError;
-+}
-diff --git src/os/unix/pa_unix_hostapis.c src/os/unix/pa_unix_hostapis.c
-index a9b4a05..f10ced1 100644
---- src/os/unix/pa_unix_hostapis.c
-+++ 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 );
-@@ -57,6 +58,10 @@ PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiI
-
- PaUtilHostApiInitializer *paHostApiInitializers[] =
- {
-+#ifdef PA_USE_SNDIO
-+ PaSndio_Initialize,
-+#endif
-+
- #ifdef __linux__
-
- #if PA_USE_ALSA
---
-2.27.0
-
diff --git a/srcpkgs/portaudio/template b/srcpkgs/portaudio/template
index 7032f8da9d41..aa49e2d82fe6 100644
--- a/srcpkgs/portaudio/template
+++ b/srcpkgs/portaudio/template
@@ -1,7 +1,7 @@
# Template file for 'portaudio'
pkgname=portaudio
-version=190600.20161030
-revision=6
+version=19.7.0
+revision=1
wrksrc=portaudio
build_style=gnu-configure
configure_args="--enable-cxx --with-jack $(vopt_enable sndio)"
@@ -11,8 +11,8 @@ short_desc="Portable cross-platform audio I/O library"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="http://www.portaudio.com"
-distfiles="http://www.${pkgname}.com/archives/pa_stable_v${version%.*}_${version#*.}.tgz"
-checksum=f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513
+distfiles="http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz"
+checksum=47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def
disable_parallel_build=yes
# sndio disabled by default: non-upstream patch
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR PATCH] [Updated] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (2 preceding siblings ...)
2021-04-17 22:57 ` [PR PATCH] [Updated] " prez
@ 2021-04-26 18:10 ` prez
2021-05-21 22:08 ` [PR REVIEW] " Chocimier
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-04-26 18:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
There is an updated pull request by prez against master on the void-packages repository
https://github.com/prez/void-packages portaudio
https://github.com/void-linux/void-packages/pull/30108
Portaudio 19.7.0
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, (x86_64-musl)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
Edit: removed the audacity and sndio patches as they (potentially) need to be updated.
A patch file from https://github.com/void-linux/void-packages/pull/30108.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-portaudio-30108.patch --]
[-- Type: text/x-diff, Size: 39439 bytes --]
From a702bdf15b373589fc30036eb9517cb7b5f0d546 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:23:05 +0200
Subject: [PATCH] portaudio: update to 19.7.0.
---
common/shlibs | 4 +-
.../portaudio/patches/audacity-compat.patch | 344 -------
srcpkgs/portaudio/patches/sndio.patch | 883 ------------------
srcpkgs/portaudio/template | 8 +-
4 files changed, 6 insertions(+), 1233 deletions(-)
delete mode 100644 srcpkgs/portaudio/patches/audacity-compat.patch
delete mode 100644 srcpkgs/portaudio/patches/sndio.patch
diff --git a/common/shlibs b/common/shlibs
index 182d311e70f2..76a6137184a1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1721,8 +1721,8 @@ libxmlsec1-gcrypt.so.1 xmlsec1-1.2.31_2
libxmlsec1-gnutls.so.1 xmlsec1-1.2.31_2
libefivar.so.1 libefivar-31_1
libefiboot.so.1 libefivar-31_1
-libportaudio.so.2 portaudio-19.20140130_1
-libportaudiocpp.so.0 portaudio-cpp-19.20140130_1
+libportaudio.so.2 portaudio-19.7.0_1
+libportaudiocpp.so.0 portaudio-cpp-19.7.0_1
libdar.so.6000 libdar-2.6.6_1
libdar64.so.6000 libdar-2.6.6_1
libpython3.so python3-3.9.2_2
diff --git a/srcpkgs/portaudio/patches/audacity-compat.patch b/srcpkgs/portaudio/patches/audacity-compat.patch
deleted file mode 100644
index ef3b7a482419..000000000000
--- a/srcpkgs/portaudio/patches/audacity-compat.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-Source: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/portaudio-audacity-compat.patch
-Upstream: No
-Reason: Audacity needs Pa_GetStreamHostApiType to use system wide portaudio
-
-
-diff --git configure.in configure.in
-index 13816fb..83c239a 100644
---- configure.in
-+++ configure.in
-@@ -420,6 +420,7 @@ case "${host_os}" in
- DLL_LIBS="$DLL_LIBS -lossaudio"
- LIBS="$LIBS -lossaudio"
- fi
-+ INCLUDES="$INCLUDES pa_unix_oss.h"
- AC_DEFINE(PA_USE_OSS,1)
- fi
-
-diff --git include/pa_unix_oss.h include/pa_unix_oss.h
-new file mode 100644
-index 0000000..64e04cb
---- /dev/null
-+++ include/pa_unix_oss.h
-@@ -0,0 +1,104 @@
-+#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
-+#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
-diff --git include/pa_win_ds.h include/pa_win_ds.h
-index 5d38641..ba1c245 100644
---- include/pa_win_ds.h
-+++ include/pa_win_ds.h
-@@ -86,6 +86,21 @@ typedef struct PaWinDirectSoundStreamInfo{
-
- }PaWinDirectSoundStreamInfo;
-
-+/** Retrieve the GUID of the input device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
-+
-+/** Retrieve the GUID of the output device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
-
-
- #ifdef __cplusplus
-diff --git include/portaudio.h include/portaudio.h
-index 8a94aaf..9c8a295 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -1197,6 +1197,15 @@ signed long Pa_GetStreamReadAvailable( PaStream* stream );
- 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 */
-
-
-diff --git src/common/pa_front.c src/common/pa_front.c
-index 188cee9..52f44a6 100644
---- src/common/pa_front.c
-+++ src/common/pa_front.c
-@@ -1257,8 +1257,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" ));
-@@ -1770,6 +1772,32 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stream )
- 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 )
- {
-diff --git src/common/pa_stream.c src/common/pa_stream.c
-index 03a0ee6..c4376f9 100644
---- src/common/pa_stream.c
-+++ src/common/pa_stream.c
-@@ -93,6 +93,8 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe
- streamRepresentation->streamInfo.inputLatency = 0.;
- streamRepresentation->streamInfo.outputLatency = 0.;
- streamRepresentation->streamInfo.sampleRate = 0.;
-+
-+ streamRepresentation->hostApiType = 0;
- }
-
-
-diff --git src/common/pa_stream.h src/common/pa_stream.h
-index 678e2ad..70572c7 100644
---- src/common/pa_stream.h
-+++ src/common/pa_stream.h
-@@ -152,6 +152,7 @@ typedef struct PaUtilStreamRepresentation {
- PaStreamFinishedCallback *streamFinishedCallback;
- void *userData;
- PaStreamInfo streamInfo;
-+ PaHostApiTypeId hostApiType;
- } PaUtilStreamRepresentation;
-
-
-diff --git src/hostapi/alsa/pa_linux_alsa.c src/hostapi/alsa/pa_linux_alsa.c
-index 584cde8..558fb3d 100644
---- src/hostapi/alsa/pa_linux_alsa.c
-+++ src/hostapi/alsa/pa_linux_alsa.c
-@@ -621,6 +621,7 @@ typedef struct
- StreamDirection streamDir;
-
- snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
-+ int card;
- } PaAlsaStreamComponent;
-
- /* Implementation specific stream structure */
-@@ -1873,6 +1874,7 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- {
- PaError result = paNoError;
- PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
-+ snd_pcm_info_t* pcmInfo;
- assert( params->channelCount > 0 );
-
- /* Make sure things have an initial value */
-@@ -1900,6 +1902,9 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- self->device = params->device;
-
- PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
-+
-+ snd_pcm_info_alloca( &pcmInfo );
-+ self->card = snd_pcm_info_get_card( pcmInfo );
- self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
-
- PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
-@@ -4605,9 +4610,7 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->capture.card;
-
- error:
- return result;
-@@ -4624,9 +4627,7 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->playback.card;
-
- error:
- return result;
-diff --git src/hostapi/coreaudio/pa_mac_core_blocking.c src/hostapi/coreaudio/pa_mac_core_blocking.c
-index 679c6ba..a69e085 100644
---- src/hostapi/coreaudio/pa_mac_core_blocking.c
-+++ src/hostapi/coreaudio/pa_mac_core_blocking.c
-@@ -66,6 +66,9 @@
- #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
- # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
- # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
-+#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
-+# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
-+# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
- #else
- # include <libkern/OSAtomic.h>
- #endif
-diff --git src/hostapi/oss/pa_unix_oss.c src/hostapi/oss/pa_unix_oss.c
-index 51e9630..f257d80 100644
---- src/hostapi/oss/pa_unix_oss.c
-+++ src/hostapi/oss/pa_unix_oss.c
-@@ -2043,3 +2043,26 @@ error:
- #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;
-+}
diff --git a/srcpkgs/portaudio/patches/sndio.patch b/srcpkgs/portaudio/patches/sndio.patch
deleted file mode 100644
index 7e43e3fcedd3..000000000000
--- a/srcpkgs/portaudio/patches/sndio.patch
+++ /dev/null
@@ -1,883 +0,0 @@
-diff --git Makefile.in Makefile.in
-index 5e1a764..2747f73 100644
---- Makefile.in
-+++ Makefile.in
-@@ -44,7 +44,7 @@ PALIB = libportaudio.la
- PAINC = include/portaudio.h
-
- PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
-- -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS)_.*" \
-+ -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS|PaSndio)_.*" \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
- COMMON_OBJS = \
-@@ -146,6 +146,7 @@ SRC_DIRS = \
- src/hostapi/dsound \
- src/hostapi/jack \
- src/hostapi/oss \
-+ src/hostapi/sndio \
- src/hostapi/wasapi \
- src/hostapi/wdmks \
- src/hostapi/wmme \
-diff --git configure.in configure.in
-index 83c239a..db11d65 100644
---- configure.in
-+++ configure.in
-@@ -24,6 +24,10 @@ AC_ARG_WITH(alsa,
- AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
- [with_alsa=$withval])
-
-+AC_ARG_WITH(sndio,
-+ AS_HELP_STRING([--with-sndio], [Enable support for sndio @<:@autodetect@:>@]),
-+ [with_sndio=$withval])
-+
- AC_ARG_WITH(jack,
- AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
- [with_jack=$withval])
-@@ -120,6 +124,10 @@ have_alsa=no
- if test "x$with_alsa" != "xno"; then
- AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
- fi
-+have_sndio=no
-+if test "x$with_sndio" != "xno"; then
-+ AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
-+fi
- have_asihpi=no
- if test "x$with_asihpi" != "xno"; then
- AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
-@@ -406,6 +414,13 @@ case "${host_os}" in
- AC_DEFINE(PA_USE_ALSA,1)
- fi
-
-+ if [[ "$have_sndio" = "yes" -a "$with_sndio" != "no" ]] ; then
-+ DLL_LIBS="$DLL_LIBS -lsndio"
-+ LIBS="$LIBS -lsndio"
-+ OTHER_OBJS="$OTHER_OBJS src/hostapi/sndio/pa_sndio.o"
-+ AC_DEFINE(PA_USE_SNDIO,1)
-+ fi
-+
- if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
- DLL_LIBS="$DLL_LIBS $JACK_LIBS"
- CFLAGS="$CFLAGS $JACK_CFLAGS"
-@@ -510,6 +525,7 @@ case "$target_os" in
- ;;
- *)
- AC_MSG_RESULT([
-+ Sndio ....................... $have_sndio
- OSS ......................... $have_oss
- JACK ........................ $have_jack
- ])
-diff --git include/portaudio.h include/portaudio.h
-index 9c8a295..e535a02 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -287,7 +287,8 @@ typedef enum PaHostApiTypeId
- paWDMKS=11,
- paJACK=12,
- paWASAPI=13,
-- paAudioScienceHPI=14
-+ paAudioScienceHPI=14,
-+ paSndio=15
- } PaHostApiTypeId;
-
-
-diff --git src/hostapi/sndio/pa_sndio.c src/hostapi/sndio/pa_sndio.c
-new file mode 100644
-index 0000000..725ef47
---- /dev/null
-+++ src/hostapi/sndio/pa_sndio.c
-@@ -0,0 +1,768 @@
-+/*
-+ * Copyright (c) 2009 Alexandre Ratchov <alex@caoua.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+#include <sys/types.h>
-+#include <pthread.h>
-+#include <poll.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <sndio.h>
-+
-+#include "pa_util.h"
-+#include "pa_hostapi.h"
-+#include "pa_stream.h"
-+#include "pa_process.h"
-+#include "pa_allocation.h"
-+
-+#if 0
-+#define DPR(...) do { fprintf(stderr, __VA_ARGS__); } while (0)
-+#else
-+#define DPR(...) do {} while (0)
-+#endif
-+
-+/*
-+ * per-stream data
-+ */
-+typedef struct PaSndioStream
-+{
-+ PaUtilStreamRepresentation base;
-+ PaUtilBufferProcessor bufproc; /* format conversion */
-+ struct sio_hdl *hdl; /* handle for device i/o */
-+ struct sio_par par; /* current device parameters */
-+ unsigned mode; /* SIO_PLAY, SIO_REC or both */
-+ int stopped; /* stop requested or not started */
-+ int active; /* thread is running */
-+ unsigned long long realpos; /* frame number h/w is processing */
-+ char *rbuf, *wbuf; /* bounce buffers for conversions */
-+ unsigned long long rpos, wpos; /* bytes read/written */
-+ pthread_t thread; /* thread of the callback interface */
-+} PaSndioStream;
-+
-+/*
-+ * api "class" data, common to all streams
-+ */
-+typedef struct PaSndioHostApiRepresentation
-+{
-+ PaUtilHostApiRepresentation base;
-+ PaUtilStreamInterface callback;
-+ PaUtilStreamInterface blocking;
-+ /*
-+ * sndio has no device discovery mechanism and PortAudio has
-+ * no way of accepting raw device strings from users.
-+ * Normally we just expose the default device, which can be
-+ * changed via the AUDIODEVICE environment variable, but we
-+ * also allow specifying a list of up to 16 devices via the
-+ * PA_SNDIO_AUDIODEVICES environment variable.
-+ *
-+ * Example:
-+ * PA_SNDIO_AUDIODEVICES=default:snd/0.monitor:snd@remote/0
-+ */
-+#define PA_SNDIO_AUDIODEVICES_MAX 16
-+ PaDeviceInfo device_info[PA_SNDIO_AUDIODEVICES_MAX];
-+ PaDeviceInfo *infos[PA_SNDIO_AUDIODEVICES_MAX];
-+ char *audiodevices;
-+} PaSndioHostApiRepresentation;
-+
-+/*
-+ * callback invoked when blocks are processed by the hardware
-+ */
-+static void
-+sndioOnMove(void *addr, int delta)
-+{
-+ PaSndioStream *s = (PaSndioStream *)addr;
-+
-+ s->realpos += delta;
-+}
-+
-+/*
-+ * convert PA encoding to sndio encoding, return true on success
-+ */
-+static int
-+sndioSetFmt(struct sio_par *sio, PaSampleFormat fmt)
-+{
-+ switch (fmt & ~paNonInterleaved) {
-+ case paInt32:
-+ sio->sig = 1;
-+ sio->bits = 32;
-+ break;
-+ case paInt24:
-+ sio->sig = 1;
-+ sio->bits = 24;
-+ sio->bps = 3; /* paInt24 is packed format */
-+ break;
-+ case paInt16:
-+ case paFloat32:
-+ sio->sig = 1;
-+ sio->bits = 16;
-+ break;
-+ case paInt8:
-+ sio->sig = 1;
-+ sio->bits = 8;
-+ break;
-+ case paUInt8:
-+ sio->sig = 0;
-+ sio->bits = 8;
-+ break;
-+ default:
-+ DPR("sndioSetFmt: %x: unsupported\n", fmt);
-+ return 0;
-+ }
-+ sio->le = SIO_LE_NATIVE;
-+ return 1;
-+}
-+
-+/*
-+ * convert sndio encoding to PA encoding, return true on success
-+ */
-+static int
-+sndioGetFmt(struct sio_par *sio, PaSampleFormat *fmt)
-+{
-+ if ((sio->bps * 8 != sio->bits && !sio->msb) ||
-+ (sio->bps > 1 && sio->le != SIO_LE_NATIVE)) {
-+ DPR("sndioGetFmt: bits = %u, le = %u, msb = %u, bps = %u\n",
-+ sio->bits, sio->le, sio->msb, sio->bps);
-+ return 0;
-+ }
-+
-+ switch (sio->bits) {
-+ case 32:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt32;
-+ break;
-+ case 24:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = (sio->bps == 3) ? paInt24 : paInt32;
-+ break;
-+ case 16:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt16;
-+ break;
-+ case 8:
-+ *fmt = sio->sig ? paInt8 : paUInt8;
-+ break;
-+ default:
-+ DPR("sndioGetFmt: %u: unsupported\n", sio->bits);
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+/*
-+ * I/O loop for callback interface
-+ */
-+static void *
-+sndioThread(void *arg)
-+{
-+ PaSndioStream *s = (PaSndioStream *)arg;
-+ PaStreamCallbackTimeInfo ti;
-+ unsigned char *data;
-+ unsigned todo, rblksz, wblksz;
-+ int n, result;
-+
-+ rblksz = s->par.round * s->par.rchan * s->par.bps;
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+
-+ DPR("sndioThread: mode = %x, round = %u, rblksz = %u, wblksz = %u\n",
-+ s->mode, s->par.round, rblksz, wblksz);
-+
-+ while (!s->stopped) {
-+ if (s->mode & SIO_REC) {
-+ todo = rblksz;
-+ data = s->rbuf;
-+ while (todo > 0) {
-+ n = sio_read(s->hdl, data, todo);
-+ if (n == 0) {
-+ DPR("sndioThread: sio_read failed\n");
-+ goto failed;
-+ }
-+ todo -= n;
-+ data += n;
-+ }
-+ s->rpos += s->par.round;
-+ ti.inputBufferAdcTime =
-+ (double)s->realpos / s->par.rate;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ ti.outputBufferDacTime =
-+ (double)(s->realpos + s->par.bufsz) / s->par.rate;
-+ }
-+ ti.currentTime = s->realpos / (double)s->par.rate;
-+ PaUtil_BeginBufferProcessing(&s->bufproc, &ti, 0);
-+ if (s->mode & SIO_PLAY) {
-+ PaUtil_SetOutputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc,
-+ 0, s->wbuf, s->par.pchan);
-+ }
-+ if (s->mode & SIO_REC) {
-+ PaUtil_SetInputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc,
-+ 0, s->rbuf, s->par.rchan);
-+ }
-+ result = paContinue;
-+ n = PaUtil_EndBufferProcessing(&s->bufproc, &result);
-+ if (n != s->par.round) {
-+ DPR("sndioThread: %d < %u frames, result = %d\n",
-+ n, s->par.round, result);
-+ }
-+ if (result != paContinue) {
-+ break;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ n = sio_write(s->hdl, s->wbuf, wblksz);
-+ if (n < wblksz) {
-+ DPR("sndioThread: sio_write failed\n");
-+ goto failed;
-+ }
-+ s->wpos += s->par.round;
-+ }
-+ }
-+ failed:
-+ s->active = 0;
-+ DPR("sndioThread: done\n");
-+}
-+
-+static PaError
-+OpenStream(struct PaUtilHostApiRepresentation *hostApi,
-+ PaStream **stream,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate,
-+ unsigned long framesPerBuffer,
-+ PaStreamFlags streamFlags,
-+ PaStreamCallback *streamCallback,
-+ void *userData)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ PaSndioStream *s;
-+ PaError err;
-+ struct sio_hdl *hdl;
-+ struct sio_par par;
-+ unsigned mode;
-+ int inch, onch;
-+ PaSampleFormat ifmt, ofmt, siofmt;
-+ const char *dev;
-+
-+ DPR("OpenStream:\n");
-+
-+ mode = 0;
-+ inch = onch = 0;
-+ ifmt = ofmt = 0;
-+ sio_initpar(&par);
-+
-+ if (outputPar && outputPar->channelCount > 0) {
-+ if (outputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad output device\n", outputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (outputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: output specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, outputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ofmt = outputPar->sampleFormat;
-+ onch = par.pchan = outputPar->channelCount;
-+ mode |= SIO_PLAY;
-+ }
-+ if (inputPar && inputPar->channelCount > 0) {
-+ if (inputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad input device\n", inputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (inputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: input specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, inputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ifmt = inputPar->sampleFormat;
-+ inch = par.rchan = inputPar->channelCount;
-+ mode |= SIO_REC;
-+ }
-+ par.rate = sampleRate;
-+ if (framesPerBuffer != paFramesPerBufferUnspecified)
-+ par.round = framesPerBuffer;
-+
-+ DPR("OpenStream: mode = %x, trying rate = %u\n", mode, par.rate);
-+
-+ if (outputPar) {
-+ dev = sndioHostApi->device_info[outputPar->device].name;
-+ } else if (inputPar) {
-+ dev = sndioHostApi->device_info[inputPar->device].name;
-+ } else {
-+ return paUnanticipatedHostError;
-+ }
-+ hdl = sio_open(dev, mode, 0);
-+ if (hdl == NULL)
-+ return paUnanticipatedHostError;
-+ if (!sio_setpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sio_getpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sndioGetFmt(&par, &siofmt)) {
-+ sio_close(hdl);
-+ return paSampleFormatNotSupported;
-+ }
-+ if ((mode & SIO_REC) && par.rchan != inputPar->channelCount) {
-+ DPR("OpenStream: rchan(%u) != %d\n", par.rchan, inputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((mode & SIO_PLAY) && par.pchan != outputPar->channelCount) {
-+ DPR("OpenStream: pchan(%u) != %d\n", par.pchan, outputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((double)par.rate < sampleRate * 0.995 ||
-+ (double)par.rate > sampleRate * 1.005) {
-+ DPR("OpenStream: rate(%u) != %g\n", par.rate, sampleRate);
-+ sio_close(hdl);
-+ return paInvalidSampleRate;
-+ }
-+
-+ s = (PaSndioStream *)PaUtil_AllocateMemory(sizeof(PaSndioStream));
-+ if (s == NULL) {
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ PaUtil_InitializeStreamRepresentation(&s->base,
-+ streamCallback ? &sndioHostApi->callback : &sndioHostApi->blocking,
-+ streamCallback, userData);
-+ DPR("inch = %d, onch = %d, ifmt = %x, ofmt = %x\n",
-+ inch, onch, ifmt, ofmt);
-+ err = PaUtil_InitializeBufferProcessor(&s->bufproc,
-+ inch, ifmt, siofmt,
-+ onch, ofmt, siofmt,
-+ sampleRate,
-+ streamFlags,
-+ framesPerBuffer,
-+ par.round,
-+ paUtilFixedHostBufferSize,
-+ streamCallback, userData);
-+ if (err) {
-+ DPR("OpenStream: PaUtil_InitializeBufferProcessor failed\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return err;
-+ }
-+ if (mode & SIO_REC) {
-+ s->rbuf = malloc(par.round * par.rchan * par.bps);
-+ if (s->rbuf == NULL) {
-+ DPR("OpenStream: failed to allocate rbuf\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ if (mode & SIO_PLAY) {
-+ s->wbuf = malloc(par.round * par.pchan * par.bps);
-+ if (s->wbuf == NULL) {
-+ DPR("OpenStream: failed to allocate wbuf\n");
-+ free(s->rbuf);
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ s->base.streamInfo.inputLatency = 0;
-+ s->base.streamInfo.outputLatency = (mode & SIO_PLAY) ?
-+ (double)(par.bufsz + PaUtil_GetBufferProcessorOutputLatencyFrames(&s->bufproc)) / (double)par.rate : 0;
-+ s->base.streamInfo.sampleRate = par.rate;
-+ s->active = 0;
-+ s->stopped = 1;
-+ s->mode = mode;
-+ s->hdl = hdl;
-+ s->par = par;
-+ *stream = s;
-+ DPR("OpenStream: done\n");
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingReadStream(PaStream *stream, void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res, todo;
-+ void *buf;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ buf = s->rbuf;
-+ todo = n * s->par.rchan * s->par.bps;
-+ while (todo > 0) {
-+ res = sio_read(s->hdl, buf, todo);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ buf = (char *)buf + res;
-+ todo -= res;
-+ }
-+ s->rpos += n;
-+ PaUtil_SetInputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc, 0, s->rbuf, s->par.rchan);
-+ res = PaUtil_CopyInput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingReadStream: copyInput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingWriteStream(PaStream* stream, const void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ PaUtil_SetOutputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc, 0, s->wbuf, s->par.pchan);
-+ res = PaUtil_CopyOutput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingWriteStream: copyOutput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ res = sio_write(s->hdl, s->wbuf, n * s->par.pchan * s->par.bps);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ s->wpos += n;
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static signed long
-+BlockingGetStreamReadAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLIN);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLIN))
-+ return 0;
-+
-+ return s->realpos - s->rpos;
-+}
-+
-+static signed long
-+BlockingGetStreamWriteAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLOUT);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLOUT))
-+ return 0;
-+
-+ return s->par.bufsz - (s->wpos - s->realpos);
-+}
-+
-+static PaError
-+BlockingWaitEmpty( PaStream *stream )
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ /*
-+ * drain playback buffers; sndio always does it in background
-+ * and there is no way to wait for completion
-+ */
-+ DPR("BlockingWaitEmpty: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return paNoError;
-+}
-+
-+static PaError
-+StartStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned primes, wblksz;
-+ int err;
-+
-+ DPR("StartStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (!s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 0;
-+ s->active = 1;
-+ s->realpos = 0;
-+ s->wpos = 0;
-+ s->rpos = 0;
-+ PaUtil_ResetBufferProcessor(&s->bufproc);
-+ if (!sio_start(s->hdl))
-+ return paUnanticipatedHostError;
-+
-+ /*
-+ * send a complete buffer of silence
-+ */
-+ if (s->mode & SIO_PLAY) {
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+ memset(s->wbuf, 0, wblksz);
-+ for (primes = s->par.bufsz / s->par.round; primes > 0; primes--)
-+ s->wpos += sio_write(s->hdl, s->wbuf, wblksz);
-+ }
-+ if (s->base.streamCallback) {
-+ err = pthread_create(&s->thread, NULL, sndioThread, s);
-+ if (err) {
-+ DPR("SndioStartStream: couldn't create thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ DPR("StartStream: started...\n");
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+StopStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ void *ret;
-+ int err;
-+
-+ DPR("StopStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 1;
-+ if (s->base.streamCallback) {
-+ err = pthread_join(s->thread, &ret);
-+ if (err) {
-+ DPR("SndioStop: couldn't join thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ }
-+ if (!sio_stop(s->hdl))
-+ return paUnanticipatedHostError;
-+ return paNoError;
-+}
-+
-+static PaError
-+CloseStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ DPR("CloseStream:\n");
-+
-+ if (!s->stopped)
-+ StopStream(stream);
-+
-+ if (s->mode & SIO_REC)
-+ free(s->rbuf);
-+ if (s->mode & SIO_PLAY)
-+ free(s->wbuf);
-+ sio_close(s->hdl);
-+ PaUtil_TerminateStreamRepresentation(&s->base);
-+ PaUtil_TerminateBufferProcessor(&s->bufproc);
-+ PaUtil_FreeMemory(s);
-+ return paNoError;
-+}
-+
-+static PaError
-+AbortStream(PaStream *stream)
-+{
-+ DPR("AbortStream:\n");
-+
-+ return StopStream(stream);
-+}
-+
-+static PaError
-+IsStreamStopped(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamStopped: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->stopped;
-+}
-+
-+static PaError
-+IsStreamActive(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamActive: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->active;
-+}
-+
-+static PaTime
-+GetStreamTime(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ return (double)s->realpos / s->base.streamInfo.sampleRate;
-+}
-+
-+static PaError
-+IsFormatSupported(struct PaUtilHostApiRepresentation *hostApi,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate)
-+{
-+ return paFormatIsSupported;
-+}
-+
-+static void
-+Terminate(struct PaUtilHostApiRepresentation *hostApi)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ free(sndioHostApi->audiodevices);
-+ PaUtil_FreeMemory(hostApi);
-+}
-+
-+static void
-+InitDeviceInfo(PaDeviceInfo *info, PaHostApiIndex hostApiIndex, const char *name)
-+{
-+ info->structVersion = 2;
-+ info->name = name;
-+ info->hostApi = hostApiIndex;
-+ info->maxInputChannels = 128;
-+ info->maxOutputChannels = 128;
-+ info->defaultLowInputLatency = 0.01;
-+ info->defaultLowOutputLatency = 0.01;
-+ info->defaultHighInputLatency = 0.5;
-+ info->defaultHighOutputLatency = 0.5;
-+ info->defaultSampleRate = 48000;
-+}
-+
-+PaError
-+PaSndio_Initialize(PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ PaDeviceInfo *info;
-+ struct sio_hdl *hdl;
-+ char *audiodevices;
-+ char *device;
-+ size_t deviceCount;
-+
-+ DPR("PaSndio_Initialize: initializing...\n");
-+
-+ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) == NULL)
-+ return paNoError;
-+ sio_close(hdl);
-+ /* unusable APIs should return paNoError and a NULL hostApi */
-+ *hostApi = NULL;
-+
-+ sndioHostApi = PaUtil_AllocateMemory(sizeof(PaSndioHostApiRepresentation));
-+ if (sndioHostApi == NULL)
-+ return paNoError;
-+
-+ // Add default device
-+ info = &sndioHostApi->device_info[0];
-+ InitDeviceInfo(info, hostApiIndex, SIO_DEVANY);
-+ sndioHostApi->infos[0] = info;
-+ deviceCount = 1;
-+
-+ // Add additional devices as specified in the PA_SNDIO_AUDIODEVICES
-+ // environment variable as a colon separated list
-+ sndioHostApi->audiodevices = NULL;
-+ audiodevices = getenv("PA_SNDIO_AUDIODEVICES");
-+ if (audiodevices != NULL) {
-+ sndioHostApi->audiodevices = strdup(audiodevices);
-+ if (sndioHostApi->audiodevices == NULL)
-+ return paNoError;
-+
-+ audiodevices = sndioHostApi->audiodevices;
-+ while ((device = strsep(&audiodevices, ":")) != NULL &&
-+ deviceCount < PA_SNDIO_AUDIODEVICES_MAX) {
-+ if (*device == '\0')
-+ continue;
-+ info = &sndioHostApi->device_info[deviceCount];
-+ InitDeviceInfo(info, hostApiIndex, device);
-+ sndioHostApi->infos[deviceCount] = info;
-+ deviceCount++;
-+ }
-+ }
-+
-+ *hostApi = &sndioHostApi->base;
-+ (*hostApi)->info.structVersion = 1;
-+ (*hostApi)->info.type = paSndio;
-+ (*hostApi)->info.name = "sndio";
-+ (*hostApi)->info.deviceCount = deviceCount;
-+ (*hostApi)->info.defaultInputDevice = 0;
-+ (*hostApi)->info.defaultOutputDevice = 0;
-+ (*hostApi)->deviceInfos = sndioHostApi->infos;
-+ (*hostApi)->Terminate = Terminate;
-+ (*hostApi)->OpenStream = OpenStream;
-+ (*hostApi)->IsFormatSupported = IsFormatSupported;
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->blocking,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ BlockingReadStream,
-+ BlockingWriteStream,
-+ BlockingGetStreamReadAvailable,
-+ BlockingGetStreamWriteAvailable);
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->callback,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ PaUtil_DummyRead,
-+ PaUtil_DummyWrite,
-+ PaUtil_DummyGetReadAvailable,
-+ PaUtil_DummyGetWriteAvailable);
-+
-+ DPR("PaSndio_Initialize: done\n");
-+ return paNoError;
-+}
-diff --git src/os/unix/pa_unix_hostapis.c src/os/unix/pa_unix_hostapis.c
-index a9b4a05..f10ced1 100644
---- src/os/unix/pa_unix_hostapis.c
-+++ 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 );
-@@ -57,6 +58,10 @@ PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiI
-
- PaUtilHostApiInitializer *paHostApiInitializers[] =
- {
-+#ifdef PA_USE_SNDIO
-+ PaSndio_Initialize,
-+#endif
-+
- #ifdef __linux__
-
- #if PA_USE_ALSA
---
-2.27.0
-
diff --git a/srcpkgs/portaudio/template b/srcpkgs/portaudio/template
index 7032f8da9d41..aa49e2d82fe6 100644
--- a/srcpkgs/portaudio/template
+++ b/srcpkgs/portaudio/template
@@ -1,7 +1,7 @@
# Template file for 'portaudio'
pkgname=portaudio
-version=190600.20161030
-revision=6
+version=19.7.0
+revision=1
wrksrc=portaudio
build_style=gnu-configure
configure_args="--enable-cxx --with-jack $(vopt_enable sndio)"
@@ -11,8 +11,8 @@ short_desc="Portable cross-platform audio I/O library"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="http://www.portaudio.com"
-distfiles="http://www.${pkgname}.com/archives/pa_stable_v${version%.*}_${version#*.}.tgz"
-checksum=f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513
+distfiles="http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz"
+checksum=47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def
disable_parallel_build=yes
# sndio disabled by default: non-upstream patch
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR REVIEW] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (3 preceding siblings ...)
2021-04-26 18:10 ` prez
@ 2021-05-21 22:08 ` Chocimier
2021-05-21 22:10 ` Chocimier
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Chocimier @ 2021-05-21 22:08 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 389 bytes --]
New review comment by Chocimier on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#discussion_r637258600
Comment:
Version scheme change is problematic. Now one has to update version *and* distfiles. 19.7.0 to 190600.20161030 is also seen downgrade by xbps, so `reverts` with old versions would need to be added, and xbps-still would list it as downgrade.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR REVIEW] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (4 preceding siblings ...)
2021-05-21 22:08 ` [PR REVIEW] " Chocimier
@ 2021-05-21 22:10 ` Chocimier
2021-05-24 12:58 ` [PR PATCH] [Updated] " prez
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Chocimier @ 2021-05-21 22:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 397 bytes --]
New review comment by Chocimier on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#discussion_r637258600
Comment:
Version scheme change is problematic. Now one has to update version *and* distfiles. 190600.20161030 [edit:] to 19.7.0 is also seen downgrade by xbps, so `reverts` with old versions would need to be added, and xbps-still would list it as downgrade.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR PATCH] [Updated] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (5 preceding siblings ...)
2021-05-21 22:10 ` Chocimier
@ 2021-05-24 12:58 ` prez
2021-05-24 12:59 ` [PR REVIEW] " prez
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-05-24 12:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
There is an updated pull request by prez against master on the void-packages repository
https://github.com/prez/void-packages portaudio
https://github.com/void-linux/void-packages/pull/30108
Portaudio 19.7.0
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, (x86_64-musl)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
Edit: removed the audacity and sndio patches as they (potentially) need to be updated.
A patch file from https://github.com/void-linux/void-packages/pull/30108.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-portaudio-30108.patch --]
[-- Type: text/x-diff, Size: 39514 bytes --]
From 1334114e9ce9969d696796ae4255ed810d404466 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:23:05 +0200
Subject: [PATCH] portaudio: update to 19.7.0.
---
common/shlibs | 4 +-
.../portaudio/patches/audacity-compat.patch | 344 -------
srcpkgs/portaudio/patches/sndio.patch | 883 ------------------
srcpkgs/portaudio/template | 10 +-
4 files changed, 7 insertions(+), 1234 deletions(-)
delete mode 100644 srcpkgs/portaudio/patches/audacity-compat.patch
delete mode 100644 srcpkgs/portaudio/patches/sndio.patch
diff --git a/common/shlibs b/common/shlibs
index a584fb460e21..1f76c574e210 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1721,8 +1721,8 @@ libxmlsec1-gcrypt.so.1 xmlsec1-1.2.31_2
libxmlsec1-gnutls.so.1 xmlsec1-1.2.31_2
libefivar.so.1 libefivar-31_1
libefiboot.so.1 libefivar-31_1
-libportaudio.so.2 portaudio-19.20140130_1
-libportaudiocpp.so.0 portaudio-cpp-19.20140130_1
+libportaudio.so.2 portaudio-19.7.0_1
+libportaudiocpp.so.0 portaudio-cpp-19.7.0_1
libdar.so.6000 libdar-2.6.6_1
libdar64.so.6000 libdar-2.6.6_1
libpython3.so python3-3.9.2_2
diff --git a/srcpkgs/portaudio/patches/audacity-compat.patch b/srcpkgs/portaudio/patches/audacity-compat.patch
deleted file mode 100644
index ef3b7a482419..000000000000
--- a/srcpkgs/portaudio/patches/audacity-compat.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-Source: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/portaudio-audacity-compat.patch
-Upstream: No
-Reason: Audacity needs Pa_GetStreamHostApiType to use system wide portaudio
-
-
-diff --git configure.in configure.in
-index 13816fb..83c239a 100644
---- configure.in
-+++ configure.in
-@@ -420,6 +420,7 @@ case "${host_os}" in
- DLL_LIBS="$DLL_LIBS -lossaudio"
- LIBS="$LIBS -lossaudio"
- fi
-+ INCLUDES="$INCLUDES pa_unix_oss.h"
- AC_DEFINE(PA_USE_OSS,1)
- fi
-
-diff --git include/pa_unix_oss.h include/pa_unix_oss.h
-new file mode 100644
-index 0000000..64e04cb
---- /dev/null
-+++ include/pa_unix_oss.h
-@@ -0,0 +1,104 @@
-+#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
-+#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
-diff --git include/pa_win_ds.h include/pa_win_ds.h
-index 5d38641..ba1c245 100644
---- include/pa_win_ds.h
-+++ include/pa_win_ds.h
-@@ -86,6 +86,21 @@ typedef struct PaWinDirectSoundStreamInfo{
-
- }PaWinDirectSoundStreamInfo;
-
-+/** Retrieve the GUID of the input device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
-+
-+/** Retrieve the GUID of the output device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
-
-
- #ifdef __cplusplus
-diff --git include/portaudio.h include/portaudio.h
-index 8a94aaf..9c8a295 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -1197,6 +1197,15 @@ signed long Pa_GetStreamReadAvailable( PaStream* stream );
- 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 */
-
-
-diff --git src/common/pa_front.c src/common/pa_front.c
-index 188cee9..52f44a6 100644
---- src/common/pa_front.c
-+++ src/common/pa_front.c
-@@ -1257,8 +1257,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" ));
-@@ -1770,6 +1772,32 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stream )
- 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 )
- {
-diff --git src/common/pa_stream.c src/common/pa_stream.c
-index 03a0ee6..c4376f9 100644
---- src/common/pa_stream.c
-+++ src/common/pa_stream.c
-@@ -93,6 +93,8 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe
- streamRepresentation->streamInfo.inputLatency = 0.;
- streamRepresentation->streamInfo.outputLatency = 0.;
- streamRepresentation->streamInfo.sampleRate = 0.;
-+
-+ streamRepresentation->hostApiType = 0;
- }
-
-
-diff --git src/common/pa_stream.h src/common/pa_stream.h
-index 678e2ad..70572c7 100644
---- src/common/pa_stream.h
-+++ src/common/pa_stream.h
-@@ -152,6 +152,7 @@ typedef struct PaUtilStreamRepresentation {
- PaStreamFinishedCallback *streamFinishedCallback;
- void *userData;
- PaStreamInfo streamInfo;
-+ PaHostApiTypeId hostApiType;
- } PaUtilStreamRepresentation;
-
-
-diff --git src/hostapi/alsa/pa_linux_alsa.c src/hostapi/alsa/pa_linux_alsa.c
-index 584cde8..558fb3d 100644
---- src/hostapi/alsa/pa_linux_alsa.c
-+++ src/hostapi/alsa/pa_linux_alsa.c
-@@ -621,6 +621,7 @@ typedef struct
- StreamDirection streamDir;
-
- snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
-+ int card;
- } PaAlsaStreamComponent;
-
- /* Implementation specific stream structure */
-@@ -1873,6 +1874,7 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- {
- PaError result = paNoError;
- PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
-+ snd_pcm_info_t* pcmInfo;
- assert( params->channelCount > 0 );
-
- /* Make sure things have an initial value */
-@@ -1900,6 +1902,9 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- self->device = params->device;
-
- PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
-+
-+ snd_pcm_info_alloca( &pcmInfo );
-+ self->card = snd_pcm_info_get_card( pcmInfo );
- self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
-
- PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
-@@ -4605,9 +4610,7 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->capture.card;
-
- error:
- return result;
-@@ -4624,9 +4627,7 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->playback.card;
-
- error:
- return result;
-diff --git src/hostapi/coreaudio/pa_mac_core_blocking.c src/hostapi/coreaudio/pa_mac_core_blocking.c
-index 679c6ba..a69e085 100644
---- src/hostapi/coreaudio/pa_mac_core_blocking.c
-+++ src/hostapi/coreaudio/pa_mac_core_blocking.c
-@@ -66,6 +66,9 @@
- #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
- # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
- # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
-+#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
-+# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
-+# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
- #else
- # include <libkern/OSAtomic.h>
- #endif
-diff --git src/hostapi/oss/pa_unix_oss.c src/hostapi/oss/pa_unix_oss.c
-index 51e9630..f257d80 100644
---- src/hostapi/oss/pa_unix_oss.c
-+++ src/hostapi/oss/pa_unix_oss.c
-@@ -2043,3 +2043,26 @@ error:
- #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;
-+}
diff --git a/srcpkgs/portaudio/patches/sndio.patch b/srcpkgs/portaudio/patches/sndio.patch
deleted file mode 100644
index 7e43e3fcedd3..000000000000
--- a/srcpkgs/portaudio/patches/sndio.patch
+++ /dev/null
@@ -1,883 +0,0 @@
-diff --git Makefile.in Makefile.in
-index 5e1a764..2747f73 100644
---- Makefile.in
-+++ Makefile.in
-@@ -44,7 +44,7 @@ PALIB = libportaudio.la
- PAINC = include/portaudio.h
-
- PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
-- -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS)_.*" \
-+ -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS|PaSndio)_.*" \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
- COMMON_OBJS = \
-@@ -146,6 +146,7 @@ SRC_DIRS = \
- src/hostapi/dsound \
- src/hostapi/jack \
- src/hostapi/oss \
-+ src/hostapi/sndio \
- src/hostapi/wasapi \
- src/hostapi/wdmks \
- src/hostapi/wmme \
-diff --git configure.in configure.in
-index 83c239a..db11d65 100644
---- configure.in
-+++ configure.in
-@@ -24,6 +24,10 @@ AC_ARG_WITH(alsa,
- AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
- [with_alsa=$withval])
-
-+AC_ARG_WITH(sndio,
-+ AS_HELP_STRING([--with-sndio], [Enable support for sndio @<:@autodetect@:>@]),
-+ [with_sndio=$withval])
-+
- AC_ARG_WITH(jack,
- AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
- [with_jack=$withval])
-@@ -120,6 +124,10 @@ have_alsa=no
- if test "x$with_alsa" != "xno"; then
- AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
- fi
-+have_sndio=no
-+if test "x$with_sndio" != "xno"; then
-+ AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
-+fi
- have_asihpi=no
- if test "x$with_asihpi" != "xno"; then
- AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
-@@ -406,6 +414,13 @@ case "${host_os}" in
- AC_DEFINE(PA_USE_ALSA,1)
- fi
-
-+ if [[ "$have_sndio" = "yes" -a "$with_sndio" != "no" ]] ; then
-+ DLL_LIBS="$DLL_LIBS -lsndio"
-+ LIBS="$LIBS -lsndio"
-+ OTHER_OBJS="$OTHER_OBJS src/hostapi/sndio/pa_sndio.o"
-+ AC_DEFINE(PA_USE_SNDIO,1)
-+ fi
-+
- if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
- DLL_LIBS="$DLL_LIBS $JACK_LIBS"
- CFLAGS="$CFLAGS $JACK_CFLAGS"
-@@ -510,6 +525,7 @@ case "$target_os" in
- ;;
- *)
- AC_MSG_RESULT([
-+ Sndio ....................... $have_sndio
- OSS ......................... $have_oss
- JACK ........................ $have_jack
- ])
-diff --git include/portaudio.h include/portaudio.h
-index 9c8a295..e535a02 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -287,7 +287,8 @@ typedef enum PaHostApiTypeId
- paWDMKS=11,
- paJACK=12,
- paWASAPI=13,
-- paAudioScienceHPI=14
-+ paAudioScienceHPI=14,
-+ paSndio=15
- } PaHostApiTypeId;
-
-
-diff --git src/hostapi/sndio/pa_sndio.c src/hostapi/sndio/pa_sndio.c
-new file mode 100644
-index 0000000..725ef47
---- /dev/null
-+++ src/hostapi/sndio/pa_sndio.c
-@@ -0,0 +1,768 @@
-+/*
-+ * Copyright (c) 2009 Alexandre Ratchov <alex@caoua.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+#include <sys/types.h>
-+#include <pthread.h>
-+#include <poll.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <sndio.h>
-+
-+#include "pa_util.h"
-+#include "pa_hostapi.h"
-+#include "pa_stream.h"
-+#include "pa_process.h"
-+#include "pa_allocation.h"
-+
-+#if 0
-+#define DPR(...) do { fprintf(stderr, __VA_ARGS__); } while (0)
-+#else
-+#define DPR(...) do {} while (0)
-+#endif
-+
-+/*
-+ * per-stream data
-+ */
-+typedef struct PaSndioStream
-+{
-+ PaUtilStreamRepresentation base;
-+ PaUtilBufferProcessor bufproc; /* format conversion */
-+ struct sio_hdl *hdl; /* handle for device i/o */
-+ struct sio_par par; /* current device parameters */
-+ unsigned mode; /* SIO_PLAY, SIO_REC or both */
-+ int stopped; /* stop requested or not started */
-+ int active; /* thread is running */
-+ unsigned long long realpos; /* frame number h/w is processing */
-+ char *rbuf, *wbuf; /* bounce buffers for conversions */
-+ unsigned long long rpos, wpos; /* bytes read/written */
-+ pthread_t thread; /* thread of the callback interface */
-+} PaSndioStream;
-+
-+/*
-+ * api "class" data, common to all streams
-+ */
-+typedef struct PaSndioHostApiRepresentation
-+{
-+ PaUtilHostApiRepresentation base;
-+ PaUtilStreamInterface callback;
-+ PaUtilStreamInterface blocking;
-+ /*
-+ * sndio has no device discovery mechanism and PortAudio has
-+ * no way of accepting raw device strings from users.
-+ * Normally we just expose the default device, which can be
-+ * changed via the AUDIODEVICE environment variable, but we
-+ * also allow specifying a list of up to 16 devices via the
-+ * PA_SNDIO_AUDIODEVICES environment variable.
-+ *
-+ * Example:
-+ * PA_SNDIO_AUDIODEVICES=default:snd/0.monitor:snd@remote/0
-+ */
-+#define PA_SNDIO_AUDIODEVICES_MAX 16
-+ PaDeviceInfo device_info[PA_SNDIO_AUDIODEVICES_MAX];
-+ PaDeviceInfo *infos[PA_SNDIO_AUDIODEVICES_MAX];
-+ char *audiodevices;
-+} PaSndioHostApiRepresentation;
-+
-+/*
-+ * callback invoked when blocks are processed by the hardware
-+ */
-+static void
-+sndioOnMove(void *addr, int delta)
-+{
-+ PaSndioStream *s = (PaSndioStream *)addr;
-+
-+ s->realpos += delta;
-+}
-+
-+/*
-+ * convert PA encoding to sndio encoding, return true on success
-+ */
-+static int
-+sndioSetFmt(struct sio_par *sio, PaSampleFormat fmt)
-+{
-+ switch (fmt & ~paNonInterleaved) {
-+ case paInt32:
-+ sio->sig = 1;
-+ sio->bits = 32;
-+ break;
-+ case paInt24:
-+ sio->sig = 1;
-+ sio->bits = 24;
-+ sio->bps = 3; /* paInt24 is packed format */
-+ break;
-+ case paInt16:
-+ case paFloat32:
-+ sio->sig = 1;
-+ sio->bits = 16;
-+ break;
-+ case paInt8:
-+ sio->sig = 1;
-+ sio->bits = 8;
-+ break;
-+ case paUInt8:
-+ sio->sig = 0;
-+ sio->bits = 8;
-+ break;
-+ default:
-+ DPR("sndioSetFmt: %x: unsupported\n", fmt);
-+ return 0;
-+ }
-+ sio->le = SIO_LE_NATIVE;
-+ return 1;
-+}
-+
-+/*
-+ * convert sndio encoding to PA encoding, return true on success
-+ */
-+static int
-+sndioGetFmt(struct sio_par *sio, PaSampleFormat *fmt)
-+{
-+ if ((sio->bps * 8 != sio->bits && !sio->msb) ||
-+ (sio->bps > 1 && sio->le != SIO_LE_NATIVE)) {
-+ DPR("sndioGetFmt: bits = %u, le = %u, msb = %u, bps = %u\n",
-+ sio->bits, sio->le, sio->msb, sio->bps);
-+ return 0;
-+ }
-+
-+ switch (sio->bits) {
-+ case 32:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt32;
-+ break;
-+ case 24:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = (sio->bps == 3) ? paInt24 : paInt32;
-+ break;
-+ case 16:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt16;
-+ break;
-+ case 8:
-+ *fmt = sio->sig ? paInt8 : paUInt8;
-+ break;
-+ default:
-+ DPR("sndioGetFmt: %u: unsupported\n", sio->bits);
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+/*
-+ * I/O loop for callback interface
-+ */
-+static void *
-+sndioThread(void *arg)
-+{
-+ PaSndioStream *s = (PaSndioStream *)arg;
-+ PaStreamCallbackTimeInfo ti;
-+ unsigned char *data;
-+ unsigned todo, rblksz, wblksz;
-+ int n, result;
-+
-+ rblksz = s->par.round * s->par.rchan * s->par.bps;
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+
-+ DPR("sndioThread: mode = %x, round = %u, rblksz = %u, wblksz = %u\n",
-+ s->mode, s->par.round, rblksz, wblksz);
-+
-+ while (!s->stopped) {
-+ if (s->mode & SIO_REC) {
-+ todo = rblksz;
-+ data = s->rbuf;
-+ while (todo > 0) {
-+ n = sio_read(s->hdl, data, todo);
-+ if (n == 0) {
-+ DPR("sndioThread: sio_read failed\n");
-+ goto failed;
-+ }
-+ todo -= n;
-+ data += n;
-+ }
-+ s->rpos += s->par.round;
-+ ti.inputBufferAdcTime =
-+ (double)s->realpos / s->par.rate;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ ti.outputBufferDacTime =
-+ (double)(s->realpos + s->par.bufsz) / s->par.rate;
-+ }
-+ ti.currentTime = s->realpos / (double)s->par.rate;
-+ PaUtil_BeginBufferProcessing(&s->bufproc, &ti, 0);
-+ if (s->mode & SIO_PLAY) {
-+ PaUtil_SetOutputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc,
-+ 0, s->wbuf, s->par.pchan);
-+ }
-+ if (s->mode & SIO_REC) {
-+ PaUtil_SetInputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc,
-+ 0, s->rbuf, s->par.rchan);
-+ }
-+ result = paContinue;
-+ n = PaUtil_EndBufferProcessing(&s->bufproc, &result);
-+ if (n != s->par.round) {
-+ DPR("sndioThread: %d < %u frames, result = %d\n",
-+ n, s->par.round, result);
-+ }
-+ if (result != paContinue) {
-+ break;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ n = sio_write(s->hdl, s->wbuf, wblksz);
-+ if (n < wblksz) {
-+ DPR("sndioThread: sio_write failed\n");
-+ goto failed;
-+ }
-+ s->wpos += s->par.round;
-+ }
-+ }
-+ failed:
-+ s->active = 0;
-+ DPR("sndioThread: done\n");
-+}
-+
-+static PaError
-+OpenStream(struct PaUtilHostApiRepresentation *hostApi,
-+ PaStream **stream,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate,
-+ unsigned long framesPerBuffer,
-+ PaStreamFlags streamFlags,
-+ PaStreamCallback *streamCallback,
-+ void *userData)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ PaSndioStream *s;
-+ PaError err;
-+ struct sio_hdl *hdl;
-+ struct sio_par par;
-+ unsigned mode;
-+ int inch, onch;
-+ PaSampleFormat ifmt, ofmt, siofmt;
-+ const char *dev;
-+
-+ DPR("OpenStream:\n");
-+
-+ mode = 0;
-+ inch = onch = 0;
-+ ifmt = ofmt = 0;
-+ sio_initpar(&par);
-+
-+ if (outputPar && outputPar->channelCount > 0) {
-+ if (outputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad output device\n", outputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (outputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: output specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, outputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ofmt = outputPar->sampleFormat;
-+ onch = par.pchan = outputPar->channelCount;
-+ mode |= SIO_PLAY;
-+ }
-+ if (inputPar && inputPar->channelCount > 0) {
-+ if (inputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad input device\n", inputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (inputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: input specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, inputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ifmt = inputPar->sampleFormat;
-+ inch = par.rchan = inputPar->channelCount;
-+ mode |= SIO_REC;
-+ }
-+ par.rate = sampleRate;
-+ if (framesPerBuffer != paFramesPerBufferUnspecified)
-+ par.round = framesPerBuffer;
-+
-+ DPR("OpenStream: mode = %x, trying rate = %u\n", mode, par.rate);
-+
-+ if (outputPar) {
-+ dev = sndioHostApi->device_info[outputPar->device].name;
-+ } else if (inputPar) {
-+ dev = sndioHostApi->device_info[inputPar->device].name;
-+ } else {
-+ return paUnanticipatedHostError;
-+ }
-+ hdl = sio_open(dev, mode, 0);
-+ if (hdl == NULL)
-+ return paUnanticipatedHostError;
-+ if (!sio_setpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sio_getpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sndioGetFmt(&par, &siofmt)) {
-+ sio_close(hdl);
-+ return paSampleFormatNotSupported;
-+ }
-+ if ((mode & SIO_REC) && par.rchan != inputPar->channelCount) {
-+ DPR("OpenStream: rchan(%u) != %d\n", par.rchan, inputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((mode & SIO_PLAY) && par.pchan != outputPar->channelCount) {
-+ DPR("OpenStream: pchan(%u) != %d\n", par.pchan, outputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((double)par.rate < sampleRate * 0.995 ||
-+ (double)par.rate > sampleRate * 1.005) {
-+ DPR("OpenStream: rate(%u) != %g\n", par.rate, sampleRate);
-+ sio_close(hdl);
-+ return paInvalidSampleRate;
-+ }
-+
-+ s = (PaSndioStream *)PaUtil_AllocateMemory(sizeof(PaSndioStream));
-+ if (s == NULL) {
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ PaUtil_InitializeStreamRepresentation(&s->base,
-+ streamCallback ? &sndioHostApi->callback : &sndioHostApi->blocking,
-+ streamCallback, userData);
-+ DPR("inch = %d, onch = %d, ifmt = %x, ofmt = %x\n",
-+ inch, onch, ifmt, ofmt);
-+ err = PaUtil_InitializeBufferProcessor(&s->bufproc,
-+ inch, ifmt, siofmt,
-+ onch, ofmt, siofmt,
-+ sampleRate,
-+ streamFlags,
-+ framesPerBuffer,
-+ par.round,
-+ paUtilFixedHostBufferSize,
-+ streamCallback, userData);
-+ if (err) {
-+ DPR("OpenStream: PaUtil_InitializeBufferProcessor failed\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return err;
-+ }
-+ if (mode & SIO_REC) {
-+ s->rbuf = malloc(par.round * par.rchan * par.bps);
-+ if (s->rbuf == NULL) {
-+ DPR("OpenStream: failed to allocate rbuf\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ if (mode & SIO_PLAY) {
-+ s->wbuf = malloc(par.round * par.pchan * par.bps);
-+ if (s->wbuf == NULL) {
-+ DPR("OpenStream: failed to allocate wbuf\n");
-+ free(s->rbuf);
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ s->base.streamInfo.inputLatency = 0;
-+ s->base.streamInfo.outputLatency = (mode & SIO_PLAY) ?
-+ (double)(par.bufsz + PaUtil_GetBufferProcessorOutputLatencyFrames(&s->bufproc)) / (double)par.rate : 0;
-+ s->base.streamInfo.sampleRate = par.rate;
-+ s->active = 0;
-+ s->stopped = 1;
-+ s->mode = mode;
-+ s->hdl = hdl;
-+ s->par = par;
-+ *stream = s;
-+ DPR("OpenStream: done\n");
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingReadStream(PaStream *stream, void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res, todo;
-+ void *buf;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ buf = s->rbuf;
-+ todo = n * s->par.rchan * s->par.bps;
-+ while (todo > 0) {
-+ res = sio_read(s->hdl, buf, todo);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ buf = (char *)buf + res;
-+ todo -= res;
-+ }
-+ s->rpos += n;
-+ PaUtil_SetInputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc, 0, s->rbuf, s->par.rchan);
-+ res = PaUtil_CopyInput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingReadStream: copyInput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingWriteStream(PaStream* stream, const void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ PaUtil_SetOutputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc, 0, s->wbuf, s->par.pchan);
-+ res = PaUtil_CopyOutput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingWriteStream: copyOutput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ res = sio_write(s->hdl, s->wbuf, n * s->par.pchan * s->par.bps);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ s->wpos += n;
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static signed long
-+BlockingGetStreamReadAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLIN);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLIN))
-+ return 0;
-+
-+ return s->realpos - s->rpos;
-+}
-+
-+static signed long
-+BlockingGetStreamWriteAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLOUT);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLOUT))
-+ return 0;
-+
-+ return s->par.bufsz - (s->wpos - s->realpos);
-+}
-+
-+static PaError
-+BlockingWaitEmpty( PaStream *stream )
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ /*
-+ * drain playback buffers; sndio always does it in background
-+ * and there is no way to wait for completion
-+ */
-+ DPR("BlockingWaitEmpty: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return paNoError;
-+}
-+
-+static PaError
-+StartStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned primes, wblksz;
-+ int err;
-+
-+ DPR("StartStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (!s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 0;
-+ s->active = 1;
-+ s->realpos = 0;
-+ s->wpos = 0;
-+ s->rpos = 0;
-+ PaUtil_ResetBufferProcessor(&s->bufproc);
-+ if (!sio_start(s->hdl))
-+ return paUnanticipatedHostError;
-+
-+ /*
-+ * send a complete buffer of silence
-+ */
-+ if (s->mode & SIO_PLAY) {
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+ memset(s->wbuf, 0, wblksz);
-+ for (primes = s->par.bufsz / s->par.round; primes > 0; primes--)
-+ s->wpos += sio_write(s->hdl, s->wbuf, wblksz);
-+ }
-+ if (s->base.streamCallback) {
-+ err = pthread_create(&s->thread, NULL, sndioThread, s);
-+ if (err) {
-+ DPR("SndioStartStream: couldn't create thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ DPR("StartStream: started...\n");
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+StopStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ void *ret;
-+ int err;
-+
-+ DPR("StopStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 1;
-+ if (s->base.streamCallback) {
-+ err = pthread_join(s->thread, &ret);
-+ if (err) {
-+ DPR("SndioStop: couldn't join thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ }
-+ if (!sio_stop(s->hdl))
-+ return paUnanticipatedHostError;
-+ return paNoError;
-+}
-+
-+static PaError
-+CloseStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ DPR("CloseStream:\n");
-+
-+ if (!s->stopped)
-+ StopStream(stream);
-+
-+ if (s->mode & SIO_REC)
-+ free(s->rbuf);
-+ if (s->mode & SIO_PLAY)
-+ free(s->wbuf);
-+ sio_close(s->hdl);
-+ PaUtil_TerminateStreamRepresentation(&s->base);
-+ PaUtil_TerminateBufferProcessor(&s->bufproc);
-+ PaUtil_FreeMemory(s);
-+ return paNoError;
-+}
-+
-+static PaError
-+AbortStream(PaStream *stream)
-+{
-+ DPR("AbortStream:\n");
-+
-+ return StopStream(stream);
-+}
-+
-+static PaError
-+IsStreamStopped(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamStopped: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->stopped;
-+}
-+
-+static PaError
-+IsStreamActive(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamActive: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->active;
-+}
-+
-+static PaTime
-+GetStreamTime(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ return (double)s->realpos / s->base.streamInfo.sampleRate;
-+}
-+
-+static PaError
-+IsFormatSupported(struct PaUtilHostApiRepresentation *hostApi,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate)
-+{
-+ return paFormatIsSupported;
-+}
-+
-+static void
-+Terminate(struct PaUtilHostApiRepresentation *hostApi)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ free(sndioHostApi->audiodevices);
-+ PaUtil_FreeMemory(hostApi);
-+}
-+
-+static void
-+InitDeviceInfo(PaDeviceInfo *info, PaHostApiIndex hostApiIndex, const char *name)
-+{
-+ info->structVersion = 2;
-+ info->name = name;
-+ info->hostApi = hostApiIndex;
-+ info->maxInputChannels = 128;
-+ info->maxOutputChannels = 128;
-+ info->defaultLowInputLatency = 0.01;
-+ info->defaultLowOutputLatency = 0.01;
-+ info->defaultHighInputLatency = 0.5;
-+ info->defaultHighOutputLatency = 0.5;
-+ info->defaultSampleRate = 48000;
-+}
-+
-+PaError
-+PaSndio_Initialize(PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ PaDeviceInfo *info;
-+ struct sio_hdl *hdl;
-+ char *audiodevices;
-+ char *device;
-+ size_t deviceCount;
-+
-+ DPR("PaSndio_Initialize: initializing...\n");
-+
-+ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) == NULL)
-+ return paNoError;
-+ sio_close(hdl);
-+ /* unusable APIs should return paNoError and a NULL hostApi */
-+ *hostApi = NULL;
-+
-+ sndioHostApi = PaUtil_AllocateMemory(sizeof(PaSndioHostApiRepresentation));
-+ if (sndioHostApi == NULL)
-+ return paNoError;
-+
-+ // Add default device
-+ info = &sndioHostApi->device_info[0];
-+ InitDeviceInfo(info, hostApiIndex, SIO_DEVANY);
-+ sndioHostApi->infos[0] = info;
-+ deviceCount = 1;
-+
-+ // Add additional devices as specified in the PA_SNDIO_AUDIODEVICES
-+ // environment variable as a colon separated list
-+ sndioHostApi->audiodevices = NULL;
-+ audiodevices = getenv("PA_SNDIO_AUDIODEVICES");
-+ if (audiodevices != NULL) {
-+ sndioHostApi->audiodevices = strdup(audiodevices);
-+ if (sndioHostApi->audiodevices == NULL)
-+ return paNoError;
-+
-+ audiodevices = sndioHostApi->audiodevices;
-+ while ((device = strsep(&audiodevices, ":")) != NULL &&
-+ deviceCount < PA_SNDIO_AUDIODEVICES_MAX) {
-+ if (*device == '\0')
-+ continue;
-+ info = &sndioHostApi->device_info[deviceCount];
-+ InitDeviceInfo(info, hostApiIndex, device);
-+ sndioHostApi->infos[deviceCount] = info;
-+ deviceCount++;
-+ }
-+ }
-+
-+ *hostApi = &sndioHostApi->base;
-+ (*hostApi)->info.structVersion = 1;
-+ (*hostApi)->info.type = paSndio;
-+ (*hostApi)->info.name = "sndio";
-+ (*hostApi)->info.deviceCount = deviceCount;
-+ (*hostApi)->info.defaultInputDevice = 0;
-+ (*hostApi)->info.defaultOutputDevice = 0;
-+ (*hostApi)->deviceInfos = sndioHostApi->infos;
-+ (*hostApi)->Terminate = Terminate;
-+ (*hostApi)->OpenStream = OpenStream;
-+ (*hostApi)->IsFormatSupported = IsFormatSupported;
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->blocking,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ BlockingReadStream,
-+ BlockingWriteStream,
-+ BlockingGetStreamReadAvailable,
-+ BlockingGetStreamWriteAvailable);
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->callback,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ PaUtil_DummyRead,
-+ PaUtil_DummyWrite,
-+ PaUtil_DummyGetReadAvailable,
-+ PaUtil_DummyGetWriteAvailable);
-+
-+ DPR("PaSndio_Initialize: done\n");
-+ return paNoError;
-+}
-diff --git src/os/unix/pa_unix_hostapis.c src/os/unix/pa_unix_hostapis.c
-index a9b4a05..f10ced1 100644
---- src/os/unix/pa_unix_hostapis.c
-+++ 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 );
-@@ -57,6 +58,10 @@ PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiI
-
- PaUtilHostApiInitializer *paHostApiInitializers[] =
- {
-+#ifdef PA_USE_SNDIO
-+ PaSndio_Initialize,
-+#endif
-+
- #ifdef __linux__
-
- #if PA_USE_ALSA
---
-2.27.0
-
diff --git a/srcpkgs/portaudio/template b/srcpkgs/portaudio/template
index 7032f8da9d41..93b90c049b9c 100644
--- a/srcpkgs/portaudio/template
+++ b/srcpkgs/portaudio/template
@@ -1,8 +1,8 @@
# Template file for 'portaudio'
pkgname=portaudio
-version=190600.20161030
-revision=6
-wrksrc=portaudio
+reverts="190600.20161030_6"
+version=19.7.0
+revision=1
build_style=gnu-configure
configure_args="--enable-cxx --with-jack $(vopt_enable sndio)"
hostmakedepends="automake libtool pkg-config"
@@ -11,8 +11,8 @@ short_desc="Portable cross-platform audio I/O library"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="http://www.portaudio.com"
-distfiles="http://www.${pkgname}.com/archives/pa_stable_v${version%.*}_${version#*.}.tgz"
-checksum=f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513
+distfiles="https://github.com/PortAudio/portaudio/archive/v${version}.tar.gz"
+checksum=5af29ba58bbdbb7bbcefaaecc77ec8fc413f0db6f4c4e286c40c3e1b83174fa0
disable_parallel_build=yes
# sndio disabled by default: non-upstream patch
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR REVIEW] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (6 preceding siblings ...)
2021-05-24 12:58 ` [PR PATCH] [Updated] " prez
@ 2021-05-24 12:59 ` prez
2021-05-24 13:02 ` prez
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-05-24 12:59 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 208 bytes --]
New review comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#discussion_r637926842
Comment:
I changed the source location to github and added a `reverts`.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (7 preceding siblings ...)
2021-05-24 12:59 ` [PR REVIEW] " prez
@ 2021-05-24 13:02 ` prez
2021-05-24 13:05 ` prez
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-05-24 13:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 318 bytes --]
New comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#issuecomment-847026749
Comment:
@ericonr
Audacity builds and runs fine.
Are you sure I don't need to revbump anything? Installing 19.7.0 without revbumping and updating xournalpp is impossible, for example.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (8 preceding siblings ...)
2021-05-24 13:02 ` prez
@ 2021-05-24 13:05 ` prez
2021-05-24 14:19 ` [PR REVIEW] " sgn
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-05-24 13:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
New comment by prez on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#issuecomment-847026749
Comment:
@ericonr
Audacity builds and runs fine. (To make the glib error go away, I had to zap masterdir)
Are you sure I don't need to revbump anything? Installing 19.7.0 without revbumping and updating xournalpp is impossible, for example.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR REVIEW] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (9 preceding siblings ...)
2021-05-24 13:05 ` prez
@ 2021-05-24 14:19 ` sgn
2021-05-24 14:36 ` [PR PATCH] [Updated] " prez
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sgn @ 2021-05-24 14:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 262 bytes --]
New review comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#discussion_r637980255
Comment:
`reverts="190600.20161030_1 190600.20161030_2 190600.20161030_3 190600.20161030_4 190600.20161030_5 190600.20161030_6"`
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR PATCH] [Updated] Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (10 preceding siblings ...)
2021-05-24 14:19 ` [PR REVIEW] " sgn
@ 2021-05-24 14:36 ` prez
2022-05-17 2:14 ` github-actions
2022-06-01 2:14 ` [PR PATCH] [Closed]: " github-actions
13 siblings, 0 replies; 15+ messages in thread
From: prez @ 2021-05-24 14:36 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
There is an updated pull request by prez against master on the void-packages repository
https://github.com/prez/void-packages portaudio
https://github.com/void-linux/void-packages/pull/30108
Portaudio 19.7.0
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, (x86_64-musl)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
Edit: removed the audacity and sndio patches as they (potentially) need to be updated.
A patch file from https://github.com/void-linux/void-packages/pull/30108.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-portaudio-30108.patch --]
[-- Type: text/x-diff, Size: 39604 bytes --]
From e4af50fa8b63f84ffef3966732282cb05825fc37 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:23:05 +0200
Subject: [PATCH] portaudio: update to 19.7.0.
---
common/shlibs | 4 +-
.../portaudio/patches/audacity-compat.patch | 344 -------
srcpkgs/portaudio/patches/sndio.patch | 883 ------------------
srcpkgs/portaudio/template | 10 +-
4 files changed, 7 insertions(+), 1234 deletions(-)
delete mode 100644 srcpkgs/portaudio/patches/audacity-compat.patch
delete mode 100644 srcpkgs/portaudio/patches/sndio.patch
diff --git a/common/shlibs b/common/shlibs
index a584fb460e21..1f76c574e210 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1721,8 +1721,8 @@ libxmlsec1-gcrypt.so.1 xmlsec1-1.2.31_2
libxmlsec1-gnutls.so.1 xmlsec1-1.2.31_2
libefivar.so.1 libefivar-31_1
libefiboot.so.1 libefivar-31_1
-libportaudio.so.2 portaudio-19.20140130_1
-libportaudiocpp.so.0 portaudio-cpp-19.20140130_1
+libportaudio.so.2 portaudio-19.7.0_1
+libportaudiocpp.so.0 portaudio-cpp-19.7.0_1
libdar.so.6000 libdar-2.6.6_1
libdar64.so.6000 libdar-2.6.6_1
libpython3.so python3-3.9.2_2
diff --git a/srcpkgs/portaudio/patches/audacity-compat.patch b/srcpkgs/portaudio/patches/audacity-compat.patch
deleted file mode 100644
index ef3b7a482419..000000000000
--- a/srcpkgs/portaudio/patches/audacity-compat.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-Source: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/portaudio-audacity-compat.patch
-Upstream: No
-Reason: Audacity needs Pa_GetStreamHostApiType to use system wide portaudio
-
-
-diff --git configure.in configure.in
-index 13816fb..83c239a 100644
---- configure.in
-+++ configure.in
-@@ -420,6 +420,7 @@ case "${host_os}" in
- DLL_LIBS="$DLL_LIBS -lossaudio"
- LIBS="$LIBS -lossaudio"
- fi
-+ INCLUDES="$INCLUDES pa_unix_oss.h"
- AC_DEFINE(PA_USE_OSS,1)
- fi
-
-diff --git include/pa_unix_oss.h include/pa_unix_oss.h
-new file mode 100644
-index 0000000..64e04cb
---- /dev/null
-+++ include/pa_unix_oss.h
-@@ -0,0 +1,104 @@
-+#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
-+#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
-diff --git include/pa_win_ds.h include/pa_win_ds.h
-index 5d38641..ba1c245 100644
---- include/pa_win_ds.h
-+++ include/pa_win_ds.h
-@@ -86,6 +86,21 @@ typedef struct PaWinDirectSoundStreamInfo{
-
- }PaWinDirectSoundStreamInfo;
-
-+/** Retrieve the GUID of the input device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
-+
-+/** Retrieve the GUID of the output device.
-+
-+ @param stream The stream to query.
-+
-+ @return A pointer to the GUID, or NULL if none.
-+*/
-+LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
-
-
- #ifdef __cplusplus
-diff --git include/portaudio.h include/portaudio.h
-index 8a94aaf..9c8a295 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -1197,6 +1197,15 @@ signed long Pa_GetStreamReadAvailable( PaStream* stream );
- 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 */
-
-
-diff --git src/common/pa_front.c src/common/pa_front.c
-index 188cee9..52f44a6 100644
---- src/common/pa_front.c
-+++ src/common/pa_front.c
-@@ -1257,8 +1257,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" ));
-@@ -1770,6 +1772,32 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stream )
- 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 )
- {
-diff --git src/common/pa_stream.c src/common/pa_stream.c
-index 03a0ee6..c4376f9 100644
---- src/common/pa_stream.c
-+++ src/common/pa_stream.c
-@@ -93,6 +93,8 @@ void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe
- streamRepresentation->streamInfo.inputLatency = 0.;
- streamRepresentation->streamInfo.outputLatency = 0.;
- streamRepresentation->streamInfo.sampleRate = 0.;
-+
-+ streamRepresentation->hostApiType = 0;
- }
-
-
-diff --git src/common/pa_stream.h src/common/pa_stream.h
-index 678e2ad..70572c7 100644
---- src/common/pa_stream.h
-+++ src/common/pa_stream.h
-@@ -152,6 +152,7 @@ typedef struct PaUtilStreamRepresentation {
- PaStreamFinishedCallback *streamFinishedCallback;
- void *userData;
- PaStreamInfo streamInfo;
-+ PaHostApiTypeId hostApiType;
- } PaUtilStreamRepresentation;
-
-
-diff --git src/hostapi/alsa/pa_linux_alsa.c src/hostapi/alsa/pa_linux_alsa.c
-index 584cde8..558fb3d 100644
---- src/hostapi/alsa/pa_linux_alsa.c
-+++ src/hostapi/alsa/pa_linux_alsa.c
-@@ -621,6 +621,7 @@ typedef struct
- StreamDirection streamDir;
-
- snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
-+ int card;
- } PaAlsaStreamComponent;
-
- /* Implementation specific stream structure */
-@@ -1873,6 +1874,7 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- {
- PaError result = paNoError;
- PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
-+ snd_pcm_info_t* pcmInfo;
- assert( params->channelCount > 0 );
-
- /* Make sure things have an initial value */
-@@ -1900,6 +1902,9 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa
- self->device = params->device;
-
- PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
-+
-+ snd_pcm_info_alloca( &pcmInfo );
-+ self->card = snd_pcm_info_get_card( pcmInfo );
- self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
-
- PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
-@@ -4605,9 +4610,7 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->capture.card;
-
- error:
- return result;
-@@ -4624,9 +4627,7 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
- /* XXX: More descriptive error? */
- PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
-
-- alsa_snd_pcm_info_alloca( &pcmInfo );
-- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
-- *card = alsa_snd_pcm_info_get_card( pcmInfo );
-+ *card = stream->playback.card;
-
- error:
- return result;
-diff --git src/hostapi/coreaudio/pa_mac_core_blocking.c src/hostapi/coreaudio/pa_mac_core_blocking.c
-index 679c6ba..a69e085 100644
---- src/hostapi/coreaudio/pa_mac_core_blocking.c
-+++ src/hostapi/coreaudio/pa_mac_core_blocking.c
-@@ -66,6 +66,9 @@
- #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
- # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
- # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
-+#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
-+# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
-+# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
- #else
- # include <libkern/OSAtomic.h>
- #endif
-diff --git src/hostapi/oss/pa_unix_oss.c src/hostapi/oss/pa_unix_oss.c
-index 51e9630..f257d80 100644
---- src/hostapi/oss/pa_unix_oss.c
-+++ src/hostapi/oss/pa_unix_oss.c
-@@ -2043,3 +2043,26 @@ error:
- #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;
-+}
diff --git a/srcpkgs/portaudio/patches/sndio.patch b/srcpkgs/portaudio/patches/sndio.patch
deleted file mode 100644
index 7e43e3fcedd3..000000000000
--- a/srcpkgs/portaudio/patches/sndio.patch
+++ /dev/null
@@ -1,883 +0,0 @@
-diff --git Makefile.in Makefile.in
-index 5e1a764..2747f73 100644
---- Makefile.in
-+++ Makefile.in
-@@ -44,7 +44,7 @@ PALIB = libportaudio.la
- PAINC = include/portaudio.h
-
- PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
-- -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS)_.*" \
-+ -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio|PaOSS|PaSndio)_.*" \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
- COMMON_OBJS = \
-@@ -146,6 +146,7 @@ SRC_DIRS = \
- src/hostapi/dsound \
- src/hostapi/jack \
- src/hostapi/oss \
-+ src/hostapi/sndio \
- src/hostapi/wasapi \
- src/hostapi/wdmks \
- src/hostapi/wmme \
-diff --git configure.in configure.in
-index 83c239a..db11d65 100644
---- configure.in
-+++ configure.in
-@@ -24,6 +24,10 @@ AC_ARG_WITH(alsa,
- AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
- [with_alsa=$withval])
-
-+AC_ARG_WITH(sndio,
-+ AS_HELP_STRING([--with-sndio], [Enable support for sndio @<:@autodetect@:>@]),
-+ [with_sndio=$withval])
-+
- AC_ARG_WITH(jack,
- AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
- [with_jack=$withval])
-@@ -120,6 +124,10 @@ have_alsa=no
- if test "x$with_alsa" != "xno"; then
- AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
- fi
-+have_sndio=no
-+if test "x$with_sndio" != "xno"; then
-+ AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
-+fi
- have_asihpi=no
- if test "x$with_asihpi" != "xno"; then
- AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
-@@ -406,6 +414,13 @@ case "${host_os}" in
- AC_DEFINE(PA_USE_ALSA,1)
- fi
-
-+ if [[ "$have_sndio" = "yes" -a "$with_sndio" != "no" ]] ; then
-+ DLL_LIBS="$DLL_LIBS -lsndio"
-+ LIBS="$LIBS -lsndio"
-+ OTHER_OBJS="$OTHER_OBJS src/hostapi/sndio/pa_sndio.o"
-+ AC_DEFINE(PA_USE_SNDIO,1)
-+ fi
-+
- if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
- DLL_LIBS="$DLL_LIBS $JACK_LIBS"
- CFLAGS="$CFLAGS $JACK_CFLAGS"
-@@ -510,6 +525,7 @@ case "$target_os" in
- ;;
- *)
- AC_MSG_RESULT([
-+ Sndio ....................... $have_sndio
- OSS ......................... $have_oss
- JACK ........................ $have_jack
- ])
-diff --git include/portaudio.h include/portaudio.h
-index 9c8a295..e535a02 100644
---- include/portaudio.h
-+++ include/portaudio.h
-@@ -287,7 +287,8 @@ typedef enum PaHostApiTypeId
- paWDMKS=11,
- paJACK=12,
- paWASAPI=13,
-- paAudioScienceHPI=14
-+ paAudioScienceHPI=14,
-+ paSndio=15
- } PaHostApiTypeId;
-
-
-diff --git src/hostapi/sndio/pa_sndio.c src/hostapi/sndio/pa_sndio.c
-new file mode 100644
-index 0000000..725ef47
---- /dev/null
-+++ src/hostapi/sndio/pa_sndio.c
-@@ -0,0 +1,768 @@
-+/*
-+ * Copyright (c) 2009 Alexandre Ratchov <alex@caoua.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+#include <sys/types.h>
-+#include <pthread.h>
-+#include <poll.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <sndio.h>
-+
-+#include "pa_util.h"
-+#include "pa_hostapi.h"
-+#include "pa_stream.h"
-+#include "pa_process.h"
-+#include "pa_allocation.h"
-+
-+#if 0
-+#define DPR(...) do { fprintf(stderr, __VA_ARGS__); } while (0)
-+#else
-+#define DPR(...) do {} while (0)
-+#endif
-+
-+/*
-+ * per-stream data
-+ */
-+typedef struct PaSndioStream
-+{
-+ PaUtilStreamRepresentation base;
-+ PaUtilBufferProcessor bufproc; /* format conversion */
-+ struct sio_hdl *hdl; /* handle for device i/o */
-+ struct sio_par par; /* current device parameters */
-+ unsigned mode; /* SIO_PLAY, SIO_REC or both */
-+ int stopped; /* stop requested or not started */
-+ int active; /* thread is running */
-+ unsigned long long realpos; /* frame number h/w is processing */
-+ char *rbuf, *wbuf; /* bounce buffers for conversions */
-+ unsigned long long rpos, wpos; /* bytes read/written */
-+ pthread_t thread; /* thread of the callback interface */
-+} PaSndioStream;
-+
-+/*
-+ * api "class" data, common to all streams
-+ */
-+typedef struct PaSndioHostApiRepresentation
-+{
-+ PaUtilHostApiRepresentation base;
-+ PaUtilStreamInterface callback;
-+ PaUtilStreamInterface blocking;
-+ /*
-+ * sndio has no device discovery mechanism and PortAudio has
-+ * no way of accepting raw device strings from users.
-+ * Normally we just expose the default device, which can be
-+ * changed via the AUDIODEVICE environment variable, but we
-+ * also allow specifying a list of up to 16 devices via the
-+ * PA_SNDIO_AUDIODEVICES environment variable.
-+ *
-+ * Example:
-+ * PA_SNDIO_AUDIODEVICES=default:snd/0.monitor:snd@remote/0
-+ */
-+#define PA_SNDIO_AUDIODEVICES_MAX 16
-+ PaDeviceInfo device_info[PA_SNDIO_AUDIODEVICES_MAX];
-+ PaDeviceInfo *infos[PA_SNDIO_AUDIODEVICES_MAX];
-+ char *audiodevices;
-+} PaSndioHostApiRepresentation;
-+
-+/*
-+ * callback invoked when blocks are processed by the hardware
-+ */
-+static void
-+sndioOnMove(void *addr, int delta)
-+{
-+ PaSndioStream *s = (PaSndioStream *)addr;
-+
-+ s->realpos += delta;
-+}
-+
-+/*
-+ * convert PA encoding to sndio encoding, return true on success
-+ */
-+static int
-+sndioSetFmt(struct sio_par *sio, PaSampleFormat fmt)
-+{
-+ switch (fmt & ~paNonInterleaved) {
-+ case paInt32:
-+ sio->sig = 1;
-+ sio->bits = 32;
-+ break;
-+ case paInt24:
-+ sio->sig = 1;
-+ sio->bits = 24;
-+ sio->bps = 3; /* paInt24 is packed format */
-+ break;
-+ case paInt16:
-+ case paFloat32:
-+ sio->sig = 1;
-+ sio->bits = 16;
-+ break;
-+ case paInt8:
-+ sio->sig = 1;
-+ sio->bits = 8;
-+ break;
-+ case paUInt8:
-+ sio->sig = 0;
-+ sio->bits = 8;
-+ break;
-+ default:
-+ DPR("sndioSetFmt: %x: unsupported\n", fmt);
-+ return 0;
-+ }
-+ sio->le = SIO_LE_NATIVE;
-+ return 1;
-+}
-+
-+/*
-+ * convert sndio encoding to PA encoding, return true on success
-+ */
-+static int
-+sndioGetFmt(struct sio_par *sio, PaSampleFormat *fmt)
-+{
-+ if ((sio->bps * 8 != sio->bits && !sio->msb) ||
-+ (sio->bps > 1 && sio->le != SIO_LE_NATIVE)) {
-+ DPR("sndioGetFmt: bits = %u, le = %u, msb = %u, bps = %u\n",
-+ sio->bits, sio->le, sio->msb, sio->bps);
-+ return 0;
-+ }
-+
-+ switch (sio->bits) {
-+ case 32:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt32;
-+ break;
-+ case 24:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = (sio->bps == 3) ? paInt24 : paInt32;
-+ break;
-+ case 16:
-+ if (!sio->sig)
-+ return 0;
-+ *fmt = paInt16;
-+ break;
-+ case 8:
-+ *fmt = sio->sig ? paInt8 : paUInt8;
-+ break;
-+ default:
-+ DPR("sndioGetFmt: %u: unsupported\n", sio->bits);
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+/*
-+ * I/O loop for callback interface
-+ */
-+static void *
-+sndioThread(void *arg)
-+{
-+ PaSndioStream *s = (PaSndioStream *)arg;
-+ PaStreamCallbackTimeInfo ti;
-+ unsigned char *data;
-+ unsigned todo, rblksz, wblksz;
-+ int n, result;
-+
-+ rblksz = s->par.round * s->par.rchan * s->par.bps;
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+
-+ DPR("sndioThread: mode = %x, round = %u, rblksz = %u, wblksz = %u\n",
-+ s->mode, s->par.round, rblksz, wblksz);
-+
-+ while (!s->stopped) {
-+ if (s->mode & SIO_REC) {
-+ todo = rblksz;
-+ data = s->rbuf;
-+ while (todo > 0) {
-+ n = sio_read(s->hdl, data, todo);
-+ if (n == 0) {
-+ DPR("sndioThread: sio_read failed\n");
-+ goto failed;
-+ }
-+ todo -= n;
-+ data += n;
-+ }
-+ s->rpos += s->par.round;
-+ ti.inputBufferAdcTime =
-+ (double)s->realpos / s->par.rate;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ ti.outputBufferDacTime =
-+ (double)(s->realpos + s->par.bufsz) / s->par.rate;
-+ }
-+ ti.currentTime = s->realpos / (double)s->par.rate;
-+ PaUtil_BeginBufferProcessing(&s->bufproc, &ti, 0);
-+ if (s->mode & SIO_PLAY) {
-+ PaUtil_SetOutputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc,
-+ 0, s->wbuf, s->par.pchan);
-+ }
-+ if (s->mode & SIO_REC) {
-+ PaUtil_SetInputFrameCount(&s->bufproc, s->par.round);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc,
-+ 0, s->rbuf, s->par.rchan);
-+ }
-+ result = paContinue;
-+ n = PaUtil_EndBufferProcessing(&s->bufproc, &result);
-+ if (n != s->par.round) {
-+ DPR("sndioThread: %d < %u frames, result = %d\n",
-+ n, s->par.round, result);
-+ }
-+ if (result != paContinue) {
-+ break;
-+ }
-+ if (s->mode & SIO_PLAY) {
-+ n = sio_write(s->hdl, s->wbuf, wblksz);
-+ if (n < wblksz) {
-+ DPR("sndioThread: sio_write failed\n");
-+ goto failed;
-+ }
-+ s->wpos += s->par.round;
-+ }
-+ }
-+ failed:
-+ s->active = 0;
-+ DPR("sndioThread: done\n");
-+}
-+
-+static PaError
-+OpenStream(struct PaUtilHostApiRepresentation *hostApi,
-+ PaStream **stream,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate,
-+ unsigned long framesPerBuffer,
-+ PaStreamFlags streamFlags,
-+ PaStreamCallback *streamCallback,
-+ void *userData)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ PaSndioStream *s;
-+ PaError err;
-+ struct sio_hdl *hdl;
-+ struct sio_par par;
-+ unsigned mode;
-+ int inch, onch;
-+ PaSampleFormat ifmt, ofmt, siofmt;
-+ const char *dev;
-+
-+ DPR("OpenStream:\n");
-+
-+ mode = 0;
-+ inch = onch = 0;
-+ ifmt = ofmt = 0;
-+ sio_initpar(&par);
-+
-+ if (outputPar && outputPar->channelCount > 0) {
-+ if (outputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad output device\n", outputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (outputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: output specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, outputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ofmt = outputPar->sampleFormat;
-+ onch = par.pchan = outputPar->channelCount;
-+ mode |= SIO_PLAY;
-+ }
-+ if (inputPar && inputPar->channelCount > 0) {
-+ if (inputPar->device >= sndioHostApi->base.info.deviceCount) {
-+ DPR("OpenStream: %d: bad input device\n", inputPar->device);
-+ return paInvalidDevice;
-+ }
-+ if (inputPar->hostApiSpecificStreamInfo) {
-+ DPR("OpenStream: input specific info\n");
-+ return paIncompatibleHostApiSpecificStreamInfo;
-+ }
-+ if (!sndioSetFmt(&par, inputPar->sampleFormat)) {
-+ return paSampleFormatNotSupported;
-+ }
-+ ifmt = inputPar->sampleFormat;
-+ inch = par.rchan = inputPar->channelCount;
-+ mode |= SIO_REC;
-+ }
-+ par.rate = sampleRate;
-+ if (framesPerBuffer != paFramesPerBufferUnspecified)
-+ par.round = framesPerBuffer;
-+
-+ DPR("OpenStream: mode = %x, trying rate = %u\n", mode, par.rate);
-+
-+ if (outputPar) {
-+ dev = sndioHostApi->device_info[outputPar->device].name;
-+ } else if (inputPar) {
-+ dev = sndioHostApi->device_info[inputPar->device].name;
-+ } else {
-+ return paUnanticipatedHostError;
-+ }
-+ hdl = sio_open(dev, mode, 0);
-+ if (hdl == NULL)
-+ return paUnanticipatedHostError;
-+ if (!sio_setpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sio_getpar(hdl, &par)) {
-+ sio_close(hdl);
-+ return paUnanticipatedHostError;
-+ }
-+ if (!sndioGetFmt(&par, &siofmt)) {
-+ sio_close(hdl);
-+ return paSampleFormatNotSupported;
-+ }
-+ if ((mode & SIO_REC) && par.rchan != inputPar->channelCount) {
-+ DPR("OpenStream: rchan(%u) != %d\n", par.rchan, inputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((mode & SIO_PLAY) && par.pchan != outputPar->channelCount) {
-+ DPR("OpenStream: pchan(%u) != %d\n", par.pchan, outputPar->channelCount);
-+ sio_close(hdl);
-+ return paInvalidChannelCount;
-+ }
-+ if ((double)par.rate < sampleRate * 0.995 ||
-+ (double)par.rate > sampleRate * 1.005) {
-+ DPR("OpenStream: rate(%u) != %g\n", par.rate, sampleRate);
-+ sio_close(hdl);
-+ return paInvalidSampleRate;
-+ }
-+
-+ s = (PaSndioStream *)PaUtil_AllocateMemory(sizeof(PaSndioStream));
-+ if (s == NULL) {
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ PaUtil_InitializeStreamRepresentation(&s->base,
-+ streamCallback ? &sndioHostApi->callback : &sndioHostApi->blocking,
-+ streamCallback, userData);
-+ DPR("inch = %d, onch = %d, ifmt = %x, ofmt = %x\n",
-+ inch, onch, ifmt, ofmt);
-+ err = PaUtil_InitializeBufferProcessor(&s->bufproc,
-+ inch, ifmt, siofmt,
-+ onch, ofmt, siofmt,
-+ sampleRate,
-+ streamFlags,
-+ framesPerBuffer,
-+ par.round,
-+ paUtilFixedHostBufferSize,
-+ streamCallback, userData);
-+ if (err) {
-+ DPR("OpenStream: PaUtil_InitializeBufferProcessor failed\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return err;
-+ }
-+ if (mode & SIO_REC) {
-+ s->rbuf = malloc(par.round * par.rchan * par.bps);
-+ if (s->rbuf == NULL) {
-+ DPR("OpenStream: failed to allocate rbuf\n");
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ if (mode & SIO_PLAY) {
-+ s->wbuf = malloc(par.round * par.pchan * par.bps);
-+ if (s->wbuf == NULL) {
-+ DPR("OpenStream: failed to allocate wbuf\n");
-+ free(s->rbuf);
-+ PaUtil_FreeMemory(s);
-+ sio_close(hdl);
-+ return paInsufficientMemory;
-+ }
-+ }
-+ s->base.streamInfo.inputLatency = 0;
-+ s->base.streamInfo.outputLatency = (mode & SIO_PLAY) ?
-+ (double)(par.bufsz + PaUtil_GetBufferProcessorOutputLatencyFrames(&s->bufproc)) / (double)par.rate : 0;
-+ s->base.streamInfo.sampleRate = par.rate;
-+ s->active = 0;
-+ s->stopped = 1;
-+ s->mode = mode;
-+ s->hdl = hdl;
-+ s->par = par;
-+ *stream = s;
-+ DPR("OpenStream: done\n");
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingReadStream(PaStream *stream, void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res, todo;
-+ void *buf;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ buf = s->rbuf;
-+ todo = n * s->par.rchan * s->par.bps;
-+ while (todo > 0) {
-+ res = sio_read(s->hdl, buf, todo);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ buf = (char *)buf + res;
-+ todo -= res;
-+ }
-+ s->rpos += n;
-+ PaUtil_SetInputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedInputChannels(&s->bufproc, 0, s->rbuf, s->par.rchan);
-+ res = PaUtil_CopyInput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingReadStream: copyInput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+BlockingWriteStream(PaStream* stream, const void *data, unsigned long numFrames)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned n, res;
-+
-+ while (numFrames > 0) {
-+ n = s->par.round;
-+ if (n > numFrames)
-+ n = numFrames;
-+ PaUtil_SetOutputFrameCount(&s->bufproc, n);
-+ PaUtil_SetInterleavedOutputChannels(&s->bufproc, 0, s->wbuf, s->par.pchan);
-+ res = PaUtil_CopyOutput(&s->bufproc, &data, n);
-+ if (res != n) {
-+ DPR("BlockingWriteStream: copyOutput: %u != %u\n");
-+ return paUnanticipatedHostError;
-+ }
-+ res = sio_write(s->hdl, s->wbuf, n * s->par.pchan * s->par.bps);
-+ if (res == 0)
-+ return paUnanticipatedHostError;
-+ s->wpos += n;
-+ numFrames -= n;
-+ }
-+ return paNoError;
-+}
-+
-+static signed long
-+BlockingGetStreamReadAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLIN);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLIN))
-+ return 0;
-+
-+ return s->realpos - s->rpos;
-+}
-+
-+static signed long
-+BlockingGetStreamWriteAvailable(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ struct pollfd pfd;
-+ int n, events;
-+
-+ n = sio_pollfd(s->hdl, &pfd, POLLOUT);
-+ while (poll(&pfd, n, 0) < 0) {
-+ if (errno == EINTR)
-+ continue;
-+ perror("poll");
-+ abort();
-+ }
-+ events = sio_revents(s->hdl, &pfd);
-+ if (!(events & POLLOUT))
-+ return 0;
-+
-+ return s->par.bufsz - (s->wpos - s->realpos);
-+}
-+
-+static PaError
-+BlockingWaitEmpty( PaStream *stream )
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ /*
-+ * drain playback buffers; sndio always does it in background
-+ * and there is no way to wait for completion
-+ */
-+ DPR("BlockingWaitEmpty: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return paNoError;
-+}
-+
-+static PaError
-+StartStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ unsigned primes, wblksz;
-+ int err;
-+
-+ DPR("StartStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (!s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 0;
-+ s->active = 1;
-+ s->realpos = 0;
-+ s->wpos = 0;
-+ s->rpos = 0;
-+ PaUtil_ResetBufferProcessor(&s->bufproc);
-+ if (!sio_start(s->hdl))
-+ return paUnanticipatedHostError;
-+
-+ /*
-+ * send a complete buffer of silence
-+ */
-+ if (s->mode & SIO_PLAY) {
-+ wblksz = s->par.round * s->par.pchan * s->par.bps;
-+ memset(s->wbuf, 0, wblksz);
-+ for (primes = s->par.bufsz / s->par.round; primes > 0; primes--)
-+ s->wpos += sio_write(s->hdl, s->wbuf, wblksz);
-+ }
-+ if (s->base.streamCallback) {
-+ err = pthread_create(&s->thread, NULL, sndioThread, s);
-+ if (err) {
-+ DPR("SndioStartStream: couldn't create thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ DPR("StartStream: started...\n");
-+ }
-+ return paNoError;
-+}
-+
-+static PaError
-+StopStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+ void *ret;
-+ int err;
-+
-+ DPR("StopStream: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ if (s->stopped) {
-+ DPR("StartStream: already started\n");
-+ return paNoError;
-+ }
-+ s->stopped = 1;
-+ if (s->base.streamCallback) {
-+ err = pthread_join(s->thread, &ret);
-+ if (err) {
-+ DPR("SndioStop: couldn't join thread\n");
-+ return paUnanticipatedHostError;
-+ }
-+ }
-+ if (!sio_stop(s->hdl))
-+ return paUnanticipatedHostError;
-+ return paNoError;
-+}
-+
-+static PaError
-+CloseStream(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ DPR("CloseStream:\n");
-+
-+ if (!s->stopped)
-+ StopStream(stream);
-+
-+ if (s->mode & SIO_REC)
-+ free(s->rbuf);
-+ if (s->mode & SIO_PLAY)
-+ free(s->wbuf);
-+ sio_close(s->hdl);
-+ PaUtil_TerminateStreamRepresentation(&s->base);
-+ PaUtil_TerminateBufferProcessor(&s->bufproc);
-+ PaUtil_FreeMemory(s);
-+ return paNoError;
-+}
-+
-+static PaError
-+AbortStream(PaStream *stream)
-+{
-+ DPR("AbortStream:\n");
-+
-+ return StopStream(stream);
-+}
-+
-+static PaError
-+IsStreamStopped(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamStopped: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->stopped;
-+}
-+
-+static PaError
-+IsStreamActive(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ //DPR("IsStreamActive: s=%d, a=%d\n", s->stopped, s->active);
-+
-+ return s->active;
-+}
-+
-+static PaTime
-+GetStreamTime(PaStream *stream)
-+{
-+ PaSndioStream *s = (PaSndioStream *)stream;
-+
-+ return (double)s->realpos / s->base.streamInfo.sampleRate;
-+}
-+
-+static PaError
-+IsFormatSupported(struct PaUtilHostApiRepresentation *hostApi,
-+ const PaStreamParameters *inputPar,
-+ const PaStreamParameters *outputPar,
-+ double sampleRate)
-+{
-+ return paFormatIsSupported;
-+}
-+
-+static void
-+Terminate(struct PaUtilHostApiRepresentation *hostApi)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
-+ free(sndioHostApi->audiodevices);
-+ PaUtil_FreeMemory(hostApi);
-+}
-+
-+static void
-+InitDeviceInfo(PaDeviceInfo *info, PaHostApiIndex hostApiIndex, const char *name)
-+{
-+ info->structVersion = 2;
-+ info->name = name;
-+ info->hostApi = hostApiIndex;
-+ info->maxInputChannels = 128;
-+ info->maxOutputChannels = 128;
-+ info->defaultLowInputLatency = 0.01;
-+ info->defaultLowOutputLatency = 0.01;
-+ info->defaultHighInputLatency = 0.5;
-+ info->defaultHighOutputLatency = 0.5;
-+ info->defaultSampleRate = 48000;
-+}
-+
-+PaError
-+PaSndio_Initialize(PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
-+{
-+ PaSndioHostApiRepresentation *sndioHostApi;
-+ PaDeviceInfo *info;
-+ struct sio_hdl *hdl;
-+ char *audiodevices;
-+ char *device;
-+ size_t deviceCount;
-+
-+ DPR("PaSndio_Initialize: initializing...\n");
-+
-+ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) == NULL)
-+ return paNoError;
-+ sio_close(hdl);
-+ /* unusable APIs should return paNoError and a NULL hostApi */
-+ *hostApi = NULL;
-+
-+ sndioHostApi = PaUtil_AllocateMemory(sizeof(PaSndioHostApiRepresentation));
-+ if (sndioHostApi == NULL)
-+ return paNoError;
-+
-+ // Add default device
-+ info = &sndioHostApi->device_info[0];
-+ InitDeviceInfo(info, hostApiIndex, SIO_DEVANY);
-+ sndioHostApi->infos[0] = info;
-+ deviceCount = 1;
-+
-+ // Add additional devices as specified in the PA_SNDIO_AUDIODEVICES
-+ // environment variable as a colon separated list
-+ sndioHostApi->audiodevices = NULL;
-+ audiodevices = getenv("PA_SNDIO_AUDIODEVICES");
-+ if (audiodevices != NULL) {
-+ sndioHostApi->audiodevices = strdup(audiodevices);
-+ if (sndioHostApi->audiodevices == NULL)
-+ return paNoError;
-+
-+ audiodevices = sndioHostApi->audiodevices;
-+ while ((device = strsep(&audiodevices, ":")) != NULL &&
-+ deviceCount < PA_SNDIO_AUDIODEVICES_MAX) {
-+ if (*device == '\0')
-+ continue;
-+ info = &sndioHostApi->device_info[deviceCount];
-+ InitDeviceInfo(info, hostApiIndex, device);
-+ sndioHostApi->infos[deviceCount] = info;
-+ deviceCount++;
-+ }
-+ }
-+
-+ *hostApi = &sndioHostApi->base;
-+ (*hostApi)->info.structVersion = 1;
-+ (*hostApi)->info.type = paSndio;
-+ (*hostApi)->info.name = "sndio";
-+ (*hostApi)->info.deviceCount = deviceCount;
-+ (*hostApi)->info.defaultInputDevice = 0;
-+ (*hostApi)->info.defaultOutputDevice = 0;
-+ (*hostApi)->deviceInfos = sndioHostApi->infos;
-+ (*hostApi)->Terminate = Terminate;
-+ (*hostApi)->OpenStream = OpenStream;
-+ (*hostApi)->IsFormatSupported = IsFormatSupported;
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->blocking,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ BlockingReadStream,
-+ BlockingWriteStream,
-+ BlockingGetStreamReadAvailable,
-+ BlockingGetStreamWriteAvailable);
-+
-+ PaUtil_InitializeStreamInterface(&sndioHostApi->callback,
-+ CloseStream,
-+ StartStream,
-+ StopStream,
-+ AbortStream,
-+ IsStreamStopped,
-+ IsStreamActive,
-+ GetStreamTime,
-+ PaUtil_DummyGetCpuLoad,
-+ PaUtil_DummyRead,
-+ PaUtil_DummyWrite,
-+ PaUtil_DummyGetReadAvailable,
-+ PaUtil_DummyGetWriteAvailable);
-+
-+ DPR("PaSndio_Initialize: done\n");
-+ return paNoError;
-+}
-diff --git src/os/unix/pa_unix_hostapis.c src/os/unix/pa_unix_hostapis.c
-index a9b4a05..f10ced1 100644
---- src/os/unix/pa_unix_hostapis.c
-+++ 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 );
-@@ -57,6 +58,10 @@ PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiI
-
- PaUtilHostApiInitializer *paHostApiInitializers[] =
- {
-+#ifdef PA_USE_SNDIO
-+ PaSndio_Initialize,
-+#endif
-+
- #ifdef __linux__
-
- #if PA_USE_ALSA
---
-2.27.0
-
diff --git a/srcpkgs/portaudio/template b/srcpkgs/portaudio/template
index 7032f8da9d41..bdaab6030457 100644
--- a/srcpkgs/portaudio/template
+++ b/srcpkgs/portaudio/template
@@ -1,8 +1,8 @@
# Template file for 'portaudio'
pkgname=portaudio
-version=190600.20161030
-revision=6
-wrksrc=portaudio
+reverts="190600.20161030_1 190600.20161030_2 190600.20161030_3 190600.20161030_4 190600.20161030_5 190600.20161030_6"
+version=19.7.0
+revision=1
build_style=gnu-configure
configure_args="--enable-cxx --with-jack $(vopt_enable sndio)"
hostmakedepends="automake libtool pkg-config"
@@ -11,8 +11,8 @@ short_desc="Portable cross-platform audio I/O library"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="http://www.portaudio.com"
-distfiles="http://www.${pkgname}.com/archives/pa_stable_v${version%.*}_${version#*.}.tgz"
-checksum=f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513
+distfiles="https://github.com/PortAudio/portaudio/archive/v${version}.tar.gz"
+checksum=5af29ba58bbdbb7bbcefaaecc77ec8fc413f0db6f4c4e286c40c3e1b83174fa0
disable_parallel_build=yes
# sndio disabled by default: non-upstream patch
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (11 preceding siblings ...)
2021-05-24 14:36 ` [PR PATCH] [Updated] " prez
@ 2022-05-17 2:14 ` github-actions
2022-06-01 2:14 ` [PR PATCH] [Closed]: " github-actions
13 siblings, 0 replies; 15+ messages in thread
From: github-actions @ 2022-05-17 2:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/30108#issuecomment-1128327739
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PR PATCH] [Closed]: Portaudio 19.7.0
2021-04-09 9:54 [PR PATCH] Portaudio 19.7.0 prez
` (12 preceding siblings ...)
2022-05-17 2:14 ` github-actions
@ 2022-06-01 2:14 ` github-actions
13 siblings, 0 replies; 15+ messages in thread
From: github-actions @ 2022-06-01 2:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]
There's a closed pull request on the void-packages repository
Portaudio 19.7.0
https://github.com/void-linux/void-packages/pull/30108
Description:
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, (x86_64-musl)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
Edit: removed the audacity and sndio patches as they (potentially) need to be updated.
^ permalink raw reply [flat|nested] 15+ messages in thread