Repository navigation
1.0.6: output audio at 29.97 / 59.94 frames/s on the TAI sample grid - #24
Merged
Merged
Conversation
The output's audio read position was frame index x floor(48000 / rate) samples: 1601 instead of 1601.6 at 29.97, 800 instead of 800.8 at 59.94. At today's TAI frame indexes that is 7.8 resp. 20.7 days behind the sample index the sources write, so these outputs played silence for good. The position is now a frame number; each frame's block runs from the 48 kHz sample index of the frame's TAI start to that of the next frame (mxlTimestampToIndex(48000, mxlIndexToTimestamp(frame rate, k))), giving the 1602/1601 and 801/800 cadence. Scratch buffers are reserved for the largest block, and the read-offset cap uses it. Whole rates (25, 50, 24, 30, 60, 23.98) give exactly the same sample indexes as before. Rebased on #23: its interlaced output test now requires sound for NTSC too, and the NMOS ANC source's grain_rate uses the field rate like its flow (ancRateOf). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01St7QwmonpoG9EEEqaLFXLi
LeeO86
force-pushed
the
fix/audio-ntsc-rates
branch
from
October 16, 2026 10:07
db634c5 to
2272cba
Compare
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.
Rebased on
mainafter #23 (3668151).Bug (pre-existing): an output's audio read position was
frame index × floor(48000 / frame rate)(output_channel.cpp528, 620, 653, 963, 1127, 1224). At 29.97 that is 1601 instead of 1601.6 samples per frame, at 59.94 800 instead of 800.8. At today's TAI frame indexes the position is about 7.8 days (29.97) or 20.7 days (59.94) behind the sample index the sources write, far outside the ring, so every 29.97/59.94 output (progressive or interlaced) played silence for good.Fix:
_audioEndFrame). Frame k's block runs fromutil::audioSampleIndexOfFrame(rate, k)=mxlTimestampToIndex(48000, mxlIndexToTimestamp(rate, k))to the same for k + 1: the 1602/1601 cadence at 29.97 and 801/800 at 59.94 (8008 / 4004 samples per 5 frames). Slips, catch-ups, preroll and the out-of-ring reset move the frame number as before.ceil(48000 / rate)) at bring-up; the read-offset cap uses the largest block.Tests (120/120 locally):
grain_rateusesancRateOflike its flow (field rate for interlaced modes).Version 1.0.6 (CMakeLists, version.hpp, deploy manifest), CHANGELOG, SPECIFICATION §2.4 lip-sync text.
🤖 Generated with Claude Code
https://claude.ai/code/session_01St7QwmonpoG9EEEqaLFXLi