Skip to content

webOS 3.4: resolve the two missing imports at runtime, and seek by reload on 3.x - #578

Merged
GLinnik21 merged 3 commits into
plxnative:mainfrom
selfhealer-png:pr/webos3-compat
Oct 9, 2026
Merged

GLinnik21 merged 3 commits into
plxnative:mainfrom
selfhealer-png:pr/webos3-compat

Conversation

@selfhealer-png

Copy link
Copy Markdown
Contributor

webOS 3.4: resolve the two missing imports at runtime, and seek by reload on 3.x

Tested on a 2016 LG set, webOS TV Lite 3.4.3 (dreadlocks-digya, board M16_DVB, firmware
05.70.45), installed through Developer Mode. Before this change, v0.8.0 signed in and browsed, then
died on the first D-pad press and on the first video frame. With it, direct play (1080p H.264 +
E-AC-3), HLS transcodes, subtitles, seeking and search all work on that set.

What was wrong

Graded against the webosbrew firmware inventory (3.4.0 = 05.60.30.01-W16N, the same platform
line), the v0.8.0 plxnative binary had exactly two unresolved strong imports, and so did 3.9.2:

Import Why it is missing When it bit
SDL_webOSCursorVisibility 3.4's SDL is 2.0.3, with none of LG's SDL_webOS* extensions First hide_cursor(), i.e. the first D-pad press
_ZN17StarfishMediaAPIs4FeedB5cxx11EPKc 3.4's libplayerAPIs predates the C++11 string ABI; it exports _ZN17StarfishMediaAPIs4FeedEPKc First sf_feed()

Both are lazily bound PLT slots, so the loader accepted the binary and the process died on first
call, which is why the set looked almost-working. Every other Starfish/ACB symbol src/starfish.c
names is present on 3.4.0, except the already-optional AcbAPI_setMediaAudioData.

Separately, the first fast-forward then crashed inside the in-place seek (SIGSEGV addr=0x43c,
immediately after seek: in-place stuck → retry reopen). That path dereferences
StarfishMediaAPIs::player at +0x4c, AbstractPlayer::pipeline at +0x04 and
ptsToDecode at +0x28, all decompiled from a 4.5 binary, and the pre-cxx11 3.4 build is a
different object.

The change

  1. rust-modules/src/app/boot.rs: hide_cursor resolves SDL_webOSCursorVisibility once
    through dynlib::Handle::self_handle() and skips it when absent. The extern block in
    app/mod.rs is removed.
  2. src/starfish.c: Feed is dlsym'd, cxx11 name first, then the COW name. On the COW
    path the reply is released through the firmware's own _ZNSsD1Ev (present in 3.4.0's
    libstdc++.so.6.0.19), since that string's buffer is a refcounted heap rep. The sret slot
    starts with the char pointer in both ABIs, so the reply reads the same. A feed abi: line
    logs which one was taken.
  3. media/src/player/engine.rs: INPLACE_SEEK_OK is armed only on a known release with
    major >= 4, beside the existing VP_EXPORTED (5+) exclusion. 3.x takes the layout-free
    reload path. Behaviour change to note: an unreadable os_info.json (major == 0) now also
    takes reload instead of in-place. I chose the slower-but-safe default; happy to flip it if
    you'd rather keep the old behaviour there.
  4. Docs: README / install guide / troubleshooting name the tested 3.4.3 set beside the 4.0
    floor, and a known-issues row records reload-only seeks on 3.x. tools/fwcompat.py's
    comment and the dated notes in docs/webos5-port.md / docs/distribution.md no longer say the
    Feed mangling blocks the old releases. docs/webosbrew-package.yml is untouched (>=4.0)
    and so is site/; widening the catalogue bound on one set's evidence felt like your call.

On 4.x and later nothing should change at runtime: the cursor call and the cxx11 Feed resolve
to the same functions they linked to before, and the seek gate is unchanged for major >= 4.

Evidence from the 3.4.3 set (event log, debug build from this branch)

webos: webOS TV Lite release=3.4.3 codename=dreadlocks-digya api=4.1.0 major=3
webos: model=m16 board=M16_DVB hw=BOARD_PT_1ST
GL: Mali-T760 / OpenGL ES 3.1 v1.r9p0-05rel0
wm sdl=2.0.3 subsys=6
feed abi: cow fn=0x76d06c65 dtor=0x751dccc0
ff: seek 45s rv=0
rebase: first post-seek keyframe pts=45712000000 -> pts_shift=-45712000000
keyboard: start support=1 focus=1

And the in-place crash, from the build before the seek gate:

seek(in-place): av_seek t=23336988888 coalesced=0
seek: in-place stuck → retry reopen at 23s (#1) coalesced=0
*** SIGNAL 11 (SIGSEGV) addr=0x43c pc=0x4a928 lr=0x4a914

No crash records since. CI on my fork passes every job (host lint, both unit suites, Python/C
gates, harness tests, cross-build): https://github.com/selfhealer-png/plx-native/actions

Possibly related

#249 (2018 sets reporting platform release 3.9.3, where video never starts): 3.9.2 lacks the same
cxx11 Feed, so those sets may have been dying at the first Feed. I can't test that, but I'd be
curious whether this change helps.

Not covered here

Separate PRs, if you want them: reopening a direct-play transfer the server cuts mid-body (rc=56
after a paused stream; not 3.x-specific), and a "Press OK to type" hint on the Search field.


This work was done with Claude Code (Anthropic) and tested by me on the TV. The commits carry a
Co-Authored-By trailer accordingly.

🤖 Generated with Claude Code

selfhealer-png and others added 3 commits October 9, 2026 14:32
webOS 3.4.0 ships SDL 2.0.3 without LG's SDL_webOS* extensions, and its
libplayerAPIs exports StarfishMediaAPIs::Feed only under the pre-C++11
string ABI. Both were strong references bound lazily through the PLT, so
the app started but died on the first D-pad press and the first Feed.

hide_cursor now dlsyms SDL_webOSCursorVisibility and skips it when absent.
sf_feed resolves the cxx11 Feed first, falls back to the COW-string name,
and releases the COW reply through the firmware's own _ZNSsD1Ev.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: selfhealer-png <[email protected]>
In-place seek reaches the pipeline through offsets decompiled from a
webOS 4.5 libplayerAPIs (StarfishMediaAPIs::player at +0x4c, pipeline at
+0x04, ptsToDecode at +0x28). 3.4.0's library is a different build with
the pre-C++11 string ABI, and the first fast-forward on a 3.4.0 set
crashed through them. Arm INPLACE_SEEK_OK only on a known release >= 4,
so 3.x (and an unreadable os_info) take the layout-free reload path, as
webOS 5+ already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: selfhealer-png <[email protected]>
README, the install guide and troubleshooting name the tested 3.4.3
set beside the 4.0 floor, and the known-issues table records the
reload-only seek on 3.x. fwcompat.py's note on the oldest releases and
the dated research notes in webos5-port.md / distribution.md say the
Feed mangling and SDL cursor imports are now resolved at runtime. The
webosbrew catalogue bound stays '>=4.0'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: selfhealer-png <[email protected]>
@selfhealer-png selfhealer-png changed the title Pr/webos3 compat webOS 3.4: resolve the two missing imports at runtime, and seek by reload on 3.x Oct 9, 2026
@GLinnik21

Copy link
Copy Markdown
Collaborator

Finally! Thank you!

@GLinnik21
GLinnik21 merged commit 331a0a5 into plxnative:main Oct 9, 2026
11 checks passed
GLinnik21 added a commit that referenced this pull request Oct 9, 2026
…W reply destructor (#581)

- starfish.c: correct the Feed mangling comment (3.9.2 is still the COW ABI; cxx11 starts
  with the 4.x inventories); track the resolved ABI in g_feed_cow instead of inferring it
  from the destructor pointer, so the `feed abi:` line says cow even without _ZNSsD1Ev.
- sf_feed: run the reply destructor only for a non-NULL reply pointer.
- New sf_feed_abi_is_cow() accessor, bound through VideoSink::feed_abi_is_cow (ffi.rs,
  ffi_host.rs stub, NoSink).
- engine.rs: inplace_layout_known(major, feed_abi_is_cow) is the in-place seek gate: the
  old-ABI Feed refuses it (covers 3.9.x), a known release below 4 too, an unknown release
  with the C++11 Feed keeps it. Unit test added.
- fw-compat-reviewer.md: the oldest images no longer fail on the two symbols #578 made
  runtime lookups; re-run the matrix for what they print.

Co-authored-by: Gleb Linnik <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@GLinnik21

Copy link
Copy Markdown
Collaborator

@selfhealer-png how's the performance?

GLinnik21 added a commit to chriskoperdraad-tech/plx-native that referenced this pull request Oct 14, 2026
…store, test the hide/show bookkeeping, fix stale docs

hide_cursor now takes its function table through hide_through/show_through, so the host can
grade the bookkeeping with fake extern "C" functions: the transparent cursor is installed, the
previous (or default) cursor is the one motion restores, a second hide keeps it, and LG's
extension door is called with 0. When SDL_GetCursor and SDL_GetDefaultCursor both answer NULL
nothing is saved to restore, so the swap is skipped instead of leaving the pointer invisible for
good. The idle-hide hint decision is a pure function, and a seam-order test pins that it is set
before SDL_Init.

note_global_press, docs/remote-keys.md and Pointer::cur_hidden said hide_cursor names a webOS-only
symbol that fails a host test at ld; since plxnative#578 it resolves through dlsym, and the hider may be a
transparent SDL cursor rather than LG's.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21 pushed a commit that referenced this pull request Oct 14, 2026
… s idle (#655)

Fixes #642.

The system SDL on webOS 3.x is 2.0.4 and exports no SDL_webOS* symbols, so since #578 the runtime lookup of SDL_webOSCursorVisibility returned nothing and every hide_cursor() was a no-op: the pointer stayed on screen, over video too, until LG's SDL hid it itself after about five minutes of stillness.

Without LG's extension, hide_cursor() now swaps SDL's cursor for a transparent one instead of switching it off (SDL_ShowCursor(DISABLE) also stops pointer motion reaching the app), and the cursor is restored on the next SDL_MOUSEMOTION. The SDL_WEBOS_CURSOR_SLEEP_TIME hint is set to 5000 ms before SDL_Init, only where SDL_webOSCursorVisibility is absent, so a still pointer hides after about five seconds as in LG's other apps. On webOS 4+ nothing changes: the extension resolves there and the hint is not set.

The cursor swap goes through a function table so host tests drive it with fake SDL functions: swap and restore, the default-cursor fallback, double hide, nothing to restore, the LG door and the hint decision, plus a seam-order test that the hint is set before SDL_Init. Stale prose about hide_cursor naming a webOS-only symbol is corrected.

Verified on a webOS 3.9.3 set by the contributor.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21 GLinnik21 added the webos-3 webOS 3.x TVs (2016-2017 models) label Oct 20, 2026 — with Claude
GLinnik21 added a commit that referenced this pull request Oct 22, 2026
* Release notes and audit for v0.9.0

Action-required evaluation (README trigger list, read from the PRs, grep not run on a built tree): no hits that need a reader action. Launch links (#853) add an inbound surface (any app that can launch apps), stated in What's new; the 3.4 image cache writes to /media/developer/temp (#667); crash/error reports gain fixed-value fields with POLICY_VERSION unchanged (#632), stated under Changed; Watchlist and PMS notifications use hosts the app already reaches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Release notes v0.9.0: coverage and accuracy pass

Note: correct the Collections surfaces (no TYPE menu; collection shelf
headings live on Home and a library's Recommended page), the Watchlist
hold-menu rows, the launch-link sign-in behaviour and platform-release
numbering, the notification-feed sentence and the per-profile settings
list (no stale "nine"). Add #832, #808, #750/#762, #709 (#628), #641,
#647, #793, #871, #877 (#679), #876 and the key-press frame work;
credit RichiL10 and Shakil Choudhury. #862 moves from Known issues to
the webOS 3.x lines as fixed by #578; the 3.9.3 source-build report
(#700) is kept in Compatibility. Compatibility links reports, not
reporters' profiles.

Audit: #862 provenance (attributed usage-report reading, no counts),
contributor list wording.

Action-required section: not owed. The README grep over
v0.8.0..origin/main (rust-modules/src src ci) hits only CI tooling,
test-only loopback listeners and fixture tokens, and the dev-only
/tmp/plxnative-trackmemory trigger; the audit's PR-by-PR reading in
"Deliberately not done" stands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Release audit v0.9.0: name the toolchain by its pin file, not its version

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
GLinnik21 pushed a commit that referenced this pull request Oct 25, 2026
On webOS 3.x every direct-play seek was a full reload: the old C++ ABI rules out the private `Segment` offsets (#578, #581), and the public `Seek` had never been tried on that ABI. `Seek` (`_ZN17StarfishMediaAPIs4SeekEPKc`) takes a `const char*`, so its symbol and calling convention are the same on the COW and cxx11 ABIs, and on a 3.9.3 set (OLED55B7V-Z) it works: 80 seeks through it all returned 1, with no downgrade, stuck-seek retry, reload, BufferFull or "Playing error", and playback ran 101-197 s past single seeks, beyond the ~48 s where a wrongly anchored segment would stall.

- `select_seek_mode` picks `NativeSeek` for an old-ABI library on the ACB plane when the set reports release 3 (`old_abi_seek_tested`, `major == 3`). Every other mode is unchanged: webOS 5+ `NativeSeek`, known-layout 4.x `Segment`, other unknown-layout releases and `VP_NONE` `Reload`.
- The nets webOS 5+ already has apply: a refused `Seek` drops the playback to `Reload` (`native_seek_refused`), and a seek that does not anchor within `SEEK_STUCK_MS` is retried, then reloaded. A seek at a speed other than 1x still reloads in every mode.
- `each_firmware_gets_its_seek_mode` covers every row; a new test checks that a refused `Seek` on webOS 3 stays on `Reload` across the reload and that a fresh play clears it.
- Docs: the `SeekMode`/`select_seek_mode` comments, the player's CLAUDE.md, the README's webOS 3.x row and `docs/webos5-port.md`'s "The public `Seek`".

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

webos-3 webOS 3.x TVs (2016-2017 models)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants