The idea is to have the rtp-source and rtp-sink be separate modules that
can be loaded a static ip/port as well.
The SAP module would then expose existing rtp-sinks or additionally load
rtp-sources based on SAP messages.
This makes things a bit more flexible when we also want to expose the
rtp-sink using zeroconf, for example.
Now that always-process nodes (the default for jack clients) can never
idle (even with passive nodes), force the qsynth client to
node.always-process = false
We can then also use the new node.passive = out handling to only idle
and suspend when nothing is linked on the input ports.
The node.passive property can actually take true, in and out as values
to mark what ports to make passive. Keep track of what port direction to
make passive.
Set the passive property also on ports and make all port inherit the
property from the node first (based on direction) and then use the new
port.passive property as an override.
Make the link use the passive property from the ports that it links to
check the passive state of the link.
PIPEWIRE_LINK_PASSIVE is to let this client make passive links, this
doesn't mean that the client wants passive links to its own node in all
cases so don't use the node.passive for that.
Instead use a new jack.passive-links. This can then also be set per
client to make it make passive links.
Parse the NODE_PASSIVE flag on nodes.
When a node is marked passive, make a passive link unless explicitly
set with a link property.
This removes the need for the session manager to set the passive flag
and it also makes things work better when using tools like pw-link.
When we are triggered, always call the process function, even if we
don't have buffers yet.
We need to do this because a usual pattern is to dequeue a buffer from
the capture stream and feed it into a playback stream. When we don't
call the process function if the playback stream is not negotiated yet,
we will run out of buffers in the capture stream and stall.
This might also be able to fix this by calling the process function of
the capture stream when we still have queued buffers that need to be
processed but this might require some more adapter changes.
Fixes#3028
We need to unescape the module argument values, just like pulseaudio
does. We might end up with invalid escape sequences for the JSON
parser.
Fixes#3071
In order for stream buffers to be captured and then processed by other
threads, pipewire needs to guarantee that the buffer will remain alive
until the application is notified of its removal. In this case pipewire
uses the "remove_buffer" callback to notify the application that a buffer
is about to be removed, so pipewire must guarantee that it is alive up
to that point.
Nodes marked as always_process will never be passive so use that as
the default case. This makes it possible to remove some checks because
always_process will imply want_driver and !passive.
In collect_nodes, don't update the passive state of the parent node
just yet. Leave the passive states of the nodes as they are found when
following links (or always_process) and update the passive state of
the driver when we add the collected nodes to it.
For unassigned nodes, this results in a more accurate passive state
calculation, not depending on the passive state of some child.
In media-sink, there's no need to set RCVBUF.
In media-source, we don't need to set NONBLOCK, as reads are done with
DONTWAIT. Don't set SNDBUF as it's not needed there. Don't set RCVBUF,
but use the (big) kernel default value: decode-buffer will handle any
overruns. Small values of RCVBUF might cause problems if kernel is
sending packets in a burst faster than we wake up.
Single argument static_assert() is only available since
C++17 and C23. Some compilers accept it even in earlier language
versions, but some do not.
Single argument static assertions can be supported by using
a GCC extensions, namely that `, ## __VA_ARGS__` removes the
comma if the variadic argument list is empty. This enables a
construction which passes a pre-determined string as the second
argument of the underlying static_assert() when only a single
argument is used in the `SPA_STATIC_ASSERT()` macro.
Fixes#3050
Don't just limit the max delay of samples we keep in the ALSA ringbuffer
to the buffer_size but to half of it. Make this into a max_delay
variable.
If we have a buffer size of 8192 samples and a headroom of 8192 samples,
when capturing, we would wait for the ringbuffer to contain at least
8192 samples, which would always xrun. When we limit the size to
half, we can still read the data without xruns.
Fixes#2972
On underflow in sources, pad with explicit silence. This avoids the
audioadapter from getting off sync from the cycle. That causes problems
as driver when we want to produce a buffer only a the start of the
cycle.
In some cases, it's also possible that the io already has buffer at the
start of the cycle when rate matching as driver. Currently, we don't
produce buffer in this case, but we should. Fix that by doing things in
the exact same way as ALSA sources do.
Move the port property logic from the adapter to the port itself.
The port was already doing some of the same work as a fallback but can
just as well do everything. This also makes things more unified when
there is no adapter used.
Add some more common channel name shortcuts supported by pulseaudio.
Make sure we match the full channel-name, not just the prefix.
Generate an invalid channel map when an invalid channel name was
given instead of a partial channel map.