Skip to content

fix(libSceAudioOut): give HostGainRamp an implicit default constructor - #13658

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Gonic0:fix/audioout-host-gain-default-ctor
Oct 31, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Gonic0:fix/audioout-host-gain-default-ctor

Conversation

@Gonic0

@Gonic0 Gonic0 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

What

libSceAudioOut does not build with clang since each AudioOut port got its own HostGainRamp (30cca88304). AudioOut.cpp resets a port with port = Port{} in four places, which copy-list-initializes the hostGain member, and the only constructor was explicit with a default argument. clang rejects that with chosen constructor is explicit in copy-initialization (AudioOut.cpp lines 397, 485, 648 and 715 on main 140d55e6a0).

HostGainRamp now has a separate, implicit default constructor that delegates to the one taking the ramp length. That constructor stays explicit, so port.hostGain = HostGainRamp(freq / 100) and the tests are unchanged.

Tested

macOS 27.2, Apple clang 21.0.0, x86-64 Release. main does not build on macOS by itself, so I built in a tree with the open macOS port PRs, where HostGain.hpp is identical to this branch.

  • Without this change, libSceAudioOut fails to compile with the four errors above.
  • With it, libSceAudioOut and the AudioOut test executables build, and the 55 CTest entries matching audio_out|host_gain pass.
  • The other users of HostGainRamp are AudioOut.cpp and libSceAudioOut/tests/HostGain.cpp; neither needed a change.

Not tested on Linux or Windows; the change only adds a constructor overload.

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
  • AI-assisted: yes

🤖 Generated with Claude Code

AudioOut.cpp resets a port with `port = Port{}`, which copy-list-initializes
its HostGainRamp member. With the default argument on the explicit
constructor, clang rejects that ("chosen constructor is explicit in
copy-initialization"), so libSceAudioOut does not build on macOS. The default
constructor is now separate and implicit; the one taking the ramp length
stays explicit.

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

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The added default constructor delegates to the existing 480-frame initialization, while preserving explicit construction with a caller-supplied ramp length.

What I ran

Reviewed head 06c1bee0721a08f816ef94d38ca44bc8341fa315; PR base 9605300f293b88295e223a27ff8cfecf24d7ab2a. The current-main merge preview used target 7fcab08f71e463b1768730a626a0f5472d336708 and was clean. Environment: Linux x86-64, Python 3.11.2, GCC 12.2 available but not invoked. No local C++ build or test was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13658
python3 tools/check_conventions.py --base 9605300f293b88295e223a27ff8cfecf24d7ab2a --head 06c1bee0721a08f816ef94d38ca44bc8341fa315 --title 'fix(libSceAudioOut): give HostGainRamp an implicit default constructor' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13658-06c1bee0721a/pr-body.md
git diff --check 9605300f293b88295e223a27ff8cfecf24d7ab2a...06c1bee0721a08f816ef94d38ca44bc8341fa315
python3 tools/pr_stack_check.py 13658 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-stack-13658
gh pr checks 13658 --repo boykopovar/AnyPS5

Results

Check Result
Source review The new zero-argument constructor delegates to DefaultRampFrames (480); the uint32_t constructor remains explicit. The member is included in the existing Port{} reset sites.
Diff and conventions git diff --check exited 0; convention check passed.
Current-main merge preview Clean against 7fcab08f71e463b1768730a626a0f5472d336708; no declared PR dependency.
Hosted CI Windows, library portability, conventions, eligibility, intake, labels, and report passed. Linux and specialized jobs were skipped.
Precheck wrapper It completed its diff/conventions/mergeability checks, but reports failure because the isolated checkout lacks workspace-only pr_abi_audit.py and pr_test_quality.py. This PR changes no exports or tests, so those helper failures do not assess the constructor change.
Unedited command output

Convention check:

All conventions checks passed.

Stack report:

# PR stack check — fresh

Target: https://github.com/boykopovar/AnyPS5/pull/13658
Target branch tip: `7fcab08f71e463b1768730a626a0f5472d336708`
All heads unchanged: **True**
Dependency order: #13658

## Individual merge previews

- PR #13658: **clean** against current base; head `06c1bee0721a08f816ef94d38ca44bc8341fa315`; changed paths: none reported

## Dependency relationships

No declared PR dependencies were found in the target PR chain.

Hosted checks:

intake	pass	18s	https://github.com/boykopovar/AnyPS5/actions/runs/41135475725/job/124336734303
library-portability	pass	1m48s	https://github.com/boykopovar/AnyPS5/actions/runs/41135476487/job/124336734908
windows	pass	8m27s	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124337933166
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124337935386
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124337935758
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124337934948
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124337935565
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124337935119
conventions	pass	16s	https://github.com/boykopovar/AnyPS5/actions/runs/41135475670/job/124336734552
eligibility	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/41135475975/job/124336732864
labels	pass	8s	https://github.com/boykopovar/AnyPS5/actions/runs/41135475700/job/124336734353
report	pass	34s	https://github.com/boykopovar/AnyPS5/actions/runs/41135476151/job/124336733538

git diff --check emitted no output and exited 0.

Findings

Blocking

None found in the reviewed change.

Non-blocking

The author reports an Apple Clang build and 55 matching AudioOut CTest entries passing in a composed tree with other open macOS port PRs; I did not independently verify that run or its complete tree.

Sources

Not verified

No local build, CTest, or macOS run was performed. Linux and specialized hosted jobs were skipped; the author's composed-tree test evidence was not reproduced.

@github-actions github-actions Bot added the prx label Oct 31, 2026
@adriadam10 adriadam10 self-assigned this Oct 31, 2026
@adriadam10
adriadam10 merged commit 0da91ea into boykopovar:main Oct 31, 2026
12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked that the new default constructor delegates to the existing 480-frame default, the explicit HostGainRamp(std::uint32_t) is unchanged, and the four Port{} resets in AudioOut.cpp plus HostGainRamp(freq / 100) still resolve; no behaviour change. Conventions and Windows green; merged.

@SHOnnay

SHOnnay commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Compile check on macOS (Apple M1, macOS 27.0.1 (26A434), Apple Clang 21.0.0, x86-64 target). Baseline upstream/main 5a14a6c with #13220 merged locally; this PR merged on top.

Compiling core/libs/prx/libSceAudioOut/src/AudioOut.cpp with -fsyntax-only (flags replayed from the full build):
before: 4 errors at AudioOut.cpp:397, 485, 648, 715, "chosen constructor is explicit in copy-initialization" (exit 1)
after: 0 errors, exit 0; the same 7 existing warnings before and after.

By inspection the default constructor still configures 480 frames and the explicit-length constructor is unchanged; this is shared code, so Windows and Linux are affected, but I did not compile them. This is a syntax check, not a runtime test.

AI-assisted (Codex); I reviewed the logs.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants