Skip to content

Software path, live raw MPEG-TS: a short forward PTS spike leaves audio queued far ahead of the clock, silent until the clock reaches it #1053

Open

Description

@l984-451

Engine: 7.62.1 (Rivulet 1.3.0 build 127), Apple TV 4K 3rd gen (AppleTV14,1), tvOS 27.2, HDMI stereo out.
Source: live MPEG-TS from a Jellyfin Live TV channel (OTA), MPEG-2 1080i + AC-3 5.1, so the software host (dispatch: codec=2 → software). Not HLS ingest.

What happens

About 44 minutes into a live session the source sends a short run of packets whose timestamps sit 347 s ahead, then goes back to the original timeline. Video gets through it with one lost frame. Audio does not: the buffers stamped +347 s reach the renderer, aRend flips from rendering/y/- to rendering/n/-, and the session stays silent for good while the picture plays on. The user only gets sound back by retuning. Field report: it happens most often when a programme returns from an ad break, on OTA and on FAST/IPTV channels.

18:13:30.800 [SWDiag] clk=13303.67 dclk=1.00 rate=1.00 aLead=3.11 aRend=rendering/y/- vLead=0.27 enq=+59 disp=+59 lost=2(+0) status=rendering
18:13:31.785 [VideoPacketProgress] event=gap route=software previous=13307.898 dts=13655.022 gap=347.124 cadence=0.033
18:13:31.791 [mpegts] [warning] DTS 1197716573 < 1228951942 out of order
18:13:31.795 [AetherEngine] #104 live edge verdict BEHIND: behind=350.04s playhead=2620.59s edge=2970.63s lastEdgeStep=347.02s targetDuration=none trackingCadence=3.93s tolerance=5.93s exitAbove=7.93s
18:13:31.799 [SWDiag] clk=13304.67 aLead=2.11 aRend=rendering/y/- vLead=0.28 enq=+61 disp=+61 lost=2(+0)
18:13:32.799 [SWDiag] clk=13305.67 aLead=349.04 aRend=rendering/y/- vLead=0.28 enq=+59 disp=+59 lost=2(+0)
18:13:33.800 [SWDiag] clk=13306.67 aLead=348.04 aRend=rendering/n/- vLead=0.28 enq=+60 disp=+60 lost=2(+0)
18:13:34.799 [SWDiag] clk=13307.67 aLead=347.04 aRend=rendering/n/- vLead=0.28 enq=+60 disp=+60 lost=2(+0)
18:13:35.799 [SWDiag] clk=13308.67 aLead=2.57 aRend=rendering/n/- vLead=0.26 enq=+42 disp=+41 lost=3(+1) dpts=0.0/116.8
18:13:36.799 [SWDiag] clk=13309.67 aLead=2.85 aRend=rendering/n/- vLead=0.28 enq=+60 disp=+60 lost=3(+0)
...
18:13:58.797 [SWDiag] clk=13331.67 aLead=2.93 aRend=rendering/n/- vLead=0.29 enq=+55 disp=+55 lost=3(+0)
18:13:59.743 [SWHost] live reader EOF (source lost)   <- user left

The two DTS values in the mpegts warning are 13655.02 s and 13307.96 s, so the jump is a spike and the timeline returns to where it was. aLead comes back to about 2.5 s from 18:13:35, so the feed is on the right axis again, but sufficient never returns to y.

Likely cause

The video side drops frames that arrive after a later one was handed over (SampleBufferRenderer, PERF-104), so the +347 s frames cost one frame. The audio side has no matching guard: AudioOutput.enqueue hands every buffer to the renderer. A few seconds of AC-3 stamped 347 s ahead sit at the head of the renderer queue, and the samples on the real timeline queue behind them. That is the state the AE#549 comment in AudioOutput.swift describes ("a survivor sits in the queue stamped far ahead of the timebase, muting the session for as long as it takes the clock to reach it"), reached here by a source timestamp spike instead of a route change.

Expected

On a live software session, a forward audio jump far past any plausible lead that is followed by a return to the clock's axis should not leave the spike in the renderer: drop the out-of-axis buffers, or flush the audio renderer and refeed from the clock when the feed returns. A single bad run of timestamps should cost at most its own duration of sound.

Full log on request.

Activity

  1. added
    area: audio
    area: live
    bug
    on Nov 14, 2026
  2. quint-aether commented on Nov 14, 2026

    @quint-aether

    This looks related to #996 (a timestamp jump at an ad break losing sound), but that one was on the live HLS ingest path, and this is raw MPEG-TS on the software host, so it is tracked as its own report.

    The report already has what is needed to reproduce it. If you can, attaching the full log would still help.

    Automated triage by Quint (Claude). A maintainer reads every issue and will follow up.

  3. l984-451 commented on Nov 14, 2026

    @l984-451
    Author

    Full engine log for the session: https://gist.github.com/l984-451/7355546156250aa3666f39a171aebb44

    It covers 18:04:48 to 18:13:59 (599 lines), which is all the engine log ring still held when the report was sent. The session started at about 17:29:49, so its load and startup lines had already rotated out. Nothing was removed from the window. The only other lines in it are the 1 Hz [SWDiag] lines, the 30 s memprobe/cpuprobe pairs, and six slow read lines between 18:05 and 18:12. The spike is at 18:13:31.785, and the user left at 18:13:57.

  4. superuser404notfound commented on Nov 14, 2026

    @superuser404notfound
    Owner

    Thanks for the full log, it made this one easy to pin down. Fixed on main in 932c155, it will be in the next release.

    The cause was the fold that hides timestamp jumps on the software path. It only looked at video packets and then shifted audio in read order. In a TS the two streams don't cross a splice at the same byte, so the AC-3 frames read just before the first spiked video packet were never folded and went to the renderer 347 s ahead of the clock. The audio that came back before the video did was shifted the other way. Your log had no PTS discontinuity line because the DVR reader only logged the first jump per session, and yours was 44 minutes in.

    What changed:

    • Video and audio now each detect their own jumps. When the second stream reaches a jump the first one already crossed, it takes over that offset exactly, so A/V stays in sync across a real splice.
    • Every jump now logs one line per stream, for example [SWHost] PTS discontinuity #1 (reader, audio): ... offset=347.00s.
    • Two smaller things on the same path: the live read-ahead no longer reads a spike as a full 347 s buffer, and on live without DVR a jump no longer drains the audio lead to about 0.3 s while the parked video catches up.

    I reproduced it on the Mac with an MPEG-2 + AC-3 5.1 TS that carries a +347 s spike in read order, served at real time. Before: aLead=349, aRend=rendering/n for the rest of the run, live edge stuck 347 s ahead. After: four per-stream seams logged, no audio gap, no lost frame, aRend stays y, and the same holds for a +5000 s splice that does not return.

    I'll leave the issue open until you can confirm it on the OTA channel. If it happens again, the new seam lines in the log will show which stream jumped and by how much.

  5. superuser404notfound commented on Nov 14, 2026

    @superuser404notfound
    Owner

    Released in 7.67.0 (578bec3). Sodalite and AetherPlayer are bumped to it on release/1.1.

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

    area: audioarea: livebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions