Repository navigation
libmpeg (sdkDemux): a demux call after a refused sound packet costs EE time - #158
Merged
Merged
Conversation
….2 ms of EE time With sdkDemux, a sound packet the game's callback refuses (its ring full) ends the demux call, and the next call offers it again, as the SDK does. On the console the player's turn between two calls takes time (the demux, the IPU); here none, so a player spinning until its sound thread made room ran the callback about 9,000 times a field. Shinobido's movies took 23 ms of host time a field and played at 60% speed in the window (and headless 80%), their sound starved. The call after a refusal now costs 0.2 ms (l.callCycles: a pinned time still wins). Shinobido's intro: 102 handlers a field instead of 9,300, 1.4 ms of host time instead of 23, 25 pictures a second in the window; the pictures' EE timing unchanged (30 every 60 vblanks) and the movie's sound without a gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boubou666
pushed a commit
to TheBozos/Shinobido_WOTN_Recomp
that referenced
this pull request
Nov 27, 2026
…the movie spin Movies played at about 60% speed in the window: the player re-offered a refused sound packet about 9,000 times a field, each through the PCM callback's handler. A demux call after a refusal now costs EE time; the intro takes 1.4 ms of host time a field instead of 23 and shows 25 pictures a second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
With
sdkDemux, a sound packet that the game's PCM callback refuses (its ring full) ends the demux call, and the next call offers it again, as the SDK does. On the console the player's turn between two calls takes time (the demux itself, the IPU's decoding). Here it took none, so a player spinning until its sound thread made room ran the callback about 9,000 times a field.Effect in Shinobido: each movie field took 23 ms of host time (dispatches, stops and the stacked handlers). Movies played at about 60% speed in the window and 80% headless, with the sound starved.
Fix: the demux call after a refusal now costs 0.2 ms of EE time (
l.callCycles, so a pinned time still wins). Nothing changes for a stream whose callbacks never refuse.Measured on Shinobido's intro (
NINJA.PSS):🤖 Generated with Claude Code