Repository navigation
obs-audio-monitoring: swap the null audio-monitoring backend to safe Rust (Refs #5269) - #5278
Merged
Merged
Conversation
…RED, Refs #5269) Tier 1 ports every assertion of test_null_audio_monitoring.c to the safe core of the null backend, which is todo!() here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(GREEN, Refs #5269) The six canonical functions of null-audio-monitoring.c stay thin C forwarders in the selected libobs.null-audio group, so no other backend sees the names; they call six hidden adapters (null-audio-monitoring.h), Rust in hybrid libobs and the original C in the C reference group libobs.ported-null-audio-monitoring. The unchanged characterization is relinked against the Rust archive; Tier 3 compares the original C. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Ci-Attestation: {"at":1795118585,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":94,"stamp":"04d3438467e627b991d8ae4ea38301ce","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118585,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":94,"stamp":"5429750b315068f8956eb1f591b43462","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118585,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":94,"stamp":"9e9c7a3590d16a7435951f370789fba8","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118585,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":94,"stamp":"cbaf38e9a523344e288a8451b37a5289","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"general/all/client-lint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"ad53031b7d430c09fc74cb70fd4f3baa","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118585,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":94,"stamp":"15982da2ca6dd4abf6127f71c7eeec64","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118490,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"8b18a8e62147e9dd2e91c9e43e652a15","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118490,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"fee2cf12e08ac7e1e146d3c0f0b4886c","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"f4ffe9a1fa9db69b05a74a621d5d10e9","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"ef44afa257c359aa6433f9abc212f23c","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"553ac59d156c1c0262997626d7bc309c","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"1e2e4fd21a8d8e32c8b7fb179a304323","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"dff74604a59f03329f733889b50f9d04","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"cd9a9dd548d80ed4d77258aac5a7db89","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"9d6997d33e50f35b23dceccfe9948f4c","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"41605132cb93b2a80653c2513e19202f","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"744a728919cb333bc2c5cd063d0173fe","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118489,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bf140ca6bc993aca4242631716fa6008420da94313b0b85ce14d267f3e7394e8","lane":"client-lint","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":77,"stamp":"e0115a18a82f75bcbce7280fa84d7f8d","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Ci-Attestation: {"at":1795118812,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"85e26f106665f70b82c27d4e4842446d2174c1dc1a831a3446346edf7ba37c45","lane":"client-test-x86_64-unknown-linux-gnu","parents":["7961a50f913755d5c46511ad26590a236689f9e9"],"secs":226,"stamp":"cfe1610db666618ab2a8b4b5935afa39","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899","v":1,"via":"run"} Client-Checks: {"checks":{"base":"7d19e183b72303c24dfdb5569f032d1c21756cab","coverage":"all-tracked-applicable-files","diff":["libobs/audio-monitoring/null/null-audio-monitoring-reference.c.h","libobs/audio-monitoring/null/null-audio-monitoring.c.h","libobs/audio-monitoring/null/null-audio-monitoring.h","libobs/build/libobs-nix.pch.h","libobs/build/libobs-ported-null-audio-monitoring.pch.h","libobs/build/libobs.ported-null-audio-monitoring+.h.c","libobs/build/ported-source-sets/nix-null-audio-monitoring.json","libobs/cmake/rust-hidden.d/obs-audio-monitoring-null_monitoring.txt","rust/README.md","rust/obs-audio-monitoring/Cargo.toml","rust/obs-audio-monitoring/src/ffi/mod.rs","rust/obs-audio-monitoring/src/ffi/null_monitoring.rs","rust/obs-audio-monitoring/src/lib.rs","rust/obs-audio-monitoring/src/null_monitoring.rs","rust/obs-audio-monitoring/tests/audio_monitoring/main.rs","rust/obs-audio-monitoring/tests/audio_monitoring/null_monitoring.rs","rust/obs-audio-monitoring/tests/audio_monitoring/null_monitoring_parity.rs","rust/obs-build/tests/native/registration/rust-static/cases/core-relinked/test_null_audio_monitoring.json","rust/obs-c-oracle/oracle/null_monitoring.c","rust/obs-c-oracle/src/lib.rs","rust/obs-c-oracle/src/null_monitoring.rs","test/cmocka/build/test-graph.json"],"head":"0f35857beec13ceb477bad81e6ba349500063626","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":"d3bf2cd385214723465a6400857580c279c762b53bd2e13a04e228180853920b","tree":"2229ab36cc9d10270830d70e63d5b58883fb1899"}}
rdoupe
enabled auto-merge
November 19, 2026 20:28
Member
|
Heads-up from the pool manager: this queue run failed only in Tier 2 Linux (tests OFF): |
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.
Refs #5269
Swaps the null audio-monitoring backend (
libobs/audio-monitoring/null/null-audio-monitoring.c.h, the one Linux and FreeBSD select whenENABLE_PULSEAUDIOis off) to safe Rust inobs-audio-monitoring. The characterization (#5262, PR #5268) is on master.What changes
obs_audio_monitoring_available,obs_enum_audio_monitoring_devices,audio_monitor_create,audio_monitor_reset,audio_monitor_destroy,devices_match) in their own backends, so the always-linked Rust archive must not export them. They stay thin C forwarders innull-audio-monitoring.c.h, which only the selectedlibobs.null-audiogroup compiles, and each calls a uniquely named adapter declared in the new private headernull/null-audio-monitoring.h(noEXPORT, listed inrust-hidden.d). This is the "uniquely named hidden Rust functions behind selected thin native forwarders" option the issue names.obs-audio-monitoring::null_monitoring(safe core;Monitoris an uninhabited type, socreatecan never return one) andffi::null_monitoring(the six hidden adapters). No argument is read, written, kept or freed; no callback runs; nothing logs or allocates.null-audio-monitoring-reference.c.h, compiled by the new grouplibobs.ported-null-audio-monitoring(its own small PCH,LIBOBS_LINUX_PORTED_SOURCESthroughported-source-sets/nix-null-audio-monitoring.json, so it covers Linux and FreeBSD without editing a shared CMake file).test_null_audio_monitoring.cis unchanged. Its target now also linkslibobs_rust-static(familycore-relinked, as rust: Port libobs/obs-video-level-queries.c.h to obs-core #5187 did fortest_video_level_queries): its two public calls still go through the selected real libobs (C reference in mode OFF, hybrid in mode ON), and its renamed copy of the whole source (null_c_*, now the forwarders) reaches the Rust adapters. Its teardown keeps checking zero log calls and balancedbnum_allocs.Tests
obs-tests-core,audio_monitoring::null_monitoring): every assertion oftest_null_audio_monitoring.c, 1:1, same names and order, against the safe core.audio_monitoring::null_monitoring_parity): the original C (oraclenull_monitoring.c, the reference copy renamedoracle_*) and the Rust shims over the C test's inputs (NULL, caller storage that is not an OBS object, equal/non-UTF-8/unterminated IDs) and a proptest over arbitrary never-valid addresses: same answers, zero callbacks, storage unchanged. Mutation check:the_comparison_catches_a_backend_that_matches_idsswaps in adevices_matchthat matches equal pointers and asserts the comparison sees it.RED → GREEN
soldr cargo test -p obs-data --test obs-tests-core null_monitoringtest: Mirror the null audio-monitoring characterization over a stub, coretodo!()):test result: FAILED. 0 passed; 4 failed(all four Tier 1 cases:not yet implemented: null monitoring: ...).obs-audio-monitoring: Port the null audio-monitoring backend to Rust):test result: ok. 7 passed; 0 failed(4 Tier 1 + 3 Tier 3).Also run locally:
./lint(lane lint ok),export_list(4 passed), the Rust-static registration tests (rust_static: 18 passed,entries_cover_every_rust_static_targetok).Tier 2, PulseAudio off (the only configuration that selects this backend; CI's Linux Tier 2 builds with PulseAudio on, where
test_null_audio_monitoringis not selected).OBS_EXTRA_CMAKE_ARGS=-DENABLE_PULSEAUDIO=OFF uv run rust/tools/linux-validate/run.py --repeat 2 --tests '...'built both libraries and printed:It then stops at
FAIL: audio-monitoring/pulse/pulseaudio-monitor-format.c.h.o was not compiled into libobs-c-reference: the ported-object proof always expects the PulseAudio ported groups, so a pulse-off run stops there on master too. I ran the tests from the same build tree (ENABLE_PULSEAUDIO:BOOL=OFF) in the linux-validate image underxvfb-run,ctest -R 'null_audio_monitoring|audio_monitor|monitoring' --repeat until-fail:2:100% tests passed, 0 tests failed out of 7LD_LIBRARY_PATH=.../libobs-c-reference,lddshowslibobs.so.30 => /build/tree/libobs-c-reference/libobs.so.30):100% tests passed, 0 tests failed out of 7test_null_audio_monitoringrun directly in both modes:[ PASSED ] 4 test(s)., every case[ RUN ]/[ OK ](none skipped).nmon the test binary shows the sixobs_null_audio_monitor*adapters defined from the Rust archive;nm -Don hybrid libobs shows none of them exported.PulseAudio-on Tier 2, the Windows MSVC link and the other targets run in PR CI.
No public header, existing C test or OBS WebSocket changes.
🤖 Generated with Claude Code