fix(libSceAudioOut): play silence for a regiven AudioOut2 buffer that is not set again #13988

Merged
alfalfa-star merged 1 commit from upstream-pr/13988 into main 2026-10-31 23:16:46 +00:00
alfalfa-star commented 2026-10-31 14:30:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-31T14:30:19Z.


What

A port that got no new PCM buffer for a grain repeated its last buffer whenever that buffer had not moved on. That also covered a port given the same buffer every grain, which then plays whatever is in that memory once the title stops setting it. Now only a port given a buffer once (since it was created or cleared with a null buffer) repeats it; a port given buffers again plays silence for a grain without a new one. The rewritten-in-place case (audio_out2_timing, TestRewrittenBufferRepeats) is unchanged, as is the ring-buffer case from #2536.

Crash Bandicoot 4 (PPSA02433): Wwise's 3D audio sink (sceaudio3d.prx) gives each of its 16 object ports (type 0x100, mono float) the same buffer every grain, about 94 sets per second. When the title loads (pressing a button on the title screen, entering the cutscene) the sets stop for ~350 ms while advances continue. The repeat then mixed the reused memory: values up to 6e18 and NaNs, a loud high-pitched burst. Per-port trace of the bad grains before the change:

[a2bad] t=39.256 port 1 type 0x100 ch 1 source 12 data 0x202dc70080 bad 16/512 peak-good 1.000 dataSets 217

(source 12 = repeated buffer, snapshot at advance). Attribute sets per second on port 4 around it: 37s:94 38s:91 39s:61 40s:94. With the change there are no bad grains in the same scene, and the burst is gone by ear.

Tested

  • Linux (Arch), PPSA02433: title screen, main menu, cutscene; no burst, no bad samples ([a2bad] trace: 0 lines vs 400 before).
  • New TestAdvancedRegivenBufferPlaysSilenceWithoutANewSet in audio_out2_port_buffers fails without the change and passes with it.
  • All 59 audio_out* tests pass. tools/check_conventions.py --base upstream/main passes.

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: PPSA02433 #9065
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5098450266 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13988). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-31T14:30:19Z. --- ### What A port that got no new PCM buffer for a grain repeated its last buffer whenever that buffer had not moved on. That also covered a port given the *same* buffer every grain, which then plays whatever is in that memory once the title stops setting it. Now only a port given a buffer once (since it was created or cleared with a null buffer) repeats it; a port given buffers again plays silence for a grain without a new one. The rewritten-in-place case (`audio_out2_timing`, `TestRewrittenBufferRepeats`) is unchanged, as is the ring-buffer case from #2536. Crash Bandicoot 4 (PPSA02433): Wwise's 3D audio sink (`sceaudio3d.prx`) gives each of its 16 object ports (type 0x100, mono float) the same buffer every grain, about 94 sets per second. When the title loads (pressing a button on the title screen, entering the cutscene) the sets stop for ~350 ms while advances continue. The repeat then mixed the reused memory: values up to 6e18 and NaNs, a loud high-pitched burst. Per-port trace of the bad grains before the change: ``` [a2bad] t=39.256 port 1 type 0x100 ch 1 source 12 data 0x202dc70080 bad 16/512 peak-good 1.000 dataSets 217 ``` (source 12 = repeated buffer, snapshot at advance). Attribute sets per second on port 4 around it: `37s:94 38s:91 39s:61 40s:94`. With the change there are no bad grains in the same scene, and the burst is gone by ear. ### Tested - Linux (Arch), PPSA02433: title screen, main menu, cutscene; no burst, no bad samples (`[a2bad]` trace: 0 lines vs 400 before). - New `TestAdvancedRegivenBufferPlaysSilenceWithoutANewSet` in `audio_out2_port_buffers` fails without the change and passes with it. - All 59 `audio_out*` tests pass. `tools/check_conventions.py --base upstream/main` passes. ### Checklist - [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: PPSA02433 #9065 - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-31 14:36:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T14:36:08Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The PR describes an audio defect in PPSA02433 but lists no title unblock and lacks the required unblocks title label and bring-up tracking.

What I ran

I checked the exact open PR head 11f217b14fbc293d8ce3e9b98b5c1cb4b924eb0e against base 73f4f7e06e4f210a8c6570e335fd654dc0a86134; no merged preview was used. I inspected the focused diff, read the hosted checks, and queried the repository for a matching bring-up discussion. I did not build or run tests locally.

Commands:

gh pr checks 13988 -R boykopovar/AnyPS5
gh api graphql -f query='query { repository(owner:"boykopovar", name:"AnyPS5") { discussion(number:9065) { title url } } }'

Results

Check Result
Hosted Windows Passed
Hosted conventions, library portability, intake, labels, report, eligibility Passed
Linux and specialized product jobs Skipped
Title-unblock checklist and label Missing; see blocking finding
Unedited hosted check output
windows\tpass\t2m53s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564110995
linux\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564111840
register-context\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564112012
relinker\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564111776
relinker-asan\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564112245
write-watch\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564111864
conventions\tpass\t17s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425175/job/124564074531
eligibility\tpass\t7s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564073435
intake\tpass\t5s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425159/job/124564074865
labels\tpass\t9s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425141/job/124564074735
library-portability\tpass\t1m48s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425068/job/124564072640
report\tpass\t37s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425052/job/124564072892

Findings

Blocking

