Repository navigation
Default to a version the set can decode - #1245
Conversation
The capability probe already asks configd for Dolby Vision on its own LS2 registration. On the same registration it now asks com.webos.service.tv.systemproperty/getSystemInfo for the UHD key, which LG documents as "whether the TV supports Ultra HD resolution" since webOS TV 1.2, and publishes the answer in devcaps::panel: Uhd, NotUhd, or Unknown when the call fails, times out or answers anything but the documented "true"/"false" string. The decoder table cannot answer this: a 1080p set whose SoC decodes 4K HEVC lists a 4K row, so nothing today tells it apart from a UHD set. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
PMS lists the highest version first, and a play without a picked version takes Media[0], so a 1080p set direct-plays or transcodes the 4K copy of every title that also has a 1080p one. With the panel known, the default is now the highest version that does not exceed it; if every version does, the smallest one. Within one resolution class the version the set decodes directly wins, then the higher bitrate. An unknown panel, a picked version and single-version items behave exactly as before. The choice is made where the item is fetched (build_stream), so Play, resume, Continue Watching and next-episode autoplay all get it. A detail page's cached copy describes Media[0], so request_env drops it only when the panel would play another version, and carries that version's rate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate active issues remain: unchecked dimension multiplication can overflow on malformed input, and panel capability probing is skipped when diagnostic overrides are enabled.
2 open issues
What changed in this PR
This pull request adds panel-aware media version selection so playback defaults to the version best suited to the detected webOS TV resolution while preserving explicit version choices and unknown-panel behavior.
Changes:
- Adds an ARM-only webOS
UHDcapability probe and cached panel capability state. - Selects media versions by panel-compatible resolution, direct-play support, and bitrate.
- Integrates selection into playback planning, metadata fetching, cached details, and regression tests.
- Requires fixes for dimension-overflow handling, consistent resolution classification, and probing when diagnostic overrides are active.
This pull request requires changes.
| File | Summary |
|---|---|
rust-modules/platform/src/webos/caps.rs |
Probes and parses the webOS UHD capability through LS2; the panel probe must also run when diagnostic overrides are active. |
rust-modules/platform/src/devcaps/panel.rs |
Defines and caches Unknown, NotUhd, and Uhd panel states. |
rust-modules/platform/src/devcaps.rs |
Exposes the panel capability module. |
rust-modules/media/src/route/plan.rs |
Selects the best panel-compatible media version during stream planning; dimension arithmetic and fallback classification need correction. |
rust-modules/media/src/route/plan_panel_version_tests.rs |
Tests resolution classification, fallback behavior, and panel-aware version ranking. |
rust-modules/media/src/route/decision.rs |
Captures panel capability and invalidates incompatible cached defaults. |
rust-modules/media/src/route/decision_version_tests.rs |
Verifies panel-aware media index, part, codec, and cache behavior. |
rust-modules/data/src/metadata.rs |
Adds metadata fetching with caller-selected version resolution. |
Review effort: Lite
- frame_class: the fallback for a version without videoResolution now uses ui::fmt::resolution's width buckets, with saturating arithmetic on the height-derived width. A garbage wire dimension cannot overflow, and the class matches the badge the version list shows. - run_probe: an armed dvcaps0/dvcaps1 replaces only the configd answer; the transport still registers and runs the panel probe. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
PMS lists the highest version first, and a play without a picked version takes Media[0]. On a set whose decoder stops at 1080p, that first version is a 4K copy it can only receive as a transcode, even when a 1080p copy sits next to it and would play directly. When the first version cannot play directly, the default is now the highest version the decoder takes. If it takes none, the smallest one, which is the cheapest to transcode. Within one resolution class PMS's own order decides. The test is video_direct_plays, so it uses the bound the app already reads from the device table, and the attempt's ceiling after a recovery. A first version that plays directly changes nothing, so a 4K set behaves as before, and a picked version always wins. The choice is made where the item is fetched (build_stream), so Play, resume, Continue Watching and next-episode autoplay all get it. A detail page's cached copy describes Media[0], so request_env drops it only when another version would play, and carries that version's rate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
Takes the tree of 18b0130, which is based on current main. The set's device table already says 1920x1088, so the UHD probe and devcaps::panel are gone, and the default version comes from video_direct_plays. Signed-off-by: Filippo Scatigna <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
An active moderate issue can retain an unplayable Dolby Vision version because the direct-play gate omits refusal-relevant DV facts, causing an unsuitable choice and fallback transcoding instead of a playable alternative.
1 open issue
Review effort: Lite
|
Nice catch! |
One conflict, in decision_version_tests.rs: main's loopback PMS now takes the item body as a parameter; the rk-4k route this branch adds is kept beside it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
GLinnik21
left a comment
There was a problem hiding this comment.
Thanks for tracking this down and adding the playback regression test. Please update the branch against main to resolve the conflict and address the three inline playback issues, with regression coverage for fixed quality, retry after a version switch, and Force Direct Play.
I'm fine keeping Dolby Vision-aware selection and the detail page's playback hint as follow-ups. Once we have a test build, could you verify on the 32LQ63006LA that normal Play selects the 1080p copy directly when Plex lists 4K first? Let's get that result before merging.
…o-skip hidden from Pass holders) (plxnative#1246) * Settings: a viewer's own Plex Pass grants intro and credits skipping plex.tv lists `pass` but neither `intro-markers` nor `credits-markers` for an account with an active Plex Pass (a webOS 10 set, 2026-11-05), so both auto-skip settings stayed hidden from a Pass holder. The feature list is read with the viewer's own credential, so `pass` there is the viewer's subscription and now grants both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KBgjCe8KH6Nnp3K51Fybrv * Docs: say pass is the one subscription signal accepted, without claiming whose Pass it is Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KBgjCe8KH6Nnp3K51Fybrv --------- Co-authored-by: Claude <[email protected]>
With Force Direct Play the automatic choice no longer swaps a 4K first copy for a 1080p one, in build_stream and in the detail-cache check alike, so the Forced gate tries the original file. The cache check now runs after the retry is applied, so a retry that changes the Direct Play mode is honoured there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
When the worker swaps the first version for another, quality_policy, src_measure and the transport fallbacks read that version's own bitrate instead of env.src_kbps, which describes the first version (or is 0 on a detail-cache miss). The cache check no longer sets the rate itself. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
RetryContext and the carried selection now record the Part their stream ids belong to. apply_retry keeps the selection it replaces, and build_stream restores it when the resolved Part differs, so the new Part's tracks are chosen by the ordinary rules instead of sending the old Part's ids. Ids of an unknown Part (0) are kept as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
…ectly When no version is within the decoder's bound the choice keeps the smallest one, which is transcoded too, so the line now says which version plays instead of saying it can play directly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
|
The checks are green on |
… uses (plxnative#1277) The Nightly run of 2026-11-06 published its release, but the site job failed at `subset-site-fonts.py check`: the Vietnamese press headline added to the Featured in strip (plxnative#1252) uses ư, ấ, ầ, ậ, ẵ, ố, ộ, ụ, ứ and ử, which BASE_RANGES did not hold. The Pages build stopped before the deploy, so nightly/latest.json and the nightly Homebrew Channel repository have not moved since the 2026-11-05 nightly. BASE_RANGES now holds U+01A0-01A1, U+01AF-01B0 and U+1EA0-1EF9 (the whole Vietnamese set, so the next headline in this language needs no re-cut). Both Inter faces carry all of them. A local subset plus check over site/ passes (22.3 KB and 22.8 KB WOFF2, up from 20.7 and 21.4). Claude-Session: https://claude.ai/code/session_01QcMoTSpKTbjsKWecSkgvHf Co-authored-by: Claude <[email protected]>
…i, feed or none (P7) (plxnative#1276) The URI and Feed backends are two crates since the two PRs before this one; this makes the build say which of them a binary contains. PLAYBACK_BACKENDS (both, the default; uri; feed; none) selects the backend features, the native sources (no src/starfish.c without Feed), the link libraries (no libplayerAPIs/libpf without Feed) and a per-value Cargo target directory, and every build now names its features explicitly, so the package stamp carries them. none is refused at parse time for every goal but check-nodef, clean and the side-effect-free queries, before the stamp reset; release-guard refuses a single-backend build for the stable and nightly ids. ci/check-elf.sh grades a uri binary against the new ci/expected-dt-needed-uri.txt (13 entries) and fails on the Feed interposer; ci/check-package.py decodes the stamp against the Makefile's own flag strings; CI type-checks uri, feed and none with check-nodef and still builds and packages only both. binary_bytes rises from 18,750,000 to 20,000,000 (owner-approved) with the baseline re-taken at 17,570,496 bytes. docs/measurements/backend-removal-drill-2026-11-06.md records the drill that deleted each backend in turn and kept the survivor green, and docs/uri-first-migration.md is the staged-migration note it belongs to. The shipping binary is unchanged: the RELEASE=1 build is the same size as main's and identical byte for byte once the embedded commit and build id are masked. No Rust or C source changed. This is the last PR of the URI-first series; main now holds the whole integration branch. Related: plxnative#1064 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. I merged On 7561145, Dolby Vision-aware selection and the detail page's hint stay as follow-ups, as you suggested. For the 32LQ63006LA: I'll install the debug IPK from this PR's CI, start a film whose 4K copy is listed first with normal Play, and post the log excerpt here, with the selected |
|
Tested on the 32LQ63006LA (webOS TV Lite 7.6.0, k8ap) with the debug IPK from 7561145, on a remote connection, with a profile that prefers Italian audio. The version choice works. With the 4K copy listed first, normal Play and Resume both pick the 1080p copy, and the ceiling reads its rate: With the quality set to Original, the same play becomes Nothing actually started on this set, though, and that isn't this PR. A film with a single 1080p version stops the same way, and so does today's nightly (1d96fbb), which doesn't have this PR: That's #1096. I've added this set's |
…ative#1133) Some webOS devices list AAC, AC3 and E-AC3 in the codec table but only list disabled software decoders in gstcool.conf. Preserve those baseline codecs so Plex can play the advertised tracks without converting them. Keep the existing DTS guard for sets that advertise DTS without a working decoder. When Plex converts a different codec to Opus, give the Feed Load a channel count bounded by the transcode profile instead of zero. Use the same layout limit in track admission and in the Opus header builder. Refs plxnative#1096. Verified by CI and on the dev LG with the packaged debug build: H.264 1080p with AC3 5.1, all pipeline assertions passed. Co-authored-by: Heiko Kopp <[email protected]>
|
The audio fix from #1133 is now in |
|
I repeated the test on the 32LQ63006LA with the debug IPK from e0c0406, under the same conditions as before:
It starts, as a direct play of the 1080p copy: Frames were displayed throughout ( One thing I noticed: Plex's dashboard shows that session as the 4K media (34027), because the timeline carries only the ratingKey. It's cosmetic, but Tautulli logs it as 4K too. I can open an issue for it if you think it's worth one. |
GLinnik21
left a comment
There was a problem hiding this comment.
The three review fixes and their regression tests check out. CI is green on this head, and the 32LQ63006LA retest confirms that Play selects the 1080p copy and runs it directly with AC3 frames fed throughout. The dashboard and Tautulli media attribution can be tracked separately.
GLinnik21
left a comment
There was a problem hiding this comment.
The final URI regression fix is in 15ef2023. The new tests preserve a qualified first copy and cover falling back to the Feed-compatible version when URI qualification is unavailable. CI is green on this head. The LG retest covered the ordinary Feed path with the audio fix and confirmed direct playback of the 1080p copy.
|
Merged into |
|
Thanks for merging! A correction before anyone opens that issue: Plex recorded this session correctly, so there's nothing to track. The server's decision was media 20052, part 37332, direct play, and Tautulli logged the session as 1080p, 2535 kbps, direct play, AC3. The 4K I reported came from my own capture, which read only the first |
|
Three follow-ups from this PR that I'd like to pick up, with what I found on
Do you want these as one PR or three? I'd start with 1. |
|
Better separate |
Play starts a version the TV can decode when the first one listed is one it cannot (a codec the set lacks, a resolution above it, or a Dolby Vision Profile 5 copy when the set shows none), instead of leaving the server to convert it. Forced Direct Play still tries the first copy. A substituted default and a version picked by hand are measured from the fetch that names them, and the quality limit judges every version on its own video bitrate, as the first copy always was. A retry that moves to another file keeps its audio and subtitle choice only while it stays on the same file. Ported from upstream 6131d5c (Default to a playback version the TV can decode (plxnative#1245)). Ported from upstream 301811e (Version choice: measure a version picked by hand from its own fetch (plxnative#1333)). Ported from upstream a056817 (Version choice: judge each version's Dolby Vision as the direct-play gate does (plxnative#1421)). Ported from upstream 3878e4f (Quality ceiling: judge every version on its video bitrate, as Media[0] is (plxnative#1423)).

PMS lists the highest version first, and a play without a picked version sends
mediaIndex=0. On a set whose decoder stops at 1080p, that first version is a 4K copy it can only receive as a transcode, even when a 1080p copy sits next to it and would play directly.The set behind this is an LG 32LQ63006LA (webOS 7.6, k8ap). Its device table gives HEVC 1920x1088, which PlxNative already reads (
devcaps: hevc=true 1920x1088). In its event log, a film with both copies starts withstart.mkvandmediaIndex=0, and picking Original logssource 75086kbps 3840x2160; re-transcoding this playback. Its 1080p copy is 11.5 Mbps H.264.What changes
video_direct_plays, so there is no new capability read. It uses the same bound as the direct-play gate, including the attempt's ceiling after a recovery, so a 4K the set refused gives way to the 1080p on the retry.videoResolution, else the frame size, using the width buckets ofui::fmt::resolution, so the choice and the version list's badge agree.build_stream, where the item is fetched (fetch_playing_item_choosing). Play, resume, Continue Watching and next-episode autoplay all get it, through thePlayedVersionpath Play Version: pick which version of a movie or episode plays #955 built: the part, codecs,mediaIndex, MDE ask, decision and start URL are all that version's.Media[0], sorequest_envdrops it only when another version would play. Otherwise it costs no extra GET.src_measureand the transport fallbacks measure that version's ownMedia.bitrate, not the first version's rate.HeldSelection). When it resolves another version, that Part's tracks are chosen by the ordinary rules.Verified
make checkis green on 7561145, which hasmainat 3ae2ebf merged in: 43 suites, 25502 passed, 0 failed, 198 ignored.make check-nodefis clean, and the armv7cargo checkofplx_dataandplx_mediapasses.a_1080p_decoder_plays_the_1080p_version_listed_after_the_4k:mediaIndex0, expected 1;a_fixed_quality_measures_the_1080p_version_it_resolved: measured 0 kbps instead of 2372;a_retry_that_moves_to_the_1080p_version_does_not_carry_the_4k_tracks: sent the 4K'saudioStreamID=31302for part 3134;force_direct_play_attempts_the_4k_original_listed_first: played part 3134 instead of the 4K original.ci/test_check_collisions.pyfails at random with "ThreadSanitizer: unexpected memory mapping", onmainas well, so the gates ran undersetarch -R.Not verified
NotDv, because listing rows rarely carry the stream facts the refusal needs. Left as a follow-up.Media[0], so on such a set it can say a film converts when Play will direct-play the 1080p copy. Left as a follow-up.Correction
An earlier version of this PR added a
getSystemInfoUHDprobe and said this set decodes 4K HEVC. That was wrong: I inferred it from Tautulli's rows instead of reading the set's table, and the table says 1920x1088. The existing bound already answers the question, so the probe anddevcaps::panelare gone. Their commits are still in this branch's history, with the wrong claim in one message; the last commit replaces them, and the diff here is the result. The two Copilot threads refer to the earlier version; the overflow fix is still here, and the other thread's code no longer exists.🤖 Generated with Claude Code