Skip to content

fix(client): re-register AUDIO_INPUT listener so microphone can reopen - #1797

Open
Mariusz Białończyk (manio) wants to merge 2 commits into
Devolutions:masterfrom
manio:multiple-audio-input
Open

fix(client): re-register AUDIO_INPUT listener so microphone can reopen#1797
Mariusz Białończyk (manio) wants to merge 2 commits into
Devolutions:masterfrom
manio:multiple-audio-input

Conversation

@manio

Copy link
Copy Markdown
Contributor

The AUDIO_INPUT (MS-RDPEAI) dynamic virtual channel was registered via with_dynamic_channel, which wraps the processor in an OnceListener. OnceListener::create hands out its RdpeaiClient exactly once: after the first DVC Close, it keeps returning None, so any later Create Request for AUDIO_INPUT is answered with NO_LISTENER and the microphone silently stops working for the rest of the session.

Windows opens and closes AUDIO_INPUT repeatedly as apps grab/release the mic, so a single-shot registration is not sufficient.

Switch to with_listener with a small RdpeaiListener factory that builds a fresh RdpeaiClient (and a fresh RdpeaiCaptureBackend/cpal stream) on every Create Request, matching the pattern already used for the RDPEWA listener. Gate the new type behind feature = "sound" and widen the existing DvcChannelListener import's cfg accordingly, since it is now also needed outside the windows + dvc-com-plugin path.

Marc-André Moreau (@mamoreau-devolutions)

The AUDIO_INPUT (MS-RDPEAI) dynamic virtual channel was registered via
`with_dynamic_channel`, which wraps the processor in an `OnceListener`.
`OnceListener::create` hands out its `RdpeaiClient` exactly once: after
the first DVC Close, it keeps returning `None`, so any later Create
Request for AUDIO_INPUT is answered with `NO_LISTENER` and the
microphone silently stops working for the rest of the session.

Windows opens and closes AUDIO_INPUT repeatedly as apps grab/release
the mic, so a single-shot registration is not sufficient.

Switch to `with_listener` with a small `RdpeaiListener` factory that
builds a fresh `RdpeaiClient` (and a fresh `RdpeaiCaptureBackend`/cpal
stream) on every Create Request, matching the pattern already used for
the RDPEWA listener. Gate the new type behind `feature = "sound"` and
widen the existing `DvcChannelListener` import's cfg accordingly,
since it is now also needed outside the `windows` + `dvc-com-plugin`
path.
@github-actions github-actions Bot added maintainer-required Maintainer review or intervention is required risk/unknown Risk could not be determined automatically; needs maintainer-level scrutiny size/S Size: up to 199 counted lines and 5 files; exceeds XS in either measure labels Aug 25, 2026
CI's feature-matrix job builds with --no-default-features --features
rustls,webauthn (no sound), which failed with unresolved-macro and
unresolved-module errors: RdpeaiListener referenced pdu_other_err!,
ironrdp_rdpeai, and RdpeaiCaptureBackend unconditionally, but those
are only imported/available when the sound feature is enabled.

Gate the struct and its DvcChannelListener impl behind
`#[cfg(feature = "sound")]`, matching the existing gate on the
RdpeaiCaptureBackend/cpal import and on the audio_capture branch that
constructs it.
@manio

Copy link
Copy Markdown
Contributor Author

Is this OK for merging now?

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

Labels

maintainer-required Maintainer review or intervention is required risk/unknown Risk could not be determined automatically; needs maintainer-level scrutiny size/S Size: up to 199 counted lines and 5 files; exceeds XS in either measure

Development

Successfully merging this pull request may close these issues.

2 participants