Skip to content

Player: a Play pressed while a held prime waits now resumes playback - #1439

Merged
GLinnik21 merged 6 commits into
mainfrom
fix/play-during-held-prime
Nov 17, 2026
Merged

GLinnik21 merged 6 commits into
mainfrom
fix/play-during-held-prime

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Bug

While the native clock is held on a prime (Engine::prime_play armed: the initial prime, the prime after a seek, a progressive rebuffer, a resume prime), FeedDriver::dispatch in rust-modules/play-feed/src/feed_driver.rs dropped a viewer Play and still answered Queued.

A viewer Pause that lands on a held prime only marks the clock user_held, which fences the prime until the Resume transition clears it. A Pause under a seek also leaves its one-frame preroll holding the transport gate shut. Because the Play was swallowed, user_resume never ran, so the contract recorded viewer_paused = false, the hold stood, reserve_hls_prime_play refused the prime, and every later Play was a no-op. Pause then Play during a post-seek or initial prime left playback paused until a seek or a stop cleared the hold.

Fix

  • rust-modules/play-feed/src/feed_driver.rs: the Play is enqueued when the prime is not armed, or when the clock is user-held (Shared::clock_user_held, previously test-only), or when a seek preroll is open (FEED_TX.seek_preroll_active()). With no hold and no preroll there is nothing to resume and the prime is left alone; the claim hold's give-back sends such a Play and is not refused.
  • rust-modules/play-feed/src/feed_pump.rs: user_resume now fires the initial physical Play only when the Resume IS the first Play (startup_play_commanded was still false). A viewer Play that undoes a Pause held on an Initial or Seek prime must not start the clock on empty lanes; the prime's own media proof releases the physical Play.
  • rust-modules/play-feed/src/shared.rs: clock_user_held is public (the test helper delegates to it).
  • rust-modules/media/src/player/pump.rs: the flight-test rig helpers the new tests reuse are made pub(super), and the new test module is registered.

Regression tests

rust-modules/media/src/player/held_prime_play_tests.rs (hostsim, 10 held_prime_play_* tests) enters at the viewer's door, transport::set_transport_paused, over an Engine the common runner started (an Active attempt, startup_controlled). A fixture Engine installed with PlayerAdapter::install has no attempt, so the door falls back to player::resume and the driver's dispatch never runs; that is how a test calling player::pause/resume directly passed over this bug. Each hold (initial prime, internal rebuffer, resume prime, seek prime with the Pause after or before the seek) is graded with and without a preceding viewer Pause; the no-Pause rows pin that nothing moves.

5 of them fail on the tests-only commit 58006f1 and pass at the tip.

TV evidence

Mock server, Guest profile, a test build of this fix with the mock's address patched in.

  • Unfixed main: Pause then Play inside a post-seek prime never resumed in 2 of 2 runs (no acb play=2, queues frozen for 46 s or more).
  • With the fix, the Play is always executed:
Row Result (n=1 each)
Initial-prime Pause, Play PASS
Stretched post-seek prime PASS
Pause before the seek PASS

The resume heartbeat reads about 1000 permille and there is no repeating timeline paused.

  • Caveat: in 2 of 3 short-prime runs the seek then went in-place stuck -> reload and the existing watchdog reloaded about 4 s later. The cause is undetermined; there was no key-less control run.
  • Not covered: an HLS internal rebuffer (not forceable on the mock) and a quality change from the player menu.

Gates

  • make test-crate C=plx_play_feed on the committed merge tree (git status --short empty before and after):
    test result: ok. 337 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s
  • make test-hostsim C=plx_media T=held_prime, make check-nodef, full make check and the ARM build are gated by CI. The local run of the first two was refused by the disk preflight (5.8 GiB free; the build needs 3.5 GiB plus a 3.0 GiB reserve).

🤖 Generated with Claude Code

GLinnik21 and others added 6 commits November 13, 2026 20:35
The matrix over `transport::set_transport_paused` -> `backend_transport_control` -> the Feed
driver's dispatch, over a runner-started Engine (the fixture Engine `PlayerAdapter::install`
makes has no attempt, so the door falls back to `player::resume` and the dispatch never runs). Each
hold (initial prime, seek prime with the Pause after and before the seek, HLS internal rebuffer,
ResumePrime) is graded with a preceding viewer Pause and without one, plus the claim hold's
give-back (a backend Play with nothing user-held). The rows with a Pause fail on this tree: the
Play is answered Queued and enqueued nothing while `prime_play` is armed, the clock stays
user-held and the prime is refused for good.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nsition

