Skip to content

fix(playback): break output-route replan loops - #4

Merged
blurbery merged 1 commit into
mainfrom
fix/playback-output-route-loop
Aug 27, 2026
Merged

blurbery merged 1 commit into
mainfrom
fix/playback-output-route-loop

Conversation

@blurbery

@blurbery blurbery commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

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_changed replan. 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

  • Android Builds / Unit tests — passed
  • Android Builds / Lint — passed
  • Added focused coverage for stable route identity, real capability changes, and preserving fallback history.
  • Local Gradle execution was unavailable because this Mac has no Java runtime; GitHub Actions supplied the repository build environment.

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

  • Tool(s): OpenAI Codex desktop
  • Model(s): gpt-5.6-sol
  • Involvement: AI-assisted
  • Review: The implementation was checked against the live route-event sequence, the playback manager’s invalidation/history behavior, and the server planner inputs. GitHub Actions unit tests and lint both passed.

@blurbery
blurbery merged commit e71524b into main Aug 27, 2026
3 checks passed
@blurbery
blurbery deleted the fix/playback-output-route-loop branch August 27, 2026 02:29
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.

1 participant