mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 08:21:50 -06:00
fix: reduce audio jitter buffer latency (#673)
* fix: reduce audio jitter buffer latency - Release listenersMu before dispatching samples to listeners - Buffer Track.sample channel (size 2) with non-blocking WriteSample - Buffer pipeline.sample channel (size 4) to unblock GStreamer thread - Add leaky=downstream max-size-buffers=5 to audio queue to prevent burst accumulation - Set sync=false on appsink to deliver buffers immediately without clock wait These changes break the backpressure chain that caused the GStreamer streaming thread to stall. When the Go scheduler has a hiccup, buffered frames were delivered in a burst, causing the browser audio jitter buffer to grow to ~10 seconds over time. Fixes: #598 * fix: log message when dropping samples due to full track channel
This commit is contained in:
@@ -135,7 +135,7 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt
|
||||
"pulsesrc device=%s "+
|
||||
"! audio/x-raw,channels=2 "+
|
||||
"! audioconvert "+
|
||||
"! queue "+
|
||||
"! queue max-size-buffers=5 leaky=downstream "+
|
||||
"! %s "+
|
||||
"! appsink name=appsink", config.AudioDevice, config.AudioCodec.Pipeline,
|
||||
), nil
|
||||
|
||||
Reference in New Issue
Block a user