Repository navigation
Description
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:
- On
.userInitiatedthe pump produces at about 1.15–1.25x real time (TrueHD object decode + APAC encode + 30 Mbit/s HEVC remux). - At
lead=4(pumpRelaxedLeadSeconds= 16 s) it drops to.utility. - On
.utilityit produces at about 0.1–0.5x real time, so the 16 s lead drains within 15–30 s. - At
lead=0or-1AVPlayer 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
- On an Apple TV 4K (3rd generation), tvOS 27.0, build AetherEngine 7.44.0 with the
TrueHDObjectAudiotrait and setobjectAudioRenderingto APAC in the 7.1.4 layout.forwardBufferSegmentsis 75 here, but the default shows the same cycle. 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.- Let it play for 10–15 minutes and grep the log for
pump qos,playbackStalledandserved .* wait=. - Repeat with
objectAudioRenderingoff: onepump 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.seriousat 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.utilitywork 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:
- HLSSegmentProducer.pump QoS: .utility cuts process energy ~60% vs .userInitiated at identical work #286 (closed): the pump QoS retune this cycle comes from. Its notes say a measurement on a device with thermal headroom can't settle the
.utilitycost; this is a case where the work at.utilitydoesn't keep up at all. - TrueHD Atmos with heights on Apple TV: our object-to-APAC rendering, offered as a reference #731: the APAC bridge, measured at about 9.5x real time on Apple Silicon (6.5–7.2x in a debug build). The A15 here manages about 1.2x on
.userInitiatedwith a 4K remux in the same pump. - Priority inversion: userInitiated demux consumer blocks on the utility read-ahead producer #519: the same pattern on the software path, a
.userInitiatedconsumer waiting on a.utilityproducer.
- HLSSegmentProducer.pump QoS: .utility cuts process energy ~60% vs .userInitiated at identical work #286 (closed): the pump QoS retune this cycle comes from. Its notes say a measurement on a device with thermal headroom can't settle the
- Full logs of both sessions (object rendering on and off) are available on request.
Activity
Merge fix/pump-relax-rate-850: a pump that measures below real time o…
superuser404notfound commentedon Oct 24, 2026
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
.utilitystill runs faster than real time.There were two parts to it:
.utilityone segment took 19 s of wall time in your log, longer than the whole 16 s relaxed lead, so the promotion could only arrive atlead=-1, with AVPlayer already waiting..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:
.userInitiatedfor 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).utilityrelaxes exactly as before, so the AE#286 energy behaviour is unchanged where it works.Measured with
aetherctl play --atmos-bed 7.1.4against 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.utilityfalls below real time the way it does on the A15. Arms were alternated, 150 s each: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
.userInitiateditself 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#850andpump qos. I'll keep the issue open until then.fix(pump): stay userInitiated once the relaxed class measures below r…
imbenjamin commentedon Oct 25, 2026
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,
objectAudioRenderingto APAC in 7.1.4,forwardBufferSegments75, 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.
.utilitykept up on its own the whole time.-> utilityatlead=4, 8 s in), none afterpump qos ... staying userInitiated (AE#850)served … wait=lines.utilityproduction ratecpuprobe.userInitiatednear 1.0x after 15–20 min)Because
.utilityran 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.
superuser404notfound commentedon Oct 26, 2026
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
.utilitypump 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.utilitystays 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
.userInitiatedslowdown 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 qosandAE#850lines is all that is needed to pick this up again.Merge AetherEngine 7.62.0 into pear