Skip to content

fix(audio): read TrueHD Atmos from the major sync when the probe never reached the track (7.40.1) - #838

Merged
superuser404notfound merged 2 commits into
mainfrom
fix/truehd-late-start
Oct 18, 2026
Merged

superuser404notfound merged 2 commits into
mainfrom
fix/truehd-late-start

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

A TrueHD track whose first packet lies beyond the probe window kept AV_PROFILE_UNKNOWN, so objectAudioRendering played it through the channel bridge. Found on John Wick: Chapter 2 (TrueHD from 22 s, 45.8 MB into the file) on an Apple TV with the tvOS probe budget (16 MiB / 10 s).

With rendering requested and the profile unknown, the engine now peeks the track's packets where the first producer starts and reads the major sync the way mlpdec does (four substreams, top bit of substream_info), then marks the stream Atmos. Peeked packets are not consumed; budget 8192 packets / 64 MiB, otherwise the channel bridge as before.

Measured with aetherctl serve --atmos-bed 7.1.4 at the tvOS probe budget:

start without the check with it
0 s profile=-99, E-AC-3 Atmos, 2599 packets, 44.7 MB, 679 ms, apac.31.03, CHANNELS="12"
926.8 s profile=-99, E-AC-3 Atmos, 10 packets, 267 KiB, 30 ms

TrueHDMajorSyncTests cover a real Atmos and a real non-Atmos major sync, a sync in a later access unit, a packet without one, and malformed headers. Full suite green (XCTest 779, swift-testing 4689).

Includes the 7.40.1 prep commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS

Vincent Herbst and others added 2 commits October 18, 2026 18:38
…r reached the track

A TrueHD track that starts after the probe window (John Wick: Chapter 2, TrueHD from 22 s,
45.8 MB in) leaves find_stream_info without a decoded frame, so the stream keeps
AV_PROFILE_UNKNOWN and objectAudioRendering played it through the channel bridge. When
object rendering is wanted and the profile is unknown, the engine now peeks the track's
packets where the first producer starts and reads the major sync the way mlpdec does (four
substreams, top bit of substream_info). Measured with the tvOS probe budget (16 MiB / 10 s):
from the start 2599 packets, 44.7 MB, 679 ms; on a resume 10 packets, 30 ms; APAC 7.1.4 in
both, where the same build without the check served E-AC-3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
…hen the probe misses the track

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
@superuser404notfound
superuser404notfound merged commit 93d54e5 into main Oct 18, 2026
4 checks passed
@superuser404notfound
superuser404notfound deleted the fix/truehd-late-start branch October 19, 2026 09:09
pkajaba pushed a commit to pkajaba/AetherEngine that referenced this pull request Oct 25, 2026
…X bed test, no pause on HDMI, stale packet and the APAC anchor, DV P5 local stills

Before merge:
1. SoftwareAtmosRouteTests.apacRoutes takes .l714 for DTS:X (main renders DTS:X only into a bed
   that carries it one to one) and a new test pins that every other bed stays PCM while TrueHD
   Atmos renders into any. The software host now logs why a TrueHD or DTS track stays on PCM
   (SoftwareAtmosRoute.apacRefusal), as it already did for E-AC-3.
2. Route removal pauses only for outputs a viewer takes away: headphones, Bluetooth (A2DP, LE,
   HFP), AirPlay and USB, spelled as AVAudioSession.Port raw values (checked against the session
   on iOS / tvOS). HDMI is out, so an ARC / eARC receiver toggling on an Apple TV keeps playing.
3. A pre-seek audio packet can no longer anchor the APAC bridge: SoftwareAudioProducing gains the
   AE#492 feed epoch, the demux loop reads it before the read, and SoftwareAPACProducer checks it
   under the same lock as flush()'s startSegment.
4. A local software session reports supportsCacheBackedStills false for a Dolby Vision Profile 5 /
   10.0 stream without the DolbyVisionStillReshaping trait (FrameDecodeContext.yieldsStill).

Follow-ups on the FEL + TrueHD Atmos path:
- The demux loop's "decoder not recovering" clock fallback uses the producer's own first-buffer
  budget; the APAC producer's is the bridge's dead-decoder bound, since its first packet is about
  100 TrueHD access units in and the old 50 sent every TrueHD load to the video-anchored clock.
- The software host resolves a TrueHD track whose profile the probe missed from its major sync,
  sharing HLSVideoEngine.trueHDMajorSyncVerdict with the loopback route (superuser404notfound#838).

CHANGELOG: route removal and the setRate(0) interruption change are listed; the software-host
Atmos entry drops `aetherctl play --atmos-bed` (main has it).

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant