*/
/*
- * The text above constitutes the entire PortAudio license; however,
+ * The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* 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. It is also
- * requested that these non-binding requests be included along with the
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
* license above.
*/
/* external reference to ASIO SDK's asioDrivers.
- This is a bit messy because we want to explicitly manage
- allocation/deallocation of this structure, but some layers of the SDK
+ This is a bit messy because we want to explicitly manage
+ allocation/deallocation of this structure, but some layers of the SDK
which we currently use (eg the implementation in asio.cpp) still
use this global version.
AsioDrivers *asioDrivers;
void *systemSpecific;
-
+
/* the ASIO C API only allows one ASIO driver to be open at a time,
so we keep track of whether we have the driver open here, and
use this information to return errors from OpenStream if the
*/
static void UnloadAsioDriver( void )
{
- ASIOExit();
+ ASIOExit();
}
/*
error:
if( asioIsInitialized )
- {
- ASIOExit();
- }
+ {
+ ASIOExit();
+ }
return result;
}
192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 };
-static PaError InitPaDeviceInfoFromAsioDriver( PaAsioHostApiRepresentation *asioHostApi,
+static PaError InitPaDeviceInfoFromAsioDriver( PaAsioHostApiRepresentation *asioHostApi,
const char *driverName, int driverIndex,
PaDeviceInfo *deviceInfo, PaAsioDeviceInfo *asioDeviceInfo )
{
paAsioDriver.info.bufferMaxSize / deviceInfo->defaultSampleRate;
if( defaultHighLatency < defaultLowLatency )
- defaultHighLatency = defaultLowLatency; /* just in case the driver returns something strange */
-
+ defaultHighLatency = defaultLowLatency; /* just in case the driver returns something strange */
+
deviceInfo->defaultHighInputLatency = defaultHighLatency;
deviceInfo->defaultHighOutputLatency = defaultHighLatency;
-
+
}else{
deviceInfo->defaultLowInputLatency = 0.;
There used to be code that initialized COM in other situations
such as when creating a Stream. This made PA work when calling Pa_CreateStream
- from a non-main thread. However we currently consider initialization
+ from a non-main thread. However we currently consider initialization
of COM in non-main threads to be the caller's responsibility.
*/
result = PaWinUtil_CoInitialize( paASIO, &asioHostApi->comInitializationResult );
try
{
asioHostApi->asioDrivers = new AsioDrivers(); /* invokes CoInitialize(0) in AsioDriverList::AsioDriverList */
- }
+ }
catch (std::bad_alloc)
{
asioHostApi->asioDrivers = 0;
// we face fact that some drivers were not meant for it, drivers which act
// like shells on top of REAL drivers, for instance.
// so we get duplicate handles, locks and other problems.
- // so lets NOT try to load any such wrappers.
+ // so lets NOT try to load any such wrappers.
// The ones i [davidv] know of so far are:
if ( strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0
}
- if( IsDebuggerPresent_ && IsDebuggerPresent_() )
+ if( IsDebuggerPresent_ && IsDebuggerPresent_() )
{
/* ASIO Digidesign Driver uses PACE copy protection which quits out
if a debugger is running. So we don't load it if a debugger is running. */
- if( strcmp(names[i], "ASIO Digidesign Driver") == 0 )
+ if( strcmp(names[i], "ASIO Digidesign Driver") == 0 )
{
- PA_DEBUG(("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n"));
+ PA_DEBUG(("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n"));
continue;
- }
- }
+ }
+ }
/* Attempt to init device info from the asio driver... */
(*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo;
++(*hostApi)->info.deviceCount;
}
- else
- {
+ else
+ {
PA_DEBUG(("Skipping ASIO device:%s\n",names[i]));
continue;
}
PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo;
int inputChannelCount, outputChannelCount;
PaSampleFormat inputSampleFormat, outputSampleFormat;
- PaDeviceIndex asioDeviceIndex;
+ PaDeviceIndex asioDeviceIndex;
ASIOError asioError;
-
+
if( inputParameters && outputParameters )
{
/* full duplex ASIO stream must use the same device for input and output */
if( inputParameters->device != outputParameters->device )
return paBadIODeviceCombination;
}
-
+
if( inputParameters )
{
inputChannelCount = inputParameters->channelCount;
this implementation doesn't support any custom sample formats */
if( inputSampleFormat & paCustomFormat )
return paSampleFormatNotSupported;
-
+
/* unless alternate device specification is supported, reject the use of
paUseHostApiSpecificDeviceSpecification */
this implementation doesn't support any custom sample formats */
if( outputSampleFormat & paCustomFormat )
return paSampleFormatNotSupported;
-
+
/* unless alternate device specification is supported, reject the use of
paUseHostApiSpecificDeviceSpecification */
/* if an ASIO device is open we can only get format information for the currently open device */
- if( asioHostApi->openAsioDeviceIndex != paNoDevice
+ if( asioHostApi->openAsioDeviceIndex != paNoDevice
&& asioHostApi->openAsioDeviceIndex != asioDeviceIndex )
{
return paDeviceUnavailable;
goto done;
}
}
-
+
/* query for sample rate support */
asioError = ASIOCanSampleRate( sampleRate );
if( asioError == ASE_NoClock || asioError == ASE_NotPresent )
}
-/* return the next power of two >= x.
- Returns the input parameter if it is already a power of two.
- http://stackoverflow.com/questions/364985/algorithm-for-finding-the-smallest-power-of-two-thats-greater-or-equal-to-a-giv
+/* return the next power of two >= x.
+ Returns the input parameter if it is already a power of two.
+ http://stackoverflow.com/questions/364985/algorithm-for-finding-the-smallest-power-of-two-thats-greater-or-equal-to-a-giv
*/
static unsigned long NextPowerOfTwo( unsigned long x )
{
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
- /* If you needed to deal with numbers > 2^32 the following would be needed.
- For latencies, we don't deal with values this large.
+ /* If you needed to deal with numbers > 2^32 the following would be needed.
+ For latencies, we don't deal with values this large.
x |= x >> 16;
*/
}
-static unsigned long SelectHostBufferSizeForUnspecifiedUserFramesPerBuffer(
+static unsigned long SelectHostBufferSizeForUnspecifiedUserFramesPerBuffer(
unsigned long targetBufferingLatencyFrames, PaAsioDriverInfo *driverInfo )
{
- /* Choose a host buffer size based only on targetBufferingLatencyFrames and the
- device's supported buffer sizes. Always returns a valid value.
- */
+ /* Choose a host buffer size based only on targetBufferingLatencyFrames and the
+ device's supported buffer sizes. Always returns a valid value.
+ */
- unsigned long result;
+ unsigned long result;
- if( targetBufferingLatencyFrames <= (unsigned long)driverInfo->bufferMinSize )
+ if( targetBufferingLatencyFrames <= (unsigned long)driverInfo->bufferMinSize )
{
result = driverInfo->bufferMinSize;
}
}
else
{
- if( driverInfo->bufferGranularity == 0 ) /* single fixed host buffer size */
+ if( driverInfo->bufferGranularity == 0 ) /* single fixed host buffer size */
{
- /* The documentation states that bufferGranularity should be zero
- when bufferMinSize, bufferMaxSize and bufferPreferredSize are the
+ /* The documentation states that bufferGranularity should be zero
+ when bufferMinSize, bufferMaxSize and bufferPreferredSize are the
same. We assume that is the case.
*/
result = driverInfo->bufferPreferredSize;
}
- else if( driverInfo->bufferGranularity == -1 ) /* power-of-two */
+ else if( driverInfo->bufferGranularity == -1 ) /* power-of-two */
{
- /* We assume bufferMinSize and bufferMaxSize are powers of two. */
+ /* We assume bufferMinSize and bufferMaxSize are powers of two. */
result = NextPowerOfTwo( targetBufferingLatencyFrames );
else /* modulo bufferGranularity */
{
/* round up to the next multiple of granularity */
- unsigned long n = (targetBufferingLatencyFrames + driverInfo->bufferGranularity - 1)
+ unsigned long n = (targetBufferingLatencyFrames + driverInfo->bufferGranularity - 1)
/ driverInfo->bufferGranularity;
-
+
result = n * driverInfo->bufferGranularity;
if( result < (unsigned long)driverInfo->bufferMinSize )
}
}
- return result;
+ return result;
}
-static unsigned long SelectHostBufferSizeForSpecifiedUserFramesPerBuffer(
+static unsigned long SelectHostBufferSizeForSpecifiedUserFramesPerBuffer(
unsigned long targetBufferingLatencyFrames, unsigned long userFramesPerBuffer,
PaAsioDriverInfo *driverInfo )
{
- /* Select a host buffer size conforming to targetBufferingLatencyFrames
- and the device's supported buffer sizes.
- The return value will always be a multiple of userFramesPerBuffer.
- If a valid buffer size can not be found the function returns 0.
-
- The current implementation uses a simple iterative search for clarity.
- Feel free to suggest a closed form solution.
- */
- unsigned long result = 0;
-
- assert( userFramesPerBuffer != 0 );
-
- if( driverInfo->bufferGranularity == 0 ) /* single fixed host buffer size */
+ /* Select a host buffer size conforming to targetBufferingLatencyFrames
+ and the device's supported buffer sizes.
+ The return value will always be a multiple of userFramesPerBuffer.
+ If a valid buffer size can not be found the function returns 0.
+
+ The current implementation uses a simple iterative search for clarity.
+ Feel free to suggest a closed form solution.
+ */
+ unsigned long result = 0;
+
+ assert( userFramesPerBuffer != 0 );
+
+ if( driverInfo->bufferGranularity == 0 ) /* single fixed host buffer size */
{
- /* The documentation states that bufferGranularity should be zero
- when bufferMinSize, bufferMaxSize and bufferPreferredSize are the
+ /* The documentation states that bufferGranularity should be zero
+ when bufferMinSize, bufferMaxSize and bufferPreferredSize are the
same. We assume that is the case.
*/
- if( (driverInfo->bufferPreferredSize % userFramesPerBuffer) == 0 )
- result = driverInfo->bufferPreferredSize;
+ if( (driverInfo->bufferPreferredSize % userFramesPerBuffer) == 0 )
+ result = driverInfo->bufferPreferredSize;
}
- else if( driverInfo->bufferGranularity == -1 ) /* power-of-two */
+ else if( driverInfo->bufferGranularity == -1 ) /* power-of-two */
{
- /* We assume bufferMinSize and bufferMaxSize are powers of two. */
+ /* We assume bufferMinSize and bufferMaxSize are powers of two. */
- /* Search all powers of two in the range [bufferMinSize,bufferMaxSize]
+ /* Search all powers of two in the range [bufferMinSize,bufferMaxSize]
for multiples of userFramesPerBuffer. We prefer the first multiple
- that is equal or greater than targetBufferingLatencyFrames, or
- failing that, the largest multiple less than
+ that is equal or greater than targetBufferingLatencyFrames, or
+ failing that, the largest multiple less than
targetBufferingLatencyFrames.
*/
- unsigned long x = (unsigned long)driverInfo->bufferMinSize;
- do {
- if( (x % userFramesPerBuffer) == 0 )
- {
+ unsigned long x = (unsigned long)driverInfo->bufferMinSize;
+ do {
+ if( (x % userFramesPerBuffer) == 0 )
+ {
/* any multiple of userFramesPerBuffer is acceptable */
- result = x;
- if( result >= targetBufferingLatencyFrames )
- break; /* stop. a value >= to targetBufferingLatencyFrames is ideal. */
- }
+ result = x;
+ if( result >= targetBufferingLatencyFrames )
+ break; /* stop. a value >= to targetBufferingLatencyFrames is ideal. */
+ }
- x *= 2;
- } while( x <= (unsigned long)driverInfo->bufferMaxSize );
+ x *= 2;
+ } while( x <= (unsigned long)driverInfo->bufferMaxSize );
}
else /* modulo granularity */
{
- /* We assume bufferMinSize is a multiple of bufferGranularity. */
+ /* We assume bufferMinSize is a multiple of bufferGranularity. */
- /* Search all multiples of bufferGranularity in the range
- [bufferMinSize,bufferMaxSize] for multiples of userFramesPerBuffer.
- We prefer the first multiple that is equal or greater than
- targetBufferingLatencyFrames, or failing that, the largest multiple
+ /* Search all multiples of bufferGranularity in the range
+ [bufferMinSize,bufferMaxSize] for multiples of userFramesPerBuffer.
+ We prefer the first multiple that is equal or greater than
+ targetBufferingLatencyFrames, or failing that, the largest multiple
less than targetBufferingLatencyFrames.
*/
- unsigned long x = (unsigned long)driverInfo->bufferMinSize;
- do {
- if( (x % userFramesPerBuffer) == 0 )
- {
+ unsigned long x = (unsigned long)driverInfo->bufferMinSize;
+ do {
+ if( (x % userFramesPerBuffer) == 0 )
+ {
/* any multiple of userFramesPerBuffer is acceptable */
- result = x;
- if( result >= targetBufferingLatencyFrames )
- break; /* stop. a value >= to targetBufferingLatencyFrames is ideal. */
- }
+ result = x;
+ if( result >= targetBufferingLatencyFrames )
+ break; /* stop. a value >= to targetBufferingLatencyFrames is ideal. */
+ }
- x += driverInfo->bufferGranularity;
- } while( x <= (unsigned long)driverInfo->bufferMaxSize );
+ x += driverInfo->bufferGranularity;
+ } while( x <= (unsigned long)driverInfo->bufferMaxSize );
}
- return result;
+ return result;
}
-static unsigned long SelectHostBufferSize(
- unsigned long targetBufferingLatencyFrames,
+static unsigned long SelectHostBufferSize(
+ unsigned long targetBufferingLatencyFrames,
unsigned long userFramesPerBuffer, PaAsioDriverInfo *driverInfo )
{
unsigned long result = 0;
- /* We select a host buffer size based on the following requirements
+ /* We select a host buffer size based on the following requirements
(in priority order):
- 1. The host buffer size must be permissible according to the ASIO
- driverInfo buffer size constraints (min, max, granularity or
+ 1. The host buffer size must be permissible according to the ASIO
+ driverInfo buffer size constraints (min, max, granularity or
powers-of-two).
- 2. If the user specifies a non-zero framesPerBuffer parameter
- (userFramesPerBuffer here) the host buffer should be a multiple of
+ 2. If the user specifies a non-zero framesPerBuffer parameter
+ (userFramesPerBuffer here) the host buffer should be a multiple of
this (subject to the constraints in (1) above).
- [NOTE: Where no permissible host buffer size is a multiple of
- userFramesPerBuffer, we choose a value as if userFramesPerBuffer were
- zero (i.e. we ignore it). This strategy is open for review ~ perhaps
- there are still "more optimal" buffer sizes related to
+ [NOTE: Where no permissible host buffer size is a multiple of
+ userFramesPerBuffer, we choose a value as if userFramesPerBuffer were
+ zero (i.e. we ignore it). This strategy is open for review ~ perhaps
+ there are still "more optimal" buffer sizes related to
userFramesPerBuffer that we could use.]
- 3. The host buffer size should be greater than or equal to
- targetBufferingLatencyFrames, subject to (1) and (2) above. Where it
- is not possible to select a host buffer size equal or greater than
- targetBufferingLatencyFrames, the highest buffer size conforming to
+ 3. The host buffer size should be greater than or equal to
+ targetBufferingLatencyFrames, subject to (1) and (2) above. Where it
+ is not possible to select a host buffer size equal or greater than
+ targetBufferingLatencyFrames, the highest buffer size conforming to
(1) and (2) should be chosen.
*/
- if( userFramesPerBuffer != 0 )
- {
- /* userFramesPerBuffer is specified, try to find a buffer size that's
+ if( userFramesPerBuffer != 0 )
+ {
+ /* userFramesPerBuffer is specified, try to find a buffer size that's
a multiple of it */
- result = SelectHostBufferSizeForSpecifiedUserFramesPerBuffer(
+ result = SelectHostBufferSizeForSpecifiedUserFramesPerBuffer(
targetBufferingLatencyFrames, userFramesPerBuffer, driverInfo );
- }
+ }
- if( result == 0 )
- {
- /* either userFramesPerBuffer was not specified, or we couldn't find a
- host buffer size that is a multiple of it. Select a host buffer size
- according to targetBufferingLatencyFrames and the ASIO driverInfo
+ if( result == 0 )
+ {
+ /* either userFramesPerBuffer was not specified, or we couldn't find a
+ host buffer size that is a multiple of it. Select a host buffer size
+ according to targetBufferingLatencyFrames and the ASIO driverInfo
buffer size constraints.
- */
- result = SelectHostBufferSizeForUnspecifiedUserFramesPerBuffer(
+ */
+ result = SelectHostBufferSizeForUnspecifiedUserFramesPerBuffer(
targetBufferingLatencyFrames, driverInfo );
- }
+ }
- return result;
+ return result;
}
return paIncompatibleHostApiSpecificStreamInfo;
for( int i=0; i < streamParameters->channelCount; ++i ){
- if( (*channelSelectors)[i] < 0
+ if( (*channelSelectors)[i] < 0
|| (*channelSelectors)[i] >= deviceChannelCount ){
return paInvalidChannelCount;
- }
+ }
}
}
/* davidv: listing ASIO Clock sources. there is an ongoing investigation by
me about whether or not to call ASIOSetSampleRate if an external Clock is
used. A few drivers expected different things here */
-
+
asioError = ASIOGetClockSources(clocks, &numSources);
if( asioError != ASE_OK ){
PA_DEBUG(("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText(asioError) ));
PA_DEBUG(("INFO ASIOGetClockSources listing %d clocks\n", numSources ));
for (int i=0;i<numSources;++i){
PA_DEBUG(("ASIOClockSource%d %s current:%d\n", i, clocks[i].name, clocks[i].isCurrentSource ));
-
+
if (clocks[i].isCurrentSource)
result = true;
}
PaError result = paNoError;
ASIOError asioError;
- // check that the device supports the requested sample rate
+ // check that the device supports the requested sample rate
asioError = ASIOCanSampleRate( sampleRate );
PA_DEBUG(("ASIOCanSampleRate(%f):%d\n", sampleRate, asioError ));
PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate));
/*
- If you have problems with some drivers when externally clocked,
+ If you have problems with some drivers when externally clocked,
try switching on the following line and commenting out the one after it.
See IsUsingExternalClockSource() for more info.
*/
}else{
info->channelNum = i;
}
-
+
info->buffers[0] = info->buffers[1] = 0;
}
else /* Using callback interface... */
{
/* Select the host buffer size based on user framesPerBuffer and the
- maximum of suggestedInputLatencyFrames and
+ maximum of suggestedInputLatencyFrames and
suggestedOutputLatencyFrames.
- We should subtract any fixed known driver latency from
+ We should subtract any fixed known driver latency from
suggestedLatencyFrames before computing the host buffer size.
- However, the ASIO API doesn't provide a method for determining fixed
- latencies independent of the host buffer size. ASIOGetLatencies()
- only returns latencies after the buffer size has been configured, so
+ However, the ASIO API doesn't provide a method for determining fixed
+ latencies independent of the host buffer size. ASIOGetLatencies()
+ only returns latencies after the buffer size has been configured, so
we can't reliably use it to determine fixed latencies here.
We could set the preferred buffer size and then subtract it from
reliable, so we don't do it.
*/
- unsigned long targetBufferingLatencyFrames =
+ unsigned long targetBufferingLatencyFrames =
(( suggestedInputLatencyFrames > suggestedOutputLatencyFrames )
- ? suggestedInputLatencyFrames
+ ? suggestedInputLatencyFrames
: suggestedOutputLatencyFrames);
- framesPerHostBuffer = SelectHostBufferSize( targetBufferingLatencyFrames,
+ framesPerHostBuffer = SelectHostBufferSize( targetBufferingLatencyFrames,
framesPerBuffer, driverInfo );
}
if( inputChannelCount > 0 )
{
- /* FIXME: assume all channels use the same type for now
-
+ /* FIXME: assume all channels use the same type for now
+
see: "ASIO devices with multiple sample formats are unsupported"
http://www.portaudio.com/trac/ticket/106
*/
if( outputChannelCount > 0 )
{
- /* FIXME: assume all channels use the same type for now
-
+ /* FIXME: assume all channels use the same type for now
+
see: "ASIO devices with multiple sample formats are unsupported"
http://www.portaudio.com/trac/ticket/106
*/
stream->outputBufferConverter = 0;
}
- /* Values returned by ASIOGetLatencies() include the latency introduced by
+ /* Values returned by ASIOGetLatencies() include the latency introduced by
the ASIO double buffer. */
ASIOGetLatencies( &stream->asioInputLatencyFrames, &stream->asioOutputLatencyFrames );
// buffer processor latency. it reports the added latency separately
PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n",
stream->asioInputLatencyFrames,
- (long)((stream->asioInputLatencyFrames*1000)/ sampleRate),
+ (long)((stream->asioInputLatencyFrames*1000)/ sampleRate),
PaUtil_GetBufferProcessorInputLatencyFrames(&stream->bufferProcessor),
(long)((PaUtil_GetBufferProcessorInputLatencyFrames(&stream->bufferProcessor)*1000)/ sampleRate)
));
PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n",
stream->asioOutputLatencyFrames,
- (long)((stream->asioOutputLatencyFrames*1000)/ sampleRate),
+ (long)((stream->asioOutputLatencyFrames*1000)/ sampleRate),
PaUtil_GetBufferProcessorOutputLatencyFrames(&stream->bufferProcessor),
(long)((PaUtil_GetBufferProcessorOutputLatencyFrames(&stream->bufferProcessor)*1000)/ sampleRate)
));
stream->postOutput = driverInfo->postOutput;
stream->isStopped = 1;
stream->isActive = 0;
-
+
asioHostApi->openAsioDeviceIndex = asioDeviceIndex;
theAsioStream = stream;
ASIODisposeBuffers();
if( asioIsInitialized )
- {
- UnloadAsioDriver();
- }
+ {
+ UnloadAsioDriver();
+ }
return result;
}
}
int buffersDone = 0;
-
+
do
{
if( buffersDone > 0 )
{
// this is a reentered buffer, we missed processing it on time
// set the input overflow and output underflow flags as appropriate
-
+
if( theAsioStream->inputChannelCount > 0 )
theAsioStream->callbackFlags |= paInputOverflow;
-
+
if( theAsioStream->outputChannelCount > 0 )
theAsioStream->callbackFlags |= paOutputUnderflow;
}
}
}
}
-
+
++buffersDone;
}while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 );
static PaError IsStreamStopped( PaStream *s )
{
PaAsioStream *stream = (PaAsioStream*)s;
-
+
return stream->isStopped;
}
&lRingBufferSize2nd);
/* Set number of frames to be copied from the ring buffer. */
- PaUtil_SetInputFrameCount( pBp, lRingBufferSize1st );
+ PaUtil_SetInputFrameCount( pBp, lRingBufferSize1st );
/* Setup ring buffer access. */
PaUtil_SetInterleavedInputChannels(pBp , /* Buffer processor. */
0 , /* The first channel's index. */
/* If block processing has stopped, abort! */
if( blockingState->stopFlag ) { return result = paStreamIsStopped; }
-
+
/* If a timeout is encountered, give up eventually. */
return result = paTimedOut;
}
&lRingBufferSize2nd);
/* Set number of frames to be copied to the ring buffer. */
- PaUtil_SetOutputFrameCount( pBp, lRingBufferSize1st );
+ PaUtil_SetOutputFrameCount( pBp, lRingBufferSize1st );
/* Setup ring buffer access. */
PaUtil_SetInterleavedOutputChannels(pBp , /* Buffer processor. */
0 , /* The first channel's index. */
}
PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) ));
-PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion ));
-PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion ));
-PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name ));
-PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage ));
+PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion ));
+PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion ));
+PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name ));
+PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage ));
asioError = ASIOControlPanel();
if( asioError != ASE_OK )
error:
if( asioIsInitialized )
- {
- ASIOExit();
- }
+ {
+ ASIOExit();
+ }
PaWinUtil_CoUninitialize( paASIO, &comInitializationResult );
*channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name;
return paNoError;
-
+
error:
return result;
}
asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name;
return paNoError;
-
+
error:
return result;
}
PaError result;
PaUtilHostApiRepresentation *hostApi;
PaAsioHostApiRepresentation *asioHostApi;
-
+
result = PaUtil_ValidateStreamPointer( s );
if( result != paNoError )
return result;
return result;
asioHostApi = (PaAsioHostApiRepresentation*)hostApi;
-
+
if( PA_STREAM_REP( s )->streamInterface == &asioHostApi->callbackStreamInterface
|| PA_STREAM_REP( s )->streamInterface == &asioHostApi->blockingStreamInterface )
{