Astro Bot Intel CPU compatibility fixes #720
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!720
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-720"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@nomolao2-cell on GitHub · 2026-09-19 19:11 UTC · original
nomolao2-cell:intel-astrobot-only→main· +366 −15 · 6 files · 2 commits · openProblem
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
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
AFTER
CRASH RIGHT AFTER ASOBI LOGO

BEFORE
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.
@coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original · edited 2026-09-22 19:05 UTC
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
2a5f2c54ebandc84a4fbc3f.📒 Files selected for processing (2)
CMakeLists.txtsrc/libs/audio.cppIncluded 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 AMDRDPRUandCLZEROemulation, SSE4a memory-store handling, platform register access, and red-zone coverage for instructions that may require emulation.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: 🟡 Moderate · up to
c84a4Several 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)
✅ Passed checks (4 passed)
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 helpto get the list of available commands.@ -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);@coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Validate write access before clearing the context buffer.
HostMemoryRangeIsReadableaccepts a read-only mapped range.std::memsetthen 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.@ -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))) {@coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 4947
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 17897
🏁 Script executed:
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
SceAudioOut2Pcmattribute is being passed with the wrong size.For
AUDIO_OUT2_PORT_ATTRIBUTE_ID_PCM, verify:On PS5,
sizeof(SceAudioOut2Pcm)may be larger than 8 becausedatais a 64-bit pointer. Also ensure the SDK headers and binary/ABI match.If this is FMOD with Unreal:
sceAudioOut2PortSetAttributesissues in later releases. [1][2]The reported
valueSize: 8is the main red flag. [1]🌐 Web query:
site:github.com "sceAudioOut2PortSetAttributes" OR "SceAudioOut2Pcm" "SceAudioOut2Attribute"💡 Result:
<search_synthesis>
The symbols
sceAudioOut2PortSetAttributes,SceAudioOut2Pcm, andSceAudioOut2Attributeare 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 thelibSceAudioOutlibrary, 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.SceAudioOut2PcmandSceAudioOut2Attribute: These appear to be related data structures or type definitions used to define PCM audio formats and port attributes, respectively, within thelibSceAudioOutframework [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 includesceAudioOutOpen,sceAudioOutOutput, andsceAudioOutGetPortState[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: 80020002github.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::SceAudioOutgithub.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:
github.com/liuk7071/ChonkyStation4@683d258b/ChonkyStation4/OS/Libraries/SceAudioOut/SceAudioOut.cppgithub.com/liuk7071/ChonkyStation4@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'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:
Repository: KytyPS5/KytyPS5
Length of output: 3821
Return
AUDIO_OUT2_ERROR_INVALID_PARAMfor a malformed PCM attribute.When a PCM attribute has a null, undersized, or unreadable
value, the condition skips the update. The function then returnsOK, so the previouspcm_dataremains active. Reject the malformed attribute instead.Proposed control flow
📝 Committable suggestion
@ -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() ||@coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 13429
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 47259
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 23844
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7994
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 2464
Protect stack-relative emulated instructions.
A live stack-relative
MOVNTSDorMOVNTSSsite is selected as amay_emulate_instruction, then skipped because it usesrsp. The original instruction can therefore raise#UDwithout red-zone protection. Windows exception dispatch may overwrite the SysV red zone beforeTryEmulateSse4aresolves thersp-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.@ -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) {@coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7775
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 6588
Ignore
REX.Bfor the specialmod=00address forms.For
mod=00, r/m=101, the address remains RIP-relative whenREX.Bis set. For a SIB operand withmod=00, base=101, the operand remains a no-basedisp32form.REX.Bdoes not select R13 for either special encoding.The current checks select R13 and omit the
disp32frominstruction_length. A reachable MOVNTSS or MOVNTSD instruction can therefore use the wrong guest address and advance RIP by the wrong length.Proposed fix
Apply both changes in
DecodeSse4aMemoryOperandandResolveSse4aMemoryAddress.📝 Committable suggestion
@ -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) {@coderabbitai[bot] on GitHub · 2026-09-19 19:20 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Restrict
0xf3to MOVNTSS opcode0x2b.Line 729 accepts
0xf3for every recognized opcode. As a result,F3 0F 78enters the INSERTQ path, reads two immediate bytes, changes an XMM register, and advances RIP. AMD defines INSERTQ with the0xf2prefix, while MOVNTSS uses0xf3. (amd.com)Validate the prefix and opcode as one pair before executing the instruction.
Proposed fix
Also applies to: 741-743
@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
f100f785daand2a5f2c54eb.📒 Files selected for processing (6)
CMakeLists.txtsrc/graphics/host_gpu/hostMemory.cppsrc/libs/audio.cppsrc/libs/libAudio2.cppsrc/loader/redZonePatcher.cppsrc/loader/x64InstructionEmulator.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@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>
@EmulationChannell on GitHub · 2026-09-19 21:39 UTC · original
@sopsner on GitHub · 2026-09-20 00:57 UTC · original
can you save progress in this fix?
@EmulationChannell on GitHub · 2026-09-20 10:24 UTC · original
@sopsner on GitHub · 2026-09-20 10:53 UTC · original
okay, so there's none for PPSA21567 yet. I guess?
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.Merge
Merge the changes and update on Forgejo.