fix(libSceAvPlayer): report PS4 stream types in a PS4 process #22033

Merged
B-Howell merged 2 commits from upstream-pr/22033 into main 2026-11-17 06:16:12 +00:00
B-Howell commented 2026-11-17 02:30:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-17T02:30:32Z.


What

sceAvPlayerGetStreamInfo and sceAvPlayerGetStreamInfoEx reported the PS5 stream types (video 1, audio 2) in every process. A PS4 title's libSceAvPlayer numbers video 0 and audio 1 (the enum shadPS4 uses at 143b58aa48 avplayer.h: Video, Audio, TimedText, Unknown).

A player now picks its numbering once from sceKernelIsPs4Process (CUSA title ID): a PS4 process gets video 0 / audio 1, a PS5 process keeps video 1 / audio 2. Auto start compares against the same numbering, so it still enables both streams. The query keeps the guest errno unchanged, which guest_avplayer checks. libSceAvPlayer (and .native) now link libkernel_sys, as libSceAudio3d already does, and avplayer_http_patched_modules stages and patches it with the other modules. The debt entry for the two exports is changed by a fragment.

Bloodborne CUSA00900 1.09 needs this. When New Game reaches the intro movie, the title calls sceAvPlayerInit, PostInit, AddSource and SetLooping, then creates Mv_AudioPlayThread. On READY its handler (eboot 0x2cff6a0) calls sceAvPlayerStreamCount and sceAvPlayerGetStreamInfo for each stream, treating type 0 as video and type 1 as audio. The trace of the failing run on main (--trace-imports, APS5_TRACE_CALLS=libSceAvPlayer, all on the main thread):

#1  aS66RI0gGgo  sceAvPlayerInit          from 0x2cfdf38
#2  HD1YKVU26-M  sceAvPlayerPostInit      from 0x2cfdff1
#3  KMcEa+rHsIo  sceAvPlayerAddSource     from 0x2cfe164
#4  OVths0xGfho  sceAvPlayerSetLooping    from 0x2cfe1ac
#5  hdTyRzCXQeQ  sceAvPlayerStreamCount   from 0x2cff6e4
#6-#14 d8FcbzfAdQw sceAvPlayerGetStreamInfo x9 from 0x2cff800
#15 NkJwDzKmIlw  sceAvPlayerClose         from 0x2cfe5d8

The handler found no type 0 video and no type 1 audio, so it never called EnableStream or Start and the title closed the movie at once. The close deletes the movie's thread object. Its destructor destroys the object's gate mutex, which the new thread's entry (0x2a3b1e0) has not locked yet. The thread then fails the title's own check and the game crashes every time:

[Dantelion2 Panic] ...\Kernel\Source\ps4\DLLightMutex.cpp(126) Mutex is not initialized.
FATAL: unhandled exception 0xc0000005 on thread 'Mv_AudioPlayThread' rip bloodborne.exe+0x20c56d2 write of 0

With this change the intro movie plays to its end, with its subtitles, and the title moves on to character creation.

Tested

