Linux screen share audio stutters and distorts with large PipeWire buffers

(#799) Bug Fixed desktop video

Thread

Comment by @wagnerfs
RexSystem 1 vote originally by @wagnerfs on GitHub OP
Found the culprit: https://github.com/fluxerapp/fluxer/blob/baa18aed5b2a28cb199d38abca151cc0b68e960b/fluxer_desktop/native/linux-audio-capture/src/pipewire/stream_ops.rs#L277 Is hardcapped to one MAX_FRAME_SAMPLES pass. I set my clock.min-quantum to 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.