# Online decoder window selection > Owner/scope: per-scan AU selection, PCM admission and window observations ## Ownership and initialization Player owns policy state per opaque DecoderHint and work mode: excerpt AI, excerpt loudness, both, or full-span loudness. Retain the codec configuration, admitted AU sizes, failed unaccepted-trial cap, working size, window evidence, file decisions, acknowledged per-file feasible ceilings and recovery context in RAM. Indexer retains live sessions and bounded working buffers. Restarting Indexer MUST reuse acknowledged state. Completing the full analysis run or an applicable L2 rebuild retires it; death of both processes loses it. No permanent blacklist, configuration option, catalog field, dependency or device-identity branch is added. Use a stock decoder, preferring the platform default among eligible implementations. Initialization checks single-AU lifecycle PCM and the priming policy; it performs no upfront performance search. [Analysis procedures](/Riff/LATEST/indexer-analysis-procedures#5-optional-analysis-stage) own the callback pump, window content, priming, framing and payload limits. ## PCM admission One AU is reference/recovery mode, not a performance arm. Multi-AU arms are every integer 2–64 that the input API, current file's feasible ceiling and PCM checks admit. Indexer supplies the file's conservative packing ceiling (also at most six for legacy Opus) through the acknowledged selection operation; Player retains it by physical source/stamp. It limits that file only, independently of cohort correctness failures. Do not explore redundant windows above the Opus 120-ms source-packet bound. A ceiling of one returns reference mode without poisoning the hint's admitted frontier. Propose a previously untested size only one AU beyond the admitted frontier. Check its three real probe windows against exact single-AU format, byte count and XXH3-64 for both first-start and post-flush lifecycle states. Do not substitute a mixed single-AU prefix. Short sources may supply fewer probe AUs but must supply nonempty decodable probes. Register each check as acknowledged CALIBRATION work. A completed mismatch/error excludes that size and further untested sizes for the tuple. Native death in an unaccepted multi-AU trial likewise retains a cap below that trial so restart cannot repeat it. These are correctness admission limits, not speed decisions. Admitted sizes are not rechecked on every file or after Indexer restart. Indexer may cache the active hint's encoded probes and lifecycle references; retain no cross-hint probe or codec pool. A new reference pass is needed only when required probe data is absent for checking an unseen size. Compatible AU-only excerpt changes retain warm sessions and use the ordinary next-file flush. Full-span input uses the same admitted first-start PCM with the [lifecycle and extent](/Riff/LATEST/full-span-decoding) owned separately. The same physical source/stamp and work mode retain their selected window across spans for the run; a file-specific single-AU override takes precedence. ## Window evidence One AU is reference and recovery, with ordinary one-AU work available as a fallback. Each excerpt group uses one selected AU count across its three logical windows. Each window reports its own successful processed audio duration and elapsed decoder time to Player as soon as it finishes. Loudness retries within a logical window are part of its work. Full-span production has one window and a separate performance context. Acknowledged successes survive Indexer death, and duplicate or stale packets cannot increase the count. Player counts completed windows individually and counts each resolved physical source at most once per size for crash risk. A same-source confirmed batch failure supersedes a success. Each decode uses one callback pump and one monotonic measurement boundary for ready encoded input through raw PCM. Bounded source reads and extraction occur before entering a timed codec call. Output analysis, digesting, IPC, opening, seeking, configuring and flushing occur outside the timer. Pending codec state survives input refills and output consumption through real EOS. A refill never flushes a session. Do not derive codec time by subtracting provider calls from group wall time. Record the decoder hint, codec, input API, requested AU count, real submitted AU and batch counts, largest actual input, decoded PCM duration, elapsed codec time, observed interval, worker lane and configured parallelism. The logical excerpt index independently identifies its completion ACK. Distinguish reference, admission, priming and ordinary production. Treat each calibration and production extent with the same measurement mechanism. Record observed overlap from monotonic boundaries when needed. Never divide an individual clock by the number of workers. The ordinary full pass records one slot with parallelism one. A separate end-to-end elapsed duration remains available for scan throughput and actual recovery cost. ## Selecting a working size Start at two AUs where feasible. Compare decoder time per second of raw PCM among compatible decoder, API and parallelism observations. A successful PCM admission can propose a size. Ordinary completed decoder windows provide its performance evidence. All source locators use this rule. Neither SAF access time nor complete-file wall time chooses a size. Use recent ordinary window observations and retain distinct resolved source counts for risk. Preserve the incumbent when speed evidence overlaps. A full-span pass may test a clean excerpt nominee, then builds its own serial evidence. Each file can admit at most the next integer size. Shortlist promising admitted sizes and periodically sample an eligible outsider. Missing speed information must not exclude an admitted size forever. Do not run extra serial or parallel decodes solely to time one candidate. First compare confirmed native process deaths, then confirmed handled failures. Prefer a clean history over an observed failure of that class. When both have failures use the one-sided Wilson upper score on distinct resolved sources. A confirmed failure of the working size triggers selection of a tested clean alternative or one AU. Keep the policy and accepted observations in Player for the run. Incomplete slots and cancelled work do not establish a failure. Speed from a completed window can survive the death of a different window in the same group. ## Recovery and verification [Decoder recovery](/Riff/LATEST/decoder-attempt-recovery) owns one-AU retries and source isolation. Account for one process death per interrupted group. Once a matching one-AU retry succeeds, treat the original grouped input as a confirmed batch-failure observation. Keep the measured elapsed time through restart and retry as recovery cost. A failed or interrupted retry gives no evidence against the original batch size. Unfinished window outcomes remain unknown. Verify per-window and distinct-source counts, early completions across a native death, conditioned risk evidence, actual recovery cost, stable selection, admission, cancellation and resets. On devices compare exact PCM and sustained throughput under MP3, AAC/M4A and both Opus input APIs where supported. Include sample order, cold start, PCM admissions, actual recovery and thermal status in performance evidence.