Fall back to avfoundation AO when coreaudio fails on macOS

macOS 27 beta's AUHAL rejects mpv's channel-layout property with paramErr
(-50), so the coreaudio AO fails to initialize and playback is silent.
Change the macOS ao option from "coreaudio" to "coreaudio,avfoundation"
so mpv self-heals: older macOS keeps using coreaudio unchanged, while the
beta drops to avfoundation (AVSampleBufferAudioRenderer) instead of playing
no sound.
This commit is contained in:
Arkadiusz Fal
2026-07-01 06:40:16 +02:00
parent a4b0c60a3e
commit b642813716
2 changed files with 8 additions and 2 deletions

View File

@@ -461,7 +461,13 @@ final class MPVClient: @unchecked Sendable {
#elseif os(iOS)
setOptionSync("ao", "audiounit")
#elseif os(macOS)
setOptionSync("ao", "coreaudio")
// coreaudio is the native macOS AO, but on macOS 27 beta it fails to
// initialize ("unable to set the input channel layout on the audio
// unit -50"), leaving playback silent. Add avfoundation
// (AVSampleBufferAudioRenderer) as a fallback so mpv self-heals: older
// macOS keeps using coreaudio, and where coreaudio can't open the
// device mpv drops to avfoundation instead of playing no sound.
setOptionSync("ao", "coreaudio,avfoundation")
#endif
// Cache settings for network streams

View File

@@ -123,7 +123,7 @@ private struct DefaultOptionsSection: View {
#if os(iOS) || os(tvOS)
options.append(("ao", "audiounit"))
#else
options.append(("ao", "coreaudio"))
options.append(("ao", "coreaudio,avfoundation"))
#endif
options.append(("cache", "yes"))