Windows 11, WinLibs GCC 15.2.0, Release.

  • New guest_avplayer_ps4_process (guest_avplayer_tests --ps4-process, run in its own working directory with a CUSA param.sfo): video type 0 and audio type 1 from both exports, and auto start still produces video and English audio. It fails on main with a PS4 process reports video as type 0 and audio as type 1, and passes with this change.
  • ctest -R avplayer: guest_avplayer, guest_avplayer_callback_close, guest_avplayer_paused_first_video, guest_avplayer_ps4_process, guest_avplayer_http, avplayer_http_patched_modules, guest_avplayer_native and guest_avplayer_native_printf all pass (8/8). The PS5 numbering checks in guest_avplayer are unchanged. avplayer_http_patched_modules failed with loading patched AvPlayer failed until the second commit staged libkernel_sys beside the patched modules; it passes now. (avplayer_http_transport was not built; it does not link the library.)
  • Bloodborne CUSA00900 1.09 (own copy), scripted pad input to New Game, Brightness, then Controls Next. On main it crashed in Mv_AudioPlayThread in 3 of 3 runs. With this change, in 2 of 2 runs, the intro movie played for about 40 s with its subtitles and the title then loaded character creation. The next stop is the unrelated AGC graphics: PS4 color target fast clear (CMASK) is not implemented. The movie's video frames show as horizontal stripes, a separate issue not touched here.

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: CUSA00900 Bloodborne
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5349337703 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22033). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-17T02:30:32Z. --- ### What `sceAvPlayerGetStreamInfo` and `sceAvPlayerGetStreamInfoEx` reported the PS5 stream types (video 1, audio 2) in every process. A PS4 title's libSceAvPlayer numbers video 0 and audio 1 (the enum shadPS4 uses at [`143b58aa48` avplayer.h](https://github.com/shadps4-emu/shadPS4/blob/143b58aa48/src/core/libraries/avplayer/avplayer.h): `Video, Audio, TimedText, Unknown`). A player now picks its numbering once from `sceKernelIsPs4Process` (CUSA title ID): a PS4 process gets video 0 / audio 1, a PS5 process keeps video 1 / audio 2. Auto start compares against the same numbering, so it still enables both streams. The query keeps the guest `errno` unchanged, which `guest_avplayer` checks. `libSceAvPlayer` (and `.native`) now link `libkernel_sys`, as `libSceAudio3d` already does, and `avplayer_http_patched_modules` stages and patches it with the other modules. The debt entry for the two exports is changed by a fragment. Bloodborne CUSA00900 1.09 needs this. When New Game reaches the intro movie, the title calls `sceAvPlayerInit`, `PostInit`, `AddSource` and `SetLooping`, then creates `Mv_AudioPlayThread`. On READY its handler (eboot `0x2cff6a0`) calls `sceAvPlayerStreamCount` and `sceAvPlayerGetStreamInfo` for each stream, treating type 0 as video and type 1 as audio. The trace of the failing run on `main` (`--trace-imports`, `APS5_TRACE_CALLS=libSceAvPlayer`, all on the main thread): ``` #1 aS66RI0gGgo sceAvPlayerInit from 0x2cfdf38 #2 HD1YKVU26-M sceAvPlayerPostInit from 0x2cfdff1 #3 KMcEa+rHsIo sceAvPlayerAddSource from 0x2cfe164 #4 OVths0xGfho sceAvPlayerSetLooping from 0x2cfe1ac #5 hdTyRzCXQeQ sceAvPlayerStreamCount from 0x2cff6e4 #6-#14 d8FcbzfAdQw sceAvPlayerGetStreamInfo x9 from 0x2cff800 #15 NkJwDzKmIlw sceAvPlayerClose from 0x2cfe5d8 ``` The handler found no type 0 video and no type 1 audio, so it never called `EnableStream` or `Start` and the title closed the movie at once. The close deletes the movie's thread object. Its destructor destroys the object's gate mutex, which the new thread's entry (`0x2a3b1e0`) has not locked yet. The thread then fails the title's own check and the game crashes every time: ``` [Dantelion2 Panic] ...\Kernel\Source\ps4\DLLightMutex.cpp(126) Mutex is not initialized. FATAL: unhandled exception 0xc0000005 on thread 'Mv_AudioPlayThread' rip bloodborne.exe+0x20c56d2 write of 0 ``` With this change the intro movie plays to its end, with its subtitles, and the title moves on to character creation. ### 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. --> Windows 11, WinLibs GCC 15.2.0, Release. - New `guest_avplayer_ps4_process` (`guest_avplayer_tests --ps4-process`, run in its own working directory with a CUSA `param.sfo`): video type 0 and audio type 1 from both exports, and auto start still produces video and English audio. It fails on `main` with `a PS4 process reports video as type 0 and audio as type 1`, and passes with this change. - `ctest -R avplayer`: `guest_avplayer`, `guest_avplayer_callback_close`, `guest_avplayer_paused_first_video`, `guest_avplayer_ps4_process`, `guest_avplayer_http`, `avplayer_http_patched_modules`, `guest_avplayer_native` and `guest_avplayer_native_printf` all pass (8/8). The PS5 numbering checks in `guest_avplayer` are unchanged. `avplayer_http_patched_modules` failed with `loading patched AvPlayer failed` until the second commit staged `libkernel_sys` beside the patched modules; it passes now. (`avplayer_http_transport` was not built; it does not link the library.) - Bloodborne CUSA00900 1.09 (own copy), scripted pad input to New Game, Brightness, then Controls Next. On `main` it crashed in `Mv_AudioPlayThread` in 3 of 3 runs. With this change, in 2 of 2 runs, the intro movie played for about 40 s with its subtitles and the title then loaded character creation. The next stop is the unrelated `AGC graphics: PS4 color target fast clear (CMASK) is not implemented`. The movie's video frames show as horizontal stripes, a separate issue not touched here. ### 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 - [x] Fixes: none - [x] Unblocks: CUSA00900 Bloodborne - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-17 02:35:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T02:35:27Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 289416ef56:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_avplayer_tests built cleanly.
  • CTest (guest_avplayer, guest_avplayer_callback_close, guest_avplayer_paused_first_video, guest_avplayer_ps4_process):
    1/4 Test #3400: guest_avplayer_paused_first_video ...   Passed    0.02 sec
    2/4 Test #3401: guest_avplayer_ps4_process ..........   Passed    0.02 sec
    3/4 Test #3398: guest_avplayer ......................   Passed    7.18 sec
    4/4 Test #3399: guest_avplayer_callback_close .......   Passed    0.12 sec
    100% tests passed, 0 tests failed out of 4
    
  • Negative control: with core/libs/prx/libSceAvPlayer/include/AvPlayer.hpp, core/libs/prx/libSceAvPlayer/src/Player.cpp reverted to main and the new tests kept, the suite fails:
    1/4 Test #3400: guest_avplayer_paused_first_video ...   Passed    0.02 sec
    2/4 Test #3401: guest_avplayer_ps4_process ..........***Failed    0.06 sec
    3/4 Test #3398: guest_avplayer ......................   Passed    7.12 sec
    4/4 Test #3399: guest_avplayer_callback_close .......   Passed    0.14 sec
    75% tests passed, 1 tests failed out of 4
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified Player::guestStreamType correctly maps internal StreamTypeVideo (1) and StreamTypeAudio (0) to Ps4StreamTypeVideo (0)/Ps4StreamTypeAudio (1) for PS4 processes and Ps5StreamTypeVideo (1)/Ps5StreamTypeAudio (2) for PS5 processes.
    • Verified Player::autoStart compares query stream types against guestStreamType(StreamTypeVideo) and guestStreamType(StreamTypeAudio), correctly selecting video and audio indices in both PS4 and PS5 environments.
    • Verified sceAvPlayerGetStreamInfo and sceAvPlayerGetStreamInfoEx transform info.type via guestStreamType while preserving struct fields such as this_size.
    • Verified IsPs4Process safely saves and restores guest errno around the sceKernelIsPs4Process invocation.
    • Verified GuestAvPlayer.cpp tests write a valid PS4 param.sfo with CUSA00000 in a dedicated working directory and exercise both manual stream info queries and auto-start video/audio decoding.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5931810041 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22033#pullrequestreview-5931810041). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-17T02:35:27Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `289416ef56`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_avplayer_tests` built cleanly. - **CTest** (`guest_avplayer`, `guest_avplayer_callback_close`, `guest_avplayer_paused_first_video`, `guest_avplayer_ps4_process`): ``` 1/4 Test #3400: guest_avplayer_paused_first_video ... Passed 0.02 sec 2/4 Test #3401: guest_avplayer_ps4_process .......... Passed 0.02 sec 3/4 Test #3398: guest_avplayer ...................... Passed 7.18 sec 4/4 Test #3399: guest_avplayer_callback_close ....... Passed 0.12 sec 100% tests passed, 0 tests failed out of 4 ``` - **Negative control**: with `core/libs/prx/libSceAvPlayer/include/AvPlayer.hpp`, `core/libs/prx/libSceAvPlayer/src/Player.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/4 Test #3400: guest_avplayer_paused_first_video ... Passed 0.02 sec 2/4 Test #3401: guest_avplayer_ps4_process ..........***Failed 0.06 sec 3/4 Test #3398: guest_avplayer ...................... Passed 7.12 sec 4/4 Test #3399: guest_avplayer_callback_close ....... Passed 0.14 sec 75% tests passed, 1 tests failed out of 4 ``` Restoring the change makes it pass again. - **Code reading**: - Verified Player::guestStreamType correctly maps internal StreamTypeVideo (1) and StreamTypeAudio (0) to Ps4StreamTypeVideo (0)/Ps4StreamTypeAudio (1) for PS4 processes and Ps5StreamTypeVideo (1)/Ps5StreamTypeAudio (2) for PS5 processes. - Verified Player::autoStart compares query stream types against guestStreamType(StreamTypeVideo) and guestStreamType(StreamTypeAudio), correctly selecting video and audio indices in both PS4 and PS5 environments. - Verified sceAvPlayerGetStreamInfo and sceAvPlayerGetStreamInfoEx transform info.type via guestStreamType while preserving struct fields such as this_size. - Verified IsPs4Process safely saves and restores guest errno around the sceKernelIsPs4Process invocation. - Verified GuestAvPlayer.cpp tests write a valid PS4 param.sfo with CUSA00000 in a dedicated working directory and exercise both manual stream info queries and auto-start video/audio decoding. Looks Good To Me
