Skip to content

rust: Port libobs/media-io/audio-io.c to obs-media-io on Windows #728

Closed

Description

@nathan-v

Unit

libobs/media-io/audio-io.c to obs-media-io, Windows backend only. The Unix port is already on master.

Phase and position

Phase 5 media-io, tracker #45, after the Unix audio-io.c port. threading-windows.c and platform-windows.c are already swapped.

Dependencies and existing tests

Depends on the Unix engine in obs-media-io and on the Windows os_gettime_ns / os_sleepto_ns_fast / os_set_thread_name shims. test/cmocka/test_audio_io.c already characterizes the C file and must stay unchanged.

Notes

Windows still compiles media-io/audio-io.c when ENABLE_RUST_LIBOBS is on. The Rust engine is gated off because the input lock is a pthread recursive mutex and the worker never calls AvSetMmThreadCharacteristicsW. This issue is that backend: a recursive CRITICAL_SECTION, the MMCSS "Audio" task on the worker, the C file dropped on Windows under the Rust flag, and the existing Tier 1 and Tier 3 tests running on Windows. audio_t stays opaque. The stop flag stays atomic, as on Unix.

Activity

  1. nathan-v commented on Oct 14, 2026

    @nathan-v
    ContributorAuthor

    Claiming: libobs/media-io/audio-io.c (Windows backend)

    1. RED: compile the existing engine on Windows against a stub recursive lock whose init fails, and run the existing Tier 1 and Tier 3 tests. They fail because audio_output_open returns AUDIO_OUTPUT_FAIL.
    2. GREEN: CRITICAL_SECTION lock, MMCSS Audio task on the worker, drop media-io/audio-io.c on Windows when ENABLE_RUST_LIBOBS is on, Tier 3 oracle wrapper for Windows.
    3. test_audio_io.c is not edited. Header inlines stay C.

    First commit today. Please add the claimed label; I cannot.

    Refs #45

  2. nathan-v commented on Oct 14, 2026

    @nathan-v
    ContributorAuthor

    Windows half is in draft PR #745. Differences from the C file: a null input callback is a failed tick; a null output callback connects and is skipped; a mid-dispatch shrink of the input list is skipped; stop is an atomic; the worker is a Rust thread; the lock is a recursive CRITICAL_SECTION and the worker registers the MMCSS Audio task. The resampler and FFmpeg wrapper stay C. The claimed label still needs a maintainer.

  3. nathan-v commented on Oct 15, 2026

    @nathan-v
    ContributorAuthor

    #745 merged this as 1b61353. The PR said Refs #728, so GitHub left the issue open.

    The Windows backend is on master. The worker lock is a recursive CRITICAL_SECTION, the worker registers the MMCSS Audio task, and ENABLE_RUST_LIBOBS drops media-io/audio-io.c on Windows. test_audio_io.c was not edited. CI on #745 passed, including the Windows Rust tests and Windows Tier 2.

    The resampler, the FFmpeg wrapper, and the header inlines stay C. The audio-io characterization item on #45 (#120) is separate and still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions