Skip to content

Mute the Windows output while streaming its audio and sync its volume - #13

Merged
FacuM merged 1 commit into
mainfrom
feat/win-audio-mute
Oct 27, 2026
Merged

FacuM merged 1 commit into
mainfrom
feat/win-audio-mute

Conversation

@FacuM

@FacuM FacuM commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Windows had no counterpart of the Linux `ezdisplay` sink: the PC kept playing the audio and the volume was not synced. This PR takes the driverless route, since a virtual audio driver needs kernel attestation signing.

  • WASAPI loopback still captures a muted device, before its master volume is applied. The host therefore mutes the default output for the whole session: the PC stays quiet and the tablet gets full-level audio.
  • The volume slider (IAudioEndpointVolume master scalar, polled every 100 ms in the capture thread) syncs with the tablet in both directions. As on Linux, the client's volume wins at start. This PC's mute is in use, so the tablet's mute flag is only echoed back.
  • When capture stops, the output gets its volume back and is unmuted. The previous state is first saved in HKCU\Software\LibreStatic\ezdisplay\SavedAudioOutput; HostService::start_with restores it if the host crashed.
  • A bare unmute (speaker button) means the user wants local playback. A slider move unmutes the device as a side effect; that unmute is undone.
  • The README Audio section, the status table and docs/architecture.md are updated.

Verification

  • cargo clippy --target x86_64-pc-windows-msvc -p ezd-host-windows -p ezd-host-service --no-default-features -- -D warnings
  • Clippy and tests on Linux, with new tests for the saved-state encoding.
  • Not yet tested on real Windows hardware.

WASAPI loopback still captures a muted device, before its master volume is
applied, so the host mutes the default output for the session: the PC stays
quiet and the tablet gets full-level audio. The volume slider now follows the
tablet's volume and the other way round. The output gets its volume back and
is unmuted when capture stops; the state before is saved in the registry
first and restored on the next start if the host crashed. Unmuting by hand
keeps local playback; a slider move that unmutes the device is undone.
@FacuM
FacuM merged commit b6b1ae0 into main Oct 27, 2026
9 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