4d71fbe
diff -wruN portaudio/include/pa_unix_oss.h portaudio-v19/include/pa_unix_oss.h
4d71fbe
--- portaudio/include/pa_unix_oss.h	1969-12-31 18:00:00.000000000 -0600
4d71fbe
+++ portaudio-v19/include/pa_unix_oss.h	2012-12-14 22:34:14.290247100 -0600
4d71fbe
@@ -0,0 +1,52 @@
4d71fbe
+#ifndef PA_UNIX_OSS_H
4d71fbe
+#define PA_UNIX_OSS_H
4d71fbe
+
4d71fbe
+/*
4d71fbe
+ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
4d71fbe
+ * PortAudio Portable Real-Time Audio Library
4d71fbe
+ * OSS-specific extensions
4d71fbe
+ *
4d71fbe
+ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
4d71fbe
+ *
4d71fbe
+ * Permission is hereby granted, free of charge, to any person obtaining
4d71fbe
+ * a copy of this software and associated documentation files
4d71fbe
+ * (the "Software"), to deal in the Software without restriction,
4d71fbe
+ * including without limitation the rights to use, copy, modify, merge,
4d71fbe
+ * publish, distribute, sublicense, and/or sell copies of the Software,
4d71fbe
+ * and to permit persons to whom the Software is furnished to do so,
4d71fbe
+ * subject to the following conditions:
4d71fbe
+ *
4d71fbe
+ * The above copyright notice and this permission notice shall be
4d71fbe
+ * included in all copies or substantial portions of the Software.
4d71fbe
+ *
4d71fbe
+ * Any person wishing to distribute modifications to the Software is
4d71fbe
+ * requested to send the modifications to the original developer so that
4d71fbe
+ * they can be incorporated into the canonical version.
4d71fbe
+ *
4d71fbe
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4d71fbe
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
4d71fbe
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
4d71fbe
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
4d71fbe
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
4d71fbe
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
4d71fbe
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4d71fbe
+ *
4d71fbe
+ */
4d71fbe
+
4d71fbe
+/** @file
4d71fbe
+ * OSS-specific PortAudio API extension header file.
4d71fbe
+ */
4d71fbe
+
4d71fbe
+#ifdef __cplusplus
4d71fbe
+extern "C" {
4d71fbe
+#endif
4d71fbe
+
4d71fbe
+const char *PaOSS_GetStreamInputDevice( PaStream *s );
4d71fbe
+
4d71fbe
+const char *PaOSS_GetStreamOutputDevice( PaStream *s );
4d71fbe
+
4d71fbe
+#ifdef __cplusplus
4d71fbe
+}
4d71fbe
+#endif
4d71fbe
+
4d71fbe
+#endif
4d71fbe
diff -wruN portaudio/include/portaudio.h portaudio-v19/include/portaudio.h
4d71fbe
--- portaudio/include/portaudio.h	2012-08-31 19:10:13.000000000 -0500
4d71fbe
+++ portaudio-v19/include/portaudio.h	2012-12-14 22:34:14.368247200 -0600
4d71fbe
@@ -1146,6 +1146,15 @@
4d71fbe
 signed long Pa_GetStreamWriteAvailable( PaStream* stream );
4d71fbe
 
4d71fbe
 
4d71fbe
+/** Retrieve the host type handling an open stream.
4d71fbe
+
4d71fbe
+ @return Returns a non-negative value representing the host API type
4d71fbe
+ handling an open stream or, a PaErrorCode (which are always negative)
4d71fbe
+ if PortAudio is not initialized or an error is encountered.
4d71fbe
+*/
4d71fbe
+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
4d71fbe
+
4d71fbe
+
4d71fbe
 /* Miscellaneous utilities */
4d71fbe
 
4d71fbe
 
4d71fbe
diff -wruN portaudio/src/common/pa_front.c portaudio-v19/src/common/pa_front.c
4d71fbe
--- portaudio/src/common/pa_front.c	2012-12-04 12:39:48.000000000 -0600
4d71fbe
+++ portaudio-v19/src/common/pa_front.c	2012-12-14 09:44:34.604344800 -0600
4d71fbe
@@ -1216,8 +1216,10 @@
4d71fbe
                                   hostApiInputParametersPtr, hostApiOutputParametersPtr,
4d71fbe
                                   sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
4d71fbe
 
4d71fbe
-    if( result == paNoError )
4d71fbe
+    if( result == paNoError ) {
4d71fbe
         AddOpenStream( *stream );
4d71fbe
+        PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
4d71fbe
+    }
4d71fbe
 
4d71fbe
 
4d71fbe
     PA_LOGAPI(("Pa_OpenStream returned:\n" ));
4d71fbe
@@ -1729,6 +1731,32 @@
4d71fbe
     return result;
4d71fbe
 }
4d71fbe
 
4d71fbe
+PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
4d71fbe
+{
4d71fbe
+    PaError error = PaUtil_ValidateStreamPointer( stream );
4d71fbe
+    PaHostApiTypeId result;
4d71fbe
+
4d71fbe
+#ifdef PA_LOG_API_CALLS
4d71fbe
+    PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
4d71fbe
+    PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
4d71fbe
+#endif
4d71fbe
+
4d71fbe
+    if( error == paNoError )
4d71fbe
+    {
4d71fbe
+        result = PA_STREAM_REP(stream)->hostApiType;
4d71fbe
+    }
4d71fbe
+    else
4d71fbe
+    {
4d71fbe
+        result = (PaHostApiTypeId) error;
4d71fbe
+    }
4d71fbe
+
4d71fbe
+#ifdef PA_LOG_API_CALLS
4d71fbe
+    PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
4d71fbe
+    PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
4d71fbe
+#endif
4d71fbe
+
4d71fbe
+    return result;
4d71fbe
+}
4d71fbe
 
4d71fbe
 PaError Pa_GetSampleSize( PaSampleFormat format )
4d71fbe
 {
4d71fbe
diff -wruN portaudio/src/common/pa_stream.c portaudio-v19/src/common/pa_stream.c
4d71fbe
--- portaudio/src/common/pa_stream.c	2008-02-15 01:50:33.000000000 -0600
4d71fbe
+++ portaudio-v19/src/common/pa_stream.c	2012-12-14 09:44:34.607345000 -0600
4d71fbe
@@ -93,6 +93,8 @@
4d71fbe
     streamRepresentation->streamInfo.inputLatency = 0.;
4d71fbe
     streamRepresentation->streamInfo.outputLatency = 0.;
4d71fbe
     streamRepresentation->streamInfo.sampleRate = 0.;
4d71fbe
+
4d71fbe
+    streamRepresentation->hostApiType = 0;
4d71fbe
 }
4d71fbe
 
4d71fbe
 
4d71fbe
diff -wruN portaudio/src/common/pa_stream.h portaudio-v19/src/common/pa_stream.h
4d71fbe
--- portaudio/src/common/pa_stream.h	2008-02-15 01:50:33.000000000 -0600
4d71fbe
+++ portaudio-v19/src/common/pa_stream.h	2012-12-14 09:44:34.610345200 -0600
4d71fbe
@@ -152,6 +152,7 @@
4d71fbe
     PaStreamFinishedCallback *streamFinishedCallback;
4d71fbe
     void *userData;
4d71fbe
     PaStreamInfo streamInfo;
4d71fbe
+    PaHostApiTypeId hostApiType;
4d71fbe
 } PaUtilStreamRepresentation;
4d71fbe
 
4d71fbe
 
4d71fbe
diff -wruN portaudio/src/hostapi/oss/pa_unix_oss.c portaudio-v19/src/hostapi/oss/pa_unix_oss.c
4d71fbe
--- portaudio/src/hostapi/oss/pa_unix_oss.c	2011-05-02 12:07:11.000000000 -0500
4d71fbe
+++ portaudio-v19/src/hostapi/oss/pa_unix_oss.c	2012-12-14 09:44:34.625346000 -0600
4d71fbe
@@ -2028,3 +2028,26 @@
4d71fbe
 #endif
4d71fbe
 }
4d71fbe
 
4d71fbe
+const char *PaOSS_GetStreamInputDevice( PaStream* s )
4d71fbe
+{
4d71fbe
+    PaOssStream *stream = (PaOssStream*)s;
4d71fbe
+
4d71fbe
+    if( stream->capture )
4d71fbe
+    {
4d71fbe
+      return stream->capture->devName;
4d71fbe
+    }
4d71fbe
+
4d71fbe
+   return NULL;
4d71fbe
+}
4d71fbe
+
4d71fbe
+const char *PaOSS_GetStreamOutputDevice( PaStream* s )
4d71fbe
+{
4d71fbe
+    PaOssStream *stream = (PaOssStream*)s;
4d71fbe
+
4d71fbe
+    if( stream->playback )
4d71fbe
+    {
4d71fbe
+      return stream->playback->devName;
4d71fbe
+    }
4d71fbe
+
4d71fbe
+   return NULL;
4d71fbe
+}
4d71fbe
diff -up portaudio/configure.in~ portaudio/configure.in
4d71fbe
--- portaudio/configure.in~	2013-04-07 12:20:18.000000000 +0200
4d71fbe
+++ portaudio/configure.in	2013-05-04 15:14:14.356191153 +0200
4d71fbe
@@ -387,7 +387,7 @@ case "${host_os}" in
4d71fbe
            DLL_LIBS="$DLL_LIBS -lasound"
4d71fbe
            LIBS="$LIBS -lasound"
4d71fbe
            OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o"
4d71fbe
-           INCLUDES="$INCLUDES pa_linux_alsa.h"
4d71fbe
+           INCLUDES="$INCLUDES pa_linux_alsa.h pa_unix_oss.h"
4d71fbe
            AC_DEFINE(PA_USE_ALSA,1)
4d71fbe
         fi
4d71fbe