Repository navigation
obs-core: Port the audio tick arithmetic (#1903) - #1909
Merged
Merged
Conversation
Two cases for the core that the next commit splits out of mix_audio(), set_fixed_audio_buffering() and add_audio_buffering(), so the Rust port can take plain values without mirroring struct obs_source or struct obs_core_audio: - obs_audio_mix_add() on plain buffers and an audio_ts of its own, with no source: the same mix as the source path from frame 511 (frame 512's time at 48 kHz), and nothing at the end of the tick. obs_audio_mix_time_to_frames() rounds down as convert_time_to_frames(). - obs_audio_buffering_fixed() and obs_audio_buffering_add() on standalone fields, with no struct obs_core_audio: nothing at the maximum (added false); fixed from 0 adds 45 ticks (960 ms at 48 kHz); 5 ticks late with room for 2 is cut at the maximum (max_reached, 42 ms); one sample late at 44.1 kHz is one tick (23 ms); a sub-sample delay adds 0 ticks and 0 ms and leaves ts. The ms values are the ones obs-audio.c logs. The 16 existing cases are unchanged. This does not build yet: the core and obs-audio-mix.h do not exist. Refs obs-rust#1903 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The seam before the Rust port of the audio tick arithmetic (obs-rust#1903): the core it ports takes the source's and the core's fields from the caller, as obs_scene_audio_actions_apply() takes the item's fields (obs-rust#1825), so Rust never mirrors struct obs_source or struct obs_core_audio. libobs/obs-audio-mix.c.h is now that core, declared in the new libobs/obs-audio-mix.h: - obs_audio_mix_time_to_frames(sample_rate, t): convert_time_to_frames(); - obs_audio_mix_add(mixes, buf, audio_ts, ts, channels, sample_rate): the window and the add loop of mix_audio(), on the source's audio_output_buf and audio_ts; - obs_audio_buffering_maxed(), obs_audio_buffering_fixed() and obs_audio_buffering_add(): the buffering steps on struct obs_audio_buffering, the buffered_ts, buffered_timestamps, buffering_wait_ticks and total_buffering_ticks fields of struct obs_core_audio by pointer, and max_buffering_ticks. They push the new windows to the deque in place and return struct obs_audio_buffering_step (added, max_reached, ticks, ms, total_ms). struct ts_info moves into that header. The core takes no lock, logs nothing and calls nothing in libobs. convert_time_to_frames(), mix_audio(), audio_buffering_maxed(), set_fixed_audio_buffering() and add_audio_buffering() go back into obs-audio.c.h as static wrappers with their old signatures: they pass the fields and log the step. The log lines and their values are unchanged; "Max audio buffering reached!" and the info line now come after the windows are pushed, not before. The per-tick DEBUG_AUDIO lines (compiled out) become one "new buffered ts" line. The declarations that the move added to obs-internal.h go. The one behaviour difference is in a state libobs does not reach: with a total above the maximum, the fixed path looped on a negative tick count and left ts->end uninitialized; the core starts from *ts. The header joins libobs.pch.h and source-sets.json. The core stays in libobs.core-output. No exported symbol changes (1766); the core functions are local symbols. test_audio_buffering_subsample builds unchanged and passes 18/18 on libobs and libobs-c-reference; test_audio_clock_drift (6), test_audio_sync_offset_change (5) and test_audio_capture_mix_race (2) pass on both. Refs obs-rust#1903 Co-Authored-By: Claude Opus 5.5 <[email protected]>
RED for the port of libobs/obs-audio-mix.c.h, the arithmetic of the audio tick (obs-rust#1903), to a new module, audio_mix, of rust/obs-core. The safe core is a stub (todo!()): TsInfo (struct ts_info), Buffering (the buffering fields of struct obs_core_audio by value), Step (struct obs_audio_buffering_step), time_to_frames(), mix_start() and mix_into() (the window and the add loop of obs_audio_mix_add() for one mix and channel), buffering_maxed(), buffering_fixed() and buffering_add(), which push their windows through a callback. tests/obs_core/audio_mix.rs ports test_audio_buffering_subsample 1:1, under the same case names, in the same order, with the same inputs and expectations: all 18 cases. struct obs_core_audio is a Buffering plus a Vec queue whose front is index 0; mix_all() is the loop of obs_audio_mix_add() over the mixes and channels. Samples compare bit for bit. New edge cases (edge_*): audio after frame 1024 of a two-tick window, the add loop on short slices, a rate of 0, a total above the maximum, timestamps that wrap, and a proptest that no input panics and that no call pushes more than max - total windows (a sum that overflows int must still be cut at the maximum). cargo test -p obs-data --test obs-tests-core obs_core::audio_mix fails 24 of 24 with "not yet implemented". Refs obs-rust#1903 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports libobs/obs-audio-mix.c.h, the arithmetic of the audio tick on plain values (obs-rust#1903), to the audio_mix module of rust/obs-core. The source and core side stays C in obs-audio.c.h: the source walk, the locks, the logging, and the static wrappers that pass the source's audio_output_buf and audio_ts and the buffering fields of struct obs_core_audio. The hybrid libobs drops the C core and links the Rust shims in its place. Safe core (src/audio_mix.rs): - time_to_frames(): floor(t * rate / 1e9) through util_mul_div64 as the C computes it on each host (written out here, saturating on MSVC x64 where the C faults, 0 for a divisor of 0); - mix_start(): the frame the source's audio starts on, None outside the tick or from frame 1024 on; mix_into(): the add loop of one mix and channel over slices, element by element in the C's order, so every sum is bit for bit the C's; - buffering_maxed(), buffering_fixed() and buffering_add(): the ticks, the cut at the maximum, the windows (pushed through a callback, each one tick before the last) and the step with the ms values obs-audio.c logs. The int and uint64_t arithmetic is the C's: wrapping timestamps, the (int) truncation of the tick count, the int-to-size_t conversion of the ms values. It keeps no state, takes no lock, and denies clippy's panic, indexing and arithmetic lints. Shim (src/ffi/audio_mix.rs): the five functions keep the C signatures. struct ts_info, struct audio_output_data, struct obs_audio_buffering and struct obs_audio_buffering_step are mirrored #[repr(C)]. The buffering shims read the fields through their pointers, push each window to the front of the C struct deque in place through obs_util::ffi::deque (bmem memory, so obs.c frees it with deque_free as before), and write the fields back (obs-core already depends on obs-util). Kept, characterized, not endorsed (obs-rust#1905): times round down twice, so a frame's own time can map to the frame before it; the maximum is equality only; a sub-sample delay is an added step of 0 ticks and 0 ms. Intentional differences, where C has undefined behaviour and libobs never gets there: audio past frame 1024 of a window longer than one tick adds nothing (the C makes an out-of-range pointer); a total above the maximum, or a tick count whose sum with the total overflows int, pushes at most max - total windows (the C loops); a rate of 0 gives 0 frames, windows and ms (the C divides by 0); null pointers do nothing; channels above MAX_AUDIO_CHANNELS is cut to it; on MSVC x64 an overflowing quotient saturates (the C faults). C side: the file leaves libobs.core-output for its own group, libobs.ported-audio-mix (LIBOBS_PORTED_SOURCES), whose PCH is obs-audio-mix.h with media-io/audio-io.h and util/util_uint64.h. The five functions are not EXPORT, so the shims are hidden: rust-hidden.txt, the local: list of rust-exports.map and rust-unexports-macos.txt. ci/test_ported_sources.py checks the group on every host. Tier 1 obs_core::audio_mix passes 24/24. Refs obs-rust#1903 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Oracle (oracle/audio_mix.c): the original obs-audio-mix.c.h, unmodified, with its five functions renamed to oracle_*, plus the layout of struct ts_info, struct audio_output_data, struct obs_audio_buffering, struct obs_audio_buffering_step and struct deque, and AUDIO_OUTPUT_FRAMES, MAX_AUDIO_MIXES, MAX_AUDIO_CHANNELS and sizeof(int). util_mul_div64, the audio-io.h time helpers and deque_push_front stay the header inlines, so the oracle pushes with the C's deque code and the shim with the Rust port, into the same bmem allocator. Tier 3 (tests/obs_core/audio_mix_parity.rs): both sides get the same inputs through their C signatures and are compared: - the layout; - obs_audio_mix_add on every start frame at 44.1 and 48 kHz, on the frame's time and 1 ns either side, and on 4096 random cases (windows of one and two ticks, audio before, on, inside, at the end of and after them, 0 to 8 channels, rates from 8 kHz to 400 kHz, start times near 0 and near u64::MAX): every sample of the 6 mixes and 8 channels, bit for bit, from the same random start values and source audio; - obs_audio_mix_time_to_frames on 20 000 random rates and times, including rates where util_mul_div64 wraps (not on MSVC x64); - obs_audio_buffering_maxed, _fixed and _add on 210 chosen and 20 000 random cases (totals up to the maximum, waiting ticks, delays from 0 ns to beyond the maximum and huge, timestamps near 0 and u64::MAX, 0 to 4 queued windows): the step, the three fields, ts, the struct deque fields (size, start, end, capacity) and every window in the queue. Excluded, the intentional differences: audio past frame 1024 of a longer window (only the shim runs; the mix must stay as it was), a delay whose int tick count is negative or overflows the total (only the shim runs; it must push at most max - total windows), a rate of 0 in the buffering steps and null pointers (Tier 1). port_comparison (benches/port_comparison/audio.rs): a stereo mix of a whole tick and of a tick from frame 300 into all 6 mixes, time to frames, and one added buffering tick on a queue popped back after each call. Mutation check (done once, not committed): 20 of 21 mutants fail Tier 1 or Tier 3. Core: the window end inclusive; = instead of +=; the start frame ignored; ticks rounded down; the cut only above the maximum; max_reached not set; one window too many; ms from the total; buffered_ts always reset; windows from the next tick; maxed as >=; exact 128-bit util_mul_div64; the ms as an unsigned int; fixed keeping the old total. Shim: total, waiting ticks or ts not written back; channels ignored or one short; windows pushed to the back. The survivor, frame 1024 mixed, is equivalent: a start of 1024 leaves no frame to add. obs_core::audio_mix and audio_mix_parity pass 30/30 on macOS arm64 and Linux x86_64 (all of obs_core: 86/86). port_comparison on Linux x86_64 (CT104, pinned to one core, criterion median, Rust / C): audio_mix/mix_whole_tick 1.051 us / 1.089 us audio_mix/mix_from_frame_300 700.4 ns / 759.7 ns audio_mix/time_to_frames 1.827 ns / 1.700 ns audio_mix/buffering_add_one_tick 30.74 ns / 25.70 ns The mix runs every tick for every root source; the buffering step only when a source falls behind. Refs obs-rust#1903 Co-Authored-By: Claude Opus 5.5 <[email protected]>
vpacher
added a commit
to vpacher/obs-studio
that referenced
this pull request
Oct 25, 2026
…MSVC (obs-rust#2420) audio_min_ts_parity::insufficient_matches draws the sample rate from all of usize. On MSVC x64 the C's util_mul_div64 is exact 128-bit math (_umul128 / _udiv128), which faults with STATUS_INTEGER_OVERFLOW when the quotient does not fit in 64 bits, so the C oracle crashed the whole obs-tests-core binary on windows-2025 (seen on obs-rust#2411, whose oracle change pulls obs-tests-core into the changed-crates run). The shim saturates there, so only the oracle faults. On MSVC x64 the rate now stays below 1e9, so t * rate / 1e9 fits for any t, as audio_mix_parity does since obs-rust#1909. Other hosts keep the full range (util_mul_div64 wraps there, and both sides wrap the same way). audio_discard_parity keeps its rates below 384 kHz and is not affected. Refs obs-rust#2405 Co-authored-by: Claude Opus 5.5 <[email protected]>
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
) * test(obs-core): Make audio_discard_parity's random cases cheap and fewer random_cases_match took 147.9 s in Fast Gate (58 s on an M-series Mac), the slowest test of the step (obs-rust#2891). Two changes: - Each side built its 8 input deques with one deque_push_back() per f32 (up to 3,200 frames per channel) and read them back with one deque_pop_front() per f32: about 100,000 calls per case. Source::new now reserves the capacity that pushing one f32 at a time from empty reaches (4 bytes doubled until it fits) and pushes each channel once; end() pops each deque once. Each deque starts in the same state as before (start 0, end at the size, the same capacity) and the same samples come back. The new one_push_matches_one_push_per_sample checks that for 0 to 300 frames and the power-of-two edges up to 3,199. With 20,000 cases: 58 s to 11 s. - 20,000 cases to 1,000. The 19 mutants of obs-rust#2404, rebuilt and run again: every one still fails the audio_discard tests. Run against random_cases_match alone, 5 runs each, 16 fail within 125 cases in every run. The other 3 (no 1 ns adjustment, in sync as `>`, the shim clearing timing_set only with the warning) need an exact boundary that random inputs do not reach: at 20,000 cases two never failed and one failed in 1 of 2 runs. The chosen cases find all three. random_cases_match: 0.56 s, 17 MB peak RSS over 25 runs (macOS arm64, debug). The comparison, the input ranges and every other test are unchanged. The proptest regression file keeps the seeds the mutants failed on. Refs obs-rust#2891 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(obs-core): Sample the start frames and cut the mix cases of audio_mix_parity mix_on_every_start_frame took 31.8 s and mix_matches 21.6 s in Fast Gate (17.6 s and 12.1 s on an M-series Mac), about 3 ms per mix: each compare_mix() makes two sets of 6 x 8 x 1024 random samples and checks every sample bit for bit (obs-rust#2891). - mix_on_every_start_frame becomes mix_on_sampled_start_frames: the first and the last 8 start frames and every 61st between them (32 of 1024; 61 is prime, so the frames fall on varied offsets), each on the frame's time and one ns before and after, at 44.1 and 48 kHz, as before. - mix_matches: 4096 cases to 512. The mix mutants of obs-rust#1909, rebuilt (the window end inclusive, = instead of +=, the start frame ignored, the window start as <=, the start frame plus one, frames counted from one ns late, the shim ignoring the channel count or one channel short, and the equivalent frame 1024 accepted): all 8 real ones still fail the audio_mix tests, and the equivalent one survives, as before. mix_matches alone, 5 runs each: 7 of 8 fail within 64 cases in every run; frames counted from one ns late fails mix_on_sampled_start_frames. The window end inclusive needs audio at the window's end, which the every-frame test did not check either; mix_matches and Tier 1 find it. macOS arm64, debug, 25 runs: mix_on_sampled_start_frames 0.62 s and 13 MB peak RSS, mix_matches 1.88 s and 15 MB. The comparison, the buffering and frame-count tests and the input ranges are unchanged. Refs obs-rust#2891 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(obs-graphics): Cut state_stacks_parity's random sequences to 500 sequences took 30.9 s in Fast Gate (14.3 s on an M-series Mac): 5,000 random sequences of up to 60 calls, each compared on both sides with the whole stack state after every call (obs-rust#2891). 5,000 cases to 500. obs-rust#2528 lists 16 mutants without naming the 14 it killed, so they were rebuilt from the core and the shim: push keeping cur, the pop floor at 1, pop without the erase, the multiply in the other order, transpose and identity ignored, translate as scale, state_pop returning the first entry or not popping, the blend reset with enable not inverted, the op ignoring the function, the function without dest_a, and in the shim: the erase of the last element keeping num, push not counting, and the capacity growing by one. All 15 fail sequences alone within 125 cases in every one of 5 runs; the equivalent one obs-rust#2528 names (no max(new_size) in the growth) survives, as before. 1,000 cases would still take about 6 s on the CI runner, so 500 (4x the need) keeps it under the 5 s that obs-rust#2888 proposes. macOS arm64, debug, 25 runs: 1.50 s and 15 MB peak RSS. The calls, the comparison after every call and every other test are unchanged. The proptest regression files keep the seeds the mutants failed on. Refs obs-rust#2891 Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=8cec7172b177aead0ee3374cc102d09e830003a5 secs=340 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1793263864,"gate":"rust/all/fmt","host":"linux-x86_64","key":"be9de4060c380e3fd3e326cc0ce090e9ac1874b2ad14138f5f0d3a9c1bc97d08","lane":"lint","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":75,"stamp":"9eaa0726b440abd9db3f8c736ab1f641","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"be9de4060c380e3fd3e326cc0ce090e9ac1874b2ad14138f5f0d3a9c1bc97d08","lane":"lint","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":75,"stamp":"467728ef5aaebb56014fa6076e352270","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"db8feb23281ca0e220c448d68f1be14a5f1062a0216f9e0340321e38e7dfee04","lane":"rust-test","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":169,"stamp":"80eb40a7c4812ab98f972778a57d6bdd","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"dd713ca81ab3614076faf09ec3a0f5f3","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"4c9c4ba7cf6c909e381e9266b8bd25d6","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"558779126ebd09147e4147bd5bea2b6a","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"7cc8841f5fa7a06f3090aade0155e0457b9c4356c17fa44b5418f11c40df3119","lane":"cross","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":96,"stamp":"228629c266e4919d49763da44bdfe222","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} Ci-Attestation: {"at":1793263864,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"53488f90bfeb235b9eecee55e15ed8e9bc3e38e2bc5df515126f9b13b5b82908","lane":"tier2-linux","parents":["c5fdd95feb1daa789bb69e17b52aff8821e3be74"],"secs":312,"stamp":"71a9f175dda786dd227f70632db58ab7","tree":"8cec7172b177aead0ee3374cc102d09e830003a5","v":1,"via":"run"} --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Summary
Step 2 of #1903 (#1846 unit 10, slice 1), after the move and characterization in #1905: the seam, then the Rust port of
libobs/obs-audio-mix.c.h, as #1825 and #1842 did for the scene audio ramp, in one PR.test: Call the audio tick core from the subsample test,libobs: Run the audio tick arithmetic through a core on plain values).obs-audio-mix.c.hbecomes a core on plain values, declared in the newobs-audio-mix.hwithoutEXPORT:obs_audio_mix_time_to_frames,obs_audio_mix_add(the source'saudio_output_bufandaudio_tspassed in), andobs_audio_buffering_maxed/_fixed/_addonstruct obs_audio_buffering(the buffering fields ofstruct obs_core_audioby pointer, the deque included). They returnstruct obs_audio_buffering_stepwith the valuesobs-audio.clogs.obs-audio.c.hgets static wrappers with the old names and signatures and keeps the logging, soaudio_callback()and the characterized test do not change. Exported symbols unchanged (1766).obs-core: Add Tier 1 tests ...): the 18 cases oftest_audio_buffering_subsample1:1, plus edge cases and a no-panic proptest; 24/24 fail on the stub.obs-core: Port the audio tick arithmetic):obs_core::audio_mix(safe core) andffi::audio_mix(hidden shims). The file moves to its own grouplibobs.ported-audio-mixwith a small PCH; the three export lists,ci/test_ported_sources.pyand the README row are updated.obs-core: Check ... against the C):oracle/audio_mix.c(the C unmodified, renamed),audio_mix_parity.rs, andport_comparison/audio.rs.Behaviour
Kept, characterized, not endorsed (#1905): times round down twice, so a frame's own time can map to the frame before it (frame 1 at 44.1 kHz, frame 512 at 48 kHz); the maximum is equality only; a sub-sample delay is an added step of 0 ticks and 0 ms.
Intentional differences, all where the C has undefined behaviour and libobs never gets there:
int, pushes at most max − total windows. In the C the sum is undefined and, as it wraps in practice, can skip the cut and loop for billions of ticks;channelsabove 8 is cut to 8;util_mul_div64quotient saturates (the C faults).Tests
macOS arm64 and Linux x86_64 (CT104):
obs_core::audio_mix+audio_mix_parity30/30 on both; allobs_coretests 128/128. Tier 3 compares every sample of the 6 mixes × 8 channels bit for bit (every start frame at 44.1 and 48 kHz ±1 ns, plus 4096 random windows), 20 000 random frame counts, and 20 210 buffering steps (step, fields,ts, thestruct dequefields and every queued window).test_audio_buffering_subsample18/18 (it compiles the C core into itself),test_audio_clock_drift6/6,test_audio_sync_offset_change5/5,test_audio_capture_mix_race2/2 (the last three run the real mixer and see the swap). The graphics tests ran fromrundirthroughxvfb-run-or-display.sh.audio_mixcode is in it and not in the C reference; the five shims are local symbols, none exported; exports 1766 = 1766 for both libraries; 0 compiler warnings.cargo clippy --workspace --all-targets --locked -- -D warningsandcargo fmt --checkclean;ci/test_build_groups.pyandci/test_ported_sources.pypass.port_comparison
Linux x86_64 (CT104, pinned to one core, criterion median, Rust / C):
audio_mix/mix_whole_tick(stereo, 6 mixes)audio_mix/mix_from_frame_300audio_mix/time_to_framesaudio_mix/buffering_add_one_tickThe mix runs every tick for every root source; the buffering step only when a source falls behind. On macOS arm64 the whole-tick mix is within 2 % of the C and the partial mix 16 % faster.
Notes
test_audio_buffering_subsamplekeeps testing the C core, as its header says; Tier 3 compares the swap.Refs #1903
🤖 Generated with Claude Code