fix(libSceAudioOut): report the port's channel count from sceAudioOut2PortGetState #4778
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4778"
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?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T21:35:47Z.
What
sceAudioOut2PortGetStatereported the two channels of the host output for every port. It now reports the channel count of the port's data format, and clears the whole state first so the reserved fields no longer keep the caller's stack contents. Output (main), volume (127), reroute counter and flags are unchanged.The channel count follows SharpEmu, another emulator. There is no console measurement for it; this is recorded in
docs/dev/debt/libSceAudioOut.md.New test
audio_out2_device_statecoverssceAudioOut2PortGetState(mono, stereo float and S16, 7.1, 7.1.4; invalid and destroyed handle; null state),sceAudioOut2GetSpeakerInfoandsceAudioOut2GetSystemState(null checks and reported values). None of the three had a test before.Related to #4317 (ASTRO BOT PPSA21564, ASTRO's PLAYROOM PPSA01284: assertion
prop->m_pParent == this). That issue has an A/B in which the reported AudioOut2 state decides the assertion, but it has not isolated which field;GetSpeakerInfoandoutputalready match onmain, so the channel count is the only remaining difference to the values described there. This PR does not claim to fix the assertion.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, built and run on
mainffa198407:audio_out2_device_state,audio_out2_port_layouts,audio_out2_port_buffers,audio_out2_pad_mix,audio_out2_latencyandaudio_out2_timingpass (6 of 6).audio_out2_device_statefails without the change toAudioOut2Port.cpp(the mono port reports 2 channels).The branch is rebased onto
main584cc4c57without a conflict in the code (TechnicalDebt.mdmoved todocs/dev/debt/, so the entry is indebt/libSceAudioOut.md). I did not rebuild on thatmain: it needs the newlibusb-cmakesubmodule, which is not available here.python tools/check_conventions.py --base upstream/mainpasses on the rebased branch.The current head
72fae2087is based on6d7b87370, a later rebase than the one described above; it was not rebuilt (not recorded).git merge-treeof it againstmain068ab2aba(13 October) is clean. The overlap bot lists #5119 fordocs/dev/debt/libSceAudioOut.mdL18, the debt file this change also touches; whichever lands second needs a small rebase there.No title run; ASTRO BOT and ASTRO's PLAYROOM are not available here. Linux not tested. Ports of other types (pad routes) are not covered by the test;
outputstays main for them, as before. A search of open PRs forsceAudioOut2PortGetStatefound only this one.Checklist
Based on current
main; no other open PR implements the same functionsOne topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (
NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebtNo notes, investigation
.mdfiles or images added to the repositoryNew third-party code is a submodule built from source (none added)
Generic behaviour, not specific to one title
Depends on: none
Unblocks: none
AI-assisted: yes
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-13T06:10:53Z.
Linux test (Arch, GCC 16.2.1, Release, PipeWire), this PR merged onto
main7e181fcc3(clean merge): all 10audio_out*tests pass, includingaudio_out2_device_state. WithAudioOut2Port.cppput back tomain's version,audio_out2_device_statefails on Linux too, so the new check guards the change on both systems. No title run.Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T11:11:25Z.
Linux validation (Ubuntu 24.04, GCC 13.3, Release), this PR's commit on
mainat77b9f7270:audio_out2_device_statepasses. Withmain's sources and this PR's test it aborts, so the test catches the reported channel count.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T21:18:35Z.
Thank you for the Linux validations, @nicolasfalesy and @coltken95. Noted for the record: the overlap bot lists #5119 for
docs/dev/debt/libSceAudioOut.mdL18; whichever PR lands second needs a small rebase there. No change to the code.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:08:20Z.
Checked on this PR merged onto main: build and ctest of libSceAudioOut (12/12) pass, and
audio_out2_device_statefails withAudioOut2Port.cppreverted. Linux runs from @nicolasfalesy and @coltken95 agree. The channel count follows another emulator only, which the debt entry records; merging.