Repository navigation
fix(playback): break output-route replan loops - #4
Merged
Merged
Conversation
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.
Problem
I traced a live Pixel 7 session that kept cycling through direct play, remux, and transcode. The server transports were healthy; each replacement was being torn down by another
output_route_changedreplan. Media3 remounts were triggering Spatializer callbacks, and the client treated every callback as a new physical output route. That advanced the opaque route generation and cleared the failed-plan history, so loop detection never had a chance to stop the cycle.This is the client-side half of blurbery/silo-server#50.
Approach
I split the output snapshot into two concepts: full runtime state for diagnostics, and a stable planning identity for deciding whether playback must be replanned. The planning identity includes the physical sink and the HDR/passthrough capabilities that can actually change the server recipe. It deliberately excludes Spatializer state because the server does not route on it and Media3 can change it as a consequence of remounting.
The route generation now advances only when that planning identity changes. I also keep the attempted-plan history when an opaque context ID changes without a material route change, so a callback cannot reopen direct, remux, and transcode routes that already failed.
The linked server guard gives already-installed builds the same protection immediately; this client change removes the trigger at its source.
Validation
Risks
A real sink, HDR, passthrough, or channel-capability change still advances the route generation and replans normally. The only callbacks filtered out are changes to state that does not affect the playback recipe.
AI Disclosure