`FeedDriver::dispatch` answered a Play `Queued` and enqueued nothing while `Engine::prime_play`
was armed. A viewer Pause that lands on a held prime (`ClockHold::Initial`/`Seek`/`Rebuffer`/
`ResumePrime`) only marks the clock `user_held`, which fences the prime (`reserve_hls_prime_play`
refuses while it stands), so the dropped Play left the contract at `viewer_paused = false`, the
hold standing and every later Play a no-op until a seek or a stop cleared it. Seen on the TV
during a hold (`run-e-diag`: `timeline paused` repeating until a reload).

The pre-#1274 door called `player::resume` directly, so every viewer Play reached
`prepare_hls_user_resume`; the `!prime_play` skip first appeared in the Feed's extraction (#1274)
with no stated reason. What it protects is a Play with nothing to resume: a prime armed, nothing
user-held (the claim hold's give-back, `claim_hold::release`, sends such a Play through
`backend_transport_control` whatever the viewer's goal reads), where handing it on would answer
`NoHold` and refuse it. The driver now hands a Play on when no prime is armed, when the clock is
user-held, or when a paused-seek preroll holds the transport gate shut (`user_resume` closes it);
otherwise the prime is left alone.

Handing the Play on newly reaches the `Deferred` branch of `feed_pump::user_resume` for an Initial
or Seek hold, whose `play_initial_now` (added for a retranscode landing, #1309) reserves the Fresh
prime and plays at once: the viewer's Play would start the clock on empty lanes. It now fires only
when the Resume IS the first Play (`startup_play_commanded` was false); once the runner's Play is
commanded the prime's own media proof releases it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…he first Play

The Deferred arm's block said every Resume under an Initial or Seek hold is the session's startup
play command and fires the initial prime. It now fires only when `startup_play_commanded` was still
false; a claim landing's `ResumeInitial` and a viewer Play that undoes a Pause held on the prime
answer Fenced, and the physical Play is left to `note_transport_result` or the prime's `try_prime`.
Comment only.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The comment said the landing's resume fires `play_initial_now`; a landing's `ResumeInitial` answers
Fenced since the held-prime fix and `note_transport_result` fires it. Comment only.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit a3f1c06 into main Nov 17, 2026
13 checks passed
@GLinnik21
GLinnik21 deleted the fix/play-during-held-prime branch November 17, 2026 20:11
@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/44191152785

GLinnik21 pushed a commit that referenced this pull request Nov 17, 2026
…layback (#1439) (#1448)

A viewer's Play pressed while a held prime was still filling (after a seek, or at the
initial start) was dropped by FeedDriver::dispatch yet answered Queued, so Pause then Play
during the prime left playback paused for good. The driver now hands that Play on when the
clock is user-held or a seek preroll is open; the prime keeps the physical Starfish Play and
mirrors the ACB resume only after Starfish accepted it. user_resume no longer calls
play_initial_now once the startup Play was commanded, which also removes a duplicate Play on
a Resume of an immediate start.

Regression tests: held_prime_play_tests (hostsim, through the viewer's door); 5 of them fail
on the tests-only commit.

TV (mock server, Guest): on main, Pause+Play inside a post-seek prime never resumed (2 of 2);
with the fix the Play resumes in every row run. The in-place seek watchdog reload seen in some
runs also happens with no keys pressed on main (1 of 3) and with the fix (2 of 3), so it is a
pre-existing seek behaviour, not this change.

(cherry picked from commit a3f1c06)
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 film played at Original quality over a link slower than the file kept
playing as its queues ran dry: the picture ran in slow motion and the sink
then dropped frames to catch up. Only HLS had a rebuffer hold.

The pump now holds a progressive stream the same way (one Pause, the
Buffering read-out, the try_prime Play). The hold begins when the native
position falls more than 100 ms behind the wall, net of a 5 % drift
allowance, while the app's video queue holds under 1 MiB, or when the
native clock stops over a remnant it will never spend. It releases on a
full video or audio queue or the end of the stream, never on a runway.
The debt constants are upstream's, measured on its TV, not yet on this one.

stall_watch stays the reporter and the restarter of a source parked on a
full lane; a hold never begins while a queue is at its cap, so the two never
act on one stall. A seek takes the clock from a hold at once. The silence
clock is wrap-safe and the position tick is published last, with Release.

A Play pressed while a held prime waits (plxnative#1439) needs no port: resume
already defers the Play to the hold's release.

Ported from upstream 9f5ff48 (Player: a starved direct-play stream pauses and shows Buffering instead of slow motion (plxnative#1441)).
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant