Always make peers of non-passive links runnable, even if we already
visited the peer node. This makes non-passive links between drivers set the
drivers to runnable. (midi-bridge, source to sink). It also makes nodes
collected from the (link-)group runnable when they are linked together.
To calculate the runnable state of the other nodes, only start from
non-driver runnable nodes (like we already did when following links).
This makes a link from echo-cancel-source to echo-cancel-sink activate
the echo-canceler chain instead of staying idle.
Actually convert the aec_args argument to something that the
echo-canceler will understand. Add the beamforming and mic-geometry
and target_direction properties.
This was introduced in 4faa28fd96 in order to correctly map the time
from the stream. From d52df30c88 on, however, the clock switched to
monotonic time, which does not need the extra-offset.
Disable `clock_reset()` for now but leave it in place so we can easily
reenable it once we use the stream time again.
This fixes video recording in Cheese and similar apps.
Closes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3149
A non-passive link between the driver and itself should make the driver
active as well.
This makes the midi-bridge running when linking its ports. It also activates
a sink when its monitor ports are connected to its playback ports.
Fixes#3153
Make the channels configurable for capture, source, playback and
sink streams. The playback and sink stream need to have the same number
of channels but the layout can be different.
Use init2 of the echo-cancel plugin when available to pass this info
around. The echo-canceler will then further adjust the settings to make
things work.
Explicitly make the driver runnable when we add a runnable node to it.
We have to do this because the runnable node might not be directly linked
to this driver.
In the case of the echo-canceler, for example, a playback stream
can be linked to the sink before the echo canceled virtual sink.
All echo-cancel nodes are added to a source driver, which would not be
activated because there is no direct path from the playback stream
to the source river.
Fixes#3145
The raw biquad takes its values from the config and then updates the
control ports with them in activate. At runtime, the changes to the
ports are applied to the biquad.
Other biquads take values from the config ports in activate.
When the timing_port is 0, just don't send out an initial timing packet.
When we receive a timing packet, reply to the same address/port that the
timing packet was sent from.
Fixes#3133
Add check for running the the loop context and thread.
Add checks in filter and stream to avoid doing things when not run from
the context main-loop because this can crash things when doing IPC from
concurrent threads.
Rework the runnable state calculation. It works in 2 steps now:
1. Collect all nodes linked to a driver in some way. Mark nodes that
are reachable with a non-passive link as runnable.
2, Go through all runnable nodes and set all linked nodes to the
runnable state as well, up to the driver.
Step 2 is new. Previously if there was just one runnable node, *all*
nodes would be set to runnable. With the addition of step 2, some nodes
might remain idle when they are not used.
This has the effect that virtual sinks without inputs stay idle when
the driver is otherwise running. Grouped nodes (like the RTP session)
will now also only run the linked nodes.
This reverts commit 2bfe772bb4.
This does not take into account nodes recursively becomming runnable and
so does not set the runnable state on all nodes correctly, like for
combine-stream.
Revert for now, it probably requires a new algorithm to make this work.
See #3128
If you set node.force-rate=0, the rate will be forced to the node.rate
denominator.
This makes it possible to autiomatically make the graph switch to the
native rate of the stream by setting this as the default property on
streams.
See #3026
There is no point in trying to restore a node to the default rate when
it's not going to run.
This avoids loops when rate switching from one forced rate to another.
Make sure we allocate at least 2 buffers when we are dealing with an
ASYNC node. This ensures that an adapter without a converter will at
least negotiate to 2 buffers when the follower stream is async (such as
is the case with pw-cat).
We need to be able to fill up one quantum of data when the stream
requests it so suggest a quantum_limit buffer size. Normally, the
converter will further improve the buffer size parameters when
resampling is involved but this is a good default for when working in
passthrough mode.
We don't actually use the stream buffering features so we're happy with
just 1 or 2 buffers.
Only make a passive link when one of the peers is passive and the other
one can be suspended or when both are explicitly passive.
This avoid making passive links between a sink/source pair.
It also avoid making passive links between two streams if they are not
explicitly marked as passive.
It does allow making passive links between a passive stream and a
sink/source or between two passive streams.
This reverts commit 6a64b4461e.
Now that sinks and sources are no longer passive by default, we need
just one part of the link to be passive to make things passive.
This breaks the stream recording from a passive stream case but we can
find a different fix for that later.
Nodes with the same link-group should be added to the same driver.
Also the runnable state of the nodes in the same link group is
shared between eachother. This makes it look like the linked nodes are
really just one big node.
With this change we correctly calculate the state of all nodes and we
can then only set the running state on the runnable nodes.
If you have 2 loopback sinks in front of a driver, this change will
only make the used loopback sink running and keep the other one
idle. It also works for grouped nodes, where only the active nodes
will now be running (such as rtp-session nodes).
Make an option to allow link.passive properties and set it to false by
default.
This effectively ignores the link.passive properties from the session
manager, jack clients and pw-link when set. This is a good idea because
the logic for making passive links is better handled in the core.
Don't increment the required activation count every time we change the
node prorties with a TRIGGER property. Only increment/decrement when the
value actually changed.
We are not allowed to call pipewire methods from any other thread than
the main thread so use invoke to schedule a module unload from the
pulseaudio thread.
Fixes some infinite loops when the work-queue list gets corrupted.
These drop-ins are not meant to be enabled by default, so let's move
them to fontconfig style *.conf.avail/ subfolders from which they can
be copied or symlinked to a location that will get merged into the
corresponding configuration file.
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>