Repository navigation
Conversation
… no longer crashes at the first note of the ocarina (GetInputStreamState, PurgeInputStream and the statistics, counts and gain calls) The host fails every OpenInputStream (no microphone), and hooks Start, Stop, Close, Read, the filled count and the format. The other input stream calls ran the SDK's code on the stream's Impl pointer, which is null for a stream that never opened: Ocarina of Time purges its two microphone streams when they are not started (main+0x336ee7c, PurgeInputStream), and the SDK function at sdk+0x1f7040 reads [Impl+0x340] first: SIGSEGV at address 0x340, pc=sdk+0x1f7050, lr=main+0x336ee80, on a guest thread (issue seedds#1525, three runs). GetInputStreamState answers closed, PurgeInputStream does nothing, the statistics are zero (returned by value through x8 as for the output stream's), the free and capacity counts are 0 and the gain is 1; SetInputStreamGain ramps nothing.
Closed
seedds
added a commit
that referenced
this pull request
Nov 6, 2026
… no longer crashes at the first note of the ocarina (PR #1527, issue #1525) - The host fails every OpenInputStream (no microphone) and answered start, stop, close, read, the filled count and the format; purge, the statistics, the free and capacity counts and the gain still ran the SDK's code on the stream's null Impl pointer. Ocarina of Time purges its two microphone streams whenever they are not started (main+0x336ee7c), without checking its own opened flag, which only a successful open sets (main+0xf481cc); PurgeInputStream tail-calls InputStreamImpl::Purge, which reads [Impl+0x340] (sdk+0x1f7050, the crash in #1525). - Now the state is closed, a purge does nothing, the statistics are 24 zero bytes (as InputStreamImpl::GetStatistics zeroes its result first), the counts are 0 and the gain is 1. - Host builds; not run in game (needs the ocarina played at a door). Regression run skipped: the hooks answer only calls that faulted on a null Impl, and the state, which the SDK already answered closed. Co-authored-by: lunks <91118+lunks@users.noreply.github.com>
Owner
|
Landed on main as 46404e8, unchanged, with you credited as co-author. I checked the reading against Ocarina's binaries: PurgeInputStream (sdk+0x1f6060) tail-calls InputStreamImpl::Purge on the null Impl, and the game's purge at main+0x336ee10 checks the stream state but not its own opened flag (+0x53a0, set only by a successful open at main+0xf481cc). The statistics hook's 24 zero bytes match what InputStreamImpl::GetStatistics writes. It is not run in game yet, so #1525 stays open for the reporter's run at the Door of Time. |
3 tasks done
2 tasks done
Aeonitis
pushed a commit
to Aeonitis/nxnative
that referenced
this pull request
Nov 7, 2026
…ixes (chain 844bf1a5ea8f, exactly upstream's), raw pool table words at commit (seedds#1427), incremental pool tables (seedds#1489), ocarina input stream (seedds#1527), damaged .zs check (seedds#1530) Conflicts: chain tools and shader_split.py taken from upstream (dmsh_depth.py dropped: upstream compiles the 259-bracket shaders its own way); the build script keeps shader.noindex and takes upstream's progress watch; docs keep both packing entries.
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
… no longer crashes at the first note of the ocarina (PR seedds#1527, issue seedds#1525) - The host fails every OpenInputStream (no microphone) and answered start, stop, close, read, the filled count and the format; purge, the statistics, the free and capacity counts and the gain still ran the SDK's code on the stream's null Impl pointer. Ocarina of Time purges its two microphone streams whenever they are not started (main+0x336ee7c), without checking its own opened flag, which only a successful open sets (main+0xf481cc); PurgeInputStream tail-calls InputStreamImpl::Purge, which reads [Impl+0x340] (sdk+0x1f7050, the crash in seedds#1525). - Now the state is closed, a purge does nothing, the statistics are 24 zero bytes (as InputStreamImpl::GetStatistics zeroes its result first), the counts are 0 and the gain is 1. - Host builds; not run in game (needs the ocarina played at a door). Regression run skipped: the hooks answer only calls that faulted on a null Impl, and the state, which the SDK already answered closed. Co-authored-by: lunks <91118+lunks@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1525.
What and why
The host fails every
OpenInputStream(no microphone) and hooksStartInputStream,StopInputStream,CloseInputStream,ReadInputStream, the filled frame count and the format. The other input stream calls still ran the SDK's own code on the stream's Impl pointer, which is null for a stream that never opened.Ocarina of Time (
0400486024DEC000, v131072) purges its two microphone streams when they are not started. #1525 crashes on the first note at the closed Door of Time (three runs, rumble off in the third):main+0x336ee7cis a call through the import stub atmain+0x3c42250, whose relocation (GOT0x4cbf2f0, read frommain.elf) is_ZN2nn5audio16PurgeInputStreamEPNS0_15InputStreamTypeE. The SDK function atsdk+0x1f7040starts withldr x1, [x0, #0x340], andx0is the null Impl pointer.This adds hooks for the calls that go to the Impl pointer (the same list our own tree has carried since Star Fox):
GetInputStreamState(closed),PurgeInputStream(nothing),GetInputStreamStatistics(zero, returned by value through x8 like the output stream's),GetInputStreamFreeFrameCountandGetInputStreamCapacityFrameCount(0),GetInputStreamGain(1) andSetInputStreamGain(nothing to ramp).Checked
make -C dm/host GAME=0400486024DEC000 dmhostbuilds. Each new symbol is defined once indm/host(no duplicate hook).regress.pynot run: the hooks answer only for a stream that never opened.Docs