Skip to content

Audio thread stops when calling paIsFormatSupported() while stream is running #1131

@stijnvanbeek

Description

@stijnvanbeek

Describe the bug

When I call paIsFormatSupported() while an audio stream is running the audio thread stops and portaudio prints the following message:

||PaMacCore (AUHAL)|| Error on line 2530: err='-50', msg=Unknown Error

To Reproduce

  1. start a duplex stream on Macbook Pro Speakers and built-in microphone device for both input and output. Samplerate 44100, buffersize 1024, paFloat

  2. Stop the stream and close it.

  3. Start a new stream with the same settings, except use buffersize 64.

  4. Call paIsFormatSupported 5 times in a row, fill in a different samplerates each time: 44100, 48000, 88200, 96000, 192000.

     	PaStreamParameters inputParameters;
     	PaStreamParameters outputParameters;
     	inputParameters.device = inputDeviceIndex;
     	outputParameters.device = outputDeviceIndex;
     	inputParameters.channelCount = 1;
     	outputParameters.channelCount = 2;
     	inputParameters.sampleFormat = paFloat32;
     	outputParameters.sampleFormat = paFloat32;
     	inputParameters.hostApiSpecificStreamInfo = nullptr;
     	outputParameters.hostApiSpecificStreamInfo = nullptr;
     	const auto result = Pa_IsFormatSupported(&inputParameters, &outputParameters, sampleRate);
    

Expected behavior
I expected the audio thread to keep running

Actual behavior
What actually happened: The audio thread stops
||PaMacCore (AUHAL)|| Error on line 2530: err='-50', msg=Unknown Error

Desktop (please complete the following information):

  • OS: [e.g. Mac OS] MacOs
  • OS Version [e.g. 22] 14.1.2
  • PortAudio version: 19.8

Metadata

Metadata

Assignees

Labels

P2Priority: Highsrc-coreaudioApple Core Audio Host API src/hostapi/coreaudio

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions