Skip to content

Seek: land a Segment seek on the clock alone when the session sends no displayed-frame counter - #1437

Merged
GLinnik21 merged 2 commits into
mainfrom
fix/seek-landing-no-counter
Nov 17, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
fix/seek-landing-no-counter

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Closes #1436

Thanks to @robozdog for the diagnosis, the patch, the evidence log and the TV verification: this change is their idea. I added a dedicated decision flag in place of the diagnostics census, the doc corrections and the tests.

What

A Segment (in-place) seek now lands on the clock and the runway alone when the session has never received a displayed-frame callback. A session that has received one keeps #1313's rule: it still needs a fresh positive count since Play. When the 4 s presentation deadline does fire, one event-log line names which check was missing (illustrative values, positions in milliseconds):

seek: Segment presentation deadline: missing=displayed clock_advanced=true position_ms=19978 runway_ms=19978..=21312 in_runway=true displayed=false counter_present=true

docs/webos5-port.md section 5a rows 5 and 7 now say what the code does (row 7 still said a primed seek without a fresh count reloads, with no exception for a set that cannot send one).

Why

On a set that sends no displayed-frame counter (the OLED C8 on webOS 4.4.3 sends no callback numbered 46-49; the era watch already says so every session) the landing check can never become true: displayed compares sink_displayed_sequence to its value at Play, and nothing advances it. SEGMENT_PRESENTATION_MS then runs out on a seek that is already playing and retry_stuck_seek returns Reload, so every seek replays its first 4 s.

  • The rule is LandingFacts::landed in rust-modules/play-feed/src/feed_pump.rs (read by stuck_seek_due). The count counts only displayed || !counter_present.
  • counter_present is a new decision flag, Shared::sink_counter_seen, set by note_displayed_frames on every displayed-frame callback (a zero count too, so a set that sends the counter at all is "present" from its first callback) on the same path that bumps the era watch's census dg_sink_displayed_cb. It is per session: reset_session_mirrors clears it, and the ACB plane bind does not. sink_displayed_live is the wrong signal: the bind clears it, and it is false on a counting set for the whole startup window. The census itself stays a one-way diagnostic.
  • The flag is read at poll time, not snapshotted at Play: a counter that first speaks after Play switches that seek back to requiring a fresh count.
  • The deadline line is written in retry_stuck_seek's primed-Segment arm, where the landing is consumed (segment_landing = None), so it is once per stuck seek by construction.
  • shared.rs keeps a "STRICTLY ONE-WAY" note that nothing may branch on a dg_* mirror. Recover Segment seeks that never reach the video sink #1313 already branched on dg_pos_ticks (the Play-time baseline in native_executor and the comparison in stuck_seek_due); the note now names that existing exception, and this change adds none.
  • Accepted gap: on a set that does send the counter, a seek made before the session's first counter callback lands without a count (clock and runway only, the pre-Recover Segment seeks that never reach the video sink #1313 rule for that one seek). The counter rides the same 200 ms libpf timer as the position tick (era_callbacks.rs), and the landing needs a clock tick after Play, so this is an ordering race inside one timer firing, not a window of seconds. That reasoning is from the code and comments, not measured on a set.

Tests

Red first, on origin/main plus the tests (make test-hostsim C=plx_media T=segment): 2 failed, 18 passed.

  • a_segment_seek_with_no_displayed_counter_in_the_session_lands_on_the_clock_alone (new, native_seek_pump_tests): FAILED at "the seek landed on the clock and the runway" (the seek stays pending after the tick, so only the 4 s deadline can end it).
  • the_segment_presentation_deadline_names_the_missing_check_once (new): FAILED, no deadline line.
  • a_segment_seek_whose_session_sends_the_counter_still_needs_a_fresh_count (new): passed on main and passes after, Recover Segment seeks that never reach the video sink #1313 unchanged. The existing a_primed_segment_seek_with_only_stale_clock_samples_reloads_once delivers its count after Play and reloads on the runway check, so it does not cover this case.
  • a_segment_landing_needs_the_count_only_where_the_session_sends_one (new, plx_play_feed): the rule over its facts.
  • a_counter_that_first_speaks_after_play_makes_the_segment_seek_need_a_fresh_count (new, native_seek_pump_tests): no counter at Play, a zero-count callback after Play, then the in-runway tick: the seek stays pending, and a positive count then lands it. With counter_present forced to its Play-time value it fails (0 passed; 1 failed), so a snapshot at Play cannot pass it.
  • the_counter_seen_flag_is_per_session_and_counts_a_zero_and_survives_the_bind (new, plx_play_feed).

Green after the fix: the same run, 20 passed, 0 failed.

Gates on the committed tree after the review fixes (git status --short empty before and after):

  • make test-hostsim C=plx_media: test result: ok. 2436 passed; 0 failed; 104 ignored; 0 measured; 0 filtered out
  • make test-crate C=plx_play_feed: test result: ok. 337 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
  • make check-nodef: finished, exit 0, no warnings
  • bash ci/check-deps.sh: check-deps: all gates green
  • python3 ci/check-module-layers.py: check-module-layers: green

One pr-reviewer pass ran on the first commit; its three minor findings (the dedicated flag, the poll-time test, this text) are addressed.

Not verified

I did not run this on a TV. The reporter's run was on their own build with the equivalent two-line patch (a seek to 62 s landed and kept playing); my version differs in reading a dedicated flag through LandingFacts and in the wording of the deadline log line, and has no device run.

🤖 Generated with Claude Code

GLinnik21 and others added 2 commits November 17, 2026 21:41
…layed-frame counter

A Segment seek waited after Play for the clock, a position on the accepted video and a fresh
positive displayed-frame count. A set that never sends the counter (an OLED C8 on webOS 4.4.3
sends no callback numbered 46-49) never satisfied the third, so every in-place seek ran out the
4 s presentation deadline and reloaded at the target.

The count is now required only when the session has received a displayed-frame callback (the
`dg_sink_displayed_cb` census, which the era watch already reads); a session with none lands on
the clock and the runway. Sets that do send the counter keep #1313's behaviour. The landing rule
and the deadline's event-log line read one `LandingFacts` value, so the one
`seek: Segment presentation deadline` line, written when the stuck landing is consumed, names which
of the clock, the runway and the fresh count was missing. webos5-port.md section 5a rows 5 and 7
say what the code now does.

Diagnosis, patch and TV verification by @robozdog.

Closes #1436

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…the dg_ census

Review of the #1436 fix: `dg_sink_displayed_cb` sits in the shared.rs block that nothing may
branch on. Add `Shared::sink_counter_seen`, set by every displayed-counter callback (a zero
count included, on the path that already feeds the census), cleared by a session reset and left
alone by the plane bind. `LandingFacts` reads it; the one-way note names only `dg_pos_ticks`
(the landing's Play-time baseline and its comparison, #1313) again.

A new rig test pins the poll-time read: a counter that first speaks after Play puts the seek back
to needing a fresh positive count, and one lands it.

Refs #1436

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21 GLinnik21 added bug Something isn't working playback Playback, the player and its controls labels Nov 17, 2026
@GLinnik21
GLinnik21 merged commit b71b0e5 into main Nov 17, 2026
18 of 19 checks passed
@GLinnik21
GLinnik21 deleted the fix/seek-landing-no-counter branch November 17, 2026 19:28
@GLinnik21 GLinnik21 added the backport release/v0.10 When merged into main, also cherry-pick onto release/v0.10 (backport.yml) label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Backport to release/v0.10: the cherry-pick applied, but pushing it or opening the pull request failed. See https://github.com/plxnative/plx-native/actions/runs/44191137798

GLinnik21 pushed a commit that referenced this pull request Nov 17, 2026
… sends no displayed-frame counter (#1437) (#1446)

On a set that sends no displayed-frame counter (an LG OLED C8 on webOS 4.4.3 sends no callback numbered 46-49), every in-place seek played about 4 s and then reloaded at its target. #1313's Segment landing check in stuck_seek_due waits for the clock to advance, the position to sit on the accepted video and a fresh positive displayed count since Play. Without the counter the last never comes, SEGMENT_PRESENTATION_MS runs out on a seek that is already playing, and retry_stuck_seek reloads.

The landing rule is now LandingFacts: a fresh count is required only when the session has received a displayed-frame callback. That fact is a new decision flag, Shared::sink_counter_seen, set by note_displayed_frames on every counter callback (a zero count too) and cleared per session by reset_session_mirrors; the ACB bind leaves it. It is read at poll time, so a counter that first speaks after Play makes that seek need a fresh count again. Sets that send the counter keep #1313's rule. When the presentation deadline fires, one event-log line names the missing check (clock_advanced, position and runway, displayed, counter_present). docs/webos5-port.md §5a rows 5 and 7 say what the code does, and the dg_ mirrors' one-way note names #1313's existing dg_pos_ticks exception.

Tests: a Segment seek with no counter in the session lands on the clock and runway (red on main); a session that sends the counter still needs a fresh count; a counter that first speaks after Play keeps the seek pending until a positive count; the deadline line is written once; the rule over its facts; the flag is per session, counts a zero and survives the bind.

Diagnosis, patch and TV verification by the reporter, robozdog; this change has no device run of its own.

Closes #1436

(cherry picked from commit b71b0e5)
GLinnik21 added a commit that referenced this pull request Nov 18, 2026
The release note and the authored half of the audit for v0.10.1, a patch released from release/v0.10: v0.10.0 plus the backports of #1438 (Realtek webOS 5 access() interposer), #1437 (seek snap-back on sets with no displayed-frame counter), #1405 (Continue Watching start position), #1439 (Play during a held prime) and #1370 (crash records filed under the uploading release).

Compatibility is unchanged from 0.10.0. The audit records the device evidence each fix rests on and leaves the generated block for the release run.
GLinnik21 pushed a commit that referenced this pull request Nov 18, 2026
The release note and the authored half of the audit for v0.10.1, a patch released from release/v0.10: v0.10.0 plus the backports of #1438 (Realtek webOS 5 access() interposer), #1437 (seek snap-back on sets with no displayed-frame counter), #1405 (Continue Watching start position), #1439 (Play during a held prime) and #1370 (crash records filed under the uploading release).

Compatibility is unchanged from 0.10.0. The audit records the device evidence each fix rests on and leaves the generated block for the release run.

(cherry picked from commit e2f8760)
nphil added a commit to nphil/Marquee that referenced this pull request Nov 18, 2026
A Segment seek (webOS 4) could be accepted through Play while the video sink stayed on the
retired timeline: the clock kept reporting old positions, no new picture showed, and nothing
recovered it. The seek now stays unresolved until the clock moves on the new AUs and, on a
session that sends a displayed-frame counter, the counter counts a fresh frame. Four seconds
after Play without that, it reloads once at its target. A session that sends no counter lands
on the clock alone, so a seek that is already playing is not reloaded. While the seek is
unconfirmed, Plex progress holds and a stop reports the target.

Ported from upstream 9be7a43 (Recover Segment seeks that never reach the video sink (plxnative#1313)).
Ported from upstream b71b0e5 (Seek: land a Segment seek on the clock alone when the session sends no displayed-frame counter (plxnative#1437)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/v0.10 When merged into main, also cherry-pick onto release/v0.10 (backport.yml) bug Something isn't working playback Playback, the player and its controls

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every seek snaps back after ~4 s on a set with no displayed-frame counter (webOS 4.4.3, OLED C8)

1 participant