high cpu usage with leaky queue

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Sep 10 02:19:33 PDT 2013


On Tue, 2013-09-10 at 10:57 +0200, Erik Andresen wrote:

Hi Erik,

> When I insert a leaky queue in a pipeline I get 100% CPU usage on one
> core. This happens with GStreamer 0.10.36 and 1.0.9, reproducible with
> the following test-pipelines:
> 
> gst-launch-0.10 -v videotestsrc ! queue leaky=2 !
> "video/x-raw-yuv,framerate=1/1" ! fakesink sync=true
> 
> gst-launch-1.0 -v videotestsrc ! "video/x-raw,framerate=1/1" ! queue
> leaky=2 ! fakesink sync=true
> 
> Is this a bug or am I doing something wrong?

Neither, it's the expected behaviour :)

videotestsrc will by default produce buffers as fast as it possible can
(using as much cpu as possible). It doesn't sync to anything or wait for
anything, it just does while (running) push_buffer;

fakesink you made to sync to the clock, so it will only consume a
certain number of frames from the queue (25 fps or so).

But since you made the queue leaky, the queue will never block (and thus
throttle) the upstream videotestsrc, it will just drop the buffers and
let videotestsrc produce another one.

Cheers
 -Tim 



More information about the gstreamer-devel mailing list