1 Description: Add features needed to make portmixer work with audacity.
3 Last-Update: 2011-12-07
5 See <http://music.columbia.edu/pipermail/portaudio/2015-March/016611.html>.
7 --- a/include/pa_win_ds.h
8 +++ b/include/pa_win_ds.h
11 }PaWinDirectSoundStreamInfo;
13 +/** Retrieve the GUID of the input device.
15 + @param stream The stream to query.
17 + @return A pointer to the GUID, or NULL if none.
19 +LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
21 +/** Retrieve the GUID of the output device.
23 + @param stream The stream to query.
25 + @return A pointer to the GUID, or NULL if none.
27 +LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
31 --- a/include/portaudio.h
32 +++ b/include/portaudio.h
33 @@ -1146,6 +1146,15 @@
34 signed long Pa_GetStreamWriteAvailable( PaStream* stream );
37 +/** Retrieve the host type handling an open stream.
39 + @return Returns a non-negative value representing the host API type
40 + handling an open stream or, a PaErrorCode (which are always negative)
41 + if PortAudio is not initialized or an error is encountered.
43 +PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
46 /* Miscellaneous utilities */
50 +++ b/include/pa_unix_oss.h
52 +#ifndef PA_UNIX_OSS_H
53 +#define PA_UNIX_OSS_H
56 + * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
57 + * PortAudio Portable Real-Time Audio Library
58 + * OSS-specific extensions
60 + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
62 + * Permission is hereby granted, free of charge, to any person obtaining
63 + * a copy of this software and associated documentation files
64 + * (the "Software"), to deal in the Software without restriction,
65 + * including without limitation the rights to use, copy, modify, merge,
66 + * publish, distribute, sublicense, and/or sell copies of the Software,
67 + * and to permit persons to whom the Software is furnished to do so,
68 + * subject to the following conditions:
70 + * The above copyright notice and this permission notice shall be
71 + * included in all copies or substantial portions of the Software.
73 + * Any person wishing to distribute modifications to the Software is
74 + * requested to send the modifications to the original developer so that
75 + * they can be incorporated into the canonical version.
77 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
78 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
79 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
80 + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
81 + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
82 + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
83 + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88 + * OSS-specific PortAudio API extension header file.
95 +const char *PaOSS_GetStreamInputDevice( PaStream *s );
97 +const char *PaOSS_GetStreamOutputDevice( PaStream *s );
104 +#ifndef PA_UNIX_OSS_H
105 +#define PA_UNIX_OSS_H
108 + * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
109 + * PortAudio Portable Real-Time Audio Library
110 + * OSS-specific extensions
112 + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
114 + * Permission is hereby granted, free of charge, to any person obtaining
115 + * a copy of this software and associated documentation files
116 + * (the "Software"), to deal in the Software without restriction,
117 + * including without limitation the rights to use, copy, modify, merge,
118 + * publish, distribute, sublicense, and/or sell copies of the Software,
119 + * and to permit persons to whom the Software is furnished to do so,
120 + * subject to the following conditions:
122 + * The above copyright notice and this permission notice shall be
123 + * included in all copies or substantial portions of the Software.
125 + * Any person wishing to distribute modifications to the Software is
126 + * requested to send the modifications to the original developer so that
127 + * they can be incorporated into the canonical version.
129 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
130 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
131 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
132 + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
133 + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
134 + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
135 + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140 + * OSS-specific PortAudio API extension header file.
147 +const char *PaOSS_GetStreamInputDevice( PaStream *s );
149 +const char *PaOSS_GetStreamOutputDevice( PaStream *s );
156 --- a/src/common/pa_front.c
157 +++ b/src/common/pa_front.c
158 @@ -1216,8 +1216,10 @@
159 hostApiInputParametersPtr, hostApiOutputParametersPtr,
160 sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
162 - if( result == paNoError )
163 + if( result == paNoError ) {
164 AddOpenStream( *stream );
165 + PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
169 PA_LOGAPI(("Pa_OpenStream returned:\n" ));
170 @@ -1729,6 +1731,32 @@
174 +PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
176 + PaError error = PaUtil_ValidateStreamPointer( stream );
177 + PaHostApiTypeId result;
179 +#ifdef PA_LOG_API_CALLS
180 + PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
181 + PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
184 + if( error == paNoError )
186 + result = PA_STREAM_REP(stream)->hostApiType;
190 + result = (PaHostApiTypeId) error;
193 +#ifdef PA_LOG_API_CALLS
194 + PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
195 + PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
201 PaError Pa_GetSampleSize( PaSampleFormat format )
203 --- a/src/common/pa_stream.c
204 +++ b/src/common/pa_stream.c
206 streamRepresentation->streamInfo.inputLatency = 0.;
207 streamRepresentation->streamInfo.outputLatency = 0.;
208 streamRepresentation->streamInfo.sampleRate = 0.;
210 + streamRepresentation->hostApiType = 0;
214 --- a/src/common/pa_stream.h
215 +++ b/src/common/pa_stream.h
217 PaStreamFinishedCallback *streamFinishedCallback;
219 PaStreamInfo streamInfo;
220 + PaHostApiTypeId hostApiType;
221 } PaUtilStreamRepresentation;
224 --- a/src/hostapi/coreaudio/pa_mac_core_blocking.c
225 +++ b/src/hostapi/coreaudio/pa_mac_core_blocking.c
227 #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
228 # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
229 # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
230 +#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
231 +# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
232 +# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
234 # include <libkern/OSAtomic.h>
236 --- a/src/hostapi/alsa/pa_linux_alsa.c
237 +++ b/src/hostapi/alsa/pa_linux_alsa.c
239 StreamDirection streamDir;
241 snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */
243 } PaAlsaStreamComponent;
245 /* Implementation specific stream structure */
246 @@ -1806,6 +1807,7 @@
248 PaError result = paNoError;
249 PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
250 + snd_pcm_info_t* pcmInfo;
251 assert( params->channelCount > 0 );
253 /* Make sure things have an initial value */
254 @@ -1826,6 +1828,9 @@
255 self->device = params->device;
257 PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
259 + snd_pcm_info_alloca( &pcmInfo );
260 + self->card = snd_pcm_info_get_card( pcmInfo );
261 self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
263 PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
264 @@ -4519,9 +4524,7 @@
265 /* XXX: More descriptive error? */
266 PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
268 - alsa_snd_pcm_info_alloca( &pcmInfo );
269 - PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
270 - *card = alsa_snd_pcm_info_get_card( pcmInfo );
271 + *card = stream->capture.card;
275 @@ -4537,9 +4540,7 @@
276 /* XXX: More descriptive error? */
277 PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
279 - alsa_snd_pcm_info_alloca( &pcmInfo );
280 - PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
281 - *card = alsa_snd_pcm_info_get_card( pcmInfo );
282 + *card = stream->playback.card;
286 --- a/src/hostapi/oss/pa_unix_oss.c
287 +++ b/src/hostapi/oss/pa_unix_oss.c
288 @@ -2028,3 +2028,26 @@
292 +const char *PaOSS_GetStreamInputDevice( PaStream* s )
294 + PaOssStream *stream = (PaOssStream*)s;
296 + if( stream->capture )
298 + return stream->capture->devName;
304 +const char *PaOSS_GetStreamOutputDevice( PaStream* s )
306 + PaOssStream *stream = (PaOssStream*)s;
308 + if( stream->playback )
310 + return stream->playback->devName;
318 DLL_LIBS="$DLL_LIBS -lossaudio"
319 LIBS="$LIBS -lossaudio"
321 + INCLUDES="$INCLUDES pa_unix_oss.h"
322 AC_DEFINE(PA_USE_OSS,1)