GNOME Bugzilla – Bug 771183
directsoundsrc: Use DSBSIZE_MIN for secondary buffer size
Last modified: 2018-02-01 18:04:31 UTC
Created attachment 335248 [details] patch causing directsoundsrc to use DSBSIZE_MIN for buffer size I have a program that sends audio over RTP and it is supposed to work for quite a long time. It is used on Windows. I have noticed during testing that while initial latency is quite low, over time it gradually increases until it reaches +/- 2s. I have removed all queues and disabled sync in all elements, the only buffer in my code is rtpjitterbuffer with latency set to 100ms and drop-on-latency = true. During investigation of GStreamer's code I've encountered the following piece of code in directsoundsrc /* Set the buffer size to two seconds. This should never reached. */ dsoundsrc->buffer_size = wfx.nAvgBytesPerSec * 2; Well, it seems it is reached. In contrary, directsoundsink is setting DSBSIZE_MIN for the secondary buffer, which IMO is better approach anyway than any arbitrarily set value. The attached patch causes directsoundsrc to use DSBSIZE_MIN for secondary buffer size.
Which version of gstreamer are you running? That code is obsolete since May of last year. Please use the latest version from here: https://gstreamer.freedesktop.org/data/pkg/windows/1.12.4/ If you know how to use Cerbero to build binaries yourself on Windows, please try out the WASAPI plugin from the latest git, it has many improvements and has much lower latency than the directsound plugins. Alternatively, you can wait till 1.14 is released, which should be next month or so, from what I know.