Skip to content

libobs: characterize and extract obs_add_raw_audio_callback (Refs #5502) - #5505

Merged
rdoupe merged 2 commits into
masterfrom
test/raw-audio-add
Nov 23, 2026
Merged

rdoupe merged 2 commits into
masterfrom
test/raw-audio-add

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #5502

C-only prerequisite for the Rust swap of obs_add_raw_audio_callback (Phase 6, #444), the counterpart of obs_remove_raw_audio_callback (#4727, then #5003). Two commits:

  1. test: characterize obs_add_raw_audio_callback: a new test_raw_audio_add cmocka test (it had none of its own), through the public API. It pins: an add registers on every mix of the core's main audio output; a repeated add is kept once (one removal takes it out); callback and param are both part of the identity; a conversion is accepted; out-of-range mixes (MAX_AUDIO_MIXES, SIZE_MAX, and on 64-bit hosts UINT32_MAX + 1 and + 2, which would alias mixes 0 and 1 if narrowed) register nothing; with no audio set up the add does nothing and nothing is kept for later; an output the core does not own is left alone, and after the core's audio is replaced a new add goes to the new output. Registration is observed through audio_output_connect's duplicate rejection, with no frame waits (Flaky Tier 2: test_source_transition_slots clear_empties_both_slots child_alive under load #4680). No display needed.
  2. libobs: extract obs_add_raw_audio_callback: moves the function verbatim from obs.c.h into obs-raw-audio-add.c.h, registered alphabetically in the core unity group. No behavior change.

No existing C test or public header changes.

Evidence

This characterizes unchanged behavior, so there is no RED commit: the test passes on master's code and must keep passing after the move.

  • Tier 2, both libraries, before and after the move: OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 1 --tests test_raw_audio_add passed against libobs-c-reference ([OFF]) and hybrid libobs ([ON]): 100% tests passed, 0 tests failed out of 1088 in each full run, and test_raw_audio_add ... Passed in each filtered repeat.
  • Mutation check: with the extracted function made a no-op (if (1) return; at the top), the same command fails test_raw_audio_add on libobs-c-reference. The log shows all 7 cases ran: every_mix_registers, repeated_add_is_one_registration, callback_and_parameter_identity, conversion_is_accepted and connects_to_main_audio FAILED; initialized_core_without_audio and invalid_full_size_mix passed, as they should when nothing registers. (The run stops after the first library's failures; 19 other tests that use the add also failed.)
  • ./lint: ok.

🤖 Generated with Claude Code

rdoupe and others added 2 commits November 23, 2026 04:49
Adds test_raw_audio_add, run against hybrid libobs and
libobs-c-reference through the public API: registration on every mix
of the core's main audio output, a repeated add kept once, callback and
param identity, a conversion accepted, out-of-range and wide mix
indices ignored, nothing kept when the core has no audio, and a new add
going to a replaced main output. Registration is observed through
audio_output_connect's duplicate rejection, without frame waits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moves obs_add_raw_audio_callback verbatim from obs.c.h into
obs-raw-audio-add.c.h, a member of the core unity group (alphabetical,
after obs-object-ref-fields.c.h), ahead of its Rust swap. No behavior
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ci-Attestation: {"at":1795427566,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"59d601b649147b6309e8c7ed5ecc228e","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427566,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"2022c34221a27e17afba58e2e320cb08","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427566,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"224d46e62240ea907b6594c5518150e0","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427566,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"245be87c21a870a29508cc52142f40ab","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"general/all/client-lint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"6720617e98431293629dccb101f711e3","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427566,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"d4304c34a6cd4def445ddf19a8773643","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"1674df05fceb5da70b9402f71764e4c4","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"42684c2a9ae8c5cccaab1ade25d51941","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"4e34e02b2bb16413c1827a7b976b8524","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"af5154929d138e8789d323614eae2368","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"9eb6ae0abd532f64420218a2b608e36e","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"7df5335dd0df7862b4ca37efe0000fa1","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"fb0d0ded6cf368b06e3e9617cb640b54","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"46c720700102538b883ccb53c713dd8a","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"72964fe1197d48ef9cfa1bde5323fe27","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"e1b2e6f14d121eb9ebf54ccb292f940b","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"5893a5c91a087e3aa117898a53d4c4d6","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"f1ec628b8b713d50972d9748a04a9f48","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}
Ci-Attestation: {"at":1795427776,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"995be26af5f1171ef0f6a8af0b5b5e1d4d8124780350ca78564a7dab29e34865","lane":"client-test-x86_64-unknown-linux-gnu","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":209,"stamp":"77c6af0d053962d1a85135037dc6b61d","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"5554cacff3927c616d3ee4de4ed79652c54d6855","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/obs-raw-audio-add.c.h","libobs/obs.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_raw_audio_add.c","test/cmocka/tests.d/test_raw_audio_add.cmake"],"head":"8ec56c4dea1e98dd0890809c70a262a74593633c","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"d710ac1ced9ec59395fbd9757096c7a712bf6272f5ce63cb9247f827bc6bbb58","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 23, 2026 09:56
@rdoupe rdoupe changed the title libobs: extract obs_add_raw_audio_callback (Refs #5502) libobs: characterize and extract obs_add_raw_audio_callback (Refs #5502) Nov 23, 2026
@rdoupe
rdoupe added this pull request to the merge queue Nov 23, 2026
Merged via the queue into master with commit 4bfe5b5 Nov 23, 2026
246 of 261 checks passed
@rdoupe
rdoupe deleted the test/raw-audio-add branch November 23, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant