PortAudio 2.0
paqa_devs.c File Reference

Self Testing Quality Assurance app for PortAudio Try to open devices and run through all possible configurations. By default, open only the default devices. Command line options support opening every device, or all input devices, or all output devices. This test does not verify that the configuration works well. It just verifies that it does not crash. It requires a human to listen to the sine wave outputs. More...

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "portaudio.h"
#include "pa_trace.h"
#include "paqa_macros.h"

Data Structures

struct  PaSineOscillator
 
struct  PaQaTestParameters
 
struct  PaQaData
 

Macros

#define _USE_MATH_DEFINES
 
#define RUN_TIME_SECONDS   (1.2)
 
#define BYPASS_TESTS   (0) /* If 1 then skip actual tests and just iterate. */
 
#define MODE_INPUT   (0)
 
#define MODE_OUTPUT   (1)
 
#define MAX_TEST_CHANNELS   (4)
 
#define LOWEST_FREQUENCY   (300.0)
 
#define SINE_AMPLITUDE   (0.2)
 
#define MILLIS_PER_SECOND   (1000.0)
 
#define DEFAULT_FRAMES_PER_BUFFER   (128)
 
#define TEST_LEVEL_QUICK   (0)
 
#define TEST_LEVEL_NORMAL   (1)
 
#define TEST_LEVEL_EXHAUSTIVE   (2)
 
#define SETUP_BUFFERS(_data_type)
 

Typedefs

typedef PAQA_INSTANTIATE_GLOBALS struct PaSineOscillator PaSineOscillator
 
typedef struct PaQaTestParameters PaQaTestParameters
 
typedef struct PaQaData PaQaData
 

Functions

int main (int argc, char **argv)
 

Variables

PaQaTestParameters kDefaultTestParameters
 

Detailed Description

Self Testing Quality Assurance app for PortAudio Try to open devices and run through all possible configurations. By default, open only the default devices. Command line options support opening every device, or all input devices, or all output devices. This test does not verify that the configuration works well. It just verifies that it does not crash. It requires a human to listen to the sine wave outputs.

Author
Phil Burk http://www.softsynth.com

Pieter adapted to V19 API. Test now relies heavily on Pa_IsFormatSupported(). Uses same 'standard' sample rates as in test pa_devs.c.

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

◆ BYPASS_TESTS

#define BYPASS_TESTS   (0) /* If 1 then skip actual tests and just iterate. */

◆ DEFAULT_FRAMES_PER_BUFFER

#define DEFAULT_FRAMES_PER_BUFFER   (128)

◆ LOWEST_FREQUENCY

#define LOWEST_FREQUENCY   (300.0)

◆ MAX_TEST_CHANNELS

#define MAX_TEST_CHANNELS   (4)

◆ MILLIS_PER_SECOND

#define MILLIS_PER_SECOND   (1000.0)

◆ MODE_INPUT

#define MODE_INPUT   (0)

Referenced by main().

◆ MODE_OUTPUT

#define MODE_OUTPUT   (1)

Referenced by main().

◆ RUN_TIME_SECONDS

#define RUN_TIME_SECONDS   (1.2)

◆ SETUP_BUFFERS

#define SETUP_BUFFERS ( _data_type)
Value:
_data_type *out; \
int stride; \
if (parameters->useNonInterleaved) { \
/* outputData points to an array of pointers to the buffers. */ \
void **buffers = (void **)outputData; \
out = (_data_type *)buffers[channelIndex]; \
stride = 1; \
} else { \
out = &((_data_type *) outputData)[channelIndex]; \
stride = parameters->numOutputChannels; \
}

◆ SINE_AMPLITUDE

#define SINE_AMPLITUDE   (0.2)

◆ TEST_LEVEL_EXHAUSTIVE

#define TEST_LEVEL_EXHAUSTIVE   (2)

◆ TEST_LEVEL_NORMAL

#define TEST_LEVEL_NORMAL   (1)

Referenced by main().

◆ TEST_LEVEL_QUICK

#define TEST_LEVEL_QUICK   (0)

Referenced by main().

Typedef Documentation

◆ PaQaData

typedef struct PaQaData PaQaData

◆ PaQaTestParameters

typedef struct PaQaTestParameters PaQaTestParameters

◆ PaSineOscillator

typedef PAQA_INSTANTIATE_GLOBALS struct PaSineOscillator PaSineOscillator

Function Documentation

◆ main()

Variable Documentation

◆ kDefaultTestParameters

PaQaTestParameters kDefaultTestParameters
Initial value:
= {
0,
44100,
0.020,
0,
1,
1,
0,
}
#define DEFAULT_FRAMES_PER_BUFFER
Definition paqa_devs.c:75
#define MODE_OUTPUT
Definition paqa_devs.c:70
#define RUN_TIME_SECONDS
Definition paqa_devs.c:66
#define paFloat32
Definition portaudio.h:492