Logs are overrun with `Sending stream format through pad` messages. Am I doing something wrong ?
I have a simple pipeline for processing text. I am using
flow_control
as auto
for all elements in the pipeline besides the source
which has flow_control
set to push
.
All elements (with the exception of the source have 1000s of messages of type
While source
only has 1. This is happening when no actual data is flowing through the pipeline.
Looking for guidance on,
- is this expected ? Is handle_action
being called continuously without any data being sent (ref) . Or, am I doing something woefully wrong ?
- any way i can reduce log output for it ? Other useful log debug
messages get washed out because this is producing 100x more volumeGitHub
membrane_core/lib/membrane/core/element/action_handler.ex at ac6b79...
The core of Membrane Framework, multimedia processing framework written in Elixir - membraneframework/membrane_core
5 Replies
I tried using flow_control with
push
across the board and that didn't seem to change the log output.Hello!
1) Sending stream format that frequently is almost certainly not an expected behaviour. I suspect that the first element in the pipeline behind the source somehow "duplicates" the stream format (by returning it as an action in one of its callbacks, that frequently gets called). Later on, the stream formats are just passed through other elements and since there is already a lot of them, you will see a lot of logs from other elements.
Could you tell me what is the element right behind your source element?
Generally speaking, the stream format is expected to be sent once, before the first buffer (and possibly once in a while later on, if the format changes, for instance, when the resolution of your video changes).
2) In a first place we should figure out why the stream formats are sent that frequently, but there is a couple of things you can do if you want to preserve your logs:
* you can play around the logger limits: https://www.erlang.org/doc/apps/kernel/logger_chapter.html#message-queue-length, set them high enough for the logs not to be washed out and then redirect the output to some file
* the simplest solution would be to remove the problematic log (https://github.com/membraneframework/membrane_core/blob/ac6b793e2ea46316af569735c63dade1d83f6ddf/lib/membrane/core/element/action_handler.ex#L366 ) in
membrane_core
dependency and recompile it with MIX_ENV=<your env> mix deps.compile membrane core
😉Hi Lukasz
Thanks, I suspected I was doing something wrong 🙂
Only the source element has a
handle_playing
method defined as
It receives a handle_parent_notification
callback and returns {[buffer: {:output, buffer}], state}
to pass payloads to the next element.
The element thats right after the source in the pipeline is one that queries an LLM. Pasted the code for it below.
Its the element thats in the logs
Maybe another fact to mention, the pipeline is defined like
Removing the section Control Flow
and removing the control
pads results in the logs not continuously outputting Sending stream format through pad
.
So, am I doing something thats not recommended to send messages upstream in the pipeline ? Or I haven't configured things correctly ?
After following @Feliks 's advice and simplifying the pipeline (by dropping the control flow section), send_stream_format
is not being called continuously and the logs arent being overrun.Great to hear that it no longer produces those
stream_format
logs!
The reason why you observed this strange behaviour was that with this additional "bypass" link from filter3
to filter1
the stream format was duplicated in filter3
. The default implementation of the handle_stream_format
is to return :forward
action, which sends the stream format on ALL available output pads. In your case, it was sending it both to the subsequent filter (as expected) and the the filter1
, through your "bypass" link. Once received by filter1
, it was once again sent to filter2
and filter3
, therefore starting to "loop" 😉ah gotcha, thx for the explanation 👍