PrivacyOnion commented 2026-11-17 02:39:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T02:39:30Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 326789bd61:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_avplayer_tests built cleanly.
  • CTest (guest_avplayer, guest_avplayer_callback_close, guest_avplayer_paused_first_video, guest_avplayer_ps4_process):
    1/4 Test #3401: guest_avplayer_ps4_process ..........   Passed    0.03 sec
    2/4 Test #3400: guest_avplayer_paused_first_video ...   Passed    0.02 sec
    3/4 Test #3398: guest_avplayer ......................   Passed    7.21 sec
    4/4 Test #3399: guest_avplayer_callback_close .......   Passed    0.13 sec
    100% tests passed, 0 tests failed out of 4
    
  • Negative control: with core/libs/prx/libSceAvPlayer/include/AvPlayer.hpp, core/libs/prx/libSceAvPlayer/src/Player.cpp reverted to main and the new tests kept, the suite fails:
    1/4 Test #3401: guest_avplayer_ps4_process ..........***Failed    0.03 sec
    2/4 Test #3400: guest_avplayer_paused_first_video ...   Passed    0.02 sec
    3/4 Test #3398: guest_avplayer ......................   Passed    7.11 sec
    4/4 Test #3399: guest_avplayer_callback_close .......   Passed    0.12 sec
    75% tests passed, 1 tests failed out of 4
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that Player::guestStreamType correctly maps internal StreamTypeVideo (1) and StreamTypeAudio (0) to Ps4StreamTypeVideo (0)/Ps4StreamTypeAudio (1) for PS4 processes and Ps5StreamTypeVideo (1)/Ps5StreamTypeAudio (2) for PS5 processes
    • Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that Player::autoStart compares against guestStreamType(StreamTypeVideo) and guestStreamType(StreamTypeAudio), correctly selecting both video and audio streams regardless of process type
    • Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that sceAvPlayerGetStreamInfo and sceAvPlayerGetStreamInfoEx transform stream type via guestStreamType while preserving struct fields such as this_size under proper mutex locks
    • Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that IsPs4Process safely captures and restores errno across sceKernelIsPs4Process()
    • Verified build and test configurations in AvPlayerLibrary.cmake, CMakeLists.txt, and AvPlayerHttpModules.cmake link and stage libkernel_sys properly for all platforms
    • Verified AGENTS.md compliance: no unauthorized comments, debt fragment added under docs/dev/debt/changes/, and comprehensive tests added in GuestAvPlayer.cpp

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5931844944 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22033#pullrequestreview-5931844944). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-17T02:39:30Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `326789bd61`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_avplayer_tests` built cleanly. - **CTest** (`guest_avplayer`, `guest_avplayer_callback_close`, `guest_avplayer_paused_first_video`, `guest_avplayer_ps4_process`): ``` 1/4 Test #3401: guest_avplayer_ps4_process .......... Passed 0.03 sec 2/4 Test #3400: guest_avplayer_paused_first_video ... Passed 0.02 sec 3/4 Test #3398: guest_avplayer ...................... Passed 7.21 sec 4/4 Test #3399: guest_avplayer_callback_close ....... Passed 0.13 sec 100% tests passed, 0 tests failed out of 4 ``` - **Negative control**: with `core/libs/prx/libSceAvPlayer/include/AvPlayer.hpp`, `core/libs/prx/libSceAvPlayer/src/Player.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/4 Test #3401: guest_avplayer_ps4_process ..........***Failed 0.03 sec 2/4 Test #3400: guest_avplayer_paused_first_video ... Passed 0.02 sec 3/4 Test #3398: guest_avplayer ...................... Passed 7.11 sec 4/4 Test #3399: guest_avplayer_callback_close ....... Passed 0.12 sec 75% tests passed, 1 tests failed out of 4 ``` Restoring the change makes it pass again. - **Code reading**: - Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that Player::guestStreamType correctly maps internal StreamTypeVideo (1) and StreamTypeAudio (0) to Ps4StreamTypeVideo (0)/Ps4StreamTypeAudio (1) for PS4 processes and Ps5StreamTypeVideo (1)/Ps5StreamTypeAudio (2) for PS5 processes - Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that Player::autoStart compares against guestStreamType(StreamTypeVideo) and guestStreamType(StreamTypeAudio), correctly selecting both video and audio streams regardless of process type - Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that sceAvPlayerGetStreamInfo and sceAvPlayerGetStreamInfoEx transform stream type via guestStreamType while preserving struct fields such as this_size under proper mutex locks - Verified in core/libs/prx/libSceAvPlayer/src/Player.cpp that IsPs4Process safely captures and restores errno across sceKernelIsPs4Process() - Verified build and test configurations in AvPlayerLibrary.cmake, CMakeLists.txt, and AvPlayerHttpModules.cmake link and stage libkernel_sys properly for all platforms - Verified AGENTS.md compliance: no unauthorized comments, debt fragment added under docs/dev/debt/changes/, and comprehensive tests added in GuestAvPlayer.cpp Looks Good To Me
MarcZX10 commented 2026-11-17 05:11:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T05:11:29Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head 326789bd610b76024824cd79d90d59aaf40405f6, base main. Merged-preview check not run.
  • Read-only review: the run folder (description, commits, manifest, diff, files list), the house-rules sections, and repository files at the head through the reader (repo_read.py).
  • Commands, as run through the reader:
repo_read.py cat core/libs/prx/libSceAvPlayer/src/Player.cpp 170 215
repo_read.py search StreamType core/libs/prx/libSceAvPlayer
repo_read.py search sceKernelIsPs4Process core
repo_read.py search VideoStream core/libs/tests/GuestAvPlayer.cpp
repo_read.py search "## change" docs/dev/debt
repo_read.py search libkernel_sys core/libs/prx/libSceAudio3d
repo_read.py cat core/libs/prx/libkernel_sys/Export.cpp 518 530
  • I did not build or run any test.

Results

Check Result Note
Diff of the 7 reviewed files passed Read as hunks; none excluded
Full text of the changed files not run Only hunks and head ranges read
Build and ctest -R avplayer not run Author-reported only
New guest_avplayer_ps4_process not run Author reports it fails on main, passes here
Bloodborne CUSA00900 run not run Author-reported only

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAvPlayer/src/Player.cpp:274: guestStreamType maps every type other than video to the audio number. StreamTypeTimedText (2) is therefore reported as audio (1) in a PS4 process, where the old code left it at 2. The source only emits video and audio (core/libs/prx/libSceAvPlayer/src/Source.cpp:619), so no current stream is affected. Smallest fix: map audio explicitly and return other types unchanged.
std::uint32_t Player::guestStreamType(std::uint32_t type) const {
    if (type == StreamTypeVideo) return ps4Process ? Ps4StreamTypeVideo : Ps5StreamTypeVideo;
    if (type == StreamTypeAudio) return ps4Process ? Ps4StreamTypeAudio : Ps5StreamTypeAudio;
    return type;
}

