fix(libSceAvPlayer): report the PS5 audio stream type for players made by sceAvPlayerInit #13987

Merged
alfalfa-star merged 2 commits from upstream-pr/13987 into main 2026-10-31 23:16:35 +00:00
alfalfa-star commented 2026-10-31 14:30:17 +00:00 (Migrated from github.com)

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


What

sceAvPlayerInit players reported audio streams as type 0; only sceAvPlayerInitEx players with the 0x230-byte PS5 layout reported type 2. The stream type is a property of the library, not of the init entry point, so every player now reports audio as type 2 (GetStreamInfo, GetStreamInfoEx and auto-start selection).

Crash Bandicoot 4 (PPSA02433) plays its logo movies (Activision, Toys for Bob, Unreal) with sceAvPlayerInit. Its READY callback (app.elf 0x1509d50) enables a stream of type 2 as audio and type 1 as video and ignores anything else:

cmp $0x2,%eax ; je enable
cmp $0x1,%eax ; jne skip ; enable + store width/height

So the logos' AAC track was never enabled and they played silent, while the opening cutscene (opened with sceAvPlayerInitEx, size 0x230) had sound. API trace before the change:

[avapi] Init ... auto_start 0 cb 0x1509d50 bufs 6
[avapi] AddSource ... BumperAtviNextGen.mp4 -> 0
[avapi] GetStreamInfo ... 0 -> 0 type 1
[avapi] EnableStream ... 0 -> 0
[avapi] GetStreamInfo ... 1 -> 0 type 0
[avapi] Start ... -> 0

After: EnableStream ... 1 -> 0 follows and the game gets 48 kHz stereo audio.

Tested

  • Linux (Arch), PPSA02433: the logo movies have sound (confirmed by ear); the cutscene audio is unchanged.
  • guest_avplayer, guest_avplayer_callback_close, guest_avplayer_paused_first_video pass; the three audio type checks of sceAvPlayerInit players now expect 2.
  • 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:5098449870 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13987). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-31T14:30:17Z. --- ### What `sceAvPlayerInit` players reported audio streams as type 0; only `sceAvPlayerInitEx` players with the 0x230-byte PS5 layout reported type 2. The stream type is a property of the library, not of the init entry point, so every player now reports audio as type 2 (`GetStreamInfo`, `GetStreamInfoEx` and auto-start selection). Crash Bandicoot 4 (PPSA02433) plays its logo movies (Activision, Toys for Bob, Unreal) with `sceAvPlayerInit`. Its READY callback (app.elf 0x1509d50) enables a stream of type 2 as audio and type 1 as video and ignores anything else: ``` cmp $0x2,%eax ; je enable cmp $0x1,%eax ; jne skip ; enable + store width/height ``` So the logos' AAC track was never enabled and they played silent, while the opening cutscene (opened with `sceAvPlayerInitEx`, size 0x230) had sound. API trace before the change: ``` [avapi] Init ... auto_start 0 cb 0x1509d50 bufs 6 [avapi] AddSource ... BumperAtviNextGen.mp4 -> 0 [avapi] GetStreamInfo ... 0 -> 0 type 1 [avapi] EnableStream ... 0 -> 0 [avapi] GetStreamInfo ... 1 -> 0 type 0 [avapi] Start ... -> 0 ``` After: `EnableStream ... 1 -> 0` follows and the game gets 48 kHz stereo audio. ### Tested - Linux (Arch), PPSA02433: the logo movies have sound (confirmed by ear); the cutscene audio is unchanged. - `guest_avplayer`, `guest_avplayer_callback_close`, `guest_avplayer_paused_first_video` pass; the three audio type checks of `sceAvPlayerInit` players now expect 2. - `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:55 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Reviewed — changes requested

The PR reports a wrong audio result in PPSA02433 but omits its required title-unblock tracking.

What I ran

I inspected the focused diff and current PR metadata at head 290345261e615c828aac59e5748d4425b8ff9759, based on 73f4f7e06e4f210a8c6570e335fd654dc0a86134; no merged preview was used. I queried GitHub Actions and confirmed the matching bring-up discussion exists. I did not run a local build or tests.

Commands:

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

Results

Check Result
Hosted conventions, eligibility, intake, labels, library portability, report Passed
Hosted Windows Pending
Linux and specialized product jobs Skipped
Title-unblock checklist and label Missing; see blocking finding
Unedited hosted check output
windows	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564088609
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564089683
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564090136
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564089690
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564090666
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564089748
conventions	pass	18s	https://github.com/boykopovar/AnyPS5/actions/runs/41210421785/job/124564064477
eligibility	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564063366
intake	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/41210421726/job/124564064806
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/41210421796/job/124564065278
library-portability	pass	1m45s	https://github.com/boykopovar/AnyPS5/actions/runs/41210421610/job/124564063222
report	pass	37s	https://github.com/boykopovar/AnyPS5/actions/runs/41210421612/job/124564063469

