Skip to content

Fix NoCompatibleStream when playing a fresh in-progress DVR recording - #1968

Open
mackandall wants to merge 1 commit into
damontecres:mainfrom
mackandall:fix/nocompatiblestream-in-progress-recording
Open

mackandall wants to merge 1 commit into
damontecres:mainfrom
mackandall:fix/nocompatiblestream-in-progress-recording

Conversation

@mackandall

Copy link
Copy Markdown

What

Pressing Play on a DVR recording that's still actively being written does nothing — no error, no toast — if that particular recording has never been played before. Logcat shows:

PlaybackViewModel$changeStreams: Error in PostedPlaybackInfo: NoCompatibleStream

...after which the app just navigates back to the series page with no indication anything went wrong.

Root cause

play() only treats BaseItemKind.TV_CHANNEL as needing no explicit mediaSourceId. A Recording item goes through streamChoiceService.chooseSource(base, itemPlayback), which picks from the item's cached MediaSources (from a plain item GET) — whose Id is the item's own guid (MediaSourceManager.GetStaticMediaSources server-side). That id gets sent as an explicit mediaSourceId in the PlaybackInfo request.

But for an actively recording item, the server resolves the real source dynamically via MediaSourceManager.GetRecordingStreamMediaSources, whose Id is the active recording's own id — never the item's guid. The server's MediaInfoHelper.ResolvePlaybackMediaSources filters by the requested mediaSourceId, finds nothing, and returns ErrorCode: NoCompatibleStream.

This only reproduces on a fresh first-ever play attempt for a given in-progress recording — a previously-played one can take a different path and work fine, which is probably why it hadn't surfaced before.

Fix

Treat an in-progress recording (item.type == BaseItemKind.RECORDING && dto.status == "InProgress") the same as a live TV channel in play() — skip static source selection, pass sourceId = null, let the server resolve fresh.

Verified on-device against two independent fresh in-progress recordings on two different shows/channels: before the fix, instant NoCompatibleStream; after, a normal Transcode playback decision and the video plays immediately.

Separate observation (not addressed by this PR)

Even without this specific root cause, changeStreams silently swallows response.errorCode instead of surfacing it to the user (a toast/snackbar) — worth considering separately, since any future NoCompatibleStream case will otherwise look like "nothing happens" again.

Root cause (confirmed against a live 12.0.0 server, both client and
server source read): playback for a Recording item picks a
MediaSourceInfo from the item's cached/static MediaSources list
(fetched by a plain item GET, server-side
MediaSourceManager.GetStaticMediaSources -- Id = the item's own
guid), then sends that Id as an explicit mediaSourceId in the
PlaybackInfo request.

For a recording that's still actively being written, that Id is
wrong: MediaSourceManager.GetRecordingStreamMediaSources builds the
real, dynamically-resolved source with Id = the active recording's
own id, which is never the item's guid. Jellyfin.Api.Helpers
.MediaInfoHelper.ResolvePlaybackMediaSources filters the server's
sources by the requested mediaSourceId, matches nothing, and the
PlaybackInfo response comes back with ErrorCode=NoCompatibleStream
-- fast (no probing, no I/O), and PlaybackViewModel.changeStreams
silently bails out and navigates back with no user-facing error at
all. Reproduced with a fresh (never-before-played) in-progress
recording; a previously-played one can still work if its stored
itemPlayback source coincidentally still matches.

Fix: treat an in-progress recording (BaseItemKind.RECORDING with
status == "InProgress") the same way TV_CHANNEL already is --skip
static source selection entirely and pass sourceId = null, letting
the server resolve the current source itself. Verified against the
same recording on-device: PlaybackInfo now returns a real Transcode
decision instead of NoCompatibleStream.
@damontecres

Copy link
Copy Markdown
Owner

Thanks for submitting this PR. Please fix the PR description to match the template provided when opening a pull request. Additionally, please review the AI/LLM policy again.

@mackandall

Copy link
Copy Markdown
Author

Apologies. Will fix with human language and resubmit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants