Skip to content

Add opt-in PCM audio and scoped CoreAudio capture - #2

Merged
undivisible merged 5 commits into
mainfrom
codex/optional-audio
Oct 3, 2026
Merged

undivisible merged 5 commits into
mainfrom
codex/optional-audio

Conversation

@undivisible

@undivisible undivisible commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

The existing bridge controls FaceTime calls but exposes no media API. This adds opt-in audio support while leaving BridgeClient, helper IPC, and call control unchanged.

  • audio provides validated, owned Float32 PCM frames, a bounded drop-newest channel with statistics, synchronous/poll/async consumption, and capture/injection backend contracts. Callers own processing; no runtime or new third-party dependency is added.
  • coreaudio-capture adds a macOS 14.2+ process-output tap scoped to an explicit PID, output-device UID, and stream index. A preallocated native ring feeds a Rust worker. Capture defaults to refusal; explicit startup, source-change checks, cancellation, and cleanup errors are documented. Non-macOS builds expose an unsupported-platform stub.
  • Injection remains a caller-supplied implementation that must write to a real configured audio route. No virtual driver, FaceTime input-selection API, or end-to-end injection implementation is claimed.
  • Add synthetic examples/tests and feature/platform CI coverage. The development manifest is 0.2.0 with Rust 1.85 minimum and resolver 3 to prefer MSRV-compatible dependency versions; features remain disabled by default. Public APIs/workers are Rust; the native shim is Objective-C/C11.

Validation on exact head df8b8e80395eb02471052ecf30432621efcee19a: all 18 serial, locked/offline local gates passed with the configured sccache wrapper unchanged. This includes strict Clippy, default/private-api/CLI/audio/capture/all-feature checks and builds, 13 audio-only tests, 19 capture/all-feature tests, the generated-audio example, actual Rust 1.85 all-feature checks and 19 tests, and Rust 1.85 Linux cross-target checking of all targets. The native sources also passed ASan/UBSan synthetic-buffer and mocked-cleanup tests plus ThreadSanitizer concurrent-ring stress; those native files are unchanged. Independent exact source review found no remaining findings. GitHub Actions CI passed both jobs on this exact head: the full macOS job and fresh Rust 1.85 Linux resolution, 16 portable runtime tests, and the generated-audio example. All audio tests use generated PCM, refused permission, or mocked teardown. No call, live audio, permission prompt, driver installation, or default-device change is involved.

Known limits: process output may include ringing and mixed participants; it is not internal FaceTime/RTP/per-participant PCM. Real permission/device behavior, macOS/SDK 14.2, and FaceTime end-to-end capture/injection remain unverified. Severe HAL teardown failure is surfaced as CleanupFailed and can retain HAL resources until process exit; callbacks then discard input. See docs/audio.md for the full ownership and routing contract.

@undivisible
undivisible marked this pull request as ready for review October 3, 2026 20:17
@undivisible
undivisible merged commit c4eaa15 into main Oct 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant