Skip to content

test(libSceAudioOut): pin the port state of a stereo main port - #414

Open
Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/17554
Open

Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/17554

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#17554, originally opened by xXPBSXx.

Source commit: 22ee940ec11826a0e4ed31608b59e804ec74abe1. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


What

Adds the test audio_out_port_state (new AudioOutPortState.cpp): a main port opened with sceAudioOutOpen(user, 0, 0, 1024, 48000, 1) (16-bit stereo) must report channel == 2, flag == 0 and activeState == 0 from sceAudioOutGetPortState, before and after one output of 1024 silent frames. main already behaves this way, so the test passes on main unchanged and only fixes the console value in place.

The fields output, volume and rerouteCounter are not pinned: the console reported output 0, volume -1 and rerouteCounter 5 there, and AnyPS5 reports 1, 127 and 0.

Tested

Measured on a PS5 with firmware 11.60 (kernel_get_fw_version 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-07 at 04:56 UTC (the console clock was about 1 h 41 min ahead), one run. sceAudioOutGetPortState returned 0 and a 16-byte record with channel 2 and flag and active state 0, the same before and after the output. A title process may differ. The probe source and its raw output are in the first comment.

On Ubuntu 24.04 under WSL2 with an AddressSanitizer and UBSan build (BUILD_TESTING=ON), ctest -R audio_out_port_state passes on main b0e5efb708. Changing AudioOut.cpp so that a stereo port reports 3 channels makes it fail. tools/check_conventions.py --base upstream/main passes.

Overlap: the 20 other open pull requests that change the library's CMakeLists.txt or AudioOutBufferSize.cpp (the files that touch this change's CMakeLists.txt lines) were checked on 2026-11-08 between 21:35 UTC and 21:43 UTC against main 0bae53facd (the base of this change is the older b0e5efb708; it still merges without a conflict, and sceAudioOutGetPortState is unchanged between the two). Four already conflict with main without this change (boykopovar#12863, boykopovar#5021, boykopovar#12315 and boykopovar#14212), and none conflicts only with this change. The other sixteen merge cleanly with and without it, among them boykopovar#17546, boykopovar#16737, boykopovar#16736, boykopovar#16641, boykopovar#16614 and boykopovar#16597.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (audio change)
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added automated coverage for audio output port state, including channel count, activity status, and state after audio submission. No user-facing behavior changes are noted.

xXPBSXx and others added 2 commits November 7, 2026 10:00
A PS5 on firmware 11.60 (payload process) reports 2 channels, flag 0 and active state 0 from sceAudioOutGetPortState for a main port opened as 48 kHz, 1024 frames, 16-bit stereo, before and after one output. Pin those fields.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Audio output port state test

Layer / File(s) Summary
Register and exercise port state test
core/libs/prx/libSceAudioOut/CMakeLists.txt, core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
CMake registers the test executable and configures its dependencies and Windows environment. The test checks the port’s channel count, flag, and active state before and after submitting a 1024-frame silent block at 48 kHz, then checks that closing the port succeeds.

Suggested reviewers: slopgobblercobbler

Change: Other

Merge Risk: Minimal · up to 22ee9

This change adds a regression test for audio output port state and does not alter runtime behavior. No merge-blocking risk was found.

Security architecture risk: Minimal · up to 22ee9

This change tests existing stereo audio port behavior without changing the shipped library, its API, or its deployment.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 2
  • Waived: $0.50 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a3be4b2-56cf-493c-90fc-2becb4c08a00
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 22ee940.

Files selected for processing: 2

  • core/libs/prx/libSceAudioOut/CMakeLists.txt
  • core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp

Limit details: You’ve used all 10 included reviews currently available.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 1 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 2 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 3 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 4 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 5 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 6 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 7 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 8 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 9 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 10 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 11 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 12 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 13 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 14 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 15 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 16 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 17 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 18 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 19 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp
PR 20 core/libs/prx/libSceAudioOut/tests/AudioOutPortState.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants