Repository navigation
Transcode: audio above 48 kHz is converted, and the local gate agrees with the profile - #1049
Merged
Merged
Conversation
PMS converts a 96 kHz FLAC to AAC and keeps 96 kHz, and an LG B8 refuses that Load (`smp_cb type=18 num=100`). The profile bounded `audio.samplingRate` only for the app-decoded PCM codecs, so the server was free to hand the pipeline any rate on every other codec. libpf's rate vocabulary stops at 48 kHz (`devcaps::PCM_SAMPLE_RATES`, read from libpf-1.0 on the B8). The one samplingRate limitation loop in `profile_for_delivery` now covers every codec of the transcode target audio list (ac3, eac3, aac, dca, opus, as the caps allow) as well as the PCM codecs, from the same ceiling, so PMS converts a wider track instead of delivering a rate the pipeline refuses. The PCM clause is unchanged. The assumed-caps golden string gains the three new clauses, as its own comment prescribes for a deliberate profile edit. Closes #951 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…empt (#951) The first commit asked PMS for audio.samplingRate <= 48000 on every transcode target audio codec, but the app's own gate only checked the rate of PCM (FLAC) tracks. Every path that decides without PMS's /decision -- the in-place audio switch (commit_audio_route -> NativeAudioReload), legacy_action, retarget_audio, the track menu's "converted by your server" mark, audio_intent_needs_conversion, pick_audio, classify_outcome -- therefore still direct-played a 96 kHz AAC, the Load an LG B8 refuses. C. devcaps::pcm_track_fits is now devcaps::audio_track_fits, the one rate-fit predicate. PCM codecs keep the exact-table check; every other codec passes at an unstated rate (0) or at most AUDIO_RATE_CEILING (48 kHz). plex::is_dp_audio_track and the planner's audio_direct_plays_with already called it, so no call site is new; Force Direct Play applies it as it applies the PCM limits (a 96 kHz AAC is refused, not failed at the Load). The profile's samplingRate clauses and the predicate read the same audio_rate_bounded set and the same ceiling. B. DTS (dca) is not bounded: the app feeds only the DTS core (ff.rs dts_core_packet), 48 kHz at most by format, so bounding it would push DTS-HD 96/24 sources that play today into a lossy AC-3 conversion. Opus, AC-3 and E-AC-3 are 48 kHz at most by format, so their bound is a no-op, kept so "every codec but DTS" stays the one rule. D. The prose no longer claims libpf's pcmInfo rate table is why a >48 kHz Load is refused; that table is the pcmInfo lookup and the AAC Load carries no rate. The measured fact is: an LG B8 refused a 96 kHz AAC Load (#951, smp_cb type=18 num=100); where the limit lives is not determined, and 48 kHz is the highest rate any Load path here is known to accept. Prose that described the profile and the gate as sharing only membership and channel bounds (devcaps, transcoder, plan, decision, agent-reference) now names the rate axis. The fixed-HLS target's aac bound no longer depends on aac being in the caps: the target codec list is per delivery. Effect: a source above 48 kHz in AAC (or any non-DTS codec) loses direct play and copy and is converted by the server; DTS is unaffected. Verification: the profile bound was NOT verified against PMS for a source above 48 kHz. On the configured PMS, as seen by the Guest account, no audio stream above 48 kHz turned up among the items probed (the ten titles whose default track is TrueHD or DTS-HD MA, per stream; the rest of the movie and show libraries by default codec only). The wire syntax is confirmed: the decision endpoint answers 200 to the profile with and without the clause, and a 48 kHz AAC item stays "copy" either way. Whether PMS converts a 96 kHz source down to 48 kHz on this clause is requested but not yet verified. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 26, 2026
…ate-48k # Conflicts: # rust-modules/media/src/route/decision.rs # rust-modules/media/src/route/plan.rs # rust-modules/platform/src/devcaps.rs # rust-modules/plex/src/plex/transcoder.rs Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 26, 2026
audio_converted_by_server reads the attempt since S2b; the merged #1049 test still used the three-argument form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #951
PMS converted a 96 kHz FLAC to AAC and kept 96 kHz, and an LG B8 refused that Load (
smp_cb type=18 num=100). Where that limit lives in the TV is not determined. 48 kHz is the highest rate any Load path here is known to accept, so audio above it is now converted, not handed over.Profile:
profile_for_deliveryemits anaudio.samplingRateupperBound ofdevcaps::AUDIO_RATE_CEILING(48 kHz) for every audio codec it lists. Before, only the app-decoded PCM codecs had one. Fixed HLS bounds itsaactarget whatever the caps say.Local gate:
devcaps::pcm_track_fitsbecomesaudio_track_fits, the one rate-fit predicate, so the planner agrees with the profile on the new axis:pcmInfotable check;The paths that decide without PMS's
/decisionall go through it already: the in-place audio switch, the track menu's "converted" mark, the cold-start pick, the Detail preview and Force Direct Play. So none of them hands the TV a 96 kHz AAC.DTS is exempt (
devcaps::audio_rate_bounded). The app feeds only the DTS core (ff.rsdts_core_packet), which is 48 kHz at most, so a DTS-HD 96/24 track keeps direct play and its copy lane.What users see: an AAC (or other non-DTS) track above 48 kHz no longer direct-plays or copies; the server converts it. Under Force Direct Play it is refused before the Load with the codec-named read-out, the way an over-wide PCM track already is.
Docs: prose that called the profile's audio lanes "shared with the local gate", or blamed
PCM_SAMPLE_RATESfor the AAC refusal, is corrected (docs/agent-reference.mdincluded).Verification
main(or the first commit) and pass now:/decision;plx_platform:test result: ok. 290 passed; 0 failedplx_plex:test result: ok. 735 passed; 0 failedplx_media:test result: ok. 1754 passed; 0 failed; 64 ignored/decisionagainst a local PMS shows it accepts the clause and still copies a 48 kHz AAC, but no >48 kHz source was at hand.smp_cb type=8line at 48000, thensink: displayed=.🤖 Generated with Claude Code