int numInputChannels;
int numOutputChannels;
int framesPerCallback;
+ /* count status flags */
+ int numInputUnderflows;
+ int numInputOverflows;
+ int numOutputUnderflows;
+ int numOutputOverflows;
+ int numPrimingOutputs;
+ int numCallbacks;
} WireConfig_t;
#define USE_FLOAT_INPUT (1)
/* This may get called with NULL inputBuffer during initial setup. */
if( inputBuffer == NULL) return 0;
+ /* Count flags */
+ if( (statusFlags & paInputUnderflow) != 0 ) config->numInputUnderflows += 1;
+ if( (statusFlags & paInputOverflow) != 0 ) config->numInputOverflows += 1;
+ if( (statusFlags & paOutputUnderflow) != 0 ) config->numOutputUnderflows += 1;
+ if( (statusFlags & paOutputOverflow) != 0 ) config->numOutputOverflows += 1;
+ if( (statusFlags & paPrimingOutput) != 0 ) config->numPrimingOutputs += 1;
+ config->numCallbacks += 1;
+
inChannel=0, outChannel=0;
while( !(inDone && outDone) )
{
outputParameters.suggestedLatency = Pa_GetDeviceInfo( outputParameters.device )->defaultLowOutputLatency;
outputParameters.hostApiSpecificStreamInfo = NULL;
+ config->numInputUnderflows = 0;
+ config->numInputOverflows = 0;
+ config->numOutputUnderflows = 0;
+ config->numOutputOverflows = 0;
+ config->numPrimingOutputs = 0;
+ config->numCallbacks = 0;
+
err = Pa_OpenStream(
&stream,
&inputParameters,
err = Pa_StartStream( stream );
if( err != paNoError ) goto error;
- printf("Hit ENTER for next configuration, or 'q' to quit.\n"); fflush(stdout);
+ printf("Now recording and playing. - Hit ENTER for next configuration, or 'q' to quit.\n"); fflush(stdout);
c = getchar();
printf("Closing stream.\n");
err = Pa_CloseStream( stream );
if( err != paNoError ) goto error;
+#define CHECK_FLAG_COUNT(member) \
+ if( config->member > 0 ) printf("FLAGS SET: " #member " = %d\n", config->member );
+ CHECK_FLAG_COUNT( numInputUnderflows );
+ CHECK_FLAG_COUNT( numInputOverflows );
+ CHECK_FLAG_COUNT( numOutputUnderflows );
+ CHECK_FLAG_COUNT( numOutputOverflows );
+ CHECK_FLAG_COUNT( numPrimingOutputs );
+ printf("number of callbacks = %d\n", config->numCallbacks );
+
if( c == 'q' ) return 1;
error: