Skip to content

feat(libSceAjm): support ratio ramp in sceAjmBatchJobSetResampleParametersEx - #5647

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
pushkarreddyy:feat/ajm-resample-ratio-ramp
Oct 14, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
pushkarreddyy:feat/ajm-resample-ratio-ramp

Conversation

@pushkarreddyy

Copy link
Copy Markdown
Contributor

What

Supports linear sample-rate ratio ramping across emitted output frames in sceAjmBatchJobSetResampleParametersEx for libSceAjm.native:

  • Extends Resampler state to track change (ratio_change_per_sample).
  • Updates ResamplerProduce to linearly adjust ratio by change on each emitted output sample frame, clamped at 0.0f.
  • Updates JobKind::SetResampleParameters to parse both ratio and change from job.parameters.
  • Updates sceAjmBatchJobSetResampleParametersEx to validate ratio_start (isfinite, > 0.0f) and ratio_change_per_sample (isfinite), packing both parameters into the batch header.
  • Documents linear ratio ramp behavior and platform assumptions in docs/dev/debt/libSceAjm.native.md.

Tested

  • Added unit tests in core/libs/tests/GuestAjm.cpp under TestResampleParametersEx:
    • Validates rejection of non-finite or non-positive ratio_start (0.0f, -1.0f, NaN, INFINITY) with 0x80930005.
    • Validates rejection of non-finite ratio_change_per_sample (NaN, INFINITY, -INFINITY) with 0x80930005.
    • Validates dynamic ratio ramping across decoded MP3 frames (1.0f start, 0.001f change over 512 samples ramping to ~1.512f), confirming output PCM generation and verification via sceAjmBatchJobGetResampleInfo.
  • Verified conventions check with 0 findings and 0 errors:
    • python tools/check_conventions.py --base origin/main

Checklist

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Progress report (63fb0cd → 3faeae8)

📉 System libraries: 88.33% (-0.03%, -1 reverted functions)

⚠️ 1 went back to stubs
Library Name
libSceAjm.native sceAjmBatchJobSetResampleParametersEx

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked build + ctest (guest_ajm and the Ajm tests pass) and that the new test fails without the change.

Added one commit: the TechnicalDebt line stated the ramp rule as fact, but no source confirms it (KytyPS5 ignores the change, prosper stubs it, and the console does not export the batch builders, per #3468). It now says it is assumed: added after each emitted output frame, clamped at zero, kept across batches. Merging once CI is green.

@adriadam10
adriadam10 force-pushed the feat/ajm-resample-ratio-ramp branch 2 times, most recently from 803d30b to 3faeae8 Compare October 14, 2026 13:08
@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Thanks @adriadam10! All CI checks (conventions, eligibility, report) are green and passing cleanly.

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked build + ctest (guest_ajm and the Ajm tests pass) on the current head; the only change since the last review is the TechnicalDebt wording that marks the ramp rule as assumed. Merging once the full Build is green.

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Thanks @adriadam10 its passing now ready for merging

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on the current head merged onto main: build and guest_ajm pass, and the new test fails without the change. The ramp rule (added after each emitted output frame, clamped at zero, kept across batches) is recorded as assumed in the TechnicalDebt entry, since no source confirms it. Merging once the full Build is green.

@adriadam10
adriadam10 merged commit 8dfaafe into boykopovar:main Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants