feat(ajm): decode ATRAC9 vibration streams #6721
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6721"
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 JJenkx on 2026-10-16T07:09:14Z.
What
Decode ATRAC9 vibration streams in AJM. Ghost of Yōtei PPSA26344 02.002.000 passes configuration
fe 7e 03 f0(channel index 7); the existing decoder rejects it, and the game then divides by zero in audio setup. The new path parses and decodes vibration mono (6) and dual mono (7) using vgmstream's pinned V3 decoder. Ordinary ATRAC9 and discrete multichannel streams keep their existing LibAtrac9 path. Reset, partial-input handling, gapless/sample accounting and PCM16/PCM32/float output use the existing AJM job pipeline.Semantics come from the pinned channel table and decoder and vibration block reader. Build only the two decoder sources from a submodule; release archives include its license. Console PCM rounding and physical controller haptics remain unverified and are recorded in debt.
Tested
Latest rebase:
e7ebd9df1eb3d4ca94d7de1655605407fa784c59on upstream16c607a9373654e1e87c1a809845b1257f6acfed. Three linear commits, no merge commits. The only stopped conflict was additivedocs/dev/debt/libSceAjm.native.mdafter the instance-slot exhaustion entry landed; both entries are retained. Range-diff confirms decoder and test behavior unchanged. Fulllibsand all five AJM test executables build; 5/5 affected checks pass, no skips (1.46 s). Packaging: 28 run, 4 platform-specific skips, no failures. Conventions againstorigin/mainand whitespace pass. Local Linux validation only; no new native title or Windows run. Rebase validation summary.Arch Linux 7.2.9, GCC 16.2.1, Ryzen 9 7950X:
5d9dcc42dplus this change, all five affected checks pass:guest_ajm,guest_ajm_vibration,guest_ajm_teardown,atrac9_config_data,atrac9_gradient.af6f2c37a578renders the PlayStation intro, reaches a loading spinner and closes normally (exit 0, 152.69 seconds, 698 presentations). A single-library negative control, rebuilding only AJM from exact main source with the same build configuration, then loading it against those same graphics libraries, restores native exit 136 after 28.59 seconds. This is not a separate complete main build. Actual library mappings were verified and the temporary kernel limit was restored in both runs.0b8281d50a251: PlayStation intro and loading spinner; normal close, exit 0 after 153.91 seconds, 768 presentations. No inputs or skipped work. The temporary kernel limit was restored.e60dd9d5a) on validation head8476d4030841, all five affected Linux checks pass, including its handle-wrap/decoder-lifetime regression and this PR’s vibration fixtures. Source and tests merge cleanly; both additive debt entries were retained. Exact combined source.Run summaries and limits. Exact combined source.
No gameplay, audio-quality, physical-haptics or performance-gain claim. Native validation includes other open changes; their individual necessity has not been isolated. Full Windows/macOS AJM builds have not been run locally; the standalone Windows decoder probe is described above.
Overlap
#5797 adds the same
3rdparty/vgmstreampath, URL and exact pin for HE-VAG, a separate decoder. Keep that shared dependency once. Both PRs add release-license packaging: when the second merges, combine the consumer condition for AJM and NGS2 and retain a single license entry. There is no decoder-code dependency on #5797. Proposed order: this verified startup fix first, then its additional NGS2 consumer. The new ATRAC9 vibration implementation was not present in the open PR search.#6051 changes instance-ID allocation, independently of vibration decoding. The only conflict when combining it here is the debt-file insertion; keep both entries. Its live-handle regression and this PR’s checks pass together as documented above. No dependency on #6051.
#6044 (
5fa62e596) relocates existing AJM tests totests/media/and changes registrations toadd_library_test(media ...); it does not change their decoder behavior. When combining, move/registerGuestAjmVibration.cppconsistently with that organization and retain the decoder target/link changes. No runtime dependency on #6044.I inspected the archived shared
.gitmodulesand packaging hunks in the older branches listed as not comparable by the bot: they do not add this vibration decoder or the vgmstream path/license. This is a scoped metadata review, not a claim that every old integration branch merges with this PR.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T07:34:12Z.
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.
main)3rdparty/vgmstreamSome comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
.gitmodulestools/package_release.py.gitmodules.gitmodules.gitmodules3rdparty/vgmstreamtools/package_release.pytools/tests/test_package_release.pycore/libs/prx/libSceAjm.native/CMakeLists.txtcore/libs/prx/libSceAjm.native/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T07:52:44Z.
Reviewed the overlap warning. #6051’s production/test changes combine cleanly with this decoder; only the additive debt insertion needs both entries retained. All five affected Linux checks pass on the combined head, including its handle-lifetime regression. #6044 is a test relocation/label change; the new vibration fixture should follow its media directory and registration helper when combining. The shared vgmstream pin and release-license handling with #5797 remain documented in the description. None is a runtime prerequisite for this PR.
I added exact combined source and a separate Windows backend portability probe: the pinned C decoder builds with MinGW, and nine synthetic cases under Wine match Linux PCM16 hashes. This does not claim a full Windows AJM DLL build or native Windows validation. Details, source and limits are now in the PR description.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T18:50:13Z.
Picking this up for our testing: it addresses the stop we see in PPSA26344 on current main, one of the titles we're bringing up, and we'd like to move it into main. We'll review, test and merge it under the normal process. Your comments and review are still very welcome, @adriadam10.
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-20T23:36:46Z.
@oneandonlydean, since you are picking this up: one thing this thread does not have yet. On my install of Ghost of Yōtei (PPSA26344), which has only
playgo-scenario.jsonand no chunk table, the game reaches the config this PR handles only since842bfcce6(#7726). JJenkx's native control on5d9dcc42d, which predates #7726, already ended with exit 136, so installs differ in when they reach it. Below are the bisect and lavapipe runs. They repeat JJenkx's startup result on a different driver; they say nothing new about the decoder.Bisect. I bisected the first-parent merges between
b106f6f8c(good) andb85d972f4(bad), each with the same local commits applied, in 9 steps. A step counted as bad when the AJM trace printedparse config fe 7e 03 f0 -> invalid, and the script stopped the game there (frame 3 to 5). It counted as good when it reached frame 30 with no such line. First bad merge:842bfcce6. With it, the game opens/app0/cache_ps5/loc/noloc.larcand passesfe 7e 03 f0tosceAjmDecAt9ParseConfigData, which returnsSCE_AJM_ERROR_INVALID_PARAMETERwithout writing the output.Three arms on the same tree, one run each, 600 s limit:
parse config fe 7e 03 f0 -> invalid, 0 channels, 0 Hz, then SIGFPE (exit 136) at frame 3. A core dump from an earlier run with the same stop showsdiv esiwithesi = 0in game code.noloc.larcnever opened; no stop before the limit.noloc.larcopened;parse config fe 7e 03 f0 -> ok, 2 channels, 48000 Hz, superframe 128 bytes (4 frames of 256 samples); no-> invalidlines; no SIGFPE; still running at the limit. The five AJM checks also pass on this tree.I did not review #7726 itself. These runs only show that its chunk list lets this install reach the config this PR decodes.
Setup: Release build, Linux (CachyOS, kernel 7.2.9),
llvmpipe (LLVM 23.1.1, 256 bits)from a local lavapipe build of Mesa 26.2.4 that carries one env-gated patch, unset for these runs. Runs usedAPS5_SKIP_REFUSED_DRAWS=1(skips draws the recompiler refuses),APS5_NO_PIPELINE_JOURNAL=1andAPS5_TRACE_AJM=1; frame numbers come from a local env-gated probe. The tree isb85d972f4plus 18 commits: 10 unsubmitted shader and recompiler commits I use for this title on lavapipe, theAPS5_SKIP_REFUSED_DRAWSchange from #8206, and 7 local probe, memory-test and cache-assert commits. By file list, none of them touch AJM, PlayGo or ATRAC9. The cherry-pick applied without conflicts. The PR heade7ebd9df1also merges cleanly into main ata8b92e43c(checked withgit merge-tree, not built).Not checked: plain main without the local commits; runs without
APS5_SKIP_REFUSED_DRAWS; RADV or NVIDIA; more than one run per arm; frame rate or memory differences between arms; audio output, haptics, Windows/macOS; whether the decoded vibration samples match hardware.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T08:49:49Z.
@Dextroid17 thanks, this is useful, and the bisect explains why installs differ. Since #7726, a scenario-only install like yours opens
noloc.larcand reaches thefe 7e 03 f0config at startup, where older trees didn't get that far. That matches what we see on our side: on main PPSA26344 stopped at about 136 s with the same SIGFPE, and with this PR it ran the full 900 s (and 40 minutes in a later run) with no abort on an RTX 4090. It still sits on the loading screen after that, which looks like a separate texture re-upload issue.This is merged now. @JJenkx, thank you for the decoder and the Windows probe.