Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Portaudio 19.7.0
@ 2021-04-09  9:54 prez
  2021-04-09 13:06 ` ericonr
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: prez @ 2021-04-09  9:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]

There is a new 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
-->


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: 54075 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 01/22] 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

From a7f0eebf7931ce2ee2ec540628469ea8d9bd7388 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:40:26 +0200
Subject: [PATCH 02/22] OpenCPN: bump for portaudo 19.7.0

---
 srcpkgs/OpenCPN/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/OpenCPN/template b/srcpkgs/OpenCPN/template
index ee67dbaff01c..93aa892056b3 100644
--- a/srcpkgs/OpenCPN/template
+++ b/srcpkgs/OpenCPN/template
@@ -1,7 +1,7 @@
 # Template file for 'OpenCPN'
 pkgname=OpenCPN
 version=5.2.0
-revision=2
+revision=3
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3
 configure_args="-DOCPN_BUNDLE_GSHHS=NONE -DOCPN_BUNDLE_TCDATA=ON

From 92b59b3fae7e8bf1f43fead06c6e0399d61f08d2 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:40:54 +0200
Subject: [PATCH 03/22] butt: bump for portaudo 19.7.0

---
 srcpkgs/butt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/butt/template b/srcpkgs/butt/template
index 0ad1ad90e114..1a6befb491cc 100644
--- a/srcpkgs/butt/template
+++ b/srcpkgs/butt/template
@@ -1,7 +1,7 @@
 # Template file for 'butt'
 pkgname=butt
 version=0.1.29
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fltk-devel portaudio-devel lame-devel libvorbis-devel libogg-devel

From fa97e4d6ee2f0f5df117d302439682e926451b19 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:40:58 +0200
Subject: [PATCH 04/22] csound: bump for portaudo 19.7.0

---
 srcpkgs/csound/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/csound/template b/srcpkgs/csound/template
index b4c67632ca8a..f02f97bc6325 100644
--- a/srcpkgs/csound/template
+++ b/srcpkgs/csound/template
@@ -1,7 +1,7 @@
 # Template file for 'csound'
 pkgname=csound
 version=6.15.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DLUA_MODULE_INSTALL_DIR=${XBPS_CROSS_BASE}/usr/lib/lua/5.1

From 6bd69b5341a7b39679052cb14df4a3b4f76754f0 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:02 +0200
Subject: [PATCH 05/22] fldigi: bump for portaudo 19.7.0

---
 srcpkgs/fldigi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fldigi/template b/srcpkgs/fldigi/template
index 098d0431c497..01c9febab5d7 100644
--- a/srcpkgs/fldigi/template
+++ b/srcpkgs/fldigi/template
@@ -1,7 +1,7 @@
 # Template file for 'fldigi'
 pkgname=fldigi
 version=4.1.13
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="fltk-devel libsamplerate-devel portaudio-devel pulseaudio-devel

From 67d01bb66a2e596788dc48baf0dbbc8e7939a974 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:07 +0200
Subject: [PATCH 06/22] fmit: bump for portaudo 19.7.0

---
 srcpkgs/fmit/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fmit/template b/srcpkgs/fmit/template
index 246dceb594d3..ebceaa43ffc3 100644
--- a/srcpkgs/fmit/template
+++ b/srcpkgs/fmit/template
@@ -1,7 +1,7 @@
 # Template file for 'fmit'
 pkgname=fmit
 version=1.2.14
-revision=1
+revision=2
 build_style=qmake
 configure_args="CONFIG+=acs_qt CONFIG+=$(vopt_if alsa acs_alsa)
  CONFIG+=$(vopt_if jack acs_jack) CONFIG+=$(vopt_if portaudio acs_portaudio)"

From 7b0b2f94e5d3650c04bb07528630f4b9fc0986bc Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:15 +0200
Subject: [PATCH 07/22] guvcview: bump for portaudo 19.7.0

---
 srcpkgs/guvcview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/guvcview/template b/srcpkgs/guvcview/template
index 447b27aecf50..23bab6da7a38 100644
--- a/srcpkgs/guvcview/template
+++ b/srcpkgs/guvcview/template
@@ -1,7 +1,7 @@
 # Template file for 'guvcview'
 pkgname=guvcview
 version=2.0.6
-revision=2
+revision=3
 wrksrc="${pkgname}-src-${version}"
 build_style=gnu-configure
 configure_args="--disable-static --disable-debian-menu"

From 937f819f1fc031e857a4787f10a71e7637f62a8d Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:21 +0200
Subject: [PATCH 08/22] hatari: bump for portaudo 19.7.0

---
 srcpkgs/hatari/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/hatari/template b/srcpkgs/hatari/template
index e05e77961d60..2b5de9f9f6c4 100644
--- a/srcpkgs/hatari/template
+++ b/srcpkgs/hatari/template
@@ -1,7 +1,7 @@
 # Template file for 'hatari'
 pkgname=hatari
 version=2.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config python3"
 makedepends="SDL2-devel libpng-devel portaudio-devel zlib-devel"

From 2bdd1dad1c7882bda3d4c2704e94740c38ae5c37 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:29 +0200
Subject: [PATCH 09/22] libopenmpt: bump for portaudo 19.7.0

---
 srcpkgs/libopenmpt/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libopenmpt/template b/srcpkgs/libopenmpt/template
index d9ba1879ff41..d461397ac6a4 100644
--- a/srcpkgs/libopenmpt/template
+++ b/srcpkgs/libopenmpt/template
@@ -1,7 +1,7 @@
 # Template file for 'libopenmpt'
 pkgname=libopenmpt
 version=0.5.7
-revision=1
+revision=2
 wrksrc="libopenmpt-${version}+release.autotools"
 build_style=gnu-configure
 configure_args="$(vopt_with pulseaudio) $(vopt_with sdl2)

From a424b0a464339a966242f0f6d1c2202add7d9673 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:34 +0200
Subject: [PATCH 10/22] lmms: bump for portaudo 19.7.0

---
 srcpkgs/lmms/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/lmms/template b/srcpkgs/lmms/template
index 3ec4eb068c91..15b67a8f222c 100644
--- a/srcpkgs/lmms/template
+++ b/srcpkgs/lmms/template
@@ -1,7 +1,7 @@
 # Template file for 'lmms'
 pkgname=lmms
 version=1.2.2
-revision=1
+revision=2
 archs="~armv6*"
 wrksrc=${pkgname}
 build_style=cmake

From fe31d04e17f170fe4ee83fd4b7a4213e949ba279 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:46 +0200
Subject: [PATCH 11/22] mame: bump for portaudo 19.7.0

---
 srcpkgs/mame/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mame/template b/srcpkgs/mame/template
index bc498d82863a..c33b7c779100 100644
--- a/srcpkgs/mame/template
+++ b/srcpkgs/mame/template
@@ -1,7 +1,7 @@
 # Template file for 'mame'
 pkgname=mame
 version=0229
-revision=1
+revision=2
 wrksrc="mame-mame${version}"
 hostmakedepends="pkg-config python3 qt5-host-tools tar xz which"
 makedepends="SDL2_ttf-devel fontconfig-devel glm libgomp-devel libjpeg-turbo-devel

From 5e6ac75f84da6acc404704c6f238db6c036b4368 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:51 +0200
Subject: [PATCH 12/22] mixxx: bump for portaudo 19.7.0

---
 srcpkgs/mixxx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template
index 4de620fd6038..6841ca1322cf 100644
--- a/srcpkgs/mixxx/template
+++ b/srcpkgs/mixxx/template
@@ -1,7 +1,7 @@
 # Template file for 'mixxx'
 pkgname=mixxx
 version=2.2.4
-revision=8
+revision=9
 wrksrc="mixxx-release-${version}"
 build_style=scons
 hostmakedepends="pkg-config protobuf"

From fef3c71d8b5c10000d77961f3d8c1489b669199c Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:41:54 +0200
Subject: [PATCH 13/22] mumble: bump for portaudo 19.7.0

---
 srcpkgs/mumble/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/mumble/template b/srcpkgs/mumble/template
index 3a0dca32d9ed..d578a511d47e 100644
--- a/srcpkgs/mumble/template
+++ b/srcpkgs/mumble/template
@@ -1,7 +1,7 @@
 # Template file for 'mumble'
 pkgname=mumble
 version=1.3.4
-revision=5
+revision=6
 build_style=qmake
 configure_args="CONFIG+=bundled-celt CONFIG+=no-bundled-opus CONFIG+=no-update
  CONFIG+=no-bundled-speex CONFIG+=no-g15 CONFIG+=no-xevie CONFIG+=pulseaudio

From 9b349d9f0cdfdfcc6c1c16fffc159828074b72c1 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:00 +0200
Subject: [PATCH 14/22] musescore: bump for portaudo 19.7.0

---
 srcpkgs/musescore/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/musescore/template b/srcpkgs/musescore/template
index 9bc29cf33078..fde84f58f436 100644
--- a/srcpkgs/musescore/template
+++ b/srcpkgs/musescore/template
@@ -1,7 +1,7 @@
 # Template file for 'musescore'
 pkgname=musescore
 version=3.6.2
-revision=1
+revision=2
 wrksrc="MuseScore-${version}"
 build_style=gnu-makefile
 make_build_args="PREFIX=/usr USE_SYSTEM_FREETYPE=ON BUILD_WEBENGINE=OFF

From ed12133a4564ed1d74a3a857a937cb039a32c6b0 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:10 +0200
Subject: [PATCH 15/22] octave: bump for portaudo 19.7.0

---
 srcpkgs/octave/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/octave/template b/srcpkgs/octave/template
index 8a92ed68d532..1b905f83c933 100644
--- a/srcpkgs/octave/template
+++ b/srcpkgs/octave/template
@@ -1,7 +1,7 @@
 # Template file for 'octave'
 pkgname=octave
 version=5.2.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args=" --with-blas=openblas --with-lapack=openblas"
 hostmakedepends="perl gcc-fortran pkg-config gnuplot"

From da6e4ff23c2a95fef795d24b6d9df9e2b0356184 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:19 +0200
Subject: [PATCH 16/22] python3-PyAudio: bump for portaudo 19.7.0

---
 srcpkgs/python3-PyAudio/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/python3-PyAudio/template b/srcpkgs/python3-PyAudio/template
index 9d0f850bd24f..8f9de6cbbacf 100644
--- a/srcpkgs/python3-PyAudio/template
+++ b/srcpkgs/python3-PyAudio/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-PyAudio'
 pkgname=python3-PyAudio
 version=0.2.11
-revision=5
+revision=6
 wrksrc="PyAudio-${version}"
 build_style=python3-module
 hostmakedepends="python3-setuptools"

From cc01363d0bcffb0c1d3144844451cabbce8a9520 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:26 +0200
Subject: [PATCH 17/22] sonic-visualiser: bump for portaudo 19.7.0

---
 srcpkgs/sonic-visualiser/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/sonic-visualiser/template b/srcpkgs/sonic-visualiser/template
index 4daa56060eea..1c3ecd8a3860 100644
--- a/srcpkgs/sonic-visualiser/template
+++ b/srcpkgs/sonic-visualiser/template
@@ -1,7 +1,7 @@
 # Template file for 'sonic-visualiser'
 pkgname=sonic-visualiser
 version=4.2
-revision=2
+revision=3
 build_style=gnu-configure
 build_helper=qmake
 hostmakedepends="pkg-config capnproto-devel"

From 70e82ba7cb93271c03590830bccefd11bbf22f82 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:31 +0200
Subject: [PATCH 18/22] spotifyd: bump for portaudo 19.7.0

---
 srcpkgs/spotifyd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/spotifyd/template b/srcpkgs/spotifyd/template
index 452356c3c8ae..41de83554388 100644
--- a/srcpkgs/spotifyd/template
+++ b/srcpkgs/spotifyd/template
@@ -1,7 +1,7 @@
 # Template file for 'spotifyd'
 pkgname=spotifyd
 version=0.3.2
-revision=1
+revision=2
 build_style=cargo
 configure_args="--no-default-features"
 hostmakedepends="pkg-config"

From 760ab798c0420b54cb37f9e1ab226cf54a4b1507 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:37 +0200
Subject: [PATCH 19/22] wordwarvi: bump for portaudo 19.7.0

---
 srcpkgs/wordwarvi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/wordwarvi/template b/srcpkgs/wordwarvi/template
index 440ba61bfe7b..971940a1eb8f 100644
--- a/srcpkgs/wordwarvi/template
+++ b/srcpkgs/wordwarvi/template
@@ -1,7 +1,7 @@
 # Template file for 'wordwarvi'
 pkgname=wordwarvi
 version=1.0.2
-revision=1
+revision=2
 build_style=gnu-makefile
 hostmakedepends="pkg-config"
 makedepends="portaudio-devel gtk+-devel libvorbis-devel alsa-lib-devel"

From a2d8187a332ee659052356de78715b5811800ca6 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:40 +0200
Subject: [PATCH 20/22] xava: bump for portaudo 19.7.0

---
 srcpkgs/xava/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xava/template b/srcpkgs/xava/template
index fa16f119e240..f7cf336ac7f6 100644
--- a/srcpkgs/xava/template
+++ b/srcpkgs/xava/template
@@ -1,7 +1,7 @@
 # Template file for 'xava'
 pkgname=xava
 version=0.6.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="automake libtool pkg-config"
 makedepends="SDL2-devel iniparser-devel ncurses-devel sndio-devel portaudio-devel"

From 300deb827f2445cd8cd4b0d841a65f86c8a50cb1 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:46 +0200
Subject: [PATCH 21/22] xournalpp: bump for portaudo 19.7.0

---
 srcpkgs/xournalpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xournalpp/template b/srcpkgs/xournalpp/template
index 1f75e7e93eda..8b8000fc46c8 100644
--- a/srcpkgs/xournalpp/template
+++ b/srcpkgs/xournalpp/template
@@ -1,7 +1,7 @@
 # Template file for 'xournalpp'
 pkgname=xournalpp
 version=1.0.20
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config gettext"
 makedepends="libxml2-devel libcppunit-devel poppler-glib-devel gtk+3-devel

From 8aff65afa582dd214a1b1fb01e897509127f3e55 Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Fri, 9 Apr 2021 11:42:53 +0200
Subject: [PATCH 22/22] zynaddsubfx: bump for portaudo 19.7.0

---
 srcpkgs/zynaddsubfx/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/zynaddsubfx/template b/srcpkgs/zynaddsubfx/template
index 04e72410af82..9ac2d42709be 100644
--- a/srcpkgs/zynaddsubfx/template
+++ b/srcpkgs/zynaddsubfx/template
@@ -1,7 +1,7 @@
 # Template file for 'zynaddsubfx'
 pkgname=zynaddsubfx
 version=3.0.5
-revision=3
+revision=4
 build_style=cmake
 build_helper=qemu
 configure_args="-DDefaultOutput=jack -DDefaultInput=jack -DGuiModule=fltk"

^ 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
                   ` (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

end of thread, other threads:[~2022-06-01  2:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-04-26 18:10 ` prez
2021-05-21 22:08 ` [PR REVIEW] " Chocimier
2021-05-21 22:10 ` Chocimier
2021-05-24 12:58 ` [PR PATCH] [Updated] " prez
2021-05-24 12:59 ` [PR REVIEW] " prez
2021-05-24 13:02 ` prez
2021-05-24 13:05 ` prez
2021-05-24 14:19 ` [PR REVIEW] " sgn
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).