diff --git a/CHANGELOG.md b/CHANGELOG.md index 391e00d25..0a17966c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,6 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **CoreAudio**: Streams no longer start automatically on creation; call `play()` manually. - **CoreAudio (iOS)**: `default_input_config()` and `default_output_config()` now prefer 48 kHz, then 44.1 kHz, then the maximum supported sample rate, instead of always taking the maximum. +- **CoreAudio (iOS)**: `default_output_config()` now prefers stereo over the maximum channel count. - **JACK**: Timestamps now use the precise hardware deadline. - **JACK**: Buffer size change no longer invokes the error callback; internal buffers are resized without error. diff --git a/src/host/coreaudio/ios/mod.rs b/src/host/coreaudio/ios/mod.rs index 3e8f16a6f..2b560d321 100644 --- a/src/host/coreaudio/ios/mod.rs +++ b/src/host/coreaudio/ios/mod.rs @@ -118,13 +118,14 @@ impl Device { } fn default_output_config(&self) -> Result { - // Get the maximum channel count config from supported configs - let range = get_supported_stream_configs(false).last().ok_or_else(|| { - Error::with_message( - ErrorKind::UnsupportedConfig, - "No supported output configuration", - ) - })?; + let range = get_supported_stream_configs(false) + .max_by(|a, b| a.cmp_default_heuristics(b)) + .ok_or_else(|| { + Error::with_message( + ErrorKind::UnsupportedConfig, + "No supported output configuration", + ) + })?; Ok(range .try_with_standard_sample_rate() .unwrap_or_else(|| range.with_max_sample_rate()))