test(libSceAudioOut): cover speaker array creation and its ambisonics coefficients #11584

Merged
milescoviello merged 1 commit from upstream-pr/11584 into main 2026-11-02 12:25:49 +00:00
milescoviello commented 2026-10-26 21:35:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-26T21:35:49Z.


What

A new tests/AudioOut2SpeakerArray.cpp (registered after the AudioOut2 latency test) covers sceAudioOut2SpeakerArrayCreate and sceAudioOut2GetSpeakerArrayAmbisonicsCoefficients. Creation rejects a null handle or parameter block, 0 or 33 speakers, memory too small for the array and misaligned memory, without writing the handle, and otherwise places the array in the memory given. For four speakers on the horizontal plane at 0, 90, 180 and 270 degrees, the W channel splits 0.25 to each speaker, the first-order Y and X channels follow the sine and cosine of each azimuth (±0.25), and a second-order channel decodes to 0, as four speakers decode only the first order. A channel without the ambisonics flag, a sixth-order channel, a wrong coefficient count, null coefficients and memory holding no array are rejected.

Until now no test called it.

Changed: core/libs/prx/libSceAudioOut/CMakeLists.txt, core/libs/prx/libSceAudioOut/tests/AudioOut2SpeakerArray.cpp. Test only, no change to the library.

Tested

Linux (Ubuntu 26.04, GCC 15.2), Release: cmake --build build --target audio_out2_speaker_array_tests and ctest -R '^audio_out2_speaker_array$' --repeat until-fail:3 pass on this branch, which is current main plus the test. tools/check_conventions.py --base upstream/main passes.

Windows (run by maskym: Windows 11, i7-12700K, WinLibs GCC 15.2.0, Release, with other open PRs merged in): audio_out2_speaker_array passes (comment).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5025010959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11584). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-26T21:35:49Z. --- ### What A new `tests/AudioOut2SpeakerArray.cpp` (registered after the AudioOut2 latency test) covers `sceAudioOut2SpeakerArrayCreate` and `sceAudioOut2GetSpeakerArrayAmbisonicsCoefficients`. Creation rejects a null handle or parameter block, 0 or 33 speakers, memory too small for the array and misaligned memory, without writing the handle, and otherwise places the array in the memory given. For four speakers on the horizontal plane at 0, 90, 180 and 270 degrees, the W channel splits 0.25 to each speaker, the first-order Y and X channels follow the sine and cosine of each azimuth (±0.25), and a second-order channel decodes to 0, as four speakers decode only the first order. A channel without the ambisonics flag, a sixth-order channel, a wrong coefficient count, null coefficients and memory holding no array are rejected. Until now no test called it. Changed: `core/libs/prx/libSceAudioOut/CMakeLists.txt`, `core/libs/prx/libSceAudioOut/tests/AudioOut2SpeakerArray.cpp`. Test only, no change to the library. ### Tested Linux (Ubuntu 26.04, GCC 15.2), Release: `cmake --build build --target audio_out2_speaker_array_tests` and `ctest -R '^audio_out2_speaker_array$' --repeat until-fail:3` pass on this branch, which is current `main` plus the test. `tools/check_conventions.py --base upstream/main` passes. Windows (run by maskym: Windows 11, i7-12700K, WinLibs GCC 15.2.0, Release, with other open PRs merged in): `audio_out2_speaker_array` passes ([comment](https://github.com/boykopovar/AnyPS5/pull/11584#issuecomment-6446367137)). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 22:12:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T22:12:52Z.

Review: APPROVED


The four-speaker geometry exercises the expected SN3D W/Y/X values and the unsupported second-order zeroing for this implementation; the invalid flag/order/count/null-handle cases are also covered. I manually checked the overlap bot warning for #5021: its AudioOut CMake change only selects the SDL link dependency near the top of the file; it does not overlap this test registration hunk, so no dependency is needed. The author reports three passing Linux runs and conventions; hosted eligibility, conventions, intake, labels and report pass. Product jobs are skipped by path policy. I did not rerun the test locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5659812953 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11584#pullrequestreview-5659812953). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T22:12:52Z. **Review:** APPROVED --- The four-speaker geometry exercises the expected SN3D W/Y/X values and the unsupported second-order zeroing for this implementation; the invalid flag/order/count/null-handle cases are also covered. I manually checked the overlap bot warning for #5021: its `AudioOut` CMake change only selects the SDL link dependency near the top of the file; it does not overlap this test registration hunk, so no dependency is needed. The author reports three passing Linux runs and conventions; hosted eligibility, conventions, intake, labels and report pass. Product jobs are skipped by path policy. I did not rerun the test locally.
THEMANnt commented 2026-10-28 12:39:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T12:39:04Z.

Review: APPROVED


Reviewed 9773824265879cfdfebb134fe7c1f5bb13f70f90 — approve. The speaker-array fixture checks rejected creation without writing a handle, placement in caller memory, known first-order coefficient values, unsupported channels/counts and null/invalid arrays. This is CPU coefficient validation; no audio device playback was performed.

Windows/GCC 15.3 Release native validation from pinned sources: head: 1 passed, 0 skipped; audio_out2_speaker_array; author base was source-compared: production sources are unchanged; its runtime was not built or executed for this review. This changes test coverage, not production behavior, so an old-production failure is not required. The build reuses matching dependency source pins and the existing FFmpeg package; no full product or game execution is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5682695392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11584#pullrequestreview-5682695392). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T12:39:04Z. **Review:** APPROVED --- Reviewed `9773824265879cfdfebb134fe7c1f5bb13f70f90` — approve. The speaker-array fixture checks rejected creation without writing a handle, placement in caller memory, known first-order coefficient values, unsupported channels/counts and null/invalid arrays. This is CPU coefficient validation; no audio device playback was performed. Windows/GCC 15.3 Release native validation from pinned sources: head: 1 passed, 0 skipped; `audio_out2_speaker_array`; author base was source-compared: production sources are unchanged; its runtime was not built or executed for this review. This changes test coverage, not production behavior, so an old-production failure is not required. The build reuses matching dependency source pins and the existing FFmpeg package; no full product or game execution is claimed.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11584
No description provided.