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

Merged
pushkarreddyy merged 2 commits from upstream-pr/5647 into main 2026-10-14 14:26:20 +00:00
pushkarreddyy commented 2026-10-14 03:32:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-14T03:32:45Z.


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

  • Depends on: none
  • Unblocks: PPSA01599 #3468
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4852554648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-14T03:32:45Z. --- ### 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 - [x] Depends on: none - [x] Unblocks: PPSA01599 #3468 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-14 03:33:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T03:33:26Z.


Progress report (63fb0cd → 3faeae8)

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

⚠️ 1 went back to stubs
Library Name
libSceAjm.native sceAjmBatchJobSetResampleParametersEx
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6160278374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647#issuecomment-6160278374). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T03:33:26Z. --- <!-- progress-report --> ### Progress report (63fb0cd → 3faeae8) 📉 **System libraries**: 88.33% (-0.03%, -1 reverted functions) <details> <summary>⚠️ 1 went back to stubs</summary> | Library | Name | | - | - | | libSceAjm.native | `sceAjmBatchJobSetResampleParametersEx` | </details>
adriadam10 commented 2026-10-14 13:08:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T13:08:21Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169093774 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647#issuecomment-6169093774). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T13:08:21Z. --- 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.
pushkarreddyy commented 2026-10-14 13:30:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-14T13:30:06Z.


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

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169515329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647#issuecomment-6169515329). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-14T13:30:06Z. --- Thanks @adriadam10! All CI checks (`conventions`, `eligibility`, `report`) are green and passing cleanly.
adriadam10 commented 2026-10-14 13:34:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T13:34:06Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169592519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647#issuecomment-6169592519). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T13:34:06Z. --- 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 commented 2026-10-14 13:54:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-14T13:54:22Z.


Thanks @adriadam10 its passing now ready for merging

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170012505 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647#issuecomment-6170012505). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-14T13:54:22Z. --- Thanks @adriadam10 its passing now ready for merging
adriadam10 commented 2026-10-14 13:58:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T13:58:34Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170103103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5647#issuecomment-6170103103). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T13:58:34Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5647
No description provided.