runtime: honor Opus activation, trimming and planar output #3084

Manually merged
github merged 1 commit from github-bot/gh-3084 into gh-pr/3084/base 2026-11-27 22:03:42 +00:00 AGit
Owner

@⁠R0Y00 on GitHub · 2026-11-27 14:40 UTC · original
R0Y00:codex/local-opus-activation → main · +169 −26 · 3 files · 1 commits · merged 2026-11-27 22:01 UTC

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 74d6e222 on x64 Windows with MSVC and libopus 1.5.2, configured with X2W_WITH_OPUS=ON.

cmake --build --preset dev --target startup_stub_xapu startup_xapu_opus_check startup_xapu_queue_check
ctest --preset dev --no-tests=error -R '^startup_xapu_(opus|queue)$' --output-on-failure

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.

**@⁠R0Y00** on GitHub · 2026-11-27 14:40 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3084) `R0Y00:codex/local-opus-activation` → `main` · +169 −26 · 3 files · 1 commits · merged 2026-11-27 22:01 UTC ## 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 74d6e222 on x64 Windows with MSVC and libopus 1.5.2, configured with X2W_WITH_OPUS=ON. ```powershell cmake --build --preset dev --target startup_stub_xapu startup_xapu_opus_check startup_xapu_queue_check ctest --preset dev --no-tests=error -R '^startup_xapu_(opus|queue)$' --output-on-failure ``` 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:41:57 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 14:46 UTC · original

Release verification at 74d6e222 with MSVC 19.51, x64 Windows and libopus 1.5.2 also passed. With CMAKE_BUILD_TYPE=Release and X2W_WITH_OPUS=ON, ctest --test-dir out/opus-rel --no-tests=error -R '^startup_xapu_(opus|queue)$' --output-on-failure ran both tests, 2 passed, 0 failed, 0 skipped. The Debug build passed the same two fixtures.

**@⁠R0Y00** on GitHub · 2026-11-27 14:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3084#issuecomment-7221218392) Release verification at `74d6e222` with MSVC 19.51, x64 Windows and libopus 1.5.2 also passed. With `CMAKE_BUILD_TYPE=Release` and `X2W_WITH_OPUS=ON`, `ctest --test-dir out/opus-rel --no-tests=error -R '^startup_xapu_(opus|queue)$' --output-on-failure` ran both tests, 2 passed, 0 failed, 0 skipped. The Debug build passed the same two fixtures.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 14:47 UTC · original · reviewed

Separate integration test at 74d6e222 with main ca659396 (tree 2bfb069f424c2d33fa82f962400ddb4de694cfde). 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 built startup_stub_xapu startup_xapu_opus_check startup_xapu_queue_check and ran ctest --test-dir <build> --no-tests=error -j 1 -V -R '^startup_xapu_(opus|queue)$'. Debug and Release /O2 each 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.

**@⁠R0Y00** on GitHub · 2026-11-27 14:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3084#pullrequestreview-6089862176) · **reviewed** Separate integration test at `74d6e222` with `main` `ca659396` (tree `2bfb069f424c2d33fa82f962400ddb4de694cfde`). 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 built `startup_stub_xapu startup_xapu_opus_check startup_xapu_queue_check` and ran `ctest --test-dir <build> --no-tests=error -j 1 -V -R '^startup_xapu_(opus|queue)$'`. Debug and Release `/O2` each 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.
github-bot changed target branch from main to gh-pr/3084/base 2026-11-27 22:03:40 +00:00
github manually merged commit 74d6e22213 into gh-pr/3084/base 2026-11-27 22:03:42 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-27 22:01 UTC · original · reviewed

Independent verification of exact head 74d6e222 integrated over 554735ef. With libopus 1.5.2 and X2W_WITH_OPUS=ON, built startup_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 over main 6cc46a3c (tree ce7c05f4); the PR's code and fixtures are byte-identical, with only upstream documentation changes in its touched paths. Hosted Windows passed.

**@⁠R0Y00** on GitHub · 2026-11-27 22:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3084#pullrequestreview-6093763722) · **reviewed** Independent verification of exact head `74d6e222` integrated over `554735ef`. With libopus 1.5.2 and `X2W_WITH_OPUS=ON`, built `startup_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 over `main` `6cc46a3c` (tree `ce7c05f4`); the PR's code and fixtures are byte-identical, with only upstream documentation changes in its touched paths. Hosted Windows passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.