Skip to content

obs-core: Port obs_remove_raw_audio_callback (Fixes #4716) - #5003

Merged
rdoupe merged 2 commits into
masterfrom
port/4716-raw-audio-remove-rebased
Nov 18, 2026
Merged

rdoupe merged 2 commits into
masterfrom
port/4716-raw-audio-remove-rebased

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4716

What and why

obs_remove_raw_audio_callback (libobs/obs-raw-audio-remove.c.h, extracted by #4727) moves to Rust in obs-core. The safe core (raw_audio_remove::remove) gets the main audio output and forwards the full size_t mix index and the unchanged callback/parameter pair to audio_output_disconnect exactly once, also when the initialized core has no audio output or the pair isn't registered. No validation, locking or fallback is added; registration stays in media-io. The C file moves to its own ported unity group (libobs.ported-raw-audio-remove+), so the C reference keeps compiling it and hybrid libobs links the Rust. No intentional differences from the C.

This is Zach Vorhies' work from port/4716-raw-audio-remove (95d9c55, ef17692), cherry-picked onto current master with his authorship kept. Changes in the rebase:

  • Conflicts in the obs-core module lists and libobs.core+ resolved (sorted beside set_output_source/shutdown_detach).
  • obs_get_audio has since been ported (it lives in obs-get-audio.c.h and obs-core exports it), so the oracle no longer extracts it from obs.c.h through build.rs under its real name, which would now collide with the Rust export. The oracle compiles obs-get-audio.c.h renamed to oracle_raw_audio_remove_get_audio (the way get_audio.c does), and the parity test passes that as the getter.

Evidence

  • RED, stub commit e4ffa09 (todo!() core): soldr cargo test -p obs-data --test obs-tests-core -- raw_audio_remove → 0 passed, 5 failed (not yet implemented: obs_remove_raw_audio_callback).
  • GREEN, same command on the head: 6 passed (5 Tier 1 + the original-C Tier 3 parity case).
  • Mutation: forwarding mix & 3 instead of mix makes raw_audio_remove_parity::original_c_arguments_calls_and_registration_state fail.
  • Tier 2 (OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 20 --tests '^test_raw_audio_remove$'): full suite 968/968 on the C reference and 968/968 on hybrid libobs, test_raw_audio_remove 20/20 repeats on each, exported symbols identical (1768).
  • ./lint: ok.

🤖 Generated with Claude Code

@rdoupe
rdoupe requested a review from zackees as a code owner November 17, 2026 22:16
@rdoupe rdoupe changed the title obs-core: swap raw audio callback removal to Rust (Refs #4716) obs-core: Port obs_remove_raw_audio_callback (Fixes #4716) Nov 17, 2026
@rdoupe
rdoupe enabled auto-merge November 17, 2026 22:16
@rdoupe
rdoupe added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 17, 2026
Forward the full mix index and unchanged callback/parameter tuple exactly once through the existing main-audio getter and media-io disconnect. Keep the original C in its reference-only ported group.

Tier 1 and original-C Tier 3 pass; a 32-bit index masking mutant is rejected. Unchanged Tier 2 suites each passed 100 repeats against hybrid and C reference, with 1768 identical exports. All eight Windows MSVC category test binaries link. The single full lint attempt found C formatting, now corrected; remaining lint checks passed except Dylint, whose managed driver is unavailable for the selected nightly under clud.

Ci-Attestation: {"at":1794960405,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":57,"stamp":"97149a2604c7926bcf507858402b7d7f","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960405,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":57,"stamp":"e637e69633a9bc48d7e85ffa2c3f701c","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960405,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":57,"stamp":"4966a023a1cc8039888fe2c92233a627","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960405,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":57,"stamp":"db0c9344863b5ba34582c8c233fcddb6","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"general/all/client-lint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"7fc513a39a581910d56111e0053278de","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960405,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":57,"stamp":"fc28d2d6a6642611426f93906af8c9da","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"548124bd977b5eed4324dd69c7b8c8ec","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"bca328a70f5a2aa8bc69493db0e3dbca","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"5b43ea5ec7841603158902a652b0329b","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"cf6825bb9b81c34c699d58e2e15663f3","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"8854a5b6fbc910b5ef0897e7a936a2b9","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"3a2b5afc581da97132d0ca325272b452","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"51164c6bafed6f867d8c3c59e60269a7","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"1df5dad07ca39882ec77d42c86858e02","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"6dc27971d8e21564192624ab4d44d1a1","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"59a37822f65562667f64a85f62985395","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"a7ef0cc090776e5289f29d1904fe67fa","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960347,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"bd1735168c2066658dcc99f90269e4c3bec661c8f6789ecdfaa711647806b2ff","lane":"client-lint","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":67,"stamp":"6769266ec728f0ed515e9b6da15e43af","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}
Ci-Attestation: {"at":1794960606,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"450edab10c1780070cfe16b4828cac54fe9381fc2ae397cc49de3726ce516235","lane":"client-test-x86_64-unknown-linux-gnu","parents":["e4ffa09df795eef91099998bac98f2979e220b81"],"secs":200,"stamp":"92d38e074f46216b0f64575f934ccf9a","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"fd4412dcb6fce3aec67fd457c22869f9bcc6f39c","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/build/libobs.ported-raw-audio-remove+.h.c","libobs/build/ported-source-sets/raw-audio-remove.json","libobs/cmake/rust-exports.d/obs-core-raw_audio_remove.txt","rust/README.md","rust/obs-c-oracle/oracle/raw_audio_remove.c","rust/obs-core/src/ffi/mod.rs","rust/obs-core/src/ffi/raw_audio_remove.rs","rust/obs-core/src/lib.rs","rust/obs-core/src/raw_audio_remove.rs","rust/obs-core/tests/obs_core/main.rs","rust/obs-core/tests/obs_core/raw_audio_remove.rs","rust/obs-core/tests/obs_core/raw_audio_remove_parity.rs"],"head":"10afc8bb94df35e236806b24d716c7e373fd9b5c","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":"99ec7bff9cbb4b0ec6b3ddce405415b2a9ceeb5a4f743fcef26901dcbf0ec647","tree":"57da9ab767b88e237fd3c342f3e1939366a484d3"}}
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.

rust: Port libobs/obs-raw-audio-remove.c.h to obs-core

2 participants