Skip to content

feat(ngs2): accept an empty waveform block list before voice setup - #5785

Closed
p3n1cillin wants to merge 1 commit into
boykopovar:mainfrom
p3n1cillin:claude/ngs2-empty-waveform-blocks
Closed

p3n1cillin wants to merge 1 commit into
boykopovar:mainfrom
p3n1cillin:claude/ngs2-empty-waveform-blocks

Conversation

@p3n1cillin

Copy link
Copy Markdown
Contributor

What

Void Terrarium (PPSA03061) stops a few seconds after its title screen, once a menu choice starts a new scene:

terminate called after throwing an instance of 'std::invalid_argument'
  what():  AddWaveformBlocks: invalid argument

A local log of the failing call showed:

rack=0x1000 channels=0 type=0x0 flags=0x0 num_blocks=0 blocks=<non-null> data=<non-null>

The title sends SCE_NGS2_SAMPLER_VOICE_PARAM_ADD_WAVEFORM_BLOCKS with zero blocks and flags 0 to a sampler voice that has no waveform format set up. AddWaveformBlocks rejected any voice without channels, even when there was nothing to add.

KytyPS5's AddWaveformBlocks, which this library already cites for the sampler, handles this case without any check on the voice's format:

  • With a count of 0 its block loop adds nothing.
  • It then sets accepts_blocks from the CONTINUE flag and returns OK.
  • It uses the channel count only to check each block's size.

So now:

  • Empty, non-append list before setup: an empty block list that doesn't append on a voice without channels adds nothing. It updates whether the voice still accepts blocks (here, the voice is closed), as KytyPS5 does. Setting the voice up resets that, as before.
  • Blocks or appended stream data before setup: still rejected with an invalid-argument error, since they need the format to be sized.

Tested

Checklist

🤖 Generated with Claude Code

Void Terrarium (PPSA03061) adds zero waveform blocks with flags 0 to a
sampler voice it has not set up. KytyPS5 adds nothing in that case and
only records whether the voice still accepts blocks, so do the same
instead of rejecting the voice for having no channels. Blocks or
appended stream data before setup are still rejected.

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

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #5660, which makes the same AddWaveformBlocks change and opened first. I've posted my Void Terrarium evidence and the KytyPS5 reference there.

@p3n1cillin p3n1cillin closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant