// This programme captures audio from 8 sources then mixes and plays them back out. // It is intended to demonstrate using JACK and FFADO with a Focusrite Saffire Pro 10 I/O // // It is compiled using the following command // gcc -Wall -ljack -lpthread -lrt -o inOut inOut.c // // A.Greensted // September 2010 #define _GNU_SOURCE // Declare this as GNU source so the prototype for asprintf is defined #include #include #include #include #include #define NUM_INPUT_PORTS 8 // Number of capture ports to connect to int allConnected; // Flag specifying all inputs and outputs are connected jack_port_t **inputPortArray; // Array of pointers to input ports jack_port_t *outputPort; // Pointer to output port jack_default_audio_sample_t **inputBufferArray; // Array of pointers to input buffers // This is called by the JACK server in a // special realtime thread once for each audio cycle. int jackProcess(jack_nframes_t nframes, void *arg) { int portNum; jack_nframes_t frameNum; jack_default_audio_sample_t *outputBuffer; // Only proceed if all ports have been connected if (allConnected == 0) return 0; // Get pointers to the capture port buffers for (portNum=0 ; portNum