mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 21:29:58 -04:00
A frame that was not rendered when it was due stayed lost: the timer set its deadline to now once it was more than 100 ms late, and the device-paced path only filled the ring to its target again, so after every gap the sound was heard that much later than the picture it belongs to. Frames that are owed are now rendered and dropped: mixed in full, so the voices, the effects and the sinks the game reads back advance, and not queued for the device, whose queue is filled to the same target afterwards. While the device paces, what is owed is the silence it played for want of frames, counted in its own samples from an underrun until the prefill is queued again; the wait for the first prefill and anything owed across a stop do not count. On the timer a frame is owed when its deadline passed a whole frame ago. A gap of more than 3 seconds is not caught up: the sound goes on from now. NX2NAVI_AUDIO_CATCHUP=0 turns it off and keeps the old timing. The audio statistics line counts the catch-up frames and the gaps that were too long, and tests/audio_mixer_check.py checks the device's side of the accounting. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 KiB
11 KiB