Sources

Not verified

  • Build, ctest and the Bloodborne run are not checked here. The author reports Windows 11, WinLibs GCC 15.2.0, Release, and a PS4 process run of CUSA00900 1.09. The negative control (new test fails on main) is also author-reported.
  • GuestAvPlayer.cpp (2771 lines) and Player.cpp (454 lines) were not read end to end. Only the changed hunks and the autoStart and stream-info regions were read. Reading the rest of the test file is what keeps this from being a full review.
  • Where sceKernelIsPs4Process gets the process type (the param.sfo lookup) was not located at the head, so the test fixture's layout was not checked against it.
  • The PS4 numbering (video 0, audio 1) and PS5 numbering (video 1, audio 2) are taken from the debt fragment and the cited PS4 enum. Neither is confirmed on a console; the fragment says so.
  • Test helpers used by the new test (Events, InitData, WaitFor, CheckEnglishAudio, WriteMovie) were not checked beyond VideoStream.

To get this to a good state

Nothing is required.

The non-blocking item above is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933263985 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22033#pullrequestreview-5933263985). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T05:11:29Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head `326789bd610b76024824cd79d90d59aaf40405f6`, base `main`. Merged-preview check not run. - Read-only review: the run folder (description, commits, manifest, diff, files list), the house-rules sections, and repository files at the head through the reader (`repo_read.py`). - Commands, as run through the reader: ``` repo_read.py cat core/libs/prx/libSceAvPlayer/src/Player.cpp 170 215 repo_read.py search StreamType core/libs/prx/libSceAvPlayer repo_read.py search sceKernelIsPs4Process core repo_read.py search VideoStream core/libs/tests/GuestAvPlayer.cpp repo_read.py search "## change" docs/dev/debt repo_read.py search libkernel_sys core/libs/prx/libSceAudio3d repo_read.py cat core/libs/prx/libkernel_sys/Export.cpp 518 530 ``` - I did not build or run any test. ## Results | Check | Result | Note | |---|---|---| | Diff of the 7 reviewed files | passed | Read as hunks; none excluded | | Full text of the changed files | not run | Only hunks and head ranges read | | Build and `ctest -R avplayer` | not run | Author-reported only | | New `guest_avplayer_ps4_process` | not run | Author reports it fails on `main`, passes here | | Bloodborne CUSA00900 run | not run | Author-reported only | ## Findings **Blocking** None. **Non-blocking** - `core/libs/prx/libSceAvPlayer/src/Player.cpp:274`: `guestStreamType` maps every type other than video to the audio number. `StreamTypeTimedText` (2) is therefore reported as audio (1) in a PS4 process, where the old code left it at 2. The source only emits video and audio (`core/libs/prx/libSceAvPlayer/src/Source.cpp:619`), so no current stream is affected. Smallest fix: map audio explicitly and return other types unchanged. ```suggestion std::uint32_t Player::guestStreamType(std::uint32_t type) const { if (type == StreamTypeVideo) return ps4Process ? Ps4StreamTypeVideo : Ps5StreamTypeVideo; if (type == StreamTypeAudio) return ps4Process ? Ps4StreamTypeAudio : Ps5StreamTypeAudio; return type; } ``` ## Sources - Source emits only video and audio stream types: https://github.com/boykopovar/AnyPS5/blob/326789bd610b76024824cd79d90d59aaf40405f6/core/libs/prx/libSceAvPlayer/src/Source.cpp#L619 ## Not verified - Build, `ctest` and the Bloodborne run are not checked here. The author reports Windows 11, WinLibs GCC 15.2.0, Release, and a PS4 process run of CUSA00900 1.09. The negative control (new test fails on `main`) is also author-reported. - `GuestAvPlayer.cpp` (2771 lines) and `Player.cpp` (454 lines) were not read end to end. Only the changed hunks and the autoStart and stream-info regions were read. Reading the rest of the test file is what keeps this from being a full review. - Where `sceKernelIsPs4Process` gets the process type (the `param.sfo` lookup) was not located at the head, so the test fixture's layout was not checked against it. - The PS4 numbering (video 0, audio 1) and PS5 numbering (video 1, audio 2) are taken from the debt fragment and the cited PS4 enum. Neither is confirmed on a console; the fragment says so. - Test helpers used by the new test (`Events`, `InitData`, `WaitFor`, `CheckEnglishAudio`, `WriteMovie`) were not checked beyond `VideoStream`. ## To get this to a good state Nothing is required. The non-blocking item above is optional.
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!22033
No description provided.