Skip to content

TrueHD Atmos → APAC: the pump drops to .utility at 16 s of lead and then runs below real time, so VOD stalls every few minutes on Apple TV 4K (A15) #850

Closed

Description

@imbenjamin

What happened?

With objectAudioRendering on, a 4K Dolby Vision remux with TrueHD Atmos stalls briefly every few minutes on an Apple TV 4K (3rd generation). The same file with object rendering off (TrueHD → E-AC-3 channel bridge) plays without a stall.

Expected: the pump stays ahead of the consumer, and the forward window (forwardBufferSegments, 75 here) fills as it does with the channel bridge.

What it did instead was a cycle driven by the AE#286 pump QoS retune:

  1. On .userInitiated the pump produces at about 1.15–1.25x real time (TrueHD object decode + APAC encode + 30 Mbit/s HEVC remux).
  2. At lead=4 (pumpRelaxedLeadSeconds = 16 s) it drops to .utility.
  3. On .utility it produces at about 0.1–0.5x real time, so the 16 s lead drains within 15–30 s.
  4. At lead=0 or -1 AVPlayer waits for a segment (playbackStalled, AVPlayerWaitingToMinimizeStallsReason), the pump returns to .userInitiated, and the cycle starts again.

Over 15 minutes the pump changed class 22 times and the lead never passed 4 segments, so the forward window never applies with object rendering on. Not every drain becomes a visible stall, which is why the stutters looked random to the viewer. With object rendering off, the same title on the same device went to .utility once and never came back. It filled the 75-segment window, with no stalls in 21 minutes.

Later in the same session it got worse. From 09:16:50 the pump stayed on .userInitiated (no further retune), yet produced at only 1.02x and then 0.96x real time over the next five minutes. The lead never reached 4 segments again, and AVPlayer stalled twice 22 s apart on the fast class (09:21:32 and 09:21:54, waits of 4.7 s and 4.9 s for seg230 and seg234). Early in the session the same class managed 1.15–1.25x. Then it collapsed: from 09:22 nearly every segment request waited (1.1–7.3 s), with two more stalls at 09:22:49 and 09:23:05, about 20 minutes into the session. That fits thermal throttling (see "Anything else").

The network wasn't the limit: the AVIO pump sat at its 16 MB high-water mark throughout, with first data after 35–65 ms.

Production rate per QoS window, from the ledger's itemAxis against wall time:

Pump class Wall time Content produced Rate
.utility 25.5 s 3.1 s 0.12x
.utility 14.8 s 4.6 s 0.31x
.utility 15.2 s 1.6 s 0.10x
.utility 20.6 s 3.7 s 0.18x
.utility 28.0 s 14.3 s 0.51x
.userInitiated 46.9 s 54.5 s 1.16x
.userInitiated 112.8 s 130.3 s 1.15x
.userInitiated 66.2 s 81.5 s 1.23x

A possible direction: pumpMayRelax could account for whether production at .utility keeps up with real time (for example by measuring it, or by not relaxing while the APAC bridge is in the path). Otherwise a demoted pump has to drain the whole relaxed lead before it is promoted again. A cheaper decode-and-encode would help on its own, and would also reduce the heat (see "Anything else").

Steps to reproduce

  1. On an Apple TV 4K (3rd generation), tvOS 27.0, build AetherEngine 7.44.0 with the TrueHDObjectAudio trait and set objectAudioRendering to APAC in the 7.1.4 layout. forwardBufferSegments is 75 here, but the default shows the same cycle.
  2. load() a 4K Dolby Vision Profile 8.1 MKV remux with TrueHD Atmos (about 35 Mbit/s overall) over HTTP. It takes the native loopback route.
  3. Let it play for 10–15 minutes and grep the log for pump qos, playbackStalled and served .* wait=.
  4. Repeat with objectAudioRendering off: one pump qos -> utility, no stalls.

AetherEngine version or commit SHA

7.44.0

Host app

Custom / my own integration

Platform

tvOS

OS version

tvOS 27.0 (24J361)

Device / chip

Apple TV 4K (3rd gen, 2022), AppleTV14,1, A15

Playback path

Native AVPlayer

Source media (for playback bugs)

