From b642813716e9a937e54712a9487398a26f16bbf4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 1 Jul 2026 06:40:16 +0200 Subject: [PATCH] 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. --- Yattee/Services/Player/MPV/MPVClient.swift | 8 +++++++- Yattee/Views/Settings/MPVOptionsSettingsView.swift | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Yattee/Services/Player/MPV/MPVClient.swift b/Yattee/Services/Player/MPV/MPVClient.swift index d5ca42d0..e0958f87 100644 --- a/Yattee/Services/Player/MPV/MPVClient.swift +++ b/Yattee/Services/Player/MPV/MPVClient.swift @@ -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 diff --git a/Yattee/Views/Settings/MPVOptionsSettingsView.swift b/Yattee/Views/Settings/MPVOptionsSettingsView.swift index 1c4fcd95..3bfbd44f 100644 --- a/Yattee/Views/Settings/MPVOptionsSettingsView.swift +++ b/Yattee/Views/Settings/MPVOptionsSettingsView.swift @@ -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"))