fix(libSceAudioOut): ignore non-finite stereo mix contributions #28890

Merged
RuiRDA merged 1 commit from upstream-pr/28890 into main 2026-12-04 14:54:21 +00:00
RuiRDA commented 2026-12-04 13:35:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by RuiRDA on 2026-12-04T13:35:43Z.


What

Skip zero-gain ports and non-finite per-channel contributions in the stereo mixer so an invalid contribution cannot discard the valid audio mixed beside it. Add a buffer fixture for the affected mix cases. The open #27282 covers different AudioOut2 validation paths.

Tested

The diff and conventions checks passed. The audio buffer fixture was not run in this environment because the SDL headers needed to compile the native audio source were unavailable.

git diff --check and the conventions checker passed. I searched for duplicate and related open PRs. A complete pr_overlap.py scan requires an authenticated GitHub CLI.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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

Summary by CodeRabbit

  • Bug Fixes
    • Improved audio mixing reliability when volume settings or audio samples contain invalid values. Valid audio continues to play, while affected values no longer disrupt the mix.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5647479972 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28890). Originally posted by [RuiRDA](https://github.com/RuiRDA) on 2026-12-04T13:35:43Z. --- ### What Skip zero-gain ports and non-finite per-channel contributions in the stereo mixer so an invalid contribution cannot discard the valid audio mixed beside it. Add a buffer fixture for the affected mix cases. The open #27282 covers different AudioOut2 validation paths. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> The diff and conventions checks passed. The audio buffer fixture was not run in this environment because the SDL headers needed to compile the native audio source were unavailable. `git diff --check` and the conventions checker passed. I searched for duplicate and related open PRs. A complete `pr_overlap.py` scan requires an authenticated GitHub CLI. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved audio mixing reliability when volume settings or audio samples contain invalid values. Valid audio continues to play, while affected values no longer disrupt the mix. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-12-04 13:55:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T13:55:59Z.

Review: APPROVED


Reviewed — looks good

The reviewed head is a5a3dca95c154fcb2cbccd13eb75cdff8a19558b; the mixer skips zero-gain ports and non-finite channel samples, and the added fixture covers NaN and infinity inputs.

What I ran

Read the prepared description, commit list, manifest, file list, and diff. Used repo_read.py to search mixer call sites and read the changed mixer and fixture context at the pinned head. No build or test was run.

Results

Check Result Note
Changed-file review passed Both reviewed files inspected
Build and tests not run Fixture execution was not attempted

Negative control

Not run; no tests were executed.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

The audio fixture, build, and runtime behavior were not verified. Read core/libs/prx/libSceAudioOut/src/AudioOut2Port.cpp and core/libs/prx/libSceAudioOut/tests/AudioOut2PortBuffers.cpp; files.json lists both changed files as reviewed and no exclusions.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6190211882 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28890#pullrequestreview-6190211882). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-04T13:55:59Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed head is `a5a3dca95c154fcb2cbccd13eb75cdff8a19558b`; the mixer skips zero-gain ports and non-finite channel samples, and the added fixture covers NaN and infinity inputs. ## What I ran Read the prepared description, commit list, manifest, file list, and diff. Used `repo_read.py` to search mixer call sites and read the changed mixer and fixture context at the pinned head. No build or test was run. ## Results | Check | Result | Note | |---|---|---| | Changed-file review | passed | Both reviewed files inspected | | Build and tests | not run | Fixture execution was not attempted | ## Negative control Not run; no tests were executed. ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [AudioOut2Port.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/a5a3dca95c154fcb2cbccd13eb75cdff8a19558b/core/libs/prx/libSceAudioOut/src/AudioOut2Port.cpp#L92) - [AudioOut2PortBuffers.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/a5a3dca95c154fcb2cbccd13eb75cdff8a19558b/core/libs/prx/libSceAudioOut/tests/AudioOut2PortBuffers.cpp#L348) ## Not verified The audio fixture, build, and runtime behavior were not verified. Read `core/libs/prx/libSceAudioOut/src/AudioOut2Port.cpp` and `core/libs/prx/libSceAudioOut/tests/AudioOut2PortBuffers.cpp`; `files.json` lists both changed files as reviewed and no exclusions. ## To get this to a good state Nothing is required.
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!28890
No description provided.