src/common/pa_stream.o \
src/common/pa_trace.o \
src/hostapi/skeleton/pa_hostapi_skeleton.o
+
+LOOPBACK_OBJS = \
+ qa/loopback/src/audio_analyzer.o \
+ qa/loopback/src/biquad_filter.o \
+ qa/loopback/src/paqa_tools.o \
+ qa/loopback/src/test_audio_analyzer.o \
+ qa/loopback/src/write_wav.o \
+ qa/loopback/src/paqa.o
TESTS = \
bin/paqa_devs \
tests: bin-stamp $(TESTS)
+loopback: bin-stamp bin/paloopback
+
# With ASIO enabled we must link libportaudio and all test programs with CXX
lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC)
@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS)
@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
@WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
+bin/paloopback: lib/$(PALIB) $(MAKEFILE) $(PAINC) $(LOOPBACK_OBJS)
+ @WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(LOOPBACK_OBJS) lib/$(PALIB) $(LIBS)
+ @WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(LOOPBACK_OBJS) lib/$(PALIB) $(LIBS)
+
install: lib/$(PALIB) portaudio-2.0.pc
$(INSTALL) -d $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir)
$(MAKE) uninstall-recursive
clean:
- $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB)
+ $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(LOOPBACK_OBJS) $(ALL_TESTS) lib/$(PALIB)
$(RM) bin-stamp lib-stamp
-$(RM) -r bin lib
)
{
int i;
- float *in = (float *)g_BigBuffer;
- float *out = (float *)g_BigBuffer;
+ float *in = (float *)g_BigBuffer;
+ float *out = (float *)g_BigBuffer;
PaError err;
int done = 0;
long available;
}
// Save in a recording.
- for( i=0; i<loopbackContext->test->inputParameters.channelCount; i++ )
+ for( i=0; i<loopbackContext->test->inputParameters.channelCount; i++ )
{
done |= PaQa_WriteRecording( &loopbackContext->recordings[i],
- in + i,
- framesPerBuffer,
- loopbackContext->test->inputParameters.channelCount );
+ in + i,
+ framesPerBuffer,
+ loopbackContext->test->inputParameters.channelCount );
}
// Synthesize audio.
for( i=0; i<loopbackContext->test->outputParameters.channelCount; i++ )
{
PaQa_MixSine( &loopbackContext->generators[i],
- out + i,
- available,
- loopbackContext->test->outputParameters.channelCount );
+ out + i,
+ available,
+ loopbackContext->test->outputParameters.channelCount );
}
// Write out audio.
static int PaQa_AnalyzeLoopbackConnection( UserOptions *userOptions, PaDeviceIndex inputDevice, PaDeviceIndex outputDevice, double expectedAmplitude )
{
int i;
+ int iFlags;
+ int iRate;
int iSize;
int totalBadChannels = 0;
TestParameters testParams;
int flagSettings[] = { 0, 1 };
int numFlagSettings = (sizeof(flagSettings)/sizeof(int));
- double sampleRates[] = { 8000.0, 11025.0, 16000.0, 22050.0, 32000.0, 44100.0, 48000.0, 96000.0 };
+ double sampleRates[] = { 44100.0, 48000.0, 8000.0, 11025.0, 16000.0, 22050.0, 32000.0, 96000.0 };
int numRates = (sizeof(sampleRates)/sizeof(double));
- int framesPerBuffers[] = { 0, 16, 32, 40, 64, 100, 128, 512, 1024 };
+ int framesPerBuffers[] = { 256, 16, 32, 40, 64, 100, 128, 512, 1024 };
int numBufferSizes = (sizeof(framesPerBuffers)/sizeof(int));
// Check to see if a specific value was requested.
printf("|-sRate-|-buffer-|-latency-|-channel results--------------------|\n");
// Loop though combinations of audio parameters.
- testParams.framesPerBuffer = 128;
+ testParams.framesPerBuffer = framesPerBuffers[0];
for( iRate=0; iRate<numRates; iRate++ )
{
// SAMPLE RATE
}
printf( "\n" );
- testParams.sampleRate = 44100;
+ testParams.sampleRate = sampleRates[0];
testParams.maxFrames = (int) (1.2 * testParams.sampleRate);
for( iSize=0; iSize<numBufferSizes; iSize++ )
{
startFrame, numFrames, NULL );
double magRightReverse = PaQa_CorrelateSine( &loopbackContext.recordings[1],
- loopbackContext.generators[0].frequency,
- testParams.sampleRate,
- startFrame, numFrames, NULL );
+ loopbackContext.generators[0].frequency,
+ testParams.sampleRate,
+ startFrame, numFrames, NULL );
if ((magLeftReverse > 0.1) && (magRightReverse>minAmplitude))
{
*/
static int ScanForLoopback(UserOptions *userOptions)
{
+ PaDeviceIndex i,j;
int numLoopbacks = 0;
int numDevices;
numDevices = Pa_GetDeviceCount();
else if (userOptions->inputDevice >= 0)
{
// Just scan for output.
- for( PaDeviceIndex i=0; i<numDevices; i++ )
+ for( i=0; i<numDevices; i++ )
{
int loopbackConnected = PaQa_CheckForLoopBack( userOptions->inputDevice, i );
if( loopbackConnected > 0 )
else if (userOptions->outputDevice >= 0)
{
// Just scan for input.
- for( PaDeviceIndex i=0; i<numDevices; i++ )
+ for( i=0; i<numDevices; i++ )
{
int loopbackConnected = PaQa_CheckForLoopBack( i, userOptions->inputDevice );
if( loopbackConnected > 0 )
else
{
// Scan both.
- for( PaDeviceIndex i=0; i<numDevices; i++ )
+ for( i=0; i<numDevices; i++ )
{
- for( PaDeviceIndex j=0; j<numDevices; j++ )
+ for( j=0; j<numDevices; j++ )
{
int loopbackConnected = PaQa_CheckForLoopBack( i, j );
if( loopbackConnected > 0 )