Skip to content

feat(ngs2): decode complete HE-VAG waveform blocks - #10994

Closed
ElysiaAlarien wants to merge 1 commit into
boykopovar:mainfrom
ElysiaAlarien:feat/ngs2-hevag-rebase
Closed

ElysiaAlarien wants to merge 1 commit into
boykopovar:mainfrom
ElysiaAlarien:feat/ngs2-hevag-rebase

Conversation

@ElysiaAlarien

Copy link
Copy Markdown
Contributor

What

sceNgs2ParseWaveformData and sceNgs2ParseWaveformFile return SCE_NGS2_ERROR_UNKNOWN_WAVEFORM_FORMAT for VAGp data, so a title that passes a VAG file to NGS2 gets an empty waveform and no sound (#5677, Steins;Gate Re:Boot, PPSA36591).

This recognizes VAGp versions 0x20001 and 0x30000 (0x30-byte header, 16-byte channel interleave, waveform type 0x1c) and lets the sampler play them. Complete submitted blocks are decoded to PCM16 with vgmstream's psv_decoder.c, built from the 3rdparty/vgmstream submodule that is already on main, and the existing renderer applies pitch, repeats and mixing. Skipped samples and block repeats work. Embedded loop flags, streaming append, dataless blocks and nonzero configuration data throw. The debt entry lists what is unverified.

This is a rebase of #5797 by @mohdfaour03 onto current main, carried with their commit's authorship credited (Co-Authored-By). #5797 was closed on 2026-10-23 for waiting on a rebase, with an invitation to reopen it. Differences from #5797:

  • no submodule, .gitmodules or packaging change: main already has the submodule at the same commit and already packs its COPYING;
  • the VAG waveform type constant moved from a private copy in Atrac9.cpp to Ngs2Types.hpp;
  • Hevag added to the ngs2 test list on main;
  • the debt entry no longer says VAG block calculation throws, since sceNgs2CalcWaveformBlock handles VAG on main.

Tested

Windows 10, WinLibs GCC 15.2, Release, BUILD_TESTING=ON, on main as of rebase time:

Not tested: PPSA36591 (I do not have it), the full repository test suite, Linux, macOS, and comparison with console output. On #5797, @milescoviello ran PPSA36591 on Linux: 22 HE-VAG waveforms in four shapes parsed and decoded to non-silent PCM with no NGS2 error in 150 s. That run was on the older #5797 head, not on this branch, and it did not compare samples with a console.

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 (PPSA36591 playback is unverified)
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

Recognize VAGp waveforms in sceNgs2ParseWaveformData and
sceNgs2ParseWaveformFile and let the sampler play them. Complete blocks
decode to PCM16 with vgmstream's psv_decoder.c, from the vgmstream
submodule already in the tree, before the existing renderer applies
pitch, repeats and mixing. Embedded loops, streaming append, dataless
blocks and nonzero configuration data throw.

Rebased onto current main from boykopovar#5797: the submodule and packaging
changes are dropped because main already carries them, and the debt
entry no longer says VAG block calculation throws.

Co-Authored-By: Mohd Faour <mohdfaour03@example.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the open PR limit Closed over the open PR limit: 1 without merged PRs, 20 with at least 1, none from 20 label Oct 25, 2026
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Authors with no pull requests merged into main can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

@github-actions github-actions Bot closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open PR limit Closed over the open PR limit: 1 without merged PRs, 20 with at least 1, none from 20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant