Problem Statement
Rein mirrors the host screen to connected clients, but it does not send host/system audio. This makes videos, presentations, games, and other media sessions incomplete on the remote device.
This is an implementation-focused follow-up to #163 now that screen mirroring is available.
Proposed Solution
Capture host/system audio and add it as an audio track to the existing single WebRTC peer connection for each viewer.
The implementation should:
- Support the platform capture backends used by Rein, with PipeWire/PulseAudio on Linux, WASAPI on Windows, and the appropriate macOS capture API.
- Keep audio synchronized with the mirrored video while prioritizing low latency.
- Add a setting to enable or disable audio sharing and a client-side mute/volume control.
- Reuse the existing WebSocket signaling and single
RTCPeerConnection architecture.
- Stop capture and release platform resources when hosting stops or the final viewer disconnects.
- Report capture or permission failures through the existing debug/logging surfaces.
Alternatives Considered (Optional)
- Sending encoded audio over a WebSocket would avoid another WebRTC track, but would require custom buffering, synchronization, and playback logic.
- Microphone capture is not equivalent because the goal is host/system audio.
Additional Context (Optional)
Suggested acceptance criteria:
- Host audio is audible on a LAN client and remains synchronized with video.
- Audio sharing can be disabled without disabling screen mirroring.
- Multiple viewers can receive audio through their existing peer connections.
- Missing permissions or unavailable capture APIs fail gracefully and are visible on
/debug.
- Relevant unit checks and platform documentation are added.
Checklist
Problem Statement
Rein mirrors the host screen to connected clients, but it does not send host/system audio. This makes videos, presentations, games, and other media sessions incomplete on the remote device.
This is an implementation-focused follow-up to #163 now that screen mirroring is available.
Proposed Solution
Capture host/system audio and add it as an audio track to the existing single WebRTC peer connection for each viewer.
The implementation should:
RTCPeerConnectionarchitecture.Alternatives Considered (Optional)
Additional Context (Optional)
Suggested acceptance criteria:
/debug.Checklist