From dd93aec0296d417fe712b9f92bcdf81a17009574 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sun, 23 Aug 2015 13:53:07 +1000 Subject: [PATCH] Don't query supported sample rates for ASIO devices in PortaudioBackend There has been reports this can take several minutes on some devices so just return the default rates(and fail to open the device when a SR is specified that isn't supported) --- libs/backends/portaudio/portaudio_io.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/backends/portaudio/portaudio_io.cc b/libs/backends/portaudio/portaudio_io.cc index 28127a1298..920929cd6b 100644 --- a/libs/backends/portaudio/portaudio_io.cc +++ b/libs/backends/portaudio/portaudio_io.cc @@ -117,6 +117,13 @@ PortAudioIO::available_sample_rates(int device_id, std::vector& sampleRat { if (!initialize_pa()) return -1; +#ifdef WITH_ASIO + if (get_current_host_api_type() == paASIO) { + get_default_sample_rates(sampleRates); + return 0; + } +#endif + // TODO use separate int device_input, int device_output ?! if (device_id == DeviceDefault) { device_id = get_default_input_device ();