Task architecture

Validate PCM Channel Mixing for Android Local AI Inputs

Test a chosen mixing matrix against a documented target audio contract, not a universal mono rule or a speech-quality assumption.

Review status: Fact and editorial QA complete; owner review pending · 2026-10-08 · Fact IDs: ANDROID-AUDIO-01, COVE-ASR-01, BENCHMARK-01, ANDROID-PCM-MIXING-2026-10

Direct answer

Downmix only when the exact downstream artifact/runtime contract requires mono; “supports speech” does not imply it. If that contract accepts stereo, preserving both channels may be correct. Treat any mono conversion as a versioned sample transform, separate from capture, resampling, WAV framing, and recognition quality. Android AudioFormat describes a frame's channel mask and PCM encoding. AudioRecord input supports mono or stereo masks, and Android guarantees mono availability; neither fact states what a model requires. Record the mask and actual byte layout at the transform boundary instead of inferring channel order, sample rate, or interleaving from a filename or requested setting. Media3 ChannelMixingMatrix defines input-channel rows and output-channel columns with non-negative row-major coefficients. ChannelMixingAudioProcessor stores a matrix per input channel count and documents 16-bit PCM input/output. It is marked UnstableApi, so pin the resolved Media3 version. The documented [0.5, 0.5] stereo-to-mono matrix is an example, not a universal optimum, ASR requirement, or evidence Cove uses Media3. The matrix cannot express negative coefficients; test opposite-phase input as possible cancellation, not as a negative-gain setting. Before execution, define y = aL + bR and use one fixed asymmetric main matrix [0.75, 0.25] across five 16-bit PCM fixtures: [12000,0] -> 9000; [0,12000] -> 3000; [8000,8000] -> 8000; [8000,-8000] -> 4000; and [30000,20000] -> 27500. Freeze inputs, row/column order, and the pinned conversion tolerance. The asymmetric matrix lets the one-sided cases reveal a left/right swap; a symmetric matrix cannot. Keep two separate controls: [0.5,0.5] with [8000,-8000] has a zero pre-quantization sum, and [1,1] with [30000,30000] has a pre-clip sum of 60000. Record the latter processor output without assuming saturation. Android and Media3 docs do not promise universal rounding or clipping behavior. Keep this test separate from recorder configuration. Request AudioRecord mono only when the app contract calls for it; that does not test a stereo-file conversion. A stereo buffer test does not establish that a device microphone route supports stereo. If output is wrapped in WAV, separately verify header channel count and PCM metadata against the transformed payload. After sample checks pass, identify the exact PCM or container sent downstream, its channel count, frame/byte totals, coefficients, processor/runtime versions, and fixture ID. Transcript checks are separate and do not turn this matrix test into WER evidence. Cove's ASR fact records PCM-to-WAV handoff, but does not establish stereo capture, a mono requirement, or Media3 integration.

A stereo fixture loses the only clear voice channel after downmix

A recording has stereo PCM; the left channel carries a quiet synthetic prompt and the right a stronger opposite-phase signal. A downstream adapter expects mono, but its matrix is undocumented and the output was not inspected.

Decision

Confirm the exact channel contract and compare a frozen matrix against a small expected-output fixture set before blaming recognition.

Expected outcome

The report shows how this transform maps or cancels channel content without claiming every model needs mono or that one matrix is best.

Evidence to collect

The claim becomes reviewable only when the following evidence is attached to the same artifact and test run:

  • Input layout and selected matrix identity
  • Single-channel and opposite-phase synthetic fixtures
  • Observed 16-bit output, rounding and near-full-scale behavior

Task quality needs a versioned corpus and acceptance rules. Fluent sample output is not an accuracy result.

Implementation workflow

  1. Confirm the downstream channel contract. Record the exact artifact/runtime requirement and whether it accepts mono or stereo. Keep resampling, WAV metadata, and mixing separate; preserve stereo when accepted instead of forcing mono.
  2. Freeze input ordering and matrix dimensions. Record PCM encoding, channel mask/order, interleaving, input/output counts, and matrix row/column order. Pin the resolved Media3 version and UnstableApi status; its processor is documented for 16-bit PCM only.
  3. Predeclare five fixtures under one asymmetric matrix. For 16-bit PCM, use [0.75,0.25] on every main case and predeclare wide-precision outputs: left-only [12000,0] -> 9000; right-only [0,12000] -> 3000; in-phase [8000,8000] -> 8000; opposite-phase [8000,-8000] -> 4000; unequal near-full-scale [30000,20000] -> 27500. Set tolerance from the pinned conversion path before running. The asymmetric weights let left/right fixtures detect a swap.
  4. Run symmetric cancellation and clipping as separate controls. Do not change the matrix within the five-case main set. Separately test [0.5,0.5] with [8000,-8000] for a zero arithmetic sum and [1,1] with [30000,30000] for a 60000 pre-clip sum. Record actual PCM16 output; do not assume a documented saturation guarantee or use the symmetric test to detect channel order.
  5. Verify the transformed buffer boundary. Check output channel count, frame count, byte length, interleaving, and any WAV header independently. Confirm the precise buffer or container delivered downstream and retain a fixture checksum; do not treat a valid header as proof that channel samples are correct.
  6. Evaluate inference separately. Only after transform checks pass, run the same fixture through the exact downstream path if that contract is available. Record empty or changed transcripts separately from matrix arithmetic, and do not present this small fixture set as WER, model quality, or device compatibility evidence.

Keep each transition observable. A failure should identify the stage, artifact, runtime, and recovery action without logging private user content.

Acceptance criteria

  • A mono transform is used only when the selected model/runtime contract calls for it; no universal single-channel requirement is inferred.
  • One fixed asymmetric matrix is used across the five main fixtures, with expected outputs and tolerance recorded before execution; its left-only/right-only cases can detect order swaps that a symmetric matrix cannot.
  • Symmetric phase-cancellation and over-range clipping controls are separate matrices and runs; implementation-specific clipping output is measured rather than assumed.
  • A passing matrix result is not presented as transcription accuracy or a Cove feature claim; the exact transformed PCM/container passed downstream is identified.

Decision table

DimensionChoice or evidenceHow to interpret it
Preserve stereoKeep both channels when the downstream contract accepts themAvoids a lossy mix but still requires verified sample order and container metadata.
Mono capture requestAsk AudioRecord for mono when the capture path and model contract agreeAndroid guarantees the mono input mask is available; this does not validate a later stereo-file conversion.
Stereo-to-mono matrixApply an explicit, tested mapping only when mono is requiredMakes channel contributions and possible cancellation reviewable; coefficients are not a universal quality setting.
Metadata-only format checkRecord sample rate, mask, encoding, and WAV headerDescribes representation but does not establish that the transformation preserved the intended audio content.

Failure patterns to prevent

  • Assuming every model requires mono
  • Calling example coefficients universally optimal

Also prevent silent fallback, unpinned artifacts, missing cancellation, and conclusions that combine unlike configurations. Store unsuccessful runs alongside successful ones.

Minimum reproducibility record

LayerRecord
DeviceManufacturer, model, chipset, RAM class, operating-system build
SoftwareApplication version and git commit
ModelFamily, variant, revision, format, file length, hash, quantization
RuntimeName, revision, requested backend, observed backend evidence
WorkloadFixture revision, input hash, prompt hash, output policy
OutcomeCompleted, failed, cancelled, fallback, and privacy-safe diagnostics

Release checklist

  • ☐ The primary query is answered without an unsupported number.
  • ☐ Every artifact and runtime is pinned.
  • ☐ The representative task and failure policy are explicit.
  • ☐ Lifecycle, cancellation, cleanup, and fallback are tested.
  • ☐ User-content and network boundaries are documented.
  • ☐ Result wording applies only to the recorded configuration.
  • ☐ The page links to raw method or evidence when results are added.

Sources and related evidence

Chinese deployment and troubleshooting content is organized in the .奇连 AI 端侧专题.

Frequently asked questions

Does every local speech model require mono PCM?

No. Check the exact artifact and runtime input contract. A stereo-capable path may preserve both channels; use mono only when the selected consumer requires it or a controlled comparison justifies the transform.

Is a 0.5/0.5 stereo-to-mono mix the best default?

No. Media3 documents it as an example, not a universal recommendation. Use one fixed asymmetric matrix for the main left/right order fixtures because symmetric weights cannot reveal a swap; test 0.5/0.5 cancellation as a separate control.

Can a symmetric mix detect swapped left and right channels?

No. If both input coefficients are equal, swapping L and R yields the same mono arithmetic result. Use a fixed asymmetric matrix for the paired one-sided fixtures, and keep other coefficient sets in separate controlled tests.

Can ChannelMixingAudioProcessor process any PCM format?

No. Its documentation specifies 16-bit PCM input and output and marks the API UnstableApi. Do not assume PCM float, 24-bit samples, or another resolved library version behaves the same; convert explicitly or mark the path unsupported.

Can a clipping fixture establish ASR accuracy?

No. It can characterize the pinned transform output near its numeric range. Transcript scoring is a separate, task-specific evaluation and requires its own reviewed corpus and evidence.