Adding HTTP elements to audiomixer dynamically

Marcin Lewandowski marcin at
Sat Dec 25 18:30:18 UTC 2021


I am writing an app which needs to mix several live HTTP audio streams and then output them to several sinks. I am trying to use the audiomixer element for such purpose.

Initially I spawn a simple pipeline with audiotestsrc -> audiomixer -> tee -> autoaudiosink plus some queues and caps filters and it works fine. I hear a beep in the speakers.

Then I try to dynamically add branches with HTTP sources. Each branch is a bin with souphttpsrc -> decodebin -> audioresample -> audioconvert -> capsfilter plus some queues to keep it on a separate thread.

As soon as the branch is added the whole data flow stops and queue placed before autoaudiosink reports underruns. The pipeline after it happens looks like on attached graph. In the logs (log level *:4) there's no "task stopped", no EOS - nothing that could indicate a problem.

I tried multiple methods of adding HTTP sources:

- adding downloadbuffer right after source and blocking output using pad probe until buffering is done, before linking to the mixer,
- adding branch and setting state to PAUSED and then linking upon buffering is done,
- adding branch, calling sync_state_with_parent, then linking,

...and nothing works as expected. I noticed that if I add a source which is immediately available, e.g. use filesrc instead of souphttpsrc it works flawlessly.

Can anyone give me a hint what is the right procedure to add dynamically a branch to the audiomixer or share a working code snippet?


PS. I am using GStreamer 1.18.5 on Mac OS X but similar behaviour is observed on 1.14 on ubuntu focal.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mixer2.png
Type: image/png
Size: 468437 bytes
Desc: not available
URL: <>

More information about the gstreamer-devel mailing list