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 784448 - multiqueue: Don't increase size too much when use-interleave is enabled
multiqueue: Don't increase size too much when use-interleave is enabled
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-02 13:12 UTC by Seungha Yang
Modified: 2017-07-19 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
multiqueue: Don't increase size too much when use-interleave is enabled (1.53 KB, patch)
2017-07-02 13:13 UTC, Seungha Yang
none Details | Review
multiqueue: Calculate interleave only within each streaming thread (5.60 KB, patch)
2017-07-03 07:30 UTC, Seungha Yang
committed Details | Review

Description Seungha Yang 2017-07-02 13:12:23 UTC
Although in case that incoming buffers were not suitably
interleaved, don't increase max size time too much, if multiqueue has
enough buffers which does not cause underrun of any single queue.

For adaptive streaming use cases, mostly each stream's incoming
buffer timestamp might be very different which results to
continuous increasing multiqueue size.

That situation breaks buffering management of upstream element (e.g, queue2).
Comment 1 Seungha Yang 2017-07-02 13:13:17 UTC
Created attachment 354795 [details] [review]
multiqueue: Don't increase size too much when use-interleave is enabled
Comment 2 Seungha Yang 2017-07-02 13:21:54 UTC
If my understanding is correct, one of the purpose of "use-interleaved" is to keep adjusting multi queue size to reasonable amount. 
Currently, however, it seems to refer to only incoming buffer timestamp without consideration of queued buffer time in multiqueue. 
I think multiqueue does not need to increase max size time if it has enough queued buffers regardless of interleave. One reason of abnormal buffering in playbin3 adaptive streaming is too large multiqueue size.
Comment 3 Edward Hervey 2017-07-03 05:08:26 UTC
The problem is that multiqueue should detect which incoming streaming thread each single queue belongs too and should calculate the interleave *within* each thread.

If each incoming streaming thread is different, we should end up with the smallest interleave (200ms iirc).
Comment 4 Seungha Yang 2017-07-03 05:54:15 UTC
(In reply to Edward Hervey from comment #3)
That seems to be optimal way I think. 
I found defined but unused *thread* member variable in single queue, which seems to be for interleaving calculation. Is it under implementation?
Comment 5 Seungha Yang 2017-07-03 07:30:10 UTC
Created attachment 354818 [details] [review]
multiqueue: Calculate interleave only within each streaming thread

... and use the biggest interleave value among streaming threads.
This is to optimize multiqueue size adaptation on adaptive streaming
use case with "use-interleave" property.
Comment 6 Edward Hervey 2017-07-19 16:13:56 UTC
commit 1b0059e0c5ae4de4c02d8b849e1d440431f60cb5 (HEAD -> master, origin/master, origin/HEAD)
Author: Seungha Yang <sh.yang@lge.com>
Date:   Mon Jul 3 15:17:33 2017 +0900

    multiqueue: Calculate interleave only within each streaming thread
    
    ... and use the biggest interleave value among streaming threads.
    This is to optimize multiqueue size adaptation on adaptive streaming
    use case with "use-interleave" property.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784448