Skip to content

load(url:) with isLive: true on an HLS playlist URL fails open: silent reconnect loop with no terminal state (262 cycles over a 5.75-min observation), playlist body consumed as raw bytes, no error, no give-up #140

Closed

Description

@cmcpherson274

What happened?

I called player.load(url:) with LoadOptions(isLive: true, suppressDisplayCriteria: true) on a
Jellyfin live-TV master.m3u8 URL (header-based auth).

I know this is not the documented HLS-live entry point — the README documents
HLSLiveIngestReader(playlistURL:) (with a typed HLSIngestError fallback) and
LoadOptions.nativeRemoteHLS (which even names "a Jellyfin live channel"). This report is about
what the GENERIC path does when an m3u8 is misrouted onto it, which is an easy mistake given the
URL shape.

Expected: either safe auto-routing to an HLS entry point, or a typed, actionable rejection like
HLSIngestError.

Instead: the engine consumed the playlist body as a raw byte stream and reconnected continuously
for the entire bounded observation — 262 reconnect cycles over 5.75 minutes, no error surfaced,
no watchdog escalation, and no terminal state reached. Each cycle re-read the same ~500-byte
playlist body at HTTP 200; zero producer segments, zero decoded output. Nothing is left to
render (I did not watch a screen during this cell, but the loop produces no frames).

Steps to reproduce

  1. Take a Jellyfin live-TV session's master.m3u8 (a variant playlist served over HTTP).
  2. player.load(url: m3u8URL, options: LoadOptions(isLive: true, suppressDisplayCriteria: true)),
    auth supplied via HTTP headers.
  3. Watch the @published state and the [AVIOReader] logs: the connection ends at the playlist
    body length and reconnects, and this repeats without ever reaching a terminal state.

AetherEngine version or commit SHA

  1. Take a Jellyfin live-TV session's master.m3u8 (a variant playlist served over HTTP). 2. player.load(url: m3u8URL, options: LoadOptions(isLive: true, suppressDisplayCriteria: true)), auth supplied via HTTP headers. 3. Watch the @published state and the [AVIOReader] logs: the connection ends at the playlist body length and reconnects, and this repeats without ever reaching a terminal state.

Host app

Custom / my own integration

Platform

tvOS

OS version

tvOS 26.5

Device / chip

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

Playback path

Native AVPlayer

Source media (for playback bugs)

Jellyfin live-TV HLS transcode: master.m3u8 variant playlist over HTTP, live (unbounded).
Playlist body ~497 bytes on device (748 bytes on the sim run). (The engine never decoded a
segment on this misroute, so the segment container/codec were not observed.)

Error codes / log lines

[AVIOReader] Persistent conn ended at offset 497 status=200, reconnecting
Live source: connection ended … reconnect will fire when buffer drains

262 cycles (gen 1→262), ~1.3 s median cadence, retryAfter 0.0; cumulative offset
497 → 129,717 = 261 × 497 (plus one stall/cancel variant at gen 111, offset 54,670 = 110 × 497).
No CoreMedia / AVPlayer / VideoToolbox error code was emitted — that absence is the defect.

Anything else

Contrast (scoped, one simulator sample, same channel): HLSLiveIngestReader(playlistURL:) reached
actual playback (~106 s of playing with an advancing clock) — so the misroute is the defect, not
a missing capability. The raw-TS isLive path fails CLOSED correctly (openFailed(-5) on a dead
source; a clean 5.6-minute hold on a healthy one).

Related issues: #71 (bounded the unproductive reconnect streak — structurally blind here, since
our cycles are productive: a full body delivered at HTTP 200); #126 (the VOD-side sibling of the
same silent-zero-packet family, but it at least reaches a ~25 s timeout — this path reached no
terminal state within either bounded observation); #8 (streaming-mode-fallback lineage).

What we'd hope for: detect a playlist body (#EXTM3U) on the generic isLive path and surface a
typed terminal error (the pattern HLSIngestError already uses), or auto-route to the HLS entry
point. Anything terminal is fine; the silent loop is the damaging half. (Minor, separate: a
headers option on HLSLiveIngestReader would help header-auth origins — we currently front it with
a local auth proxy.)

