Alberto di Bene | 24 Jun 18:40 2016

Invalid number of channels...(?)

I am coding a new program that makes use of Portaudio, opsys is Windows 10.

Listing the WASAPI devices, I have this statement that I use to fill a box for the user to choose the output device :

   if(deviceInfo->maxOutputChannels > 0)

Stopping in debug mode, I can see that the maxOutputChannels has the value of 2 for the device

"Speakers (High Definition Audio Device)"

So far, so good.

Then I issue a  Pa_OpenStream  instruction, specifying that device as output, after having set
the requested number of channels to 1 :

      outputParameters.channelCount = 1;     /* mono output */

The Pa_OpenStream fails with error code -9998, which means :

"Invalid number of channels"

Is there a reasonable explanation for this behavior ?



Portaudio mailing list
Portaudio <at>
Peter | 24 Jun 13:58 2016

Soundcard / Chipset with output only

Hi all,

I never had a computer under my hands that has no audio input.
So this PC (HP Compaq Elite 8300, Windows 7) has such a configuration.

Now my program does not start playing my audio.

This due to the fact that
  - input device = -1
  - inputParameters = NIL

function Pa_OpenStream( var stream: PPaStream;
                       inputParameters: PPaStreamParameters;
                       outputParameters: PPaStreamParameters;
                       sampleRate: cdouble;
                       framesPerBuffer: culong;
                       streamFlags: TPaStreamFlags;
                       streamCallback: PPaStreamCallback;
                       userData: Pointer ): TPaError; cdecl; external LibName;

How do I have to configure Portaudio ?
Why does it not trigger the streamCallback function ?

Portaudio mailing list
Portaudio <at>
Dino Cro | 15 Jun 11:58 2016

PulseAudio Host API status

Hello list,
is the PulseAudio Host API still in development or did it somehow stop?

In case the development has stopped, is there any documentation available on how to write Host APIs (specifically, what to implement and the like)?

Best regards,
Portaudio mailing list
Portaudio <at>
Puneet Rana | 14 Jun 17:31 2016

Latency increase with newer Portaudio on Mac

Hello all,

I see an increase in latency of about 3x when comparing the latest stable version (Jan 30 2014) with an older stable version (Mar 26, 2011) on Mac using CoreAudio.

I use a modified version of the paex_record.c example to play audio and record it back. I have a loopback cable connected between audio out and audio in of the sound card. On observing the recorded audio, the latency values I see are (frame size of 128 samples, sample rate of 44100 Hz):
* March 26, 2011 version: 10.6 ms
* Jan 20, 2014 version: 28.1 ms

These numbers are obtained using the same hardware, with the same frame size and sample rate settings. I have been able to reproduce this on other Mac machines, sound cards, and frame sizes. This leads me to believe that something in the Portaudio code may have changed between these two versions that gives a poorer result now. Can someone please help debug this issue?

For reference, here is the loopback code and the recorded audio files:
Portaudio mailing list
Portaudio <at>
tsuji | 8 Jun 08:00 2016

About Multi-recording with Portaudio

My name is Toshikazu Tsuji.
I am a 2nd grade graduate student.
I am from Japan.

I want to record multi-track (multi-record) using audio-device with ASIO.
Can I multi-record on Portaudio?

If Portaudio enable us to multi-record , could you tell me  Web sites 
and books and so on as reference?


三重大学 工学研究科 情報工学専攻
Mie University Graduate School of Engineering Information Engineering Major
Laboratory of Pattern Information Processing
辻 敏和
Name: Toshikazu Tsuji
tsuji <at>
Portaudio mailing list
Portaudio <at>
Ross Bencina | 31 May 11:32 2016

spamer banned

Apologies for the recent spam, the offending address has been banned.

Greetings to all,

typograph | 30 May 18:18 2016

interesting moments


I've been reading a lot on the subject we were discussing in our last conversation and found a lot of interesting moments, read more here

Looking forward, typograph <at>

Portaudio mailing list
Portaudio <at>
typograph | 20 May 01:37 2016

be prepared



I'm sure you are interested in such info, be prepared for something really great! More info here


Warmest regards, typograph <at>

Portaudio mailing list
Portaudio <at>
Phil Burk | 19 May 07:41 2016

fix for non-power-of-2 ready for review

PortAudio asserted on Mac if one tried to write() or read() N channels where N was not a power of 2.

A possible fix is ready here for review:

Here is the bug report:

Phil Burk

Portaudio mailing list
Portaudio <at>
Raphael Melgar | 18 May 22:15 2016

Getting lowest latency on Mac OS X


I’m learning PortAudio and so far it’s pretty straight forward to get it working. I’m basically
writing a program that is attempting to test the roundtrip latency of a thunderbolt audio interface I have
by sending the output of ch1 to input ch1. 

I hope this question isn’t inappropriate for this mailing list but I’m having trouble with setting up
my Pa parameters such that I get the lowest latency possible (<10ms).

First I’m not clear on how to use the functions in pa_mac_core.h or from port audio.h to setup an optimized
environment for low latency, this is what I’m doing:

#define SAMPLE_RATE 48000
#define BLOCK_SIZE 32
#define NUM_CHANNELS 1
#define DESIRED_LATENCY 0.0	// I read that you can set this to 0 to tell PA you want the lowest latency possible

    // Get default input device 
    inputParameters.device = Pa_GetDefaultInputDevice(); /* Get the default output device. */

    // Get default output device
    outputParameters.device = Pa_GetDefaultOutputDevice(); /* Get the default output device. */

    // set pa_mac_core info
    PaMacCore_SetupStreamInfo(&mac_info, paMacCoreChangeDeviceParameters);

    // set input device params
    inputParameters.channelCount = 1;   
    inputParameters.sampleFormat = paFloat32;       
    inputParameters.hostApiSpecificStreamInfo = &mac_info;
    inputParameters.suggestedLatency = DESIRED_LATENCY;

    // set output device params
    outputParameters.channelCount = 1;               
    outputParameters.sampleFormat = paFloat32;   
    outputParameters.hostApiSpecificStreamInfo = &mac_info;
    outputParameters.suggestedLatency = DESIRED_LATENCY;

    /****************** open a stream *********************/
    pa_error = Pa_OpenStream(&stream,

Then I have a setup where in my callback function I first send audio to the output buffer, then immediately
get the input sample. I test to see if the current input sample passes a certain threshold, and if so I abort
the process:

    for(i = 0; i < framesPerBuffer; i++){

        // send a test signal out of the DAC,
        // the first sample is a unit impulse.
        *out++ = test_sig[i];

        // get current input sample from input buffer
        input_samp = *in++;

        // detect a signal value above THRESHOLD
        // if detected, abort the stream
        if (input_samp > THRESHOLD ) {
            return paAbort;                 // quit processing samples

Using timing info I get from port audio, my program reports on average a roundtrip latency about ~240ms. am I
missing any steps or is it not possible to get the <10ms latency I desire?


Portaudio mailing list
Portaudio <at>
Phil Burk | 17 May 07:40 2016

no assert in pa_mac_core.c

I cleaned up some comments in the pa_mac_core.c merge request.
This change list (CL) replaces asserts with code that stops the stream.

I have not gotten any feedback. So I plan to just merge the code tomorrow, unless I hear otherwise.

This CL is to fix this bug:

Phil Burk

Portaudio mailing list
Portaudio <at>