audio: play dataless and streamed NGS2 PCM waveform blocks for Oricru #1787
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1787
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1787/head"
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?
@PhialsBasement on GitHub · 2026-10-21 15:14 UTC · original
PhialsBasement:fix/oricru-ngs2-pcm-blocks→main· +98 −47 · 2 files · 1 commits · merged 2026-10-22 00:09 UTCGame
The Last Oricru (PPSA04867, 01.005.000)
Problem
The Last Oricru stops before the main menu with:
The sampler rejects any PCM waveform block whose data covers less than its
num_samples. The game submits blocks of that kind, which the NGS2 sampler previously treated as unimplemented.Changes
0x10): a PCM block with flag0x10anddata_size0 playsnum_samplesframes of silence, reports them throughnum_decoded_samplesanddecoded_data_size, and finishes like a complete block. ATRAC9 voices still stop withEXIT_NOT_IMPLEMENTEDfor this case. The existing meaning of0x10together with0x2on ATRAC9 (do not join contiguous data) is unchanged.num_samples, starts a stream. Flag0x2on a PCM voice appends pieces to that stream. While the voice accepts blocks, the stream outputs silence without advancing once it runs out of data. After it is closed, it ends atnum_samplesor at its last appended frame.waveform_datafollows the read position inside the current piece, and played pieces are released.The behaviour follows AnyPS5's implementation of the same cases (boykopovar/AnyPS5#2744 and its streaming PCM support). The real name of flag
0x10and the console's behaviour have not been verified on hardware.Evidence
Tests
ngs2_sampler_testspasses on Linux, including two new cases:TestSilentWaveformBlocks: a dataless0x11block followed by a data block, checking silence, the null read address and published progress.TestPcmStreamAppend: waiting on an open stream, out of order appends, releasing played pieces, ending atnum_samples, and a stream closed before its declared samples.🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-10-21 15:35 UTC · original
📝 Walkthrough
NGS2 PCM blocks now support appended, frame-aligned streaming data and track available frames and pieces. Data-only additions append pieces, and continuation flags control whether more blocks are accepted. Decoder-backed silence blocks can contain no PCM data. PCM decoding waits for stream data, consumes available pieces, and finishes closed streams when drained. Tests cover silent output, appended-piece handling, read addresses, and decoded progress.
Suggested reviewers:
cosmoPriority: ⬆️ High
Change: Bug fix
Merge Risk: 🔵 Low · up to
0e068A late append after a completed stream can abort the emulator. This appears limited to that sequence, but handling it before merge would avoid the crash.
Pre-merge checks:
4 ·
1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-10-21 15:35 UTC · original
On
src/libs/ngs2.cppline 711 (outdated):🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 24005
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 42695
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 42155
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 12795
Handle a late PCM stream append without aborting.
A completed PCM stream is removed from
blocks, butaccepts_blocksremains enabled when the stream used continuation flag0x1. A later guestONLY_DATArequest is forwarded toAppendStream, which then aborts becauseblocksis empty.Limit the no-op behavior to an empty queue. The ordinary-block case is not a regression because the base implementation rejected all PCM
ONLY_DATArequests.Suggested fix
📝 Committable suggestion
@coderabbitai[bot] on GitHub · 2026-10-21 15:35 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
30d864b1-ff59-43e5-a44d-67b151e8a819📥 Commits
Reviewing files that changed from the base of the PR and between
4644c52927and 0e068c3fe20baf4d1f092ffbf1fa5db018709e46.📒 Files selected for processing: 2
src/libs/ngs2.cpptests/Ngs2SamplerTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.