Astro Bot Intel CPU compatibility fixes #720

Open
github-bot wants to merge 2 commits from github-bot/gh-720 into main AGit
Owner

@⁠nomolao2-cell on GitHub · 2026-09-19 19:11 UTC · original
nomolao2-cell:intel-astrobot-only → main · +366 −15 · 6 files · 2 commits · open

Problem

Astro Bot uses AMD-specific instructions, including SSE4a and RDPRU. On Intel CPUs these instructions can raise an illegal-instruction fault, causing the emulator to crash after the Asobi logo.

The macOS x86_64 host also requires compatible register-context handling and host-memory validation.

Fix

  • Emulate the required AMD/SSE4a memory-store and timing instructions on Intel hosts.
  • Load and update general-purpose registers from the macOS x86_64 context.
  • Add macOS Mach VM range validation for host pointers.
  • Validate AudioOut2 guest-owned PCM, attribute, and context memory before access.
  • Initialize the AudioOut2 context arena safely.
  • Preserve guest red-zone safety during host exception handling.
  • Link host memory support into the AudioOut2 test target.

Scope

This is a host-compatibility change for Intel CPUs and macOS. It does not modify game files, guest binaries, rendering hacks, or game-specific assets.

Testing

  • Local Windows Release build
  • Local Windows tests
  • GitHub Actions Windows
  • GitHub Actions Linux
  • GitHub Actions macOS

AFTER

CRASH RIGHT AFTER ASOBI LOGO
Captura de pantalla 2026-09-19 125941

BEFORE

image Captura de pantalla 2026-09-19 122855

AI use disclosure

I used Codex to assist with investigating the Intel illegal-instruction crashes, reviewing the host exception paths, preparing the compatibility changes, and checking the build/test results. The final diff was reviewed before submission.

**@⁠nomolao2-cell** on GitHub · 2026-09-19 19:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720) `nomolao2-cell:intel-astrobot-only` → `main` · +366 −15 · 6 files · 2 commits · open ## Problem Astro Bot uses AMD-specific instructions, including SSE4a and RDPRU. On Intel CPUs these instructions can raise an illegal-instruction fault, causing the emulator to crash after the Asobi logo. The macOS x86_64 host also requires compatible register-context handling and host-memory validation. ## Fix - Emulate the required AMD/SSE4a memory-store and timing instructions on Intel hosts. - Load and update general-purpose registers from the macOS x86_64 context. - Add macOS Mach VM range validation for host pointers. - Validate AudioOut2 guest-owned PCM, attribute, and context memory before access. - Initialize the AudioOut2 context arena safely. - Preserve guest red-zone safety during host exception handling. - Link host memory support into the AudioOut2 test target. ## Scope This is a host-compatibility change for Intel CPUs and macOS. It does not modify game files, guest binaries, rendering hacks, or game-specific assets. ## Testing - [x] Local Windows Release build - [x] Local Windows tests - [ ] GitHub Actions Windows - [ ] GitHub Actions Linux - [ ] GitHub Actions macOS ## AFTER CRASH RIGHT AFTER ASOBI LOGO <img width="1267" height="766" alt="Captura de pantalla 2026-09-19 125941" src="https://github.com/user-attachments/assets/1ea8ac5a-6658-4188-98f0-743856a0832d" /> ## BEFORE <img width="1275" height="750" alt="image" src="https://github.com/user-attachments/assets/e48acfc7-1d0d-4375-955b-2ecc5a7349fc" /> <img width="1274" height="751" alt="Captura de pantalla 2026-09-19 122855" src="https://github.com/user-attachments/assets/d088835f-6761-4d52-9e96-b8a15b052233" /> ## AI use disclosure I used Codex to assist with investigating the Intel illegal-instruction crashes, reviewing the host exception paths, preparing the compatibility changes, and checking the build/test results. The final diff was reviewed before submission.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:30:43 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original · edited 2026-09-22 19:05 UTC

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7acd87c8-b716-450d-86ae-d3eba50ebe36

📥 Commits

Reviewing files that changed from the base of the PR and between 2a5f2c54eb and c84a4fbc3f.

📒 Files selected for processing (2)
  • CMakeLists.txt
  • src/libs/audio.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change adds macOS Mach memory-region querying and host-memory validation to audio output, context creation, and port attribute updates. Audio output holds port mutexes during validation and submission. The test target now compiles hostMemory.cpp. The loader adds AMD RDPRU and CLZERO emulation, SSE4a memory-store handling, platform register access, and red-zone coverage for instructions that may require emulation.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: 🟡 Moderate · up to c84a4

Several Intel and macOS compatibility paths can still crash, corrupt guest state, or produce stale audio behavior. These issues should be corrected before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: compatibility fixes for Astro Bot on Intel CPUs. It also covers the related host and macOS compatibility work at a suitable level.
Description check ✅ Passed The description directly explains the Intel CPU and macOS compatibility problems, the implemented fixes, scope, and testing status. It is related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 8.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 5 files. (1 skipped: 1 unsupported.)


Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#issuecomment-5744658275) · edited 2026-09-22 19:05 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/720"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> Navigate logical layers of code changes, visualize relationships, and explore their blast radius. <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `7acd87c8-b716-450d-86ae-d3eba50ebe36` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2a5f2c54eb94787e04ca29a5c38e3616011cfa1b and c84a4fbc3f45e0c7783daf55fa7caefc158e6605. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `CMakeLists.txt` * `src/libs/audio.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough The change adds macOS Mach memory-region querying and host-memory validation to audio output, context creation, and port attribute updates. Audio output holds port mutexes during validation and submission. The test target now compiles `hostMemory.cpp`. The loader adds AMD `RDPRU` and `CLZERO` emulation, SSE4a memory-store handling, platform register access, and red-zone coverage for instructions that may require emulation. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"c84a4fbc3f45e0c7783daf55fa7caefc158e6605" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _🟡 Moderate_ · up to `c84a4` <!-- final_review_risk_coverage:{"sourceCommitId":"c84a4fbc3f45e0c7783daf55fa7caefc158e6605","coveredCommitId":"c84a4fbc3f45e0c7783daf55fa7caefc158e6605","kind":"reviewed"} --> Several Intel and macOS compatibility paths can still crash, corrupt guest state, or produce stale audio behavior. These issues should be corrected before merging. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 8.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 5 files. (1 skipped: 1… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ✅ Passed | The title clearly identifies the main change: compatibility fixes for Astro Bot on Intel CPUs. It also covers the related host and macOS compatibility work at a suitable level. | | Description check | ✅ Passed | The description directly explains the Intel CPU and macOS compatibility problems, the implemented fixes, scope, and testing status. It is related to the changeset. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> <details> <summary>Full details: Docstring Coverage</summary> **Explanation** Docstring coverage is 8.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 5 files. (1 skipped: 1 unsupported.) </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -426,0 +435,4 @@
if (!Graphics::HostMemoryRangeIsReadable(reinterpret_cast<uint64_t>(buffer), init_size)) {
return AUDIO_OUT2_ERROR_INVALID_PARAM;
}
std::memset(buffer, 0, init_size);
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Validate write access before clearing the context buffer.

HostMemoryRangeIsReadable accepts a read-only mapped range. std::memset then writes to that range. A caller can therefore pass validation and cause a host access violation.

Add a writable-range query and use it before std::memset.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#discussion_r4054371687) _🩺 Stability & Availability_ | _🟠 Major_ | _🏗️ Heavy lift_ **Validate write access before clearing the context buffer.** `HostMemoryRangeIsReadable` accepts a read-only mapped range. `std::memset` then writes to that range. A caller can therefore pass validation and cause a host access violation. Add a writable-range query and use it before `std::memset`. <!-- fingerprinting:phantom:medusa:quokka --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:a9e87822a46f359983f2b6f7 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -671,1 +698,3 @@
attributes[i].value != nullptr && attributes[i].value_size >= sizeof(AudioOut2Pcm)) {
attributes[i].value != nullptr && attributes[i].value_size >= sizeof(AudioOut2Pcm) &&
Graphics::HostMemoryRangeIsReadable(reinterpret_cast<uint64_t>(attributes[i].value),
sizeof(AudioOut2Pcm))) {
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '650,715p' src/libs/libAudio2.cpp
rg -n 'AudioOut2PortSetAttributes|PORT_ATTRIBUTE_ID_PCM|value_size' src tests CMakeLists.txt

Repository: KytyPS5/KytyPS5

Length of output: 4947


🏁 Script executed:

set -eu
printf '%s\n' '--- public declaration ---'
cat -n src/libs/audio.h | sed -n '45,85p'
printf '%s\n' '--- implementation context ---'
cat -n src/libs/libAudio2.cpp | sed -n '35,85p;200,240p;650,725p'
printf '%s\n' '--- focused tests ---'
cat -n tests/AudioOut2PortTests.cpp | sed -n '1,180p'
printf '%s\n' '--- relevant callers ---'
rg -n -C 3 'AudioOut2PortSetAttributes|AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM|AsAttribute' --glob '!src/libs/libAudio2.cpp' --glob '!src/libs/audio.h' .

Repository: KytyPS5/KytyPS5

Length of output: 17897


🏁 Script executed:

set -eu
printf '%s\n' '--- AudioOut2 attribute references and documentation ---'
rg -n -i -C 3 'AudioOut2Attribute|PortSetAttributes|attribute.*PCM|PCM.*attribute|invalid.?param|unsupported attribute' . --glob '!build/**' --glob '!dist/**'
printf '%s\n' '--- remaining focused tests ---'
cat -n tests/AudioOut2PortTests.cpp | sed -n '180,420p'
printf '%s\n' '--- analogous attribute handlers ---'
rg -n -C 8 'SetAttributes|attribute_id|has_pcm|value_size' src/libs --glob '*.cpp' --glob '*.h'

Repository: KytyPS5/KytyPS5

Length of output: 50371


🌐 Web query:

sceAudioOut2PortSetAttributes AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM invalid parameter value_size

💡 Result:

This PS5 error usually means the SceAudioOut2Pcm attribute is being passed with the wrong size.

For AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM, verify:

SceAudioOut2Pcm pcm = {
    .data = buffer,
    .numSamples = 2048
};

SceAudioOut2Attribute attr = {
    .attributeId = AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM,
    .value = &pcm,
    .valueSize = sizeof(pcm)   // not hard-coded 8
};

On PS5, sizeof(SceAudioOut2Pcm) may be larger than 8 because data is a 64-bit pointer. Also ensure the SDK headers and binary/ABI match.

If this is FMOD with Unreal:

  • Do not run FMOD together with UE’s built-in audio path unless the required PS5 integration changes are applied.
  • Disable UE audio, or use a compatible newer FMOD integration; FMOD documented fixes for PS5 sceAudioOut2PortSetAttributes issues in later releases. [1][2]

The reported valueSize: 8 is the main red flag. [1]


🌐 Web query:

site:github.com "sceAudioOut2PortSetAttributes" OR "SceAudioOut2Pcm" "SceAudioOut2Attribute"

💡 Result:

<search_synthesis>
The symbols sceAudioOut2PortSetAttributes, SceAudioOut2Pcm, and SceAudioOut2Attribute are associated with the low-level audio output libraries found in Sony PlayStation console operating systems, specifically related to the PS5 (and potentially PS4) system software [1][2]. These functions and types are part of the libSceAudioOut library, which manages audio hardware ports and output streams [1][3]. Based on technical documentation and reverse-engineering projects available on GitHub: 1. sceAudioOut2PortSetAttributes: This is a function used to configure specific attributes for an audio output port [1][2]. Debug logs from emulator projects indicate that failures in this function (e.g., error code 0x80020002) are often encountered during the initialization or configuration phase of audio threads in game applications [2]. 2. SceAudioOut2Pcm and SceAudioOut2Attribute: These appear to be related data structures or type definitions used to define PCM audio formats and port attributes, respectively, within the libSceAudioOut framework [1]. These symbols are typically found in proprietary system libraries and are not part of public, official SDK documentation. They are primarily referenced in the context of homebrew development, emulator research, and reverse engineering of PlayStation system libraries [1][4][3][2]. Other related functions commonly seen in these libraries include sceAudioOutOpen, sceAudioOutOutput, and sceAudioOutGetPortState [4][3].
</search_synthesis>

<source_evidence>

GitHub issue 287 in sharpemu/sharpemu (link omitted to avoid creating a cross-reference) 0000010020 ... > [DEBUG][PRINF] sceAudioOut2PortSetAttributes failed - 80020002 ... > [DEBUG][PRINF] Error in audio thread: 80020002 github.com/liuk7071/ChonkyStation4@683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cpp # ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cpp - Branch: 683d258b - Repository: liuk7071/ChonkyStation4 --- `#include` "SceAudioOut.hpp" `#include` <Logger.hpp> `#include` `#include` <SDL.h> `#include` `#include` <unordered_map> namespace PS4::OS::Libs::SceAudioOut { MAKE_LOG_FUNCTION(log, lib_sceAudioOut); void init(Module& module) { module.addSymbolExport("JfEPXVxhFqA", "sceAudioOutInit", "libSceAudioOut", "libSceAudioOut", (void*)&sceAudioOutInit); module.addSymbolExport("ekNvsT22rsY", "sceAudioOutOpen", "libSceAudioOut", "libSceAudioOut", (void*)&sceAudioOutOpen); module.addSymbolExport("GrQ9s4IrNaQ", "sceAudioOutGetPortState", "libSceAudioOut", "libSceAudioOut", (void*)&sceAudioOutGetPortState); module.addSymbolExport("QOQtbeDqsT4", "sceAudioOutOutput", "libSceAudioOut", "libSceAudioOut", (void*)&sceAudioOutOutput); module.addSymbolExport("w3PdaSTSwGE", "sceAudioOutOutputs", "libSceAudioOut", "libSceAudioOut", (void*)&sceAudioOutOutputs); module.addSymbolStub("s1--uE9mBFw", "sceAudioOutClose", "libSceAudioOut", "libSceAudioOut"); module.addSymbolStub("b+uAV89IlxE", "sceAudioOutSetVolume", "libSceAudioOut", "libSceAudioOut"); module.addSymbolStub("wVwPU50pS1c", "sceAudioOutSetMixLevelPadSpk", "libSceAudioOut", "libSceAudioOut"); } SDL_AudioDeviceID dev; s32 PS4_FUNC sceAudioOutInit() { log("sceAudioOutInit()\n"); return SCE_OK; } static std::unordered_map<s32, std::pair<s32, s32>> sdl_format_map = { { 0, { AUDIO_S16, 1 }}, { 1, { AUDIO_S16, 2 }}, { 2, { AUDIO_S16, 8 }}, { 3, { AUDIO_F32, 1 }}, { 4, { AUDIO_F32, 2 }}, { 5, { AUDIO_F32, 8 }}, { 6, { AUDIO_S16, 8 }}, { 7, { AUDIO_F32, 8 }}, }; static bool is_opened = false; static s32 opened_handle = 0; s32 PS4_FUNC sceAudioOutOpen(Libs::SceUserService::SceUserServiceUserId uid, s32 type, s32 idx, u32 len, u32 freq, u32 param) { log("sceAudioOutOpen(uid=%d, type=%d, idx=%d, len=%d, freq=%d, param=0x%x)\n", uid, type, idx, len, freq, param); auto* port = PS4::OS::make (); port->device = (AudioVirtualDevice)type; port->len = len; port->freq = freq; port->format = param & 0xff; const auto handle = port->handle; log("Opened audio port %d: device=%s, len=%d, freq=%d, format=%d\n", handle, audioVirtualDeviceToStr(port->device).c_str(), port->len, port->freq, port->format); // Init SDL audio // I stubbed it to only work for the first opened port for now... if (!is_opened) { is_opened = true; opened_handle = handle; SDL_AudioSpec desired, obtained; SDL_zero(desired); Helpers::debugAssert(sdl_format_map.contains(port->format), "sceAudioOutOpen: invalid format %d\n", port->format); const auto [format, n_channels] = sdl_format_map[port->format]; port->sdl_format = format; port->n_channels = n_channels; desired.freq = 48000; desired.format = format; desired.channels = n_channels; desired.samples = len; desired.callback = NULL; dev = SDL_OpenAudioDevice(NULL, 0, &desired, &obtained, SDL_AUDIO_ALLOW_FORMAT_CHANGE); if (!dev) { Helpers::panic("Failed to open SDL audio device for playback\n"); } SDL_PauseAudioDevice(dev, 0); } return handle; } s32 PS4_FUNC sceAudioOutGetPortState(s32 handle, SceAudioOutPortState* state) { log("sceAudioOutGetPortState(handle=%d, state=*%p)\n", handle, state); auto* port = PS4::OS::find (handle); if (!port) { Helpers::panic("sceAudioOutGetPortState: could not find port with handle %d\n", handle); } state->output = 1; // Primary output state->channel = port->n_channels; state->volume = 127; // This is supposed to be set for PADSPK only stat…[truncated] github.com/liuk7071/ChonkyStation4@683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.hpp # ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.hpp - Branch: 683d258b - Repository: liuk7071/ChonkyStation4 --- `#pragma` once `#include` <Common.hpp> `#include` // For SceUserServiceUserId `#include` class Module; namespace PS4::OS::Libs::SceAudioOut { void init(Module& module); enum AudioVirtualDevice { Main, BGM, Voice, Personal, PadSpeaker, Aux = 127 }; inline std::string audioVirtualDeviceToStr(AudioVirtualDevice dev) { switch (dev) { case AudioVirtualDevice::Main: return "Main"; case AudioVirtualDevice::BGM: return "BGM"; case AudioVirtualDevice::Voice: return "Voice"; case AudioVirtualDevice::Personal: return "Personal"; case AudioVirtualDevice::PadSpeaker: return "PadSpeaker"; case AudioVirtualDevice::Aux: return "Aux"; } Helpers::panic("audioVirtualDeviceToStr: unreachable\n"); } struct SceAudioOutOutputParam { s32 handle; const void* ptr; }; struct SceAudioOutPortState { u16 output; u8 channel; u8 reserved1[1]; s16 volume; u16 reroute_counter; u64 flag; u64 reserved2[2]; }; struct SceAudioOutPort : SceObj { AudioVirtualDevice device; u32 len; u32 freq; u32 format; u32 n_channels; u32 sdl_format; }; s32 PS4_FUNC sceAudioOutInit(); s32 PS4_FUNC sceAudioOutOpen(Libs::SceUserService::SceUserServiceUserId uid, s32 type, s32 idx, u32 len, u32 freq, u32 param); s32 PS4_FUNC sceAudioOutGetPortState(s32 handle, SceAudioOutPortState* state); s32 PS4_FUNC sceAudioOutOutput(s32 handle, const void* ptr); s32 PS4_FUNC sceAudioOutOutputs(SceAudioOutOutputParam* param, u32 num); } // End namespace PS4::OS::Libs::SceAudioOut github.com/ps3dev/PSL1GHT@b1b5597c/ppu/include/audio/audio.h # ppu/include/audio/audio.h - Branch: b1b5597c - Repository: ps3dev/PSL1GHT --- /*! \file audio.h \brief Audio library. This library manages communications of the application with the system audio server. It basically allows the application to play raw PCM audio by filling a circular buffer. To play audio, follow these steps: - Initialize the audio system for the application (\ref audioInit). - Open an audio port with \ref audioPortOpen, which returns a unique port number. - Allocate a \ref audioPortConfig object with \ref audioGetPortConfig. - Create a notify event queue (\ref audioCreateNotifyEventQueue). - Set the created event queue as the current event queue (\ref audioSetNotifyEventQueue). - Eventually drain the existing events in the queue (\ref sysEventQueueDrain). - Start the audio port (\ref audioPortStart). - As soon as you receive an event from the notify event queue (\ref sysEventQueueReceive), you can write the next block into the buffer. The first block number is 0, the following is 1, and so on until you reach the number of allocated blocks (specified in the audioPortParam::numBlocks value you provide when you call \ref audioPortOpen), then the block number returns to 0. The address of block 0 is the \ref audioPortConfig::audioDataStart "audioDataStart" field of the \ref audioPortConfig structure. Then the address of block \c x is audioDataStart + x * numChannels * AUDIO_BLOCK_SAMPLES * sizeof(float). The size of each block in bytes is numChannels * AUDIO_BLOCK_SAMPLES * sizeof(float). To stop playing audio, the steps are: - Stop the audio port (\ref audioPortStop). - Unset the current event queue (\ref audioRemoveNotifyEventQueue). - Close the audio port (\ref audioPortClose). - Destroy the event queue (\ref sysEventQueueDestroy). - Quit the audio system (\ref audioQuit). The PCM audio sample format is 32-bit floating point where sample values vary from -1 to 1. Samples are interlaced: for instance in stereo mode, even sample positions correspond to the left channel, and odd ones correspond to the right channel. */ `#ifndef` __LV2_AUDIO_H__ `#define` __LV2_AUDIO_H__ `#include` /*! \brief Number of samples in an audio block. */ `#define` AUDIO_BLOCK_SAMPLES 256 /*! \brief Audio port is ready to play. */ `#define` AUDIO_STATUS_READY 1 /*! \brief Audio port is playing. */ `#define` AUDIO_STATUS_RUN 2 /*! \brief Audio port has been closed. */ `#define` AUDIO_STATUS_CLOSE 0x1010 /*! \brief 2-channel (stereo) output. */ `#define` AUDIO_PORT_2CH 2 /*! \brief 8-channel output. */ `#define` AUDIO_PORT_8CH 8 /*! \brief Set initial output level. */ `#define` AUDIO_PORT_INITLEVEL 0x1000 /*! \brief 8 blocks are allocated in the audio buffer */ `#define` AUDIO_BLOCK_8 8 /*! \brief 16 blocks are allocated in the audio buffer */ `#define` AUDIO_BLOCK_16 16 /*! \brief 32 blocks are allocated in the audio buffer */ `#define` AUDIO_BLOCK_32 32 `#ifdef` __cplusplus extern "C" { `#endif` /*! \brief Audio port parameter data structure. */ typedef struct _audio_port_param { /*! \brief Number of channels. Possible values are: - \ref AUDIO_PORT_2CH - \ref AUDIO_PORT_8CH */ u64 numChannels; /*! \brief Number of blocks in audio buffer. Possible values are: - \ref AUDIO_BLOCK_8 - \ref AUDIO_BLOCK_16 - \ref AUDIO_BLOCK_32 */ u64 numBlocks; /*! \brief Special attributes. This value must be either 0 or \ref AUDIO_PORT_INITLEVEL. */ u64 attrib; /*! \Brief Initial volume. Valid only if \ref attrib was set to \ref AUDIO_PORT_INITLEVEL. Possible values vary from 0 to 1. */ f32 level; } audioPortParam; /*! \brief Audio port config data structure. */ typedef struct _audio_port_config { u32 readIndex; /*!< \brief index of currently read block in audio port buffer */ /*! \brief audio port status Possible values are: - \ref AUDIO_STATUS_READY - \ref AUDIO_STATUS_RUN - \ref AUDIO_STATUS_CLOSE */ u32 status; u64 channelCount; /*!< \brief number of channels */ /*! \brief number of blocks Possible values are: - \ref AUDIO_BLOCK_8 - \ref AUDIO_BL…[truncated]

Citations:


🌐 Web query:

"DNNDHH/PS5-3.20_Libs" "sceAudioOut2PortSetAttributes" "AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM"

💡 Result:

<search_synthesis>
The terms you referenced relate to the PlayStation 5 (PS5) audio system API, specifically within the context of low-level system libraries and third-party audio middleware integration [1][2]. DNNDHH/PS5-3.20_Libs is a public repository containing decrypted stub libraries (sprx files) for the PlayStation 5 firmware version 3.20 [1]. These stubs are used by developers to interface with the PS5&#39;s proprietary system functions [1]. sceAudioOut2PortSetAttributes is a function within the PS5&#39;s audio system API used to configure attributes for an audio output port [2]. The constant AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM is an identifier used to specify that the attribute being set or queried relates to Pulse Code Modulation (PCM) audio data [2]. Technical context and common issues: - Usage: Developers or middleware (such as FMOD) use this function to define how audio data is handled by the hardware [2]. - Errors: A common error associated with this function is SCE_AUDIO_OUT2_ERROR_INVALID_PARAM, which can occur due to incorrect attribute configurations or race conditions during port initialization [2][3]. - Middleware Integration: Issues with this function have been documented in game development environments (e.g., Unreal Engine with FMOD), where improper initialization or conflicting audio modules can cause the audio system to freeze or return errors [2]. FMOD has released updates to address specific race conditions related to this function [3].
</search_synthesis>

<source_evidence>

https://github.com/DNNDHH/PS5-3.20_Libs # Repository: DNNDHH/PS5-3.20_Libs decrypted sprx libs for PS5 - 3.20 FW - Stars: 3 - Forks: 1 - Watchers: 3 - Open issues: 0 - Primary language: C - Languages: C - Default branch: main - Created: 2023-10-09T07:33:52Z - Last push: 2023-10-13T11:04:14Z - Contributors: 1 (top: DNNDHH) --- # PS5-3.20_Libs sprx stub libs for 3.20 FW https://qa.fmod.com/t/ps5-audio-freeze/20416 PS5 audio freeze - Unreal Engine - FMOD Forums # PS5 audio freeze DPG_Kamis July 14, 2023, 8:18am 1 Hi, UE 4.27plus latest from Epic’s Github. Sony SDK 7.0 FMOD 2.02.14 Whan launching game on PS5 after loading audio banks our logs are spammed with this message: ``` [2023.07.14-08.04.16:148][ 0]LogAudio: Warning: 00:12:58 Dump of call to sceAudioOut2PortSetAttributes: 00:12:58 PortHandle: 69273723264 00:12:58 SceAudioOut2Attribute: 00:12:58 attributeId: 0 00:12:58 value: SceAudioOut2Pcm 00:12:58 data: 0x13ce000 (2048 samples) 00:12:58 valueSize: 8 00:12:58 00:12:58 Result: SCE_AUDIO_OUT2_ERROR_INVALID_PARAM ``` This is causing title to freeze. In Ps5Engine.ini I have: ``` [Audio] AudioDeviceModuleName= AudioMixerModuleName= AudioDeviceModuleName=Ngs2 ; Defining below allows switching to audio mixer using -audiomixer commandline AudioMixerModuleName=PS5AudioFeatures UseAudioMixer=true ``` What am I missing? Have a great day Marcin Connor_FMOD July 19, 2023, 6:43am 2 Hi, The issue is FMOD won’t work with built-in UE audio without engine modification (Unreal Integration | Platform Specifics - PS5). In your`PS5Engine.ini` you are both disabling and setting the`AudioDeviceModule` and`Mixer`. There is a linked forum post here: which outlines the modifications required to get FMOD to work with UE audio: https://qa.fmod.com/t/unreal-video-playback-with-audio-on-ps5/16555/2. Another solution is just disabling UE audio altogether. Hope this helps. https://www.fmod.com/docs/2.03/api/welcome-revision-history.html - Core API - PS5 - ... - Core API - PS5 - Fixed internal error from sceAudioOut2PortSetAttributes returning "not-ready" caused by a race condition in opening a port. https://android.googlesource.com/platform/frameworks/base/+/master/media/java/android/media/AudioPort.java | /** | | * An audio port is a node of the audio framework or hardware that can be connected to or | | * disconnect from another audio node to create a specific audio routing configuration. | | * Examples of audio ports are an output device (speaker) or an output mix (see AudioMixPort). | | * All attributes that are relevant for applications to make routing selection are described | | * in an AudioPort, in particular: | | * - possible channel mask configurations. | | * - audio format (PCM 16bit, PCM 24bit...) | | * - gain: a port can be associated with one or more gain controllers (see AudioGain). | | * | ... | * This object is always created by the framework and read only by applications. | | * A list of all audio port descriptors currently available for applications to control | | * is obtained by AudioManager.listAudioPorts(). | | * An application can obtain an AudioPortConfig for a valid configuration of this port | | * by calling AudioPort.buildConfig() and use this configuration | | * to create a connection between audio sinks and sources with AudioManager.connectAudioPatch() | | * | | * `@hide` | | */ | | public class AudioPort { | ... | /** | | * Get the list of supported channel mask configurations | | * (e.g AudioFormat.CHANNEL_OUT_STEREO) | ... | * Empty array if channel mask is not relevant for this audio port | | */ | | public int[] channelMasks() { | | return mChannelMasks; | | } | ... | /** | ... | * Get the list ... supported channel index mask configurations ... | * (e.g 0x0003 means 2 channel, 0x000F means 4 channel....) | | * Empty array if channel index mask is not relevant for this audio port | | */ | | public int ... channelIndexMasks() { | | return mChannelIndexMasks; | | } | ... | /** | | * Get the list of supported audio format configurations | | * (e.g AudioFormat.ENCODING_PCM_16BIT) | | * Empty array if format is not relevant for this audio port | | */ | | public int[] formats() { | | return mFormats; | | } | ... | /** | | * Build a specific configuration of this audio port for use by methods | | * like AudioManager.connectAudioPatch(). | | * `@param` samplingRate | | * `@param` channelMask The desired channel mask. AudioFormat.CHANNEL_OUT_DEFAULT if no change | | * from active configuration requested. | | * `@param` format The desired audio format. AudioFormat.ENCODING_DEFAULT if no change | | * from active configuration requested. | | * `@param` gain The desired gain. null if no gain changed requested. | | */ | | public AudioPortConfig buildConfig(int samplingRate, int channelMask, int format, | | AudioGainConfig gain) { | | return new AudioPortConfig(this, samplingRate, channelMask, format, gain); | | } | https://android.googlesource.com/platform/hardware/interfaces/+/4cea813a35623eff37f68b8890f4a1661743adbe/audio/common/2.0/types.hal Aliases */ | | /** note != AudioFormat.ENCODING_PCM_16BIT */ | | PCM_16_BIT = (PCM | PCM_SUB_16_BIT), | ... | | ... | /** | | ... audio output flags ... port role: ... | /** | | * Audio port type indicates if it is a session (e.g AudioTrack), a mix (e.g | | * PlaybackThread output) or a physical device (e.g OUT_SPEAKER) | | */ | | `@export`(name="audio_port_type_t", value_prefix="AUDIO_PORT_TYPE_") | | enum AudioPortType : int32 ... t { | | NONE, | | DEVICE, | | MIX, | | SESSION, | | }; | ... | * Flags ... _PORT_CONFIG_") ... AudioPortConfigMask ... | /** | | * Audio port configuration structure used to specify a particular configuration | | * of an audio port. | | */ | | struct AudioPortConfig { | | AudioPortHandle id; | | AudioPortConfigMask configMask; | | uint32_t sampleRateHz; | | AudioChannelMask channelMask; | | AudioFormat format; | | AudioGainConfig gain; | | AudioPortType type; // type is used as a discriminator for Ext union | | AudioPortRole role; // role is used as a discriminator for UseCase union | | union Ext { | | AudioPortConfigDeviceExt device; | ... union UseCase ... | } ext; ... | }; | ... | struct AudioPort { | | AudioPortHandle id; | | AudioPortRole role; | | string name; | | vec<uint32_t> sampleRates; | | vec channelMasks; | | vec formats; | | vec gains; | | AudioPortConfig activeConfig; // current audio port configuration | | AudioPortType type; // type is used as a discriminator | ... | union Ext { | | AudioPortDeviceExt device; | | AudioPortMixExt mix; | | AudioPortSessionExt session; | | } ext; | | }; |

Citations:


🏁 Script executed:

set -eu
url='https://raw.githubusercontent.com/DNNDHH/PS5-3.20_Libs/main/libSceAudioOut.c'
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
curl -fsSL "$url" -o "$tmp"
rg -n -C 12 'sceAudioOut2PortSetAttributes|AudioOut2Pcm|SceAudioOut2Pcm|PORT_ATTRIBUTE_ID_PCM|INVALID_PARAM' "$tmp" || true

Repository: KytyPS5/KytyPS5

Length of output: 3821


Return AUDIO_OUT2_ERROR_INVALID_PARAM for a malformed PCM attribute.

When a PCM attribute has a null, undersized, or unreadable value, the condition skips the update. The function then returns OK, so the previous pcm_data remains active. Reject the malformed attribute instead.

Proposed control flow
-		if (attributes[i].attribute_id == AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM &&
-		    attributes[i].value != nullptr && attributes[i].value_size >= sizeof(AudioOut2Pcm) &&
-		    Graphics::HostMemoryRangeIsReadable(reinterpret_cast<uint64_t>(attributes[i].value),
-		                                            sizeof(AudioOut2Pcm))) {
+		if (attributes[i].attribute_id == AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM) {
+			if (attributes[i].value == nullptr ||
+			    attributes[i].value_size < sizeof(AudioOut2Pcm) ||
+			    !Graphics::HostMemoryRangeIsReadable(
+			        reinterpret_cast<uint64_t>(attributes[i].value), sizeof(AudioOut2Pcm))) {
+				return AUDIO_OUT2_ERROR_INVALID_PARAM;
+			}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

		if (attributes[i].attribute_id == AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM) {
			if (attributes[i].value == nullptr ||
			    attributes[i].value_size < sizeof(AudioOut2Pcm) ||
			    !Graphics::HostMemoryRangeIsReadable(
			        reinterpret_cast<uint64_t>(attributes[i].value), sizeof(AudioOut2Pcm))) {
				return AUDIO_OUT2_ERROR_INVALID_PARAM;
			}
**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#discussion_r4054371692) _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash sed -n '650,715p' src/libs/libAudio2.cpp rg -n 'AudioOut2PortSetAttributes|PORT_ATTRIBUTE_ID_PCM|value_size' src tests CMakeLists.txt ``` Repository: KytyPS5/KytyPS5 Length of output: 4947 --- 🏁 Script executed: ```bash set -eu printf '%s\n' '--- public declaration ---' cat -n src/libs/audio.h | sed -n '45,85p' printf '%s\n' '--- implementation context ---' cat -n src/libs/libAudio2.cpp | sed -n '35,85p;200,240p;650,725p' printf '%s\n' '--- focused tests ---' cat -n tests/AudioOut2PortTests.cpp | sed -n '1,180p' printf '%s\n' '--- relevant callers ---' rg -n -C 3 'AudioOut2PortSetAttributes|AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM|AsAttribute' --glob '!src/libs/libAudio2.cpp' --glob '!src/libs/audio.h' . ``` Repository: KytyPS5/KytyPS5 Length of output: 17897 --- 🏁 Script executed: ```bash set -eu printf '%s\n' '--- AudioOut2 attribute references and documentation ---' rg -n -i -C 3 'AudioOut2Attribute|PortSetAttributes|attribute.*PCM|PCM.*attribute|invalid.?param|unsupported attribute' . --glob '!build/**' --glob '!dist/**' printf '%s\n' '--- remaining focused tests ---' cat -n tests/AudioOut2PortTests.cpp | sed -n '180,420p' printf '%s\n' '--- analogous attribute handlers ---' rg -n -C 8 'SetAttributes|attribute_id|has_pcm|value_size' src/libs --glob '*.cpp' --glob '*.h' ``` Repository: KytyPS5/KytyPS5 Length of output: 50371 --- 🌐 Web query: `sceAudioOut2PortSetAttributes AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM invalid parameter value_size` 💡 Result: This PS5 error usually means the `SceAudioOut2Pcm` attribute is being passed with the wrong size. For `AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM`, verify: ```cpp SceAudioOut2Pcm pcm = { .data = buffer, .numSamples = 2048 }; SceAudioOut2Attribute attr = { .attributeId = AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM, .value = &pcm, .valueSize = sizeof(pcm) // not hard-coded 8 }; ``` On PS5, `sizeof(SceAudioOut2Pcm)` may be larger than 8 because `data` is a 64-bit pointer. Also ensure the SDK headers and binary/ABI match. If this is FMOD with Unreal: - Do not run FMOD together with UE’s built-in audio path unless the required PS5 integration changes are applied. - Disable UE audio, or use a compatible newer FMOD integration; FMOD documented fixes for PS5 `sceAudioOut2PortSetAttributes` issues in later releases. [1][2] The reported `valueSize: 8` is the main red flag. [1] --- 🌐 Web query: `site:github.com "sceAudioOut2PortSetAttributes" OR "SceAudioOut2Pcm" "SceAudioOut2Attribute"` 💡 Result: <search_synthesis> The symbols `sceAudioOut2PortSetAttributes`, `SceAudioOut2Pcm`, and `SceAudioOut2Attribute` are associated with the low-level audio output libraries found in Sony PlayStation console operating systems, specifically related to the PS5 (and potentially PS4) system software [1][2]. These functions and types are part of the `libSceAudioOut` library, which manages audio hardware ports and output streams [1][3]. Based on technical documentation and reverse-engineering projects available on GitHub: 1. `sceAudioOut2PortSetAttributes`: This is a function used to configure specific attributes for an audio output port [1][2]. Debug logs from emulator projects indicate that failures in this function (e.g., error code 0x80020002) are often encountered during the initialization or configuration phase of audio threads in game applications [2]. 2. `SceAudioOut2Pcm` and `SceAudioOut2Attribute`: These appear to be related data structures or type definitions used to define PCM audio formats and port attributes, respectively, within the `libSceAudioOut` framework [1]. These symbols are typically found in proprietary system libraries and are not part of public, official SDK documentation. They are primarily referenced in the context of homebrew development, emulator research, and reverse engineering of PlayStation system libraries [1][4][3][2]. Other related functions commonly seen in these libraries include `sceAudioOutOpen`, `sceAudioOutOutput`, and `sceAudioOutGetPortState` [4][3]. </search_synthesis> <source_evidence> <source> <title>Farming Simulator 22 [PPSA02385]</title> <location>GitHub issue 287 in sharpemu/sharpemu (link omitted to avoid creating a cross-reference)</location> <excerpt>0000010020 ... &gt; [DEBUG][PRINF] sceAudioOut2PortSetAttributes failed - 80020002 ... &gt; [DEBUG][PRINF] Error in audio thread: 80020002</excerpt> </source> <source> <title>ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cpp</title> <location>https://github.com/liuk7071/ChonkyStation4/blob/683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cpp</location> <excerpt># ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cpp - Branch: 683d258b - Repository: liuk7071/ChonkyStation4 --- `#include` &quot;SceAudioOut.hpp&quot; `#include` &lt;Logger.hpp&gt; `#include` `#include` &lt;SDL.h&gt; `#include` `#include` &lt;unordered_map&gt; namespace PS4::OS::Libs::SceAudioOut { MAKE_LOG_FUNCTION(log, lib_sceAudioOut); void init(Module&amp; module) { module.addSymbolExport(&quot;JfEPXVxhFqA&quot;, &quot;sceAudioOutInit&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;, (void*)&amp;sceAudioOutInit); module.addSymbolExport(&quot;ekNvsT22rsY&quot;, &quot;sceAudioOutOpen&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;, (void*)&amp;sceAudioOutOpen); module.addSymbolExport(&quot;GrQ9s4IrNaQ&quot;, &quot;sceAudioOutGetPortState&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;, (void*)&amp;sceAudioOutGetPortState); module.addSymbolExport(&quot;QOQtbeDqsT4&quot;, &quot;sceAudioOutOutput&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;, (void*)&amp;sceAudioOutOutput); module.addSymbolExport(&quot;w3PdaSTSwGE&quot;, &quot;sceAudioOutOutputs&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;, (void*)&amp;sceAudioOutOutputs); module.addSymbolStub(&quot;s1--uE9mBFw&quot;, &quot;sceAudioOutClose&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;); module.addSymbolStub(&quot;b+uAV89IlxE&quot;, &quot;sceAudioOutSetVolume&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;); module.addSymbolStub(&quot;wVwPU50pS1c&quot;, &quot;sceAudioOutSetMixLevelPadSpk&quot;, &quot;libSceAudioOut&quot;, &quot;libSceAudioOut&quot;); } SDL_AudioDeviceID dev; s32 PS4_FUNC sceAudioOutInit() { log(&quot;sceAudioOutInit()\n&quot;); return SCE_OK; } static std::unordered_map&lt;s32, std::pair&lt;s32, s32&gt;&gt; sdl_format_map = { { 0, { AUDIO_S16, 1 }}, { 1, { AUDIO_S16, 2 }}, { 2, { AUDIO_S16, 8 }}, { 3, { AUDIO_F32, 1 }}, { 4, { AUDIO_F32, 2 }}, { 5, { AUDIO_F32, 8 }}, { 6, { AUDIO_S16, 8 }}, { 7, { AUDIO_F32, 8 }}, }; static bool is_opened = false; static s32 opened_handle = 0; s32 PS4_FUNC sceAudioOutOpen(Libs::SceUserService::SceUserServiceUserId uid, s32 type, s32 idx, u32 len, u32 freq, u32 param) { log(&quot;sceAudioOutOpen(uid=%d, type=%d, idx=%d, len=%d, freq=%d, param=0x%x)\n&quot;, uid, type, idx, len, freq, param); auto* port = PS4::OS::make (); port-&gt;device = (AudioVirtualDevice)type; port-&gt;len = len; port-&gt;freq = freq; port-&gt;format = param &amp; 0xff; const auto handle = port-&gt;handle; log(&quot;Opened audio port %d: device=%s, len=%d, freq=%d, format=%d\n&quot;, handle, audioVirtualDeviceToStr(port-&gt;device).c_str(), port-&gt;len, port-&gt;freq, port-&gt;format); // Init SDL audio // I stubbed it to only work for the first opened port for now... if (!is_opened) { is_opened = true; opened_handle = handle; SDL_AudioSpec desired, obtained; SDL_zero(desired); Helpers::debugAssert(sdl_format_map.contains(port-&gt;format), &quot;sceAudioOutOpen: invalid format %d\n&quot;, port-&gt;format); const auto [format, n_channels] = sdl_format_map[port-&gt;format]; port-&gt;sdl_format = format; port-&gt;n_channels = n_channels; desired.freq = 48000; desired.format = format; desired.channels = n_channels; desired.samples = len; desired.callback = NULL; dev = SDL_OpenAudioDevice(NULL, 0, &amp;desired, &amp;obtained, SDL_AUDIO_ALLOW_FORMAT_CHANGE); if (!dev) { Helpers::panic(&quot;Failed to open SDL audio device for playback\n&quot;); } SDL_PauseAudioDevice(dev, 0); } return handle; } s32 PS4_FUNC sceAudioOutGetPortState(s32 handle, SceAudioOutPortState* state) { log(&quot;sceAudioOutGetPortState(handle=%d, state=*%p)\n&quot;, handle, state); auto* port = PS4::OS::find (handle); if (!port) { Helpers::panic(&quot;sceAudioOutGetPortState: could not find port with handle %d\n&quot;, handle); } state-&gt;output = 1; // Primary output state-&gt;channel = port-&gt;n_channels; state-&gt;volume = 127; // This is supposed to be set for PADSPK only stat…[truncated]</excerpt> </source> <source> <title>ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.hpp</title> <location>https://github.com/liuk7071/ChonkyStation4/blob/683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.hpp</location> <excerpt># ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.hpp - Branch: 683d258b - Repository: liuk7071/ChonkyStation4 --- `#pragma` once `#include` &lt;Common.hpp&gt; `#include` // For SceUserServiceUserId `#include` class Module; namespace PS4::OS::Libs::SceAudioOut { void init(Module&amp; module); enum AudioVirtualDevice { Main, BGM, Voice, Personal, PadSpeaker, Aux = 127 }; inline std::string audioVirtualDeviceToStr(AudioVirtualDevice dev) { switch (dev) { case AudioVirtualDevice::Main: return &quot;Main&quot;; case AudioVirtualDevice::BGM: return &quot;BGM&quot;; case AudioVirtualDevice::Voice: return &quot;Voice&quot;; case AudioVirtualDevice::Personal: return &quot;Personal&quot;; case AudioVirtualDevice::PadSpeaker: return &quot;PadSpeaker&quot;; case AudioVirtualDevice::Aux: return &quot;Aux&quot;; } Helpers::panic(&quot;audioVirtualDeviceToStr: unreachable\n&quot;); } struct SceAudioOutOutputParam { s32 handle; const void* ptr; }; struct SceAudioOutPortState { u16 output; u8 channel; u8 reserved1[1]; s16 volume; u16 reroute_counter; u64 flag; u64 reserved2[2]; }; struct SceAudioOutPort : SceObj { AudioVirtualDevice device; u32 len; u32 freq; u32 format; u32 n_channels; u32 sdl_format; }; s32 PS4_FUNC sceAudioOutInit(); s32 PS4_FUNC sceAudioOutOpen(Libs::SceUserService::SceUserServiceUserId uid, s32 type, s32 idx, u32 len, u32 freq, u32 param); s32 PS4_FUNC sceAudioOutGetPortState(s32 handle, SceAudioOutPortState* state); s32 PS4_FUNC sceAudioOutOutput(s32 handle, const void* ptr); s32 PS4_FUNC sceAudioOutOutputs(SceAudioOutOutputParam* param, u32 num); } // End namespace PS4::OS::Libs::SceAudioOut</excerpt> </source> <source> <title>ppu/include/audio/audio.h</title> <location>https://github.com/ps3dev/PSL1GHT/blob/b1b5597c/ppu/include/audio/audio.h</location> <excerpt># ppu/include/audio/audio.h - Branch: b1b5597c - Repository: ps3dev/PSL1GHT --- /*! \file audio.h \brief Audio library. This library manages communications of the application with the system audio server. It basically allows the application to play raw PCM audio by filling a circular buffer. To play audio, follow these steps: - Initialize the audio system for the application (\ref audioInit). - Open an audio port with \ref audioPortOpen, which returns a unique port number. - Allocate a \ref audioPortConfig object with \ref audioGetPortConfig. - Create a notify event queue (\ref audioCreateNotifyEventQueue). - Set the created event queue as the current event queue (\ref audioSetNotifyEventQueue). - Eventually drain the existing events in the queue (\ref sysEventQueueDrain). - Start the audio port (\ref audioPortStart). - As soon as you receive an event from the notify event queue (\ref sysEventQueueReceive), you can write the next block into the buffer. The first block number is 0, the following is 1, and so on until you reach the number of allocated blocks (specified in the audioPortParam::numBlocks value you provide when you call \ref audioPortOpen), then the block number returns to 0. The address of block 0 is the \ref audioPortConfig::audioDataStart &quot;audioDataStart&quot; field of the \ref audioPortConfig structure. Then the address of block \c x is audioDataStart + x * numChannels * AUDIO_BLOCK_SAMPLES * sizeof(float). The size of each block in bytes is numChannels * AUDIO_BLOCK_SAMPLES * sizeof(float). To stop playing audio, the steps are: - Stop the audio port (\ref audioPortStop). - Unset the current event queue (\ref audioRemoveNotifyEventQueue). - Close the audio port (\ref audioPortClose). - Destroy the event queue (\ref sysEventQueueDestroy). - Quit the audio system (\ref audioQuit). The PCM audio sample format is 32-bit floating point where sample values vary from -1 to 1. Samples are interlaced: for instance in stereo mode, even sample positions correspond to the left channel, and odd ones correspond to the right channel. */ `#ifndef` __LV2_AUDIO_H__ `#define` __LV2_AUDIO_H__ `#include` /*! \brief Number of samples in an audio block. */ `#define` AUDIO_BLOCK_SAMPLES 256 /*! \brief Audio port is ready to play. */ `#define` AUDIO_STATUS_READY 1 /*! \brief Audio port is playing. */ `#define` AUDIO_STATUS_RUN 2 /*! \brief Audio port has been closed. */ `#define` AUDIO_STATUS_CLOSE 0x1010 /*! \brief 2-channel (stereo) output. */ `#define` AUDIO_PORT_2CH 2 /*! \brief 8-channel output. */ `#define` AUDIO_PORT_8CH 8 /*! \brief Set initial output level. */ `#define` AUDIO_PORT_INITLEVEL 0x1000 /*! \brief 8 blocks are allocated in the audio buffer */ `#define` AUDIO_BLOCK_8 8 /*! \brief 16 blocks are allocated in the audio buffer */ `#define` AUDIO_BLOCK_16 16 /*! \brief 32 blocks are allocated in the audio buffer */ `#define` AUDIO_BLOCK_32 32 `#ifdef` __cplusplus extern &quot;C&quot; { `#endif` /*! \brief Audio port parameter data structure. */ typedef struct _audio_port_param { /*! \brief Number of channels. Possible values are: - \ref AUDIO_PORT_2CH - \ref AUDIO_PORT_8CH */ u64 numChannels; /*! \brief Number of blocks in audio buffer. Possible values are: - \ref AUDIO_BLOCK_8 - \ref AUDIO_BLOCK_16 - \ref AUDIO_BLOCK_32 */ u64 numBlocks; /*! \brief Special attributes. This value must be either 0 or \ref AUDIO_PORT_INITLEVEL. */ u64 attrib; /*! \Brief Initial volume. Valid only if \ref attrib was set to \ref AUDIO_PORT_INITLEVEL. Possible values vary from 0 to 1. */ f32 level; } audioPortParam; /*! \brief Audio port config data structure. */ typedef struct _audio_port_config { u32 readIndex; /*!&lt; \brief index of currently read block in audio port buffer */ /*! \brief audio port status Possible values are: - \ref AUDIO_STATUS_READY - \ref AUDIO_STATUS_RUN - \ref AUDIO_STATUS_CLOSE */ u32 status; u64 channelCount; /*!&lt; \brief number of channels */ /*! \brief number of blocks Possible values are: - \ref AUDIO_BLOCK_8 - \ref AUDIO_BL…[truncated]</excerpt> </source> </source_evidence> Citations: - 1: https://github.com/DNNDHH/PS5-3.20_Libs/blob/main/libSceAudioOut.c - 2: GitHub issue 287 in sharpemu/sharpemu (link omitted to avoid creating a cross-reference) - 3: https://github.com/liuk7071/ChonkyStation4/blob/683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cpp - 4: https://github.com/liuk7071/ChonkyStation4/blob/683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.hpp --- 🌐 Web query: `"DNNDHH/PS5-3.20_Libs" "sceAudioOut2PortSetAttributes" "AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM"` 💡 Result: <search_synthesis> The terms you referenced relate to the PlayStation 5 (PS5) audio system API, specifically within the context of low-level system libraries and third-party audio middleware integration [1][2]. DNNDHH/PS5-3.20_Libs is a public repository containing decrypted stub libraries (sprx files) for the PlayStation 5 firmware version 3.20 [1]. These stubs are used by developers to interface with the PS5&`#39`;s proprietary system functions [1]. sceAudioOut2PortSetAttributes is a function within the PS5&`#39`;s audio system API used to configure attributes for an audio output port [2]. The constant AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM is an identifier used to specify that the attribute being set or queried relates to Pulse Code Modulation (PCM) audio data [2]. Technical context and common issues: - Usage: Developers or middleware (such as FMOD) use this function to define how audio data is handled by the hardware [2]. - Errors: A common error associated with this function is SCE_AUDIO_OUT2_ERROR_INVALID_PARAM, which can occur due to incorrect attribute configurations or race conditions during port initialization [2][3]. - Middleware Integration: Issues with this function have been documented in game development environments (e.g., Unreal Engine with FMOD), where improper initialization or conflicting audio modules can cause the audio system to freeze or return errors [2]. FMOD has released updates to address specific race conditions related to this function [3]. </search_synthesis> <source_evidence> <source> <title>DNNDHH/PS5-3.20_Libs</title> <location>https://github.com/DNNDHH/PS5-3.20_Libs</location> <excerpt># Repository: DNNDHH/PS5-3.20_Libs decrypted sprx libs for PS5 - 3.20 FW - Stars: 3 - Forks: 1 - Watchers: 3 - Open issues: 0 - Primary language: C - Languages: C - Default branch: main - Created: 2023-10-09T07:33:52Z - Last push: 2023-10-13T11:04:14Z - Contributors: 1 (top: DNNDHH) --- # PS5-3.20_Libs sprx stub libs for 3.20 FW</excerpt> </source> <source> <title>PS5 audio freeze - Unreal Engine - FMOD Forums</title> <location>https://qa.fmod.com/t/ps5-audio-freeze/20416</location> <excerpt>PS5 audio freeze - Unreal Engine - FMOD Forums # PS5 audio freeze DPG_Kamis July 14, 2023, 8:18am 1 Hi, UE 4.27plus latest from Epic’s Github. Sony SDK 7.0 FMOD 2.02.14 Whan launching game on PS5 after loading audio banks our logs are spammed with this message: ``` [2023.07.14-08.04.16:148][ 0]LogAudio: Warning: 00:12:58 Dump of call to sceAudioOut2PortSetAttributes: 00:12:58 PortHandle: 69273723264 00:12:58 SceAudioOut2Attribute: 00:12:58 attributeId: 0 00:12:58 value: SceAudioOut2Pcm 00:12:58 data: 0x13ce000 (2048 samples) 00:12:58 valueSize: 8 00:12:58 00:12:58 Result: SCE_AUDIO_OUT2_ERROR_INVALID_PARAM ``` This is causing title to freeze. In Ps5Engine.ini I have: ``` [Audio] AudioDeviceModuleName= AudioMixerModuleName= AudioDeviceModuleName=Ngs2 ; Defining below allows switching to audio mixer using -audiomixer commandline AudioMixerModuleName=PS5AudioFeatures UseAudioMixer=true ``` What am I missing? Have a great day Marcin Connor_FMOD July 19, 2023, 6:43am 2 Hi, The issue is FMOD won’t work with built-in UE audio without engine modification (Unreal Integration | Platform Specifics - PS5). In your`PS5Engine.ini` you are both disabling and setting the`AudioDeviceModule` and`Mixer`. There is a linked forum post here: which outlines the modifications required to get FMOD to work with UE audio: https://qa.fmod.com/t/unreal-video-playback-with-audio-on-ps5/16555/2. Another solution is just disabling UE audio altogether. Hope this helps.</excerpt> </source> <source> <title>FMOD - Welcome to the FMOD Engine | Detailed Revision History</title> <location>https://www.fmod.com/docs/2.03/api/welcome-revision-history.html</location> <excerpt>- Core API - PS5 - ... - Core API - PS5 - Fixed internal error from sceAudioOut2PortSetAttributes returning &quot;not-ready&quot; caused by a race condition in opening a port.</excerpt> </source> <source> <title>media/java/android/media/AudioPort.java - platform/frameworks/base - Git at Google</title> <location>https://android.googlesource.com/platform/frameworks/base/+/master/media/java/android/media/AudioPort.java</location> <excerpt>| /** | | * An audio port is a node of the audio framework or hardware that can be connected to or | | * disconnect from another audio node to create a specific audio routing configuration. | | * Examples of audio ports are an output device (speaker) or an output mix (see AudioMixPort). | | * All attributes that are relevant for applications to make routing selection are described | | * in an AudioPort, in particular: | | * - possible channel mask configurations. | | * - audio format (PCM 16bit, PCM 24bit...) | | * - gain: a port can be associated with one or more gain controllers (see AudioGain). | | * | ... | * This object is always created by the framework and read only by applications. | | * A list of all audio port descriptors currently available for applications to control | | * is obtained by AudioManager.listAudioPorts(). | | * An application can obtain an AudioPortConfig for a valid configuration of this port | | * by calling AudioPort.buildConfig() and use this configuration | | * to create a connection between audio sinks and sources with AudioManager.connectAudioPatch() | | * | | * `@hide` | | */ | | public class AudioPort { | ... | /** | | * Get the list of supported channel mask configurations | | * (e.g AudioFormat.CHANNEL_OUT_STEREO) | ... | * Empty array if channel mask is not relevant for this audio port | | */ | | public int[] channelMasks() { | | return mChannelMasks; | | } | ... | /** | ... | * Get the list ... supported channel index mask configurations ... | * (e.g 0x0003 means 2 channel, 0x000F means 4 channel....) | | * Empty array if channel index mask is not relevant for this audio port | | */ | | public int ... channelIndexMasks() { | | return mChannelIndexMasks; | | } | ... | /** | | * Get the list of supported audio format configurations | | * (e.g AudioFormat.ENCODING_PCM_16BIT) | | * Empty array if format is not relevant for this audio port | | */ | | public int[] formats() { | | return mFormats; | | } | ... | /** | | * Build a specific configuration of this audio port for use by methods | | * like AudioManager.connectAudioPatch(). | | * `@param` samplingRate | | * `@param` channelMask The desired channel mask. AudioFormat.CHANNEL_OUT_DEFAULT if no change | | * from active configuration requested. | | * `@param` format The desired audio format. AudioFormat.ENCODING_DEFAULT if no change | | * from active configuration requested. | | * `@param` gain The desired gain. null if no gain changed requested. | | */ | | public AudioPortConfig buildConfig(int samplingRate, int channelMask, int format, | | AudioGainConfig gain) { | | return new AudioPortConfig(this, samplingRate, channelMask, format, gain); | | } |</excerpt> </source> <source> <title>audio/common/2.0/types.hal - platform/hardware/interfaces - Git at Google</title> <location>https://android.googlesource.com/platform/hardware/interfaces/+/4cea813a35623eff37f68b8890f4a1661743adbe/audio/common/2.0/types.hal</location> <excerpt>Aliases */ | | /** note != AudioFormat.ENCODING_PCM_16BIT */ | | PCM_16_BIT = (PCM | PCM_SUB_16_BIT), | ... | | ... | /** | | ... audio output flags ... port role: ... | /** | | * Audio port type indicates if it is a session (e.g AudioTrack), a mix (e.g | | * PlaybackThread output) or a physical device (e.g OUT_SPEAKER) | | */ | | `@export`(name=&quot;audio_port_type_t&quot;, value_prefix=&quot;AUDIO_PORT_TYPE_&quot;) | | enum AudioPortType : int32 ... t { | | NONE, | | DEVICE, | | MIX, | | SESSION, | | }; | ... | * Flags ... _PORT_CONFIG_&quot;) ... AudioPortConfigMask ... | /** | | * Audio port configuration structure used to specify a particular configuration | | * of an audio port. | | */ | | struct AudioPortConfig { | | AudioPortHandle id; | | AudioPortConfigMask configMask; | | uint32_t sampleRateHz; | | AudioChannelMask channelMask; | | AudioFormat format; | | AudioGainConfig gain; | | AudioPortType type; // type is used as a discriminator for Ext union | | AudioPortRole role; // role is used as a discriminator for UseCase union | | union Ext { | | AudioPortConfigDeviceExt device; | ... union UseCase ... | } ext; ... | }; | ... | struct AudioPort { | | AudioPortHandle id; | | AudioPortRole role; | | string name; | | vec&lt;uint32_t&gt; sampleRates; | | vec channelMasks; | | vec formats; | | vec gains; | | AudioPortConfig activeConfig; // current audio port configuration | | AudioPortType type; // type is used as a discriminator | ... | union Ext { | | AudioPortDeviceExt device; | | AudioPortMixExt mix; | | AudioPortSessionExt session; | | } ext; | | }; |</excerpt> </source> </source_evidence> Citations: - 1: https://github.com/DNNDHH/PS5-3.20_Libs - 2: https://qa.fmod.com/t/ps5-audio-freeze/20416 - 3: https://www.fmod.com/docs/2.03/api/welcome-revision-history.html --- 🏁 Script executed: ```bash set -eu url='https://raw.githubusercontent.com/DNNDHH/PS5-3.20_Libs/main/libSceAudioOut.c' tmp=$(mktemp) trap 'rm -f "$tmp"' EXIT curl -fsSL "$url" -o "$tmp" rg -n -C 12 'sceAudioOut2PortSetAttributes|AudioOut2Pcm|SceAudioOut2Pcm|PORT_ATTRIBUTE_ID_PCM|INVALID_PARAM' "$tmp" || true ``` Repository: KytyPS5/KytyPS5 Length of output: 3821 --- </details> **Return `AUDIO_OUT2_ERROR_INVALID_PARAM` for a malformed PCM attribute.** When a PCM attribute has a null, undersized, or unreadable `value`, the condition skips the update. The function then returns `OK`, so the previous `pcm_data` remains active. Reject the malformed attribute instead. <details> <summary>Proposed control flow</summary> ```diff - if (attributes[i].attribute_id == AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM && - attributes[i].value != nullptr && attributes[i].value_size >= sizeof(AudioOut2Pcm) && - Graphics::HostMemoryRangeIsReadable(reinterpret_cast<uint64_t>(attributes[i].value), - sizeof(AudioOut2Pcm))) { + if (attributes[i].attribute_id == AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM) { + if (attributes[i].value == nullptr || + attributes[i].value_size < sizeof(AudioOut2Pcm) || + !Graphics::HostMemoryRangeIsReadable( + reinterpret_cast<uint64_t>(attributes[i].value), sizeof(AudioOut2Pcm))) { + return AUDIO_OUT2_ERROR_INVALID_PARAM; + } ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (attributes[i].attribute_id == AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM) { if (attributes[i].value == nullptr || attributes[i].value_size < sizeof(AudioOut2Pcm) || !Graphics::HostMemoryRangeIsReadable( reinterpret_cast<uint64_t>(attributes[i].value), sizeof(AudioOut2Pcm))) { return AUDIO_OUT2_ERROR_INVALID_PARAM; } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:quokka --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:26520a12f17d107228349ec3 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -747,2 +773,3 @@
for (const auto& [address, decoded]: function.instructions) {
if (!decoded.accesses_memory || !decoded.red_zone_live.any() ||
if ((!decoded.accesses_memory && !decoded.may_emulate_instruction) ||
!decoded.red_zone_live.any() ||
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

sed -n '730,825p' src/loader/redZonePatcher.cpp
sed -n '825,940p' src/loader/redZonePatcher.cpp
sed -n '760,855p' src/loader/runtimeLinker.cpp
rg -n 'uses_stack_pointer|red_zone_live|may_emulate_instruction|ProtectsRedZone|RelocateRedZone' src/loader/redZonePatcher.cpp

Repository: KytyPS5/KytyPS5

Length of output: 13429


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- relevant symbols ---'
rg -n -C 8 'TryEmulate|MayEmulateInstruction|replaces_stack_pointer|uses_stack_pointer|KytyExceptionHandler|ExceptionHandler|SetException|native_context|GuestRedZoneSize' src/loader src/common src 2>/dev/null | head -n 500
printf '%s\n' '--- redZonePatcher declarations and analysis ---'
sed -n '90,245p' src/loader/redZonePatcher.cpp
sed -n '560,715p' src/loader/redZonePatcher.cpp
printf '%s\n' '--- emulator files ---'
rg -l 'TryEmulate|MayEmulateInstruction|class X64InstructionEmulator|namespace X64InstructionEmulator' src | head -n 80

Repository: KytyPS5/KytyPS5

Length of output: 47259


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- emulator context and SSE4a ---'
sed -n '1,180p' src/loader/x64InstructionEmulator.cpp
sed -n '700,830p' src/loader/x64InstructionEmulator.cpp
sed -n '950,1010p' src/loader/x64InstructionEmulator.cpp
printf '%s\n' '--- Windows exception filter ---'
sed -n '1,135p' src/common/hostException.cpp
sed -n '275,305p' src/common/hostException.cpp
printf '%s\n' '--- patch application and unresolved handling ---'
sed -n '940,1085p' src/loader/redZonePatcher.cpp
sed -n '1260,1350p' src/loader/redZonePatcher.cpp

Repository: KytyPS5/KytyPS5

Length of output: 23844


🏁 Script executed:

#!/bin/bash
set -e
rg -n -C 10 'ResolveSse4aMemoryAddress|struct Context|class Context|LoadGprs|Rsp\(\)|RSP|CONTEXT' src/loader/x64InstructionEmulator.cpp

Repository: KytyPS5/KytyPS5

Length of output: 7994


🏁 Script executed:

#!/bin/bash
set -e
sed -n '441,506p' src/loader/x64InstructionEmulator.cpp

Repository: KytyPS5/KytyPS5

Length of output: 2464


Protect stack-relative emulated instructions.

A live stack-relative MOVNTSD or MOVNTSS site is selected as a may_emulate_instruction, then skipped because it uses rsp. The original instruction can therefore raise #UD without red-zone protection. Windows exception dispatch may overwrite the SysV red zone before TryEmulateSse4a resolves the rsp-relative destination, which can corrupt live guest stack data.

Add a path that preserves the instruction’s original stack-relative address while lowering host rsp, or use another protection mechanism for these sites.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#discussion_r4054371706) _🗄️ Data Integrity & Integration_ | _🟠 Major_ | _🏗️ Heavy lift_ <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash sed -n '730,825p' src/loader/redZonePatcher.cpp sed -n '825,940p' src/loader/redZonePatcher.cpp sed -n '760,855p' src/loader/runtimeLinker.cpp rg -n 'uses_stack_pointer|red_zone_live|may_emulate_instruction|ProtectsRedZone|RelocateRedZone' src/loader/redZonePatcher.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 13429 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- relevant symbols ---' rg -n -C 8 'TryEmulate|MayEmulateInstruction|replaces_stack_pointer|uses_stack_pointer|KytyExceptionHandler|ExceptionHandler|SetException|native_context|GuestRedZoneSize' src/loader src/common src 2>/dev/null | head -n 500 printf '%s\n' '--- redZonePatcher declarations and analysis ---' sed -n '90,245p' src/loader/redZonePatcher.cpp sed -n '560,715p' src/loader/redZonePatcher.cpp printf '%s\n' '--- emulator files ---' rg -l 'TryEmulate|MayEmulateInstruction|class X64InstructionEmulator|namespace X64InstructionEmulator' src | head -n 80 ``` Repository: KytyPS5/KytyPS5 Length of output: 47259 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- emulator context and SSE4a ---' sed -n '1,180p' src/loader/x64InstructionEmulator.cpp sed -n '700,830p' src/loader/x64InstructionEmulator.cpp sed -n '950,1010p' src/loader/x64InstructionEmulator.cpp printf '%s\n' '--- Windows exception filter ---' sed -n '1,135p' src/common/hostException.cpp sed -n '275,305p' src/common/hostException.cpp printf '%s\n' '--- patch application and unresolved handling ---' sed -n '940,1085p' src/loader/redZonePatcher.cpp sed -n '1260,1350p' src/loader/redZonePatcher.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 23844 --- 🏁 Script executed: ```bash #!/bin/bash set -e rg -n -C 10 'ResolveSse4aMemoryAddress|struct Context|class Context|LoadGprs|Rsp\(\)|RSP|CONTEXT' src/loader/x64InstructionEmulator.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 7994 --- 🏁 Script executed: ```bash #!/bin/bash set -e sed -n '441,506p' src/loader/x64InstructionEmulator.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 2464 --- </details> **Protect stack-relative emulated instructions.** A live stack-relative `MOVNTSD` or `MOVNTSS` site is selected as a `may_emulate_instruction`, then skipped because it uses `rsp`. The original instruction can therefore raise `#UD` without red-zone protection. Windows exception dispatch may overwrite the SysV red zone before `TryEmulateSse4a` resolves the `rsp`-relative destination, which can corrupt live guest stack data. Add a path that preserves the instruction’s original stack-relative address while lowering host `rsp`, or use another protection mechanism for these sites. <!-- fingerprinting:phantom:medusa:quokka --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:8999a779bdc8f71a0ce8bf0e --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -383,0 +473,4 @@
result += static_cast<uint64_t>(static_cast<int64_t>(displacement));
offset += sizeof(displacement);
}
} else if (mod == 0u && rm == 5u && (rex & 0x01u) == 0) {
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '395,505p' src/loader/x64InstructionEmulator.cpp
rg -n 'DecodeSse4aMemoryOperand|ResolveSse4aMemoryAddress|MOVNTSS|MOVNTSD|rex' tests src/loader

Repository: KytyPS5/KytyPS5

Length of output: 7775


🏁 Script executed:

sed -n '720,785p' src/loader/x64InstructionEmulator.cpp
printf '\\nRelevant test/source references:\\n'
rg -n -C 2 'Sse4a|MOVNTSS|MOVNTSD|DecodeSse4aMemoryOperand|ResolveSse4aMemoryAddress' tests src/loader

Repository: KytyPS5/KytyPS5

Length of output: 6588


Ignore REX.B for the special mod=00 address forms.

For mod=00, r/m=101, the address remains RIP-relative when REX.B is set. For a SIB operand with mod=00, base=101, the operand remains a no-base disp32 form. REX.B does not select R13 for either special encoding.

The current checks select R13 and omit the disp32 from instruction_length. A reachable MOVNTSS or MOVNTSD instruction can therefore use the wrong guest address and advance RIP by the wrong length.

Proposed fix
-		const bool    has_base = mod != 0u || base_low != 5u || (rex & 0x01u) != 0;
+		const bool    has_base = mod != 0u || base_low != 5u;
...
-	} else if (mod == 0u && rm == 5u && (rex & 0x01u) == 0) {
+	} else if (mod == 0u && rm == 5u) {

Apply both changes in DecodeSse4aMemoryOperand and ResolveSse4aMemoryAddress.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

		const bool    has_base = mod != 0u || base_low != 5u;
		if (!has_base || mod == 2u) {
			offset += sizeof(int32_t);
		} else if (mod == 1u) {
			offset += sizeof(int8_t);
		}
	} else if (mod == 0u && rm == 5u) {
		// RIP-relative addressing.
		offset += sizeof(int32_t);
	} else if (mod == 1u) {
		offset += sizeof(int8_t);
	} else if (mod == 2u) {
		offset += sizeof(int32_t);
	}

	instruction_length = offset;
	return true;
}

static bool ResolveSse4aMemoryAddress(const uint8_t* rip, size_t modrm_offset, uint8_t rex,
                                      size_t instruction_length, const uint64_t (&gpr)[16],
                                      void*& address) {
	const uint8_t modrm = rip[modrm_offset];
	const uint8_t mod   = modrm >> 6u;
	const uint8_t rm    = modrm & 0x07u;
	if (mod == 3u) {
		return false;
	}

	size_t   offset = modrm_offset + 1;
	uint64_t result = 0;

	if (rm == 4u) {
		const uint8_t sib       = rip[offset++];
		const uint8_t scale     = sib >> 6u;
		const uint8_t index_low = (sib >> 3u) & 0x07u;
		const uint8_t base_low  = sib & 0x07u;
		const bool    has_index = index_low != 4u || (rex & 0x02u) != 0;
		const bool    has_base  = mod != 0u || base_low != 5u;

		if (has_base) {
			const uint8_t base = base_low | ((rex & 0x01u) << 3u);
			result += gpr[base];
		}
		if (has_index) {
			const uint8_t index = index_low | ((rex & 0x02u) << 2u);
			result += gpr[index] << scale;
		}
		if (!has_base) {
			int32_t displacement = 0;
			std::memcpy(&displacement, rip + offset, sizeof(displacement));
			result += static_cast<uint64_t>(static_cast<int64_t>(displacement));
			offset += sizeof(displacement);
		}
	} else if (mod == 0u && rm == 5u) {
**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#discussion_r4054371714) _🎯 Functional Correctness_ | _🟠 Major_ | _⚡ Quick win_ <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash sed -n '395,505p' src/loader/x64InstructionEmulator.cpp rg -n 'DecodeSse4aMemoryOperand|ResolveSse4aMemoryAddress|MOVNTSS|MOVNTSD|rex' tests src/loader ``` Repository: KytyPS5/KytyPS5 Length of output: 7775 --- 🏁 Script executed: ```bash sed -n '720,785p' src/loader/x64InstructionEmulator.cpp printf '\\nRelevant test/source references:\\n' rg -n -C 2 'Sse4a|MOVNTSS|MOVNTSD|DecodeSse4aMemoryOperand|ResolveSse4aMemoryAddress' tests src/loader ``` Repository: KytyPS5/KytyPS5 Length of output: 6588 --- </details> **Ignore `REX.B` for the special `mod=00` address forms.** For `mod=00, r/m=101`, the address remains RIP-relative when `REX.B` is set. For a SIB operand with `mod=00, base=101`, the operand remains a no-base `disp32` form. `REX.B` does not select R13 for either special encoding. The current checks select R13 and omit the `disp32` from `instruction_length`. A reachable MOVNTSS or MOVNTSD instruction can therefore use the wrong guest address and advance RIP by the wrong length. <details> <summary>Proposed fix</summary> ```diff - const bool has_base = mod != 0u || base_low != 5u || (rex & 0x01u) != 0; + const bool has_base = mod != 0u || base_low != 5u; ... - } else if (mod == 0u && rm == 5u && (rex & 0x01u) == 0) { + } else if (mod == 0u && rm == 5u) { ``` Apply both changes in `DecodeSse4aMemoryOperand` and `ResolveSse4aMemoryAddress`. </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion const bool has_base = mod != 0u || base_low != 5u; if (!has_base || mod == 2u) { offset += sizeof(int32_t); } else if (mod == 1u) { offset += sizeof(int8_t); } } else if (mod == 0u && rm == 5u) { // RIP-relative addressing. offset += sizeof(int32_t); } else if (mod == 1u) { offset += sizeof(int8_t); } else if (mod == 2u) { offset += sizeof(int32_t); } instruction_length = offset; return true; } static bool ResolveSse4aMemoryAddress(const uint8_t* rip, size_t modrm_offset, uint8_t rex, size_t instruction_length, const uint64_t (&gpr)[16], void*& address) { const uint8_t modrm = rip[modrm_offset]; const uint8_t mod = modrm >> 6u; const uint8_t rm = modrm & 0x07u; if (mod == 3u) { return false; } size_t offset = modrm_offset + 1; uint64_t result = 0; if (rm == 4u) { const uint8_t sib = rip[offset++]; const uint8_t scale = sib >> 6u; const uint8_t index_low = (sib >> 3u) & 0x07u; const uint8_t base_low = sib & 0x07u; const bool has_index = index_low != 4u || (rex & 0x02u) != 0; const bool has_base = mod != 0u || base_low != 5u; if (has_base) { const uint8_t base = base_low | ((rex & 0x01u) << 3u); result += gpr[base]; } if (has_index) { const uint8_t index = index_low | ((rex & 0x02u) << 2u); result += gpr[index] << scale; } if (!has_base) { int32_t displacement = 0; std::memcpy(&displacement, rip + offset, sizeof(displacement)); result += static_cast<uint64_t>(static_cast<int64_t>(displacement)); offset += sizeof(displacement); } } else if (mod == 0u && rm == 5u) { ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:quokka --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:e934a076c7cf3e2460313f42 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -564,3 +727,3 @@
const auto* rip = reinterpret_cast<const uint8_t*>(context.Rip());
const uint8_t prefix = rip[0];
if (prefix != 0x66 && prefix != 0xf2) {
if (prefix != 0x66 && prefix != 0xf2 && prefix != 0xf3) {
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restrict 0xf3 to MOVNTSS opcode 0x2b.

Line 729 accepts 0xf3 for every recognized opcode. As a result, F3 0F 78 enters the INSERTQ path, reads two immediate bytes, changes an XMM register, and advances RIP. AMD defines INSERTQ with the 0xf2 prefix, while MOVNTSS uses 0xf3. (amd.com)

Validate the prefix and opcode as one pair before executing the instruction.

Proposed fix
-	if (prefix != 0x66 && prefix != 0xf2 && prefix != 0xf3) {
+	if (prefix != 0x66 && prefix != 0xf2 && prefix != 0xf3) {
 		return false;
 	}
...
 	const uint8_t opcode           = rip[offset + 1];
 	const bool    register_extract = prefix == 0x66 && opcode == 0x79;
-	if (opcode != 0x78 && !register_extract && opcode != 0x2b) {
+	const bool immediate_bitfield =
+	    opcode == 0x78 && (prefix == 0x66 || prefix == 0xf2);
+	const bool memory_store =
+	    opcode == 0x2b && (prefix == 0xf2 || prefix == 0xf3);
+	if (!immediate_bitfield && !register_extract && !memory_store) {
 		return false;
 	}

Also applies to: 741-743

**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#discussion_r4054371725) _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ **Restrict `0xf3` to MOVNTSS opcode `0x2b`.** Line 729 accepts `0xf3` for every recognized opcode. As a result, `F3 0F 78` enters the INSERTQ path, reads two immediate bytes, changes an XMM register, and advances RIP. AMD defines INSERTQ with the `0xf2` prefix, while MOVNTSS uses `0xf3`. ([amd.com](https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/26568.pdf?utm_source=openai)) Validate the prefix and opcode as one pair before executing the instruction. <details> <summary>Proposed fix</summary> ```diff - if (prefix != 0x66 && prefix != 0xf2 && prefix != 0xf3) { + if (prefix != 0x66 && prefix != 0xf2 && prefix != 0xf3) { return false; } ... const uint8_t opcode = rip[offset + 1]; const bool register_extract = prefix == 0x66 && opcode == 0x79; - if (opcode != 0x78 && !register_extract && opcode != 0x2b) { + const bool immediate_bitfield = + opcode == 0x78 && (prefix == 0x66 || prefix == 0xf2); + const bool memory_store = + opcode == 0x2b && (prefix == 0xf2 || prefix == 0xf3); + if (!immediate_bitfield && !register_extract && !memory_store) { return false; } ``` </details> Also applies to: 741-743 <!-- fingerprinting:phantom:medusa:quokka --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:6e1a80ba15ca422c6cbd3e50 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original · reviewed

Actionable comments posted: 5


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 910459e1-b16d-4a9e-9e89-d7b2d3e5fe4c

📥 Commits

Reviewing files that changed from the base of the PR and between f100f785da and 2a5f2c54eb.

📒 Files selected for processing (6)
  • CMakeLists.txt
  • src/graphics/host_gpu/hostMemory.cpp
  • src/libs/audio.cpp
  • src/libs/libAudio2.cpp
  • src/loader/redZonePatcher.cpp
  • src/loader/x64InstructionEmulator.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-19 19:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#pullrequestreview-5257262441) · **reviewed** **Actionable comments posted: 5** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `910459e1-b16d-4a9e-9e89-d7b2d3e5fe4c` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between f100f785dafa108bbf5b40ea8e425e08236f981a and 2a5f2c54eb94787e04ca29a5c38e3616011cfa1b. </details> <details> <summary>📒 Files selected for processing (6)</summary> * `CMakeLists.txt` * `src/graphics/host_gpu/hostMemory.cpp` * `src/libs/audio.cpp` * `src/libs/libAudio2.cpp` * `src/loader/redZonePatcher.cpp` * `src/loader/x64InstructionEmulator.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠ChronoRPG on GitHub · 2026-09-19 21:11 UTC · original

I have a 9070XT and Ryzen 5900X with windows 11, and i cant run this game

Initialized: Config
Initialized: Log
Initialized: Timer
Initialized: Pthread
Initialized: Profiler
Initialized: Network
Initialized: Memory
Initialized: FileSystem
Initialized: Controller
Initialized: Audio
Vulkan pipeline cache: initializing _PipelineCache\PPSA21567.bin
Vulkan pipeline cache: initialized empty
Initialized: Graphics
Title ID: PPSA21567
version = 13
Shaders: VS 0 | PS 0 | CS 1 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 0 | PS 0 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 0 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0
Shader: emitted zero-position clip guard
Shaders: VS 1 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 3 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 4 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 5 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 6 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 7 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 8 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 9 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 10 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 11 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 12 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 1 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 2 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 2 | PS 1 | CS 14 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 2 | PS 1 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 2 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0
Shaders: VS 3 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0
--- Build ---
Source build 4e0c00e
--- Error ---
shader CFG build failed: unsupported decoded instruction in CFG at pc 0x00002190: 0x00002190: unsupported family=MIMG opcode=0xe6 raw=[0xf1989f07 0x00040505 0x4442413d 0x4543403e 0x00004746] reason=MIMG opcode is not implemented in D:\a\KytyPS5\KytyPS5\src\graphics\shader\recompiler\frontend\cfg\ShaderCFG.cpp:40

F:\Emuladores\KytyPS5>

**@⁠ChronoRPG** on GitHub · 2026-09-19 21:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#issuecomment-5745328042) I have a 9070XT and Ryzen 5900X with windows 11, and i cant run this game Initialized: Config Initialized: Log Initialized: Timer Initialized: Pthread Initialized: Profiler Initialized: Network Initialized: Memory Initialized: FileSystem Initialized: Controller Initialized: Audio Vulkan pipeline cache: initializing _PipelineCache\PPSA21567.bin Vulkan pipeline cache: initialized empty Initialized: Graphics Title ID: PPSA21567 version = 13 Shaders: VS 0 | PS 0 | CS 1 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 0 | PS 0 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 0 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shader: emitted zero-position clip guard Shaders: VS 1 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 3 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 4 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 5 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 6 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 7 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 8 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 9 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 10 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 11 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 12 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 14 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 3 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 --- Build --- Source build 4e0c00e --- Error --- shader CFG build failed: unsupported decoded instruction in CFG at pc 0x00002190: 0x00002190: unsupported family=MIMG opcode=0xe6 raw=[0xf1989f07 0x00040505 0x4442413d 0x4543403e 0x00004746] reason=MIMG opcode is not implemented in D:\a\KytyPS5\KytyPS5\src\graphics\shader\recompiler\frontend\cfg\ShaderCFG.cpp:40 F:\Emuladores\KytyPS5>
Author
Owner

@⁠EmulationChannell on GitHub · 2026-09-19 21:39 UTC · original

I have a 9070XT and Ryzen 5900X with windows 11, and i cant run this game

Initialized: Config Initialized: Log Initialized: Timer Initialized: Pthread Initialized: Profiler Initialized: Network Initialized: Memory Initialized: FileSystem Initialized: Controller Initialized: Audio Vulkan pipeline cache: initializing _PipelineCache\PPSA21567.bin Vulkan pipeline cache: initialized empty Initialized: Graphics Title ID: PPSA21567 version = 13 Shaders: VS 0 | PS 0 | CS 1 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 0 | PS 0 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 0 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shader: emitted zero-position clip guard Shaders: VS 1 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 3 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 4 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 5 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 6 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 7 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 8 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 9 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 10 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 11 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 12 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 14 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 3 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 --- Build --- Source build 4e0c00e --- Error --- shader CFG build failed: unsupported decoded instruction in CFG at pc 0x00002190: 0x00002190: unsupported family=MIMG opcode=0xe6 raw=[0xf1989f07 0x00040505 0x4442413d 0x4543403e 0x00004746] reason=MIMG opcode is not implemented in D:\a\KytyPS5\KytyPS5\src\graphics\shader\recompiler\frontend\cfg\ShaderCFG.cpp:40

F:\Emuladores\KytyPS5>
Please apply the patch. Thanks, friend.

**@⁠EmulationChannell** on GitHub · 2026-09-19 21:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#issuecomment-5745490769) > I have a 9070XT and Ryzen 5900X with windows 11, and i cant run this game > > Initialized: Config Initialized: Log Initialized: Timer Initialized: Pthread Initialized: Profiler Initialized: Network Initialized: Memory Initialized: FileSystem Initialized: Controller Initialized: Audio Vulkan pipeline cache: initializing _PipelineCache\PPSA21567.bin Vulkan pipeline cache: initialized empty Initialized: Graphics Title ID: PPSA21567 version = 13 Shaders: VS 0 | PS 0 | CS 1 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 0 | PS 0 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 0 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shader: emitted zero-position clip guard Shaders: VS 1 | PS 1 | CS 2 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 3 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 4 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 5 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 6 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 7 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 8 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 9 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 10 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 11 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 12 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 1 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 13 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 14 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 1 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 2 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 Shaders: VS 3 | PS 2 | CS 15 | GS 0 | LS 0 | HS 0 | TES 0 --- Build --- Source build [4e0c00e](https://github.com/KytyPS5/KytyPS5/commit/4e0c00e3c82d4b0d709051e4e5222a9a3a7ac0ce) --- Error --- shader CFG build failed: unsupported decoded instruction in CFG at pc 0x00002190: 0x00002190: unsupported family=MIMG opcode=0xe6 raw=[0xf1989f07 0x00040505 0x4442413d 0x4543403e 0x00004746] reason=MIMG opcode is not implemented in D:\a\KytyPS5\KytyPS5\src\graphics\shader\recompiler\frontend\cfg\ShaderCFG.cpp:40 > > F:\Emuladores\KytyPS5> Please apply the patch. Thanks, friend.
Author
Owner

@⁠sopsner on GitHub · 2026-09-20 00:57 UTC · original

can you save progress in this fix?

**@⁠sopsner** on GitHub · 2026-09-20 00:57 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#issuecomment-5746555866) can you save progress in this fix?
Author
Owner

@⁠EmulationChannell on GitHub · 2026-09-20 10:24 UTC · original

can you save progress in this fix?
fixed save file progress #659

**@⁠EmulationChannell** on GitHub · 2026-09-20 10:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#issuecomment-5749212554) > can you save progress in this fix? fixed save file progress #659
Author
Owner

@⁠sopsner on GitHub · 2026-09-20 10:53 UTC · original

can you save progress in this fix?
fixed save file progress #659

okay, so there's none for PPSA21567 yet. I guess?

**@⁠sopsner** on GitHub · 2026-09-20 10:53 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/720#issuecomment-5749346974) > > can you save progress in this fix? > > fixed save file progress #659 okay, so there's none for PPSA21567 yet. I guess?
This pull request has changes conflicting with the target branch.
  • src/graphics/host_gpu/hostMemory.cpp
  • src/libs/audio.cpp
  • src/libs/libAudio2.cpp
  • src/loader/x64InstructionEmulator.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/720/head:github-bot/gh-720'
git switch 'github-bot/gh-720'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-720'
git switch 'github-bot/gh-720'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-720'
git switch 'github-bot/gh-720'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-720'
git switch 'main'
git merge --squash 'github-bot/gh-720'
git switch 'main'
git merge --ff-only 'github-bot/gh-720'
git switch 'main'
git merge 'github-bot/gh-720'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.