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.
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.
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.
When a stream uses the FIX_ flags it should negotiate to the format of
the sink or source it connects to. To do this, look up the sink or
source and look at the format, use this as the allowed format for the
stream when the FIX flags are set.
Make it still possible to override with with properties. Use
audio.position to make it possible to set a channelmap override.
The effect is that the null-sink will report the given format in the
Sample Specification, which is what some applications might expect when
they pass a format parameter.
Use a different key than the usual one to select an audio format when we
are fixating a stream format to avoid confusion.
So pulse.fix.rate, pulse.fix.format, pulse.fix.channels are now used to
force a specific format when the stream has the FIX_ stream flags.
Add support for using custom format, rate or channels when the streams
asks to fix those parameters for us.
Some streams might expect to see S16LE when they connect to a sink in
S16LE when the FIX_FORMAT flag is set but this is not the case in
PipeWire because the audio DSP pipeline works in F32, and so F32 is
choosen. Make it possible to use a pulse.rule with a audio.format
property to control this.
Make pw_getrandom() more usable by handling the EINTR case and returning
< 0 when there was an error or not enough random data was available.
Make a new pw_random() function that uses pw_getrandom() but falls back
to a pseudo random number generator otherwise. This pseudo random number
generator is seeded with either data from the urandom source or from the
current time when pipewire is initialized.
In most cases where crytographic security is not required pw_random()
should be easier to use.
When pw_stream receives a proxy error it does not set its state to an
error state on its own, commenting:
```
we just emit the state change here to inform the application.
If this is supposed to be a permanent error, the app should
do a pw_stream_set_error()
```
Until now this was not done in the pipewiresrc, resulting in the
negotiation loop to not bail out after an error as a successive
`pw_stream_get_state()` did not return an error state.
Make the error permanent so negotiation errors make us take the
appropriate error paths.
The data stride for encoded formats should be 1 and also placed in the
stride in the buffer (not 0). So there is really no difference with the
regular codepath.
This commit implements generating /etc/security/limits.d/20-pw-defaults.conf and
/etc/security/limits.d/25-pw-rlimits.conf files. The numbering is arbitrary and
may very well warrant being in the reverse order, however `man 5 limits.conf`
does not appear to specify the parsing order or even say exactly how multiples
matches will resolve, so the value can be adjusted later, if required.
The actual limit values, the match rule and even whether each file is to be
installed can be changed via the build system before compilation. Likewise
the files can be modified or (re)moved during distro package building phase.
The 20-pw-defaults.conf should only be installed on legacy systems lacking both
a modern kernel and up to date systemd, because all it does is set the current
Linux default. Accordingly its not installed by default.
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
Actually return the pointer to the created object
from `impl-core.c:core_create_object()` instead of
returning a NULL pointer.
This has not caused issues because the return value
is not checked anywhere.