Handle the update of the activation status before calling resume_node()
because we can call this when starting a cycle or when completing
a node.
Only set the AWAKE status and time in process_node when not exported or
not driving. For an exported driving driver, the server will have
already updated the values before it triggered our last process and then
completed the graph. If we update again in the client, the server will
read wrong values.
Because there is not really a way yet to get the finish time of the remote
driver the awake and finish times are too early. We might be able to fix
this later by making the stats at the start of the cycle from the
previous values.
Keep 2 extra variables to record the driver start and previos driver
start values. This way we can measure the period. This used to be done
with a little hack, using the finish_time of the driver, which was set
previously in resume_node().
For exported driving nodes, the TRIGGERED time is set in the remote-node
before it writes the eventfd to trigger the node_ready event. For
non-exported nodes, we need to set this ourselves.
For non-driver nodes that trigger node_ready, mean that they did an
async resume of the node. This means the node is finished and we can set
the finish_time accordingly.
Pass the ready status to the client-node using the state array.
Don't just SPA_STATUS_HAVE_DATA on the server side but use the value
from the client.
This avoids some potential extra work when a driver sink pulls in data
with the NEED_DATA ready callback but then the server performs the
actions (tee) as if it were SPA_STATUS_HAVE_DATA.
When we move a node from one driver to another, don't move the rate
and quantum because this tricks the new driver into thinking it's
already in the correct rate and it will skip doing a complete rate
switch.
This causes some nodes to fail to switch to the new rate, like in this
scenario:
1. mpv (node.always-process = true) appears and is added to the dummy
driver with rate/quantum of 48000/512
2. mpv is linked to an equalizer, linked to a sink, nodes are moved
to the new sink, target rate/quantum is copied to the new sink.
3. sink and followers are started in 48000/512, all is good. The sink
is now configured in 48000/512.
4. mpv is stopped, sinks and eq (input, not output) suspend
5. mpv appears again with 44100/512 and is added to dummy driver, which
is then configured in 44100/512
6. mpv is linked again to eq, nodes are moved, the sink rate/quantum
is copied and the sink thinks it's in 44100/512
7. sink and followes are started but no rate switch is happening because
rate/quantum was copied in step 6. Some followers are not suspended
and don't apply the rate change correctly (eq output).
By eliminating the rate/quantum copy when moving drivers, the sink will
correctly perform the rate change on all nodes.
Fixes#3159
Let's avoid doing timestamp math as much as possible and let `GstBaseSrc`
do it for us instead.
This bring the source more in line with others in Gstreamer and
may help to avoid bugs and share concepts or code.
Add an option to put {} around the properties.
Add option to skip the keys and put [] around the properties.
Add option to recursively serialize properties.
When a config name was given and it fails to load, don't fall back to
client.conf but return the error. Only load client.conf when nothing
else was specified.
Intercept the stream volume/mute and set it as the remove volume/mute.
Listen for remote volume/mute changes and set this as the local stream
volume. Make sure the adapter is using 1.0 software volume but reports
the real channelVolume of the remote stream.
Add a new pw_stream_set_param() method to configure a param on the
adapter.
This can be used to override the volume param for the adapter, for
example.
Make the XOpenDiplay call failure print an info message instead of a
warning. We usually ignore this error in the config file. Add a
suggestion for how to fix this issue in the info log.
Fixes#2918
As soon as we find a failed match, break the loop so that we don't check
uselessly the other properties but that we proceeed to the next set of
properties to match.
Add a condition to load the session manager and pipewire-pulse. This
makes it possible to disable the exec based on a context.properties
override.
Add a condition to load the access module. This makes it possible to
disable the default access behaviour and override with a custom one.
Fixes#3160
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