Problem: children in a Membrane pipeline get started twice
[debug] <0.874.0>/ Starting children: [%Membrane.ChildEntry{name: {Membrane.PortAudio.Source, #Reference<0.2383238512.2415132675.126993>}, module: Membrane.PortAudio.Source, options: %Membrane.PortAudio.Source{endpoint_id: :default, portaudio_buffer_size: 256, latency: :high, sample_format: :f32le, sample_rate: 16000, channels: 1}, component_type: :element, pid: nil, clock: nil, sync: nil, spec_ref: #Reference<0.2383238512.2415132675.127072>, group: nil, initialized?: false, ready?: false, terminating?: false}, %Membrane.ChildEntry{name: :debug, module: Membrane.Debug.Sink, options: %Membrane.Debug.Sink{handle_buffer: #Function<0.39588851/1 in Wonderfluent.MembranePipeline.handle_init/2>, handle_event: &Membrane.Debug.Sink.noop/1, handle_stream_format: &Membrane.Debug.Sink.noop/1}, component_type: :element, pid: nil, clock: nil, sync: nil, spec_ref: #Reference<0.2383238512.2415132675.127072>, group: nil, initialized?: false, ready?: false, terminating?: false}] in children group: nil
[debug] <0.867.0>/ Starting children: [%Membrane.ChildEntry{name: {Membrane.PortAudio.Source, #Reference<0.2383238512.2415132675.126993>}, module: Membrane.PortAudio.Source, options: %Membrane.PortAudio.Source{endpoint_id: :default, portaudio_buffer_size: 256, latency: :high, sample_format: :f32le, sample_rate: 16000, channels: 1}, component_type: :element, pid: nil, clock: nil, sync: nil, spec_ref: #Reference<0.2383238512.2415132675.127050>, group: nil, initialized?: false, ready?: false, terminating?: false}, %Membrane.ChildEntry{name: :debug, module: Membrane.Debug.Sink, options: %Membrane.Debug.Sink{handle_buffer: #Function<0.39588851/1 in Wonderfluent.MembranePipeline.handle_init/2>, handle_event: &Membrane.Debug.Sink.noop/1, handle_stream_format: &Membrane.Debug.Sink.noop/1}, component_type: :element, pid: nil, clock: nil, sync: nil, spec_ref: #Reference<0.2383238512.2415132675.127050>, group: nil, initialized?: false, ready?: false, terminating?: false}] in children group: nil
I suspect the problem is with how I start the pipeline in conversation.ex
(in the init function) but I can't tell what the issue is.
When I try starting the same pipeline directly in a livebook cell(as below), there aren't duplicated frames:
import Membrane.ChildrenSpec
alias Membrane.RCPipeline
spec = [
child(%Membrane.PortAudio.Source{channels: 1, sample_format: :f32le, sample_rate: 16_000})
|> child(:debug, %Membrane.Debug.Sink{
handle_buffer: fn buffer ->
# Membrane.Logger.info("MembranePipeline received buffer: #{inspect(buffer)}")
IO.inspect(buffer.payload, label: "buffer.payload")
end
})
]
pipeline = RCPipeline.start_link!()
RCPipeline.exec_actions(pipeline, spec: spec)