Skip to content

ACB: create the URI engine's handle at the first Experimental offer, not at boot - #1396

Merged
GLinnik21 merged 5 commits into
mainfrom
fix/uri-acb-handle-on-demand
Nov 14, 2026
Merged

GLinnik21 merged 5 commits into
mainfrom
fix/uri-acb-handle-on-demand

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Closes #1394

What

The URI engine's ACB handle (player type 0) is no longer created at every boot on a webOS 4.x ACB display. A boot creates only Feed's handle. The URI handle is created once, on the main thread, when the first source is OFFERED to the URI engine (an Experimental viewer's play routed to it on an ACB display), and is never destroyed. If it cannot be made, the offer is declined and Feed plays the title.

  • tv/plane.rs (the plane owner, a pure machine): new Event::HandleWanted { handle } answered with Fx::Create { handle } while that handle's boot is not recorded. PlaneOwner::ensure_handle is the runner that executes it through the sink (create, read the initialize confirmation, log, record the boot); the handle's own boot event is the result. No IO enters the machine and no ci/allow/ line is added.
  • A late Boot/BootUri now only promotes Unavailable to Idle. It used to reset the state to Idle, which was harmless while both boots ran together and would have erased a Bound/Releasing/Quarantined state once the second one ran later.
  • After a create the owner re-selects the handle it had selected. The C seam (acb_create) makes the newest handle current, so without this Feed's verbs would address the URI handle.
  • playback-contract UriDriver::ready_to_start (default: ready), asked by offer_qualified_uri (media/src/player/adapter.rs) last, on the main thread, before it stores the offer. The product driver on an ACB display answers it through acb_drive::uri_handle_gate (PlaneOwner::ensure_handle plus the existing gate); a false gate declines the offer with uri: original declined (the ACB handle for the URI engine could not be created) and the route's existing declined-source retry (retry_declined_uri_source) hands the same play to Feed. The failure is recorded, so every later offer declines at once with no new create attempt. An exported-window driver, an ACB-bound driver over a display that is not ACB, and the fake driver answer "ready" (nothing to set up); the Start's own gate is unchanged and stays the backstop.
  • play-uri/src/acb_drive.rs: Op::Check (the first step of a bind) reads the same uri_handle_gate, so the dev probe, which has no offer, creates the handle at its first check. execute is shared by the product backend and the dev probe.
  • product_binding is Acb on any VP_ACB display. The composition line stays truthful: handle=deferred ptype=0.
  • Boot log lines, before and after:
    • before (every boot on an ACB display): acb create=1, acb handle=feed ptype=10 create=.. initialized=.., acb handle=uri ptype=0 create=.. initialized=.., uri: product binding=Acb mode=1 handle=true ptype=0 ...
    • after (boot): acb create=1, acb handle=feed ptype=10 create=.. initialized=.., uri: product binding=Acb mode=1 handle=deferred ptype=0 .... No acb handle=uri line.
    • after (first Experimental offer): acb handle=uri ptype=0 create=<id> initialized=.. at the moment it is created, once, before the Start.
  • Dev and harness paths (requirement 5): they go through the same on-demand path. The devtriggers URI probe and the acb-control/acb-dass arms call acb_drive::execute, whose gate creates the handle if it is missing. The old boot_handle helper in backends.rs is gone (Feed's boot uses ensure_handle), and the backend.rs test rigs boot Feed's handle and let the gate create the URI handle, or script the sink.
  • webOS 5+ (exported window) and builds without play-uri: the binding result and playback are unchanged (the new create code runs only under VP_ACB), but the uri: product binding=... composition line's text changed on EVERY display. A 5.x set used to read handle=false ptype=10 initialized=false and now reads handle=none ptype=0; the initialized= field is gone, ptype= is the URI engine's fixed 0, and an ACB display reads handle=deferred ptype=0. The binding and major=/evidence= fields are as before.
  • While a release is in flight (the previous Feed object may still be inside its off-frame Unload) offer_qualified_uri does NOT ask the driver to set anything up: no create may run against the display then (Feed's own sink fence refuses it, and a Start waits for the Unload for the same reason). The offer is taken and the Start's gate makes the handle once the release is done. A create that fails THAT way refuses that Start, with the logged reason (uri-acb: the ACB gate refused this start ...), rather than handing the play to Feed; the next offer then declines at once.
  • PlaneOwner::attempted and PlaneOwner::boot_handle are fixture-only (#[cfg(any(test, feature = "test-support"))]). boot_handle seating the URI handle is not reachable in production: only ensure_handle seats it (and Feed's), and PlaneOwner::boot no longer goes through it.

Why

#1394: on an LG OLED55C8 (webOS 4.4.3, W18O firmware) 0.10.0 makes every Feed Load return only after ~30 s, so every play fails load_timeout, and LG's own player stalls afterwards until a reboot. 0.9.0 was fine; with the second boot handle removed (and a reboot) the Load returns at once. The handle has no purpose unless the URI engine plays, and the URI engine plays only for a viewer whose Playback engine is Experimental. The handle was created for everyone.

Tests

Red first: an_acb_boot_creates_only_feeds_handle_and_records_it failed on the unchanged code with left: [("com.beb.plxnative", 10), ("com.beb.plxnative", 0)] right: [("com.beb.plxnative", 10)]; it passes now.

  • plx_platform (tv/plane.rs): HandleWanted answered with Create only while the handle is not booted; late boot keeps Bound/Releasing/Quarantined; ensure_handle creates once and logs; re-select after a later create; a failed create is recorded and not retried.
  • plx_play_uri (backend.rs): ready_to_start creates the type-0 handle once and a Start after it makes no second; a failed create answers not-ready and is not retried; exported and non-ACB displays are ready and create nothing; the Start's gate (the backstop) still creates on demand and refuses on a failed create; composition tests updated for handle=deferred.
  • plx_media (adapter.rs): an offer the driver is not ready for is declined with its logged reason, keeps no authorization and leaves Feed as the offer; the next offer asks again.
  • application crate: boot creates one handle (type 10); the composition line. Hostsim app tests (run_uri_boot_tests.rs): an Experimental offer creates the handle at the offer, is taken, and the Start makes no second; an offer whose create fails is declined and the same play starts on Feed; a second offer after a failed create declines with no second create attempt; a Standard viewer (production qualifier, NotOptedIn) is never offered and nothing is created.
  • Red, on the code before the offer-time check, three app tests failed: an_acb_offer_whose_handle_cannot_be_created_is_declined_and_feed_plays and a_second_acb_offer_after_a_failed_create_declines_without_another_attempt at the offer is declined, and an_acb_offer_creates_the_uri_handle_at_the_offer_and_a_second_play_makes_no_second (renamed ..._at_the_offer_and_is_taken afterwards) with left: [] right: [0]: the handle was not there at the offer. The Standard-viewer test (a_standard_viewers_play_on_an_acb_display_creates_no_uri_handle) passed on both sides, as a guard.
  • plx_media (adapter.rs): an_offer_while_a_release_is_in_flight_is_taken_without_asking_the_driver. Red with the release check neutralised: it fails at the offer is taken (a driver that would decline was asked during the release); green with the check: the offer is taken, the driver is asked 0 times while the release runs and once on the next offer after it. The Start-after-release creation is the existing Start-gate test in play-uri (the_first_acb_start_creates_the_uri_handle_once_and_a_later_start_reuses_it); no app-level test drives a real Feed Unload.

Not verified

  • The TV has not been run. The 4.5 set (our own) never showed the stall.
  • On a URI-only ACB build (no play-feed; not the shipping feature set) PlaneOwner::any_handle() stays false until the first offer, so acb_ok reads false and diagnostics (app/diagnostics.rs:994) would show the video-plane fault before the first URI play. The doc comments say so; the shipping build has play-feed and is not affected, and this is left as is.
  • The ARM cross-build and make check are CI's. pr-reviewer ran one round on the offer-time commit: four MINOR findings, fixed in the last commit.
  • The cause of [webOS 4.4.3 / o18] 0.10.0: every Load stalls past the 20 s deadline (load_timeout) while the URI engine's boot ACB handle exists #1394 on the W18O firmware is not proven; this removes the condition the reporter's workaround removed (the second ACB instance existing for Feed's whole run). After the first Experimental URI play a second ACB instance does exist for the rest of the process, so an Experimental viewer on that firmware may still see the stall.
  • fw-compat-reviewer (source-only, no ELF built here): no new symbol, DT_NEEDED or load-time change; acb_create slot logic (2 slots, newest current, failed create keeps the current) is safe for a create after Feed's bind.

TV verification checklist (4.5 set, FLAVOR=debug, --guest --mock)

Standard boot: acb create=1, acb handle=feed ptype=10 create=.. initialized=true, uri: product binding=Acb mode=1 handle=deferred ptype=0 major=.. evidence=none; no acb handle=uri line and no acb select or second acb initialize playerType=0 line. A Feed play loads as on 0.9.0, and a Standard viewer's play adds no acb handle=uri line either.

Experimental first URI play: the offer makes the handle, before the Start: acb initialize playerType=0 rv=1 callback_installed=true (C seam) and acb handle=uri ptype=0 create=<id> initialized=true, then at the Start uri-acb: request=1 step=Check, acb gate mode=1 boot_handle=true actual_ptype=0 dass_available=false initialized=true, then plane: uri handle <id> selected=true at the MediaId bind. A second URI play shows no second acb handle=uri line. A Feed play after a URI play shows plane: feed handle <id> selected=true before its bind.

Failure path (only if the set can be made to fail the create): acb handle=uri ptype=0 create=0 initialized=false, uri: original declined (the ACB handle for the URI engine could not be created), and the same title plays on Feed; a later Experimental play logs the declined line again with no second acb handle=uri line.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits November 14, 2026 20:04
…y boot

0.10.0 (#1281) created a second ACB handle, player type 0, at every boot on
a webOS 4.x display, whatever the viewer's Playback engine was. On an LG
OLED55C8 (W18O firmware) every Feed Load then returned only after ~30 s and
failed load_timeout (#1394); with the call removed the Load returned at once.
The cause on that firmware is not proven; the handle has no purpose unless the
URI engine plays, which only an Experimental viewer's play does.

A boot now creates only Feed's handle (player type 10, the same calls and log
lines). The plane owner's machine answers a new HandleWanted event with a
Create effect until that handle's boot is recorded; PlaneOwner::ensure_handle
runs it through the sink on the main thread and the handle's own boot event is
the result. The URI driver's gate (Op::Check, shared with the dev probe) asks
for the handle before it reads the gate's facts, so it is created once, before
the first URI-engine bind that needs it, and logs `acb handle=uri ptype=0 ..`
at that moment. The product binding is Acb on any ACB display ("handle=deferred"
on the composition line).

Two things that were only safe while both creates happened at boot are fixed:
a later BootUri no longer resets the plane state to Idle (it erased a Bound,
Releasing or Quarantined state), and a create made after the owner selected a
handle puts that handle back as the sink's current one (the C seam makes the
newest handle current).

A failed on-demand create refuses that Start (Failure::Unsupported) with a
logged reason and is not retried. The route does NOT hand that play to Standard
today: a refused URI Start settles StartFailed (see the PR body).

Closes #1394

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… a Standard handoff

The refusal log line, its test name and media/src/player/CLAUDE.md said a
refused URI Start sends the play to Standard. The route settles a refused URI
Start as a failed start (BufferfeedStartOutcome::Failed), and only a
post-open URI failure hands over to Feed. Wording only.

Closes #1394

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

Comments and the harness manifest notes still said the boot creates the URI
engine's handle. Wording only.

Closes #1394

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eed plays the title

The handle is now made when the first source is OFFERED, not at the Start. The
URI driver gets a UriDriver::ready_to_start (default: ready); the product
driver on an ACB display runs the plane owner's ensure_handle through the
shared gate, and offer_qualified_uri asks it last, on the main thread. A failed
create or initialize declines the offer with
`uri: original declined (the ACB handle for the URI engine could not be created)`
and the route's existing declined-source retry hands the same play to Feed. The
failure is recorded, so every later offer declines at once and makes no second
attempt. The Start's gate stays the backstop. An exported-window driver, a
driver off the ACB display and the fake driver are always ready.

Before this, a failed create at the Start refused that Start, which the route
settles as a failed start with no handoff to Feed, and every later Experimental
play in the process failed the same way; a failed boot-time create used to
leave the binding Unbound and the play on Feed.

Closes #1394

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…oments and two fixture-only seams

pr-reviewer's four MINOR findings on the offer-time check:

- offer_qualified_uri runs from pump_play's landing without checking the
  release. While a release is in flight the previous Feed object may still be
  inside its off-frame Unload, and no create may run against the display then
  (Feed's sink fence refuses it; a Start waits for the Unload for the same
  reason). The driver is not asked to set anything up while the release is busy:
  the offer is taken and the Start's gate makes the handle once the release is
  done.
- PlaneOwner::any_handle and the acb_ok field said the URI handle is made at
  its first bind / first URI Start; they now say the first Experimental offer
  or, while a release is in flight, the Start's gate.
- PlaneOwner::attempted and PlaneOwner::boot_handle were called only by tests;
  both are now behind cfg(any(test, feature = "test-support")). PlaneOwner::boot
  seats Feed's handle without it, and the URI handle is seated only by
  ensure_handle in production.

Closes #1394

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 14, 2026
@GLinnik21
GLinnik21 merged commit 038e8e9 into main Nov 14, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the fix/uri-acb-handle-on-demand branch November 14, 2026 18:45
GLinnik21 added a commit that referenced this pull request Nov 14, 2026
One conflict, rust-modules/src/app/adapters/backends.rs. Main's #1396 made the URI engine's ACB
handle on-demand: uri_product_binding no longer takes the plane owner, and the composition tests
stopped building a booted owner. This branch's major-10 composition assertions are kept, written
against that new signature: majors 5 and 10 bind Exported on VP_EXPORTED, every other major 0..=30
is Unbound, and the boot line pins major=5 and major=10 evidence=table. No behaviour changes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Nov 14, 2026
…#1377)

EXPORTED_STRATA listed firmware major 5 only. It now lists major 10 too. On a set reporting major 10 (an LG C2 on webOS 25, firmware 33.31.68, is the one set that has run), a viewer on the Experimental engine now plays a qualifying original through the TV's own pipeline in the exported window. A qualifying original is a direct play with one audio track and no subtitle stream, on quality Original or on Auto over a local link. The boot line reads `major=10 evidence=table`. Every other webOS 5+ major (6 to 9, 11 and later) still plays Standard, and major 9 is not bracketed, because major 8 has no entry.

The evidence is the docs/uri-mode.md admission rule, met on one tester's set (#1064):
- (a) The 10.3 image reads option.windowId at load.
- (b) The product run of 2026-11-14 had the override armed (`evidence=override`). Its 2.39:1 original was placed from src=3840x1608, "full width with black bars". There was sound, and two seeks were logged landing on seekDone. Pause and resume rest on the tester's words. Two earlier product runs on the same set support it.
- (c) The drive probe, with amendment (1). A replay test, uri_drive_webos_25_c2_run_replays_to_pause_froze_from_the_paused_event_and_resume, has the current grader answer pause=froze from the run's recorded numbers.

Host tests pin majors 5 and 10 to Exported on the exported-window display, every other major 0..=30 to Unbound, and both admitted majors to nothing on ACB and on no display. A boot-line test pins `major=10 evidence=table`. The merge of main kept #1396's binding signature and its boot line.

Not checked on major 10: subtitles, HLS, track switching and end of stream through the product, other 10.x minors, and a build carrying this entry.

Part of the webOS 5+ URI work tracked in #1064; does not close it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[webOS 4.4.3 / o18] 0.10.0: every Load stalls past the 20 s deadline (load_timeout) while the URI engine's boot ACB handle exists

1 participant