runtime: honor Opus activation, trimming and planar output #3084
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3084"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T14:40:41Z.
Change
Honor activation-time channel counts for typed Opus streams. Decode at 48 kHz, apply the requested leading-frame trim and output capacity, and publish the corresponding completion record. Stereo streams support planar and interleaved output.
Verification
Tested
74d6e222on x64 Windows with MSVC and libopus 1.5.2, configured with X2W_WITH_OPUS=ON.Both source-built tests passed, zero skips. The stereo fixture compares decoding to libopus, checks trimming 312 leading frames from a 960-frame packet, and verifies completion fields and output order. This verifies the stream interface; application playback still requires integration testing.
AI-assisted contribution.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T14:46:51Z.
Release verification at
74d6e222with MSVC 19.51, x64 Windows and libopus 1.5.2 also passed. WithCMAKE_BUILD_TYPE=ReleaseandX2W_WITH_OPUS=ON,ctest --test-dir out/opus-rel --no-tests=error -R '^startup_xapu_(opus|queue)$' --output-on-failureran both tests, 2 passed, 0 failed, 0 skipped. The Debug build passed the same two fixtures.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T14:47:11Z.
Review: COMMENTED
Separate integration test at
74d6e222withmainca659396(tree2bfb069f424c2d33fa82f962400ddb4de694cfde). Typed activation supplies the channel count, decode consumes the full Opus packet before trimming, and only the kept PCM and packed completion are written.With
-DX2W_WITH_OPUS=ON, MSVC x64, Windows 11 26200.9974 and libopus 1.5.2, I builtstartup_stub_xapu startup_xapu_opus_check startup_xapu_queue_checkand ranctest --test-dir <build> --no-tests=error -j 1 -V -R '^startup_xapu_(opus|queue)$'. Debug and Release/O2each passed 2/2 with no skips. Two additional source-built Debug variants reduced the output capacity to 647 frames while requesting 960, or requested 647 with capacity 648. Both returned exactly 647 frames in planar and interleaved output, matched the libopus reference, and left the tails untouched. These are interface tests; application playback still needs integration evidence. Hosted Windows and both Linux jobs passed. A reviewer other than the PR author should give the merge verdict.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T22:01:10Z.
Review: COMMENTED
Independent verification of exact head
74d6e222integrated over554735ef. With libopus 1.5.2 andX2W_WITH_OPUS=ON, builtstartup_stub_xapu startup_xapu_opus_check startup_xapu_queue_check.ctest --test-dir <build> --no-tests=error -j1 -V -R '^startup_xapu_(opus|queue)$'passed 2/2 in both Debug and Release /O2, no skips. Checked that typed streams retain the full decode before applying trim/capacity and that the completion describes the kept output. Reapplied overmain6cc46a3c(treece7c05f4); the PR's code and fixtures are byte-identical, with only upstream documentation changes in its touched paths. Hosted Windows passed.