The description reports a wrong audio result in PPSA02433, but its checklist says Unblocks: none (PPSA02433 audio burst) and the PR has no unblocks title label. The contribution rules require the title ID and its Game bring-up discussion on the checklist, the corresponding label, and keeping the discussion’s list of needed PRs current (CONTRIBUTING.md at the reviewed base). The matching discussion is Crash Bandicoot 4: It’s About Time (PPSA02433), #9065. Update the checklist to Unblocks: PPSA02433 #9065, add the unblocks title label, and list this PR in that discussion.

Non-blocking

None identified in this pass.

Not verified

I did not independently run the audio tests or the reported PPSA02433 scene, and the PR does not establish behavior on a physical PS5. The reported Linux tests and title observations are author-provided. Product CI jobs were skipped.

To get this to a good state

Update the title-unblock checklist, label, and discussion entry. I will recheck the updated PR and relevant checks after the change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5723321532 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13988#pullrequestreview-5723321532). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T14:36:08Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The PR describes an audio defect in PPSA02433 but lists no title unblock and lacks the required `unblocks title` label and bring-up tracking. ## What I ran I checked the exact open PR head `11f217b14fbc293d8ce3e9b98b5c1cb4b924eb0e` against base `73f4f7e06e4f210a8c6570e335fd654dc0a86134`; no merged preview was used. I inspected the focused diff, read the hosted checks, and queried the repository for a matching bring-up discussion. I did not build or run tests locally. Commands: ```sh gh pr checks 13988 -R boykopovar/AnyPS5 gh api graphql -f query='query { repository(owner:"boykopovar", name:"AnyPS5") { discussion(number:9065) { title url } } }' ``` ## Results | Check | Result | |---|---| | Hosted Windows | Passed | | Hosted conventions, library portability, intake, labels, report, eligibility | Passed | | Linux and specialized product jobs | Skipped | | Title-unblock checklist and label | Missing; see blocking finding | <details><summary>Unedited hosted check output</summary> ```text windows\tpass\t2m53s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564110995 linux\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564111840 register-context\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564112012 relinker\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564111776 relinker-asan\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564112245 write-watch\tskipping\t0\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564111864 conventions\tpass\t17s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425175/job/124564074531 eligibility\tpass\t7s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425142/job/124564073435 intake\tpass\t5s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425159/job/124564074865 labels\tpass\t9s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425141/job/124564074735 library-portability\tpass\t1m48s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425068/job/124564072640 report\tpass\t37s\thttps://github.com/boykopovar/AnyPS5/actions/runs/41210425052/job/124564072892 ``` </details> ## Findings ### Blocking The description reports a wrong audio result in PPSA02433, but its checklist says `Unblocks: none (PPSA02433 audio burst)` and the PR has no `unblocks title` label. The contribution rules require the title ID and its Game bring-up discussion on the checklist, the corresponding label, and keeping the discussion’s list of needed PRs current ([CONTRIBUTING.md at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/73f4f7e06e4f210a8c6570e335fd654dc0a86134/CONTRIBUTING.md#L64-L66)). The matching discussion is [Crash Bandicoot 4: It’s About Time (PPSA02433), #9065](https://github.com/boykopovar/AnyPS5/discussions/9065). Update the checklist to `Unblocks: PPSA02433 #9065`, add the `unblocks title` label, and list this PR in that discussion. ### Non-blocking None identified in this pass. ## Not verified I did not independently run the audio tests or the reported PPSA02433 scene, and the PR does not establish behavior on a physical PS5. The reported Linux tests and title observations are author-provided. Product CI jobs were skipped. ## To get this to a good state Update the title-unblock checklist, label, and discussion entry. I will recheck the updated PR and relevant checks after the change.
MarcZX10 commented 2026-10-31 15:04:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T15:04:45Z.

Review: APPROVED


Re-checked — looks good

The title-unblock checklist, label, and #9065 bring-up entry are now present for the already-reviewed head.

What I ran

Rechecked head 11f217b14fbc293d8ce3e9b98b5c1cb4b924eb0e against base 73f4f7e06e4f210a8c6570e335fd654dc0a86134; no code changed since the previous review. I verified the live PR checklist and label, the #9065 discussion entry, and current hosted checks.

Results

Check Result
Title-unblock checklist and unblocks title label Present.
#9065 bring-up discussion Lists #13988 alongside #13987 and #13998.
Windows CI Passed.
Conventions, eligibility, intake, labels, library portability, report Passed.
Linux and specialized product jobs Skipped.

Not verified

I did not independently run the AudioOut2 tests or PPSA02433; those results remain author-reported.

Sources

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5723453535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13988#pullrequestreview-5723453535). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T15:04:45Z. **Review:** APPROVED --- # Re-checked — looks good The title-unblock checklist, label, and #9065 bring-up entry are now present for the already-reviewed head. ## What I ran Rechecked head `11f217b14fbc293d8ce3e9b98b5c1cb4b924eb0e` against base `73f4f7e06e4f210a8c6570e335fd654dc0a86134`; no code changed since the previous review. I verified the live PR checklist and label, the #9065 discussion entry, and current hosted checks. ## Results | Check | Result | |---|---| | Title-unblock checklist and `unblocks title` label | Present. | | #9065 bring-up discussion | Lists #13988 alongside #13987 and #13998. | | Windows CI | Passed. | | Conventions, eligibility, intake, labels, library portability, report | Passed. | | Linux and specialized product jobs | Skipped. | ## Not verified I did not independently run the AudioOut2 tests or PPSA02433; those results remain author-reported. ## Sources - [Crash Bandicoot 4 bring-up discussion #9065](https://github.com/boykopovar/AnyPS5/discussions/9065).
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!13988
No description provided.