Low-Latency Desktop Audio Capture Without Feedback (Linux, Electron) #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Story: Low-Latency Desktop Audio Capture Without Feedback (Linux, Electron)
Context
I am building a Discord-like application using Electron on Linux. The app includes screen sharing with system audio capture.
The current implementation uses PulseAudio (
pactl,parec) with:module-null-sink)module-loopback)parec)This setup successfully captures desktop audio while excluding the app’s own audio (preventing feedback loops). However, it introduces ~2 seconds of audio latency, causing significant desynchronization with the video stream.
Problem Statement
The current audio pipeline introduces excessive latency due to buffering across:
parecinternal bufferingThis makes the solution unsuitable for real-time communication.
Goal
Design a low-latency (<100ms target) desktop audio capture system on Linux that:
Current Architecture (Simplified)
Additionally:
pactlKey Constraints
Non-Goals
Requirements
Functional
Non-Functional
Pain Points in Current Implementation
module-loopbackintroduces unpredictable latencyparecbuffers aggressively by defaultDesired Output from the Model
Provide a detailed technical proposal including:
1. Architecture Options
Compare at least:
2. Recommended Architecture
Include:
3. Implementation Plan
4. Latency Analysis
5. Trade-offs
6. Optional Enhancements
parecSuccess Criteria
Notes
Priority
High — this directly impacts core real-time communication UX