By defining JUCE_IOS_AUDIO_EXPLICIT_SAMPLERATES, the iOS audio device
will always use the requested samplerates instead of querying the
current audio device for the samplerates it supports. This is useful
because certain hardware (such as the Focusrite iTrack Dock) takes a
long time to set new samplerates, which can end up freezing the main
thread for significant lengths of time.
This approach is inspired by the AUM app for iOS, which appears to
provide a fixed list of "allowed" samplerates, rather than querying the
device for its allowed samplerates.
When AudioDeviceStop() is called from a thread other than the IO thread there are no guarantees about the IOProc being called before the thread actually terminates. Moving this call to the audioCallback() method ensures that the device will be stopped immediately and we can remove a check that was taking a few seconds to close devices.
When immediately closing a MidiInput after starting, the ALSA handle may be closed whilst the MidiInputThread is running and it polls a destroyed handle
Requesting a callback when opening an Oboe device is required on some devices to get a FAST stream, so pass a dummy callback object to the temporary stream used when querying the device buffer size in order to get the best available.
If input channels have been requested but no data is being sent from CoreAudio (usually due to permissions not being granted yet) then avoid waiting unnecessarily in AudioIODeviceCombiner::readInput() which could previously cause audio glitches. Also changed the wait time to use an exponential backoff.