12 Commits

Author SHA1 Message Date
Seungha Yang
0f4bddc9a9 wasapi2: Add support for format negotiation
Enumerate supported formats during open so that src/sink can
report them via get_caps(). The format is then fixated and
initialized on acquire(), allowing users to select their
preferred format

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:28 +00:00
Seungha Yang
d9279a5145 wasapi2: Enumerate supported shared mode formats
... and report it via device provider property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:28 +00:00
Seungha Yang
c97ed1e6f6 wasapi2: Workaround for S24_32LE format mismatch
Since Windows 24bit-in-32bit format is not supported
by GStreamer (Windows one is MSB-aligned), converts format
in ringbuffer using SSE2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:28 +00:00
Seungha Yang
f2aabd6a71 wasapi2: Add support for exclusive mode device switching
Because of APO/OS mixer bypass in exclusive mode, we should
convert samples if new device has different format.
The conversion with additional buffering is implemented in this patch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:26 +00:00
Seungha Yang
4257cd8546 wasapi2: Fix process loopback device init
Fix AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM flag usage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:26 +00:00
Seungha Yang
18b5398960 wasapi2: Add support for exclusive mode
Add "exclusive" property and try exclusive mode streaming

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:25 +00:00
Seungha Yang
370499875c wasapi2: Probe exclusive mode formats
... and report it via device provider props

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9586>
2025-08-22 22:10:25 +00:00
Seungha Yang
7a48a0036f wasapi2: Warm up capture audio client on open
If the endpoint is idle, the first IAudioClient::Start() call
may take a long time to return. Start/stop the capture client
on open to reduce latency of subsequent Start() calls.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9553>
2025-08-14 12:38:41 +00:00
Seungha Yang
cb7dcff69e wasapi2sink: Do not push too large preroll buffer to endpoint
To avoid startup glitches, a silent buffer is pushed to
render endpoint, but pushing too large silent buffer will
introduce unnecessary latency. Limit it to a single period worth data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9553>
2025-08-14 12:38:41 +00:00
Seungha Yang
6af0ea60c1 wasapi2: Always fallback to MMDevice if default device is unavailable
Automatic stream routing supported virtual device may not be
available for some reason, but can try default MMdevice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9468>
2025-08-05 13:40:29 +00:00
Seungha Yang
0d2157e801 wasapi2: Add continue-on-error property
If enabled, wasapi2src/sink will post a warning message instead of an error,
when device failures occur, such as open failure, I/O error,
or device removal.
The element will continue to produce/consume audio buffers and behave as if
a capture/render device were active, allowing pipeline to keep running even when
no audio endpoint is available

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326>
2025-07-24 17:04:53 +00:00
Seungha Yang
9dbc7a491e wasapi2: Add support for dynamic device switch
Ringbuffer implementation is re-written to support "device" property
change in playing state

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9326>
2025-07-24 17:04:53 +00:00