Repository navigation
fix: expand %VAR% environment variables in path resolution + AudioOut2 state parity (ASTRO BOT sound init) - #3959
StarMrGamer wants to merge 2 commits into
Conversation
Fixes sound system assertion crash in ASTRO BOT by: - Adding ExpandEnvironmentVariables() to resolve %VAR% syntax in paths - Setting AudioOut2Port portType to match PS5 specification - Setting AudioOut2SpeakerArray to match PS5 specification Without ASOBI_ROOT environment variable, paths like /host/%ASOBI_ROOT%/ fail to resolve, causing sound config load failure and assertion at SoundManager.cpp:306. This fix enables proper path resolution when ASOBI_ROOT=app0 is set. Issue: boykopovar#3480
|
Tested the Demon's Souls PPSA01342 v1.04 calls
|
|
Thanks for digging into ASTRO BOT. A few things before this can go in:
AI-assisted: yes. Written with AI assistance (Claude Code); I reviewed it. |
|
Thanks for the review — all fair points, and the
One question: for the environment fix, do you want the value served from AnyPS5's app-info/system-parameter layer (so titles see the same root the OS would give), or is there an existing convention in the repo for title-root variables we should follow? Written with AI assistance. |
|
Closing in favor of #4274. This PR combined two changes:
The root cause was that ASTRO BOT calls getenv("ASOBI_ROOT") to expand path tokens, and without the variable the paths fail. PR #4274 provides ASOBI_ROOT in the guest environment, which is the correct fix. The AudioOut2 changes here were exploratory and are not required for the title to boot. If they prove necessary for later stages, they can be submitted separately with evidence. |
The problem. ASTRO BOT (PPSA21564) dies during start-up. Its own SoundManager asserts
defaultBusses.size() == 1(SoundManager.cpp:306) and the game exits. The cause: the game builds its sound-config paths with a%ASOBI_ROOT%token in them (for example<root>/target/data/common/sound/config.xml). AnyPS5's path resolution passed that token through literally, so the config lookup failed, the sound system never loaded its bus definitions, and the assertion fired. Without those definitions the game also grew to ~13.9 GB in about 20 seconds and then crashed.What this changes.
core/libs/prx/libc/src/General.cpp— path resolution now expands%VAR%environment variables (via the PS5 environment lookup) before resolving a path. WithASOBI_ROOTset, the sound config is found and the sound system initialises normally.core/libs/prx/libSceAudioOut/src/AudioOut2Port.cppandAudioOut2SpeakerArray.cpp—sceAudioOut2PortGetState/sceAudioOut2GetSpeakerInfonow report the same state a real PS5 reports:output= main, channel count taken from the port's own data format, volume at max, and a stereo speaker layout with the two front angles. Previously these were fixed placeholder values.core/libs/tests/AudioOut2PortState.cpp— new regression test: creates a real port and checks the returned state against the port's format. It fails on the previous values and passes with the change.Verification (Linux, CachyOS, gcc 16.2.1, RX 7800 XT / RADV).
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R 'audio_out|audioout').tools/check_conventions.py --base origin/main: all checks passed.Notes. The game needs
ASOBI_ROOTset in the environment (this is the title's own requirement, the same as on hardware). Could not verify Windows or macOS. Rendering is a separate open issue (the game's scene currently renders black during start-up; tracked separately).Related: #3480.
Written with AI assistance.