Reason: fluxerapp/fluxer#2481: fix(desktop): capture full pipewire quantum on linux (#2481)
- Title changed from
Screenshare audio on linux is "bad"
to Linux screen share audio stutters and distorts with large PipeWire buffers
Reason: Says what the problem is, based on the cause found in the thread.
Rex edited a comment on
#799 Reason: Changed GitHub profile links in mentions into plain names or profiles here.
Rex edited a comment on
#799 Reason: Changed GitHub profile links in mentions into plain names or profiles here.
- Tags added: desktop, video
Reason: Added tags for the area this report covers.
Thread
Comment by @wagnerfs
MAX_FRAME_SAMPLESpass. I set myclock.min-quantumto 1024 to prevent some audio crackles due to small buffers, this directly affects: https://github.com/fluxerapp/fluxer/blob/baa18aed5b2a28cb199d38abca151cc0b68e960b/fluxer_desktop/native/linux-audio-capture/src/pipewire/stream_ops.rs#L292 Which does a single pass of the truncated at 1920 payalod and silently drops the rest. I've updated both functions locally to decode f32 samples passing an offset as parameter to be able to decode everything until the end of the payload or until scratch is full, then loop through the entire payload until the payload is fully drained instead of a single pass. This completely fixed the audio quality issues I had.