MKV, 28.2 GB, 34.9 Mbit/s overall

  • Video: HEVC Main 10, 3840x2160, Dolby Vision Profile 8.1 (HDR10), 29.4 Mbit/s
  • Audio (selected): TrueHD Atmos 7.1, 4.6 Mbit/s (object configuration: LFE + 13 objects)

Error codes / log lines

[HLSVideoEngine] audio: codec=truehd (bridge required), decoding + Atmos object render into 7.1.4, APAC re-encode
[SpatialAudioBridge] init: layout=7.1.4 bitRate=3840 kbps codecs=apac.31.03 priming=2048 frames
[HLSVideoEngine] segment retention budget: 2048 MiB (volumeAvailable=31015 MiB, forwardWindow=75 seg)

One stall, mid-film, no seek:
09:13:10.095 [HLSSegmentProducer] pump qos -> utility (now=utility epochHead=136 target=132 lead=4)
09:13:10.262 [HLSSegmentProducer] #65 ledger seg-137 ... itemAxis=793.251s
09:13:24.141 [HLSLocalServer] GET /seg137.mp4
09:13:26.142 [HLSLocalServer] seg137: slow serve, sending early chunked header
09:13:28.086 [NativeAVPlayerHost] #2 playbackStalled
09:13:28.091 [NativeAVPlayerHost] #2 timeControlStatus=waitingToPlay reason=AVPlayerWaitingToMinimizeStallsReason
09:13:29.491 [HLSSegmentProducer] pump qos -> userInitiated (now=userInitiated epochHead=136 target=137 lead=-1)
09:13:29.494 [HLSSegmentProducer] #65 ledger seg-138 ... itemAxis=803.511s
09:13:29.496 [HLSVideoEngine] seg137: served 30707463 B (wait=5355.2ms cache=26 restarted=false)
09:13:29.575 [NativeAVPlayerHost] #2 timeControlStatus=playing

seg-138 took 19.2 s of wall time on .utility for about 10 s of content.

Later, with the pump on .userInitiated since 09:16:50:
09:21:32.384 [NativeAVPlayerHost] #2 playbackStalled
09:21:33.176 [HLSVideoEngine] seg230: served 33391494 B (wait=4734.2ms cache=119 restarted=false)
09:21:54.604 [NativeAVPlayerHost] #2 playbackStalled
09:21:55.600 [HLSVideoEngine] seg234: served 35102026 B (wait=4941.4ms cache=123 restarted=false)
No WARNING or error lines; no SpatialAudioBridge re-anchors, feed failures or decoder self-resets.

Anything else

  • Host: Dionysus Player, a Jellyfin client, direct-playing from a Jellyfin server on the LAN.
  • Thermal. The device's ProcessInfo.thermalState (read by the host's stats panel) reached .serious at times during these sessions. The A15 Apple TV has no fan, so the repeated catch-up bursts may be heating it, and thermal throttling would hit .utility work first, making the drains faster still. The later slowdown on .userInitiated (1.2x falling to about 1.0x) suggests throttling reaches the fast class too. The engine doesn't log thermal state, so this is an observation, not a measurement.
  • 7.45.0's notes don't touch the pump or the APAC bridge, so I expect it behaves the same.
  • Related, no duplicate found among the open issues:
  • Full logs of both sessions (object rendering on and off) are available on request.

Activity

  1. superuser404notfound commented on Oct 24, 2026

    @superuser404notfound
    Owner

    Thanks for this report. The per-window production table made the cause obvious: the AE#286 relaxation only ever asked how far ahead the pump was, never whether .utility still runs faster than real time.

    There were two parts to it:

    1. The pump only re-decided at segment boundaries. On .utility one segment took 19 s of wall time in your log, longer than the whole 16 s relaxed lead, so the promotion could only arrive at lead=-1, with AVPlayer already waiting.
    2. Nothing measured the relaxed rate. At 0.10 to 0.51x the forward window can never fill on .utility, so the pump cycled between a drained lead and a promotion for the whole session.

    Fixed on main in 9759e5e (commit 9421ef0), along the direction you suggested:

    • While relaxed, the pump measures content produced against wall time. The measurement adds up across relaxed stretches, because a lead-driven promotion ends each stretch long before one window is complete, and it is cleared whenever the relaxed pump parks, since a park proves it is keeping up. Once an 8 s window comes in below 1.0x, the pump stays on .userInitiated for the rest of the session, seeks included, and logs it once:
      [HLSSegmentProducer] pump qos: utility produced at 0.59x real time, below 1.00x, staying userInitiated for this session (AE#850)
    • The class is also re-decided once a second inside a segment, not only at the boundaries.
    • A session that keeps up on .utility relaxes exactly as before, so the AE#286 energy behaviour is unchanged where it works.

    Measured with aetherctl play --atmos-bed 7.1.4 against a 4K DV + TrueHD Atmos MKV (about 53 Mbit/s) over HTTP from a Jellyfin server, on an M1 loaded with two concurrent 4K HEVC decodes so that .utility falls below real time the way it does on the A15. Arms were alternated, 150 s each:

    build class changes stalls segments produced
    main before the fix 19 / 28 0 / 1 39 / 35
    with the fix 4 / 4 0 / 0 42 / 42

    Both fixed runs locked in after two short relaxed stretches (0.59x and 0.73x). On an idle M1 the fixed build relaxed once and stayed relaxed.

    What this does not cover is the later part of your session, where .userInitiated itself fell to about 1.0x and then 0.96x. No class choice gets the pump above what the device delivers at that point, and your thermal observation fits that. That part needs a cheaper decode-and-encode, which I'm tracking separately.

    This isn't in a release yet. A retest on the A15 with a build from main would be very welcome when you get a chance: grep for AE#850 and pump qos. I'll keep the issue open until then.

  2. imbenjamin commented on Oct 25, 2026

    @imbenjamin
    Author

    Thanks for the fix and the detailed write-up. I retested on the same Apple TV 4K (3rd gen, A15, tvOS 27.0) with the same title and settings as the report: 4K DV Profile 8.1 + TrueHD Atmos, objectAudioRendering to APAC in 7.1.4, forwardBufferSegments 75, native loopback route, HDMI to an AV receiver. The build was from main at 9759e5e. Playback started at the beginning and ran for 28 minutes.

    It played without a single stall, but the new latch never fired. .utility kept up on its own the whole time.

    7.44.0 (report) main at 9759e5e
    Pump class changes 22 in 15 min 1 (-> utility at lead=4, 8 s in), none after
    pump qos ... staying userInitiated (AE#850) n/a not logged
    AVPlayer stalls after startup several, every ~20 s after 15 min 0, no served … wait= lines
    Lead never above 4 segments filled the 75-segment window, about 5.5 min ahead at 28 min
    .utility production rate 0.10–0.51x about 3.4x for the first 85 s, then 2.1x until the window filled
    cpuprobe (not available in 7.44.0) about 135% while filling, 30–70% once the window was full
    Late slowdown (.userInitiated near 1.0x after 15–20 min) yes not seen

    Because .utility ran this far above real time, I'd guess the improvement comes mostly from the TrueHD exact-decode change (#731, LibTrueHD 3.1.0) rather than from the pump. Today the box may also have been cooler at the start than on the day of the report. So this run confirms the end result on the A15 but doesn't exercise the latch itself. The lower CPU would also explain why the late, thermal-looking slowdown didn't come back.

    The receiver showed Dolby Atmos throughout, so the 7.47.0 activator fix works here too.

    Happy to close this from our side. We'll pick it up in the next release and keep an eye on long sessions.

  3. superuser404notfound commented on Oct 26, 2026

    @superuser404notfound
    Owner

    Thank you for the long retest and the comparison table, that is exactly the evidence needed here.

    Your reading matches the history: the TrueHD exact-decode change (#731, LibTrueHD 3.1.0) is already in 9759e5e, so a .utility pump at 2 to 3.4x is most likely that cheaper decode, plus a cooler box. On this title the latch is then simply not needed, which is the intended outcome: a session that keeps up on .utility stays relaxed as before. The latch itself is covered by the unit tests and the loaded-M1 runs above, where it engaged at 0.59x and 0.73x.

    It is also good to see the late .userInitiated slowdown gone at 30 to 70% CPU with a full window, and Atmos holding on the receiver with the 7.47.0 activator fix.

    The fix goes into the next release. If a long session on the A15 ever drains the lead again, a log with the pump qos and AE#850 lines is all that is needed to pick this up again.

  4. added a commit that references this issue on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions