Repository navigation
Description
Summary
On the loopback-HLS backend (HEVC served over the internal 127.0.0.1 HLS to AVPlayer), a burst of rapid or repeated seeks can wedge the pipeline: currentTime stops advancing for roughly 10 seconds while state remains .playing. The engine recovers on its own, but after recovery the reported currentTime no longer matches the frame on screen (off by 5 to 10 seconds), and broken/pixelated frames are visible during recovery.
Environment
- AetherEngine 3.4.0 (
4a442c6), FFmpegBuild (07ffa41) - tvOS 26.x, Apple TV 4K (2nd gen AppleTV11,1 and 3rd gen AppleTV14,1)
- HEVC content on the native loopback-HLS to AVPlayer backend (not the software AVSampleBuffer path)
- LoadOptions:
suppressDisplayCriteria: false,matchContentEnabled: true,audioBridgeMode: .lossless
Steps to reproduce
- Play an HEVC item on the loopback-HLS backend.
- Perform a burst of rapid seeks (repeated short skips, or fast scrubbing back and forth) over several seconds.
- Observe the player after the seek burst settles.
Observed
- The clock freezes:
currentTimestops advancing whilestatestays.playingand the display holds a single frame. - No buffering signal during the stall: the engine does not report
.buffering/.loading. It sometimes reports.pausedfor what is actually a buffering stall, which is indistinguishable from a real pause. - After roughly 10 seconds the engine recovers on its own, but:
- the recovered
currentTimeadvances non-monotonically (in one capture a seek to 146.7s was followed by the clock reading 271.9s seconds later), - the reported
currentTimediverges from the frame actually displayed (clock vs frame off by 5 to 10 seconds), and - broken/pixelated frames appear briefly during recovery (consistent with resuming mid-GOP without a clean decoder reset).
- the recovered
- A same-position seek issued during the wedge is a no-op, so it cannot be used to re-prime the pipeline.
Expected
A burst of seeks should leave the pipeline either playing from the final target, or briefly buffering (reported as buffering) and then resuming, with currentTime monotonic and matching the displayed frame.
Impact
The clock-versus-frame divergence is the most damaging part: any consumer that trusts currentTime (scrubber UI, A/V sync, or an app coordinating multiple players) is misled, since the reported position looks correct while the picture is seconds away. It cannot be detected from outside the engine, because the only position signal available is the diverged clock.
Notes
Found while embedding AetherEngine as the default VOD engine in a tvOS app. Reproducible only under heavy scrubbing; ordinary playback with occasional seeks is unaffected. Happy to provide UDP logs from a capture or a minimal standalone repro app if useful.
Activity
Merge fix/issue-35-rapid-seek-wedge: coalesce burst-seek restarts + i…
feat(aetherctl): seektest rapid-seek burst repro harness (#35)
superuser404notfound commentedon Jun 15, 2026
Thanks for the unusually precise report, the clock-versus-frame note in particular pointed straight at the root cause.
Root cause
All of the symptoms trace to an uncoordinated producer-restart cascade. On the loopback-HLS path, every out-of-range segment request triggers a full producer restart: tear down the old producer (waiting up to 5s for its pump to exit), seek the demuxer (network-bound on a remote source), and rebuild. These serialize on a single gate with no coalescing. A burst of rapid seeks fires many of them back to back, and on a slow/remote source each one is slow enough that they pile up, which is the ~10s wedge you saw.
Worse, when the 5s wait times out the old producer is abandoned but keeps reading the shared demuxer, so it can steal the first post-seek packet. The surviving producer then starts a GOP late (the broken/pixelated frames) and computes a wrong timeline shift, which the clock fold publishes as the large non-monotonic jump (your 146.7s reading 271.9s). So the wedge, the broken frames, and the clock-versus-frame divergence are one root, not three.
This only reproduces under heavy scrubbing against a network-bound source, which is why it is hard to trigger with ordinary seeks: restart latency has to exceed the seek spacing for the cascade to overlap.
Fix
Producer restarts now coalesce: a burst collapses to the in-flight restart plus a single final restart at the settled target, instead of serializing one full teardown per intermediate scrub position. The surviving restart runs cleanly without the abandoned-producer demuxer contention, so it lands on a keyframe with the correct shift. Off-device, with an injected restart delay to force the overlap, this takes the longest "playing but clock frozen" interval from 6.35s to 0.21s and the coalescer absorbs the burst as expected.
Separately, there is now a published
isBufferingsignal that is true during a mid-playback rebuffer stall, so a stall is distinguishable from real playback and from an explicit pause (your point about it being indistinguishable from a real pause). It is kept separate fromstate, which still reports.playingacross a rebuffer so the transport icon does not flicker.Could you re-test?
The fix is on
mainnow (not yet in a tagged release). Could you build against latestmainand run your scrub-burst repro again? The wedge is verified off-device, but the clock-versus-frame divergence is the hardest part to confirm without a real frame on screen, so your test against the actual source would be the decisive check before I cut a release. If it still repros, the UDP capture you offered would be very welcome.chore(release): 3.5.0 — DVD + Blu-ray ISO playback
rrgomes commentedon Jun 15, 2026
Confirmed fixed in 3.5.0. 🎉
Bumped our pin 3.4.0 → 3.5.0 and re-ran the original repro on an Apple TV 4K (tvOS 26.5): a long H.264/AVC asset on the loopback-HLS path, scrubbed hard back and forth — sustained click-skip bursts plus continuous swipe-scrub — for several minutes, in plain single-player playback. No wedge, no clock↔frame divergence, no stuck spinner; every scrub settles cleanly and resumes at the target. The
RestartCoalesceris doing exactly what it describes.For context, we'd been masking this with a watchdog that pins a clean frozen frame; on 3.5.0 that path no longer triggers under heavy scrub. Thanks for the quick turnaround — happy to see this closed.
fix(seek): await the real loopback-HLS landing + publish isSeeking/se…
feat(video): add RestartCoalescer for burst-seek restart coalescing (s…
fix(video): coalesce burst-seek producer restarts to kill the wedge (s…
docs(video): update stale restartProducer comment ref to requestResta…
feat(engine): publish isBuffering for mid-playback stalls (superuser4…
fix(hls): never 404 an in-range loopback segment; re-assert orphaned …
fix(video): break the loopback-HLS VOD scrub-burst livelock (superuse…
fix(engine): make #79 scrub-burst recovery anchor authoritatively + u…
fix(startup): gate cold DV/HDR master start on real track readiness, …
2 remaining items
fix(fallback): revert the SDR-signalled reduced master (#98)
fix(startup): suspend the superuser404notfound#65 backpressure wedge …
fix(hls): serve FRAME-RATE on HDR masters, recover live master reject…
fix(playback): wait for the first segment before failing the readines…
fix(playback): wait for the first segment before failing the readines…
diag(airplay): clamp the declared peak on the receiver's HDR master (#…
fix(airplay): retry the master before falling back, not after (#227)
feat(airplay): offer the HDR master to the receiver, gated on readine…
fix(display): trust an accepted HDR write once the headroom has decayed
fix(live): every live item's axis is stated by the playlist it loads (s…
fix(producer): a backward scrub is a fetching consumer, not a wedge (#…
fix(startup): a local start is a plain play; the readiness gate is Ai…
fix(startup): a local start is a plain play; the readiness gate is Ai…
feat(hls): audio as its own rendition, the HLS Authoring Specificatio…
feat(hls): a demuxed session plays without a master from its two rend…