From 2563d624caceada588d0a2b207c54b5a97679ef7 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Fri, 21 Aug 2026 06:02:33 +0200 Subject: [PATCH] fix(player): stop periodic audio dropouts during Dolby passthrough via MPVKit 1.0.25 With Audio Passthrough on, every (E-)AC-3 track on Apple TV dropped 100-220ms of audio every 1.79s. The system pipeline behind the compressed AVPlayer path reads unboundedly far ahead of the playhead and consumes its buffer in fixed ~1.8s quanta; the AO's 2s feed lead meant each refill overran the write head and the renderer skipped the missing audio to stay on clock. Bitrate- and route-independent, and invisible to the AO: item status, time control, and the feed margin all stayed clean while the sink output gapped (#1300, #1776). MPVKit 1.0.25 feeds the elementary stream 8s ahead of the observed playhead -- 4x the pipeline's refill quantum -- sizes the ES window from the configured lead, exposes it as --ao-avfoundation-compressed-lead, and keeps waiting during preroll while a slow source (a realtime-pinned server transcode) is still making priming progress instead of abandoning Atmos for PCM. Verified on an Apple TV 4K gen 3 with an HDMI audio capture rig against EAC3 768k and 640k streams: 21 dropouts/min on 2.15.0, zero across 10.7 minutes with the new lead; a 997Hz sine encoded as EAC3 through the full passthrough path is statistically identical to first-party AVKit playback of the same tone; a rate-limited server at 0.95x realtime now prerolls late on the compressed path instead of downgrading, and once the lead is filled mpv's cache pauses absorb the deficit with the margin intact. --- ios/Runner.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- macos/Runner.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- .../Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- tvos/Runner.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- tvos/scripts/test_wire_mpv.rb | 4 ++-- tvos/scripts/wire_mpv.rb | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0205f77d8..0aa871a60 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -798,7 +798,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = exactVersion; - version = 1.0.23; + version = 1.0.25; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a8f9d8116..1427f94e7 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e", - "version" : "1.0.23" + "revision" : "94108e2976b80e8a4b465c6bf72ea6934c5ebde4", + "version" : "1.0.25" } }, { diff --git a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index a8f9d8116..1427f94e7 100644 --- a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e", - "version" : "1.0.23" + "revision" : "94108e2976b80e8a4b465c6bf72ea6934c5ebde4", + "version" : "1.0.25" } }, { diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 9e0c159e7..e9f913b1a 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -895,7 +895,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = exactVersion; - version = 1.0.23; + version = 1.0.25; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7f04815eb..ea8611cdd 100644 --- a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e", - "version" : "1.0.23" + "revision" : "94108e2976b80e8a4b465c6bf72ea6934c5ebde4", + "version" : "1.0.25" } }, { diff --git a/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7f04815eb..ea8611cdd 100644 --- a/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e", - "version" : "1.0.23" + "revision" : "94108e2976b80e8a4b465c6bf72ea6934c5ebde4", + "version" : "1.0.25" } }, { diff --git a/tvos/Runner.xcodeproj/project.pbxproj b/tvos/Runner.xcodeproj/project.pbxproj index c3f8959ae..838bfd66e 100644 --- a/tvos/Runner.xcodeproj/project.pbxproj +++ b/tvos/Runner.xcodeproj/project.pbxproj @@ -1161,7 +1161,7 @@ repositoryURL = "https://github.com/edde746/MPVKit"; requirement = { kind = exactVersion; - version = 1.0.23; + version = 1.0.25; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 5c86d8050..b6a594229 100644 --- a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e", - "version" : "1.0.23" + "revision" : "94108e2976b80e8a4b465c6bf72ea6934c5ebde4", + "version" : "1.0.25" } } ], diff --git a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 5c86d8050..b6a594229 100644 --- a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/MPVKit", "state" : { - "revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e", - "version" : "1.0.23" + "revision" : "94108e2976b80e8a4b465c6bf72ea6934c5ebde4", + "version" : "1.0.25" } } ], diff --git a/tvos/scripts/test_wire_mpv.rb b/tvos/scripts/test_wire_mpv.rb index 5afeb3a6d..133b02497 100755 --- a/tvos/scripts/test_wire_mpv.rb +++ b/tvos/scripts/test_wire_mpv.rb @@ -24,8 +24,8 @@ class WireMpvTest < Minitest::Test ].freeze MPVKIT_PIN = { 'location' => 'https://github.com/edde746/MPVKit', - 'revision' => 'ee423a7e8727eeee4748f08cb7d3c00e935ed45e', - 'version' => '1.0.23', + 'revision' => '94108e2976b80e8a4b465c6bf72ea6934c5ebde4', + 'version' => '1.0.25', }.freeze def setup diff --git a/tvos/scripts/wire_mpv.rb b/tvos/scripts/wire_mpv.rb index ba1287680..5333a60b7 100755 --- a/tvos/scripts/wire_mpv.rb +++ b/tvos/scripts/wire_mpv.rb @@ -49,7 +49,7 @@ end # Swift Package: MPVKit. Restore each graph edge independently so a project # with a surviving package reference cannot silently omit the Runner linkage. pkg_url = 'https://github.com/edde746/MPVKit' -pkg_version = '1.0.23' +pkg_version = '1.0.25' pkg = project.root_object.package_references.find do |candidate| candidate.repositoryURL == pkg_url rescue false end