On nativeRemoteHLS we can offer only a confounded observation, not a claim: under our sim rig with
a minimal forced-transcode profile, the player sat in waitingToPlay (clock 0.00) for 120 s in two
runs with no error, while asset-metadata loads succeeded. A test-profile confound (and an auth
variable in our rig) contaminate it; a hardware run with our real profile is needed first.

Version note: measured at 5.5.1; no release 5.6.0–5.8.6 touches playlist-input detection, the HLS
entry-point routing, or reconnect give-up (5.8.6's AVIO change is documented "no behaviour
change"), so we expect this reproduces at HEAD — happy to re-test. Sanitized logs available on
request.

Activity

  1. added
    bug
    on Jul 19, 2026
  2. superuser404notfound commented on Jul 19, 2026

    @superuser404notfound
    Owner

    Fixed in 5.9.0 (merged 5262771).

    Your diagnosis was exactly right, and thanks for the unusually precise write-up (the 262-cycle count, the "productive reconnect" framing, and the raw-TS-vs-m3u8 contrast made the root cause obvious). What happens: load(url: m3u8, isLive: true) without nativeRemoteHLS routes the playlist URL onto the raw-byte live reader. The origin serves the finite #EXTM3U body at HTTP 200 and closes; the endless-feed reader reads that as a dropped live stream and reconnects, re-fetching the same body forever. Every find_stream_info probe seek resets the unproductive-reconnect streak, so the #71 give-up counters are structurally blind to it (a full body at 200 is indistinguishable from a healthy live source), avformat_open_input never returns, and load() never reaches a terminal state.

    The give-up counters were the wrong layer, so the fix sits at the byte source instead: the raw-byte reader now inspects the first bytes of a live source and fails closed when they begin with the HLS playlist tag (#EXTM3U, tolerating a BOM and leading whitespace), before the reconnect loop is entered. A raw container never opens with # (TS syncs on 0x47), so the prefix is an unambiguous misroute. load() surfaces it as a new typed, catchable AetherEngineError.hlsPlaylistOnRawLivePath with an actionable message pointing at LoadOptions.nativeRemoteHLS / HLSLiveIngestReader. End-to-end on a local static-playlist fixture: the same .url + isLive call now terminates in ~0.03s with that error instead of hanging.

    On the two side notes:

    • Headers option on HLSLiveIngestReader for header-auth origins is a reasonable ask and a separate change from this one; open a dedicated issue for it if the local auth proxy is a real friction point and it can be scoped on its own.
    • nativeRemoteHLS sitting in waitingToPlay for 120s stays a confounded observation for now (your words), given the test-profile and auth variables in the sim rig. A hardware run with the real profile would be the thing that turns it into an actionable report; happy to dig in once it reproduces off the rig.
  3. cmcpherson274 commented on Jul 20, 2026

    @cmcpherson274
    Author
    Verified fixed at 5.9.7. I pointed the same generic call — load(url:, options:
    LoadOptions(isLive: true, suppressDisplayCriteria: true)) — at a local mock origin serving a
    #EXTM3U variant-playlist body (~430 B, HTTP 200): load() now throws the typed
    AetherEngineError.hlsPlaylistOnRawLivePath in 8 ms. At 5.5.1 the identical call produced the
    silent reconnect loop with no terminal state. Fail-closed confirmed, and the error message's
    pointer at the two real entry points is exactly what a host needs. (macOS harness sample;
    probe source available on request.) Thanks for the fast turnaround — same-day across the
    whole batch is remarkable.
    
  4. superuser404notfound commented on Jul 20, 2026

    @superuser404notfound
    Owner

    Appreciate the confirmation, and the 5.5.1-vs-5.9.7 A/B with the 8 ms terminal throw is exactly the datapoint that closes this out. Glad the error's entry-point pointer landed where a host needs it, that was the whole intent of surfacing it as a typed, catchable case rather than a log line. Thanks again for the precise original write-up; the 262-cycle count and the raw-TS-vs-m3u8 contrast are what made the byte-source root cause obvious in the first place.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions