Ticket #49 (assigned defect)

Opened 17 months ago

Last modified 6 months ago

Default device is paNoDevice if the Default API contains no devices.

Reported by: bjornroche Owned by: rossb
Priority: critical Milestone: V19-RC1
Component: common Version:
Keywords: Cc:

Description

From Eliot Blennerhassett:

If portaudio is built with support for more than one API, and the default API has no devices (or is not installed), then Pa_GetDefault[Input| Output]Device() returns an error paNoDevice, even if other APIs have available devices.

The following patch returns the first available device from any API if one isn't available from the default API.

(I guess this could be turned around, and ensure that the default API has at least one device!)

Index: pa_front.c =================================================================== --- pa_front.c (revision 1182) +++ pa_front.c (working copy) @@ -747,6 +747,17 @@

else {

result = hostApis_[hostApi]->info.defaultInputDevice;

+ if (result == paNoDevice) + { + hostApi=0; + while (hostApis_[hostApi]) + { + result = hostApis_[hostApi]->info.defaultInputDevice; + if (result != paNoDevice) + break; + hostApi++; + } + }

}

#ifdef PA_LOG_API_CALLS

@@ -775,6 +786,17 @@

else {

result = hostApis_[hostApi]->info.defaultOutputDevice;

+ if (result == paNoDevice) + { + hostApi=0; + while (hostApis_[hostApi]) + { + result = hostApis_[hostApi]->info.defaultOutputDevice; + if (result != paNoDevice) + break; + hostApi++; + } + }

}

#ifdef PA_LOG_API_CALLS

Change History

Changed 6 months ago by rossb

  • status changed from new to assigned
  • milestone changed from V19-PREVIEW1 to V19-RC1

Changed 6 months ago by rossb

  • priority changed from major to critical
Note: See TracTickets for help on using tickets.