From d667b569671ec1eff353fc1c68b6da60099f4d8f Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 5 Jun 2026 07:04:04 +0200 Subject: [PATCH] Fix silent audio on tvOS with Atmos Continuous Audio Output (#928) With Atmos "Continuous Audio Output" enabled, some HDMI routes report 32 output channels, which mpv's audiounit AO cannot open - playback stays silent while other (AVPlayer-based) apps work fine. Update MPVKit to 0.41.0-n8.1.2, which builds mpv's avfoundation AO (AVSampleBufferAudioRenderer, previously macOS-only) for iOS/tvOS (mpvkit/MPVKit#73), and prefer it on tvOS via ao=avfoundation,audiounit so mpv still falls back to audiounit if it fails to initialize. iOS and macOS audio outputs are unchanged. The MPVKit pin must be exactVersion: SwiftPM sorts the pre-release identifier below 0.41.0, so a range starting at 0.41.0 never resolves to it. Note this tag also bumps FFmpeg from 8.0 to n8.1.1. --- Yattee.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- Yattee/Services/Player/MPV/MPVClient.swift | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Yattee.xcodeproj/project.pbxproj b/Yattee.xcodeproj/project.pbxproj index 7263a500..3c00ba53 100644 --- a/Yattee.xcodeproj/project.pbxproj +++ b/Yattee.xcodeproj/project.pbxproj @@ -1233,8 +1233,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/mpvkit/MPVKit.git"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 0.41.0; + kind = exactVersion; + version = "0.41.0-n8.1.2"; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 1520ed4d..dded042d 100644 --- a/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Yattee.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mpvkit/MPVKit.git", "state" : { - "revision" : "613c0ccc3acf70e136aaff880a9b5fe8fdfaf5b8", - "version" : "0.41.0" + "revision" : "99030e05253f0977b5e00eb079416565c608f2b1", + "version" : "0.41.0-n8.1.2" } }, { diff --git a/Yattee/Services/Player/MPV/MPVClient.swift b/Yattee/Services/Player/MPV/MPVClient.swift index a9444911..d5ca42d0 100644 --- a/Yattee/Services/Player/MPV/MPVClient.swift +++ b/Yattee/Services/Player/MPV/MPVClient.swift @@ -453,7 +453,12 @@ final class MPVClient: @unchecked Sendable { // Audio setOptionSync("audio-client-name", "Yattee") - #if os(iOS) || os(tvOS) + #if os(tvOS) + // Prefer avfoundation (AVSampleBufferAudioRenderer): audiounit can't open + // 32-channel HDMI routes (Atmos "Continuous Audio Output") and stays silent. + // mpv falls back to audiounit if avfoundation fails to initialize. + setOptionSync("ao", "avfoundation,audiounit") + #elseif os(iOS) setOptionSync("ao", "audiounit") #elseif os(macOS) setOptionSync("ao", "coreaudio")