Findings

Blocking

The PR says PPSA02433’s logo movies were silent because the title ignored audio streams reported as type 0, and that the change restores their sound. For a title-specific wrong result, repository rules require the title ID and Game bring-up discussion on the checklist, the unblocks title label, and an up-to-date discussion entry (CONTRIBUTING.md at the reviewed base). The matching discussion is Crash Bandicoot 4: It’s About Time (PPSA02433), #9065. Replace Unblocks: none (PPSA02433 logo audio) with 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 reported Linux title scene or test the behavior on a physical PS5. The Windows job remains pending; product CI jobs were skipped. The Linux observations and focused CTest results are author-reported.

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:5723326165 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13987#pullrequestreview-5723326165). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T14:36:55Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The PR reports a wrong audio result in PPSA02433 but omits its required title-unblock tracking. ## What I ran I inspected the focused diff and current PR metadata at head `290345261e615c828aac59e5748d4425b8ff9759`, based on `73f4f7e06e4f210a8c6570e335fd654dc0a86134`; no merged preview was used. I queried GitHub Actions and confirmed the matching bring-up discussion exists. I did not run a local build or tests. Commands: ```sh gh pr diff 13987 -R boykopovar/AnyPS5 gh pr checks 13987 -R boykopovar/AnyPS5 gh api graphql -f query='query { repository(owner:"boykopovar", name:"AnyPS5") { discussion(number:9065) { title url } } }' ``` ## Results | Check | Result | |---|---| | Hosted conventions, eligibility, intake, labels, library portability, report | Passed | | Hosted Windows | Pending | | Linux and specialized product jobs | Skipped | | Title-unblock checklist and label | Missing; see blocking finding | <details><summary>Unedited hosted check output</summary> ```text windows pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564088609 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564089683 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564090136 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564089690 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564090666 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564089748 conventions pass 18s https://github.com/boykopovar/AnyPS5/actions/runs/41210421785/job/124564064477 eligibility pass 5s https://github.com/boykopovar/AnyPS5/actions/runs/41210421561/job/124564063366 intake pass 4s https://github.com/boykopovar/AnyPS5/actions/runs/41210421726/job/124564064806 labels pass 7s https://github.com/boykopovar/AnyPS5/actions/runs/41210421796/job/124564065278 library-portability pass 1m45s https://github.com/boykopovar/AnyPS5/actions/runs/41210421610/job/124564063222 report pass 37s https://github.com/boykopovar/AnyPS5/actions/runs/41210421612/job/124564063469 ``` </details> ## Findings ### Blocking The PR says PPSA02433’s logo movies were silent because the title ignored audio streams reported as type 0, and that the change restores their sound. For a title-specific wrong result, repository rules require the title ID and Game bring-up discussion on the checklist, the `unblocks title` label, and an up-to-date discussion entry ([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). Replace `Unblocks: none (PPSA02433 logo audio)` with `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 reported Linux title scene or test the behavior on a physical PS5. The Windows job remains pending; product CI jobs were skipped. The Linux observations and focused CTest results are author-reported. ## 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:11:53 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-checked — new head, looks good

At head b81fe33ff6714eefeb2b6eb13c091a7380ee5e73 against base 73f4f7e06e4f210a8c6570e335fd654dc0a86134, the required title tracking is present and the new debt entry records both the title evidence and the remaining uncertainty about other layouts and SDK versions (debt entry). The Windows job passed; the PPSA02433 Linux playback and focused test results are author-reported. I did not build or test locally; Linux and specialized product CI jobs were skipped, and no physical-console measurement is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5723484115 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13987#pullrequestreview-5723484115). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T15:11:53Z. **Review:** APPROVED --- # Re-checked — new head, looks good At head `b81fe33ff6714eefeb2b6eb13c091a7380ee5e73` against base `73f4f7e06e4f210a8c6570e335fd654dc0a86134`, the required title tracking is present and the new debt entry records both the title evidence and the remaining uncertainty about other layouts and SDK versions ([debt entry](https://github.com/boykopovar/AnyPS5/blob/b81fe33ff6714eefeb2b6eb13c091a7380ee5e73/docs/dev/debt/libSceAvPlayer.md#L21)). The Windows job passed; the PPSA02433 Linux playback and focused test results are author-reported. I did not build or test locally; Linux and specialized product CI jobs were skipped, and no physical-console measurement 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!13987
No description provided.