After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719893 - multiqueue: spams overrun signal
multiqueue: spams overrun signal
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-12-05 10:52 UTC by Per Johansson
Modified: 2014-01-24 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested patch for the problem. (2.01 KB, patch)
2013-12-05 10:54 UTC, Per Johansson
rejected Details | Review
diff (1.14 KB, patch)
2014-01-07 10:33 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Per Johansson 2013-12-05 10:52:22 UTC
multiqueue emits the overrun signal as soon as the buffer limit is reached, instead of waiting until the hard limits (bytes or time) are reached. This behavior was introduced by commit 17bff49262489950e40f6775e9ba0d2b574537bf. That results in the signal spamming and not filling it's purpose.
Comment 1 Per Johansson 2013-12-05 10:54:32 UTC
Created attachment 263572 [details] [review]
Suggested patch for the problem.
Comment 2 Sebastian Dröge (slomo) 2013-12-18 08:55:19 UTC
Review of attachment 263572 [details] [review]:

I don't think this is correct. Now you'll only ever emit the signal for bytes/time overruns, not buffer overruns.
Comment 3 Per Johansson 2013-12-20 12:38:10 UTC
(In reply to comment #2)
> Review of attachment 263572 [details] [review]:
> 
> I don't think this is correct. Now you'll only ever emit the signal for
> bytes/time overruns, not buffer overruns.

I think we should then start by determine what the purpose of the overrun signal is. What use case is it supposed to solve. As I see it overrun should be used to handle the case where the pipeline might deadlock. For example  when one queue is full while an other is empty, and a muxer with collect pads are waiting for buffers from both before continuing.
If overrun is emitted as soon as one queue reaches it's buffer limit, overrun will be spammed when the source produces buffers faster than the sink consumes them.
Comment 4 Sebastian Dröge (slomo) 2013-12-20 14:27:22 UTC
That's the use case, yes. For example decodebin uses it to detect when it should stop waiting for the no-more-pads signal and declare a demuxer as finished and not adding more streams.

Why would you handle the buffers limit different to the other two limits? I think you can get this spamming behaviour with the other limits too easily. The main difference with the buffers limit is that it is not fixed and can grow in the beginning.
Comment 5 Sebastian Dröge (slomo) 2014-01-07 10:32:32 UTC
Comment on attachment 263572 [details] [review]
Suggested patch for the problem.

As discussed on IRC this does not seem to make much sense, but there's something broken here somewhere still :(
Comment 6 Sebastian Dröge (slomo) 2014-01-07 10:33:10 UTC
Created attachment 265521 [details] [review]
diff

This at least handles the case correctly when all other pads are not linked. But that shouldn't be the problem of this bug.
Comment 7 Sebastian Dröge (slomo) 2014-01-07 14:55:54 UTC
Might make sense to change the queue_is_empty() check to a queue_get_length() < X, where X is a configurable value.
Comment 8 Sebastian Dröge (slomo) 2014-01-08 08:54:32 UTC
Comment on attachment 265521 [details] [review]
diff

commit c343ebd454e0e5846f6d5b3a22ed0dd3ffdd98e8
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Jan 8 09:53:09 2014 +0100

    multiqueue: Allow growing a queue if all other queues are not linked
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=719893
Comment 9 Sebastian Dröge (slomo) 2014-01-24 13:27:17 UTC
Closing, related discussion happening in bug #722900