First try to make a unique node name and then assign this as the
client_name. This ensures we can detect a client name change because of
a name conflict and we properly handle the JackNameNotUnique and
JackUseExactName client open options.
Also emit a new client event when the client name existed but was from
another client and we made a unique name.
Fixes#2833
Commit 90b11e3c49 removed inactive
node from the fallback driver, even if it was always_process.
This should not happen, always_process nodes should stay on a driver in
all cases.
JACK nodes are marked like this and need to stay on the driver even when
inactive or else they don't have a transport when inactive.
Fixes#3189
After we se the format, we negotiate the buffer size and period size.
When this fails, the period_size can be 0. Handle this case without
causing a floating point exception.
Ask RTKit what the min nice level is and clamp our value to it to avoid
InvalidArgument errors.
Also add some more info messages when the level is clamped or invalid.
Fixes#3186
For remote nodes, set the signal time before we wake up the server. For
non-remote nodes, ser the signal time in node_ready. This ensures we
take the time to start the graph into account.
In client.error method, require that the global id in the message refers
to an existing registered global known to the sender of the message. If
not, do not try forwarding errors to the resources.
Also emit errors on the sender client resource in this case, so that the
sender client gets to know that what it tried to do didn't work.
This addresses a race condition where session manager sends a client
error for a global id, but before server processed that message the
global got deleted and the id reused for a different object, resulting
to an error being sent to the wrong resource. See #3192.
Wireplumber & pipewire-media-session do this on non-reconnectable node
connection failures: they first delete the node, and then try to send a
client error for its id. However, the global and its resources then
usually are already deleted at that point, and there are no resources to
send messages to so that is a no-op, except in the race condition where
id gets reused and the message goes to the wrong object.
They should do it in the opposite order. That it is wrong is also
visible in that
pw-play --target badtarget -P '{ node.dont-reconnect = true }' sample.ogg
hangs instead of bailing out, which is what happens also before this
commit.
The driver and follower signal times are currently the same timestamp
so allow a 0 difference between the driver and follower signal time
to calculate the scheduling delay.
Use separate flag for indicating if pw_stream_destroy is needed.
Don't set s->stream = NULL to indicate that, it will race with data
loop. Setting to null separately is not needed, removing from the stream
list is enough.
Add a _fast callback function that skips the version and method check.
We can use this in places where performance is critical when we do the
check out of the critical loops.
Make all system methods _fast calls. We expect them to exist and have
the right version. If we add new versions we can make them slow.
We copied the position information for the deprecated _get_time()
function. Don't do this anymore and just read the values from the
get_time() function directly.
They might race with the processing thread but that's why the
function is deprecated.
Improves performance in tight loops.
Avoid doing the interface unref and version check for each iteration but
do this before entering the loop. Improves performance in high frequency
wakeups.
This way we can search for the real jack library instead of using our
custom libjack.so. Add an option to override the search path with
LIBJACK_PATH and an option to select the library name to load.
Set the module to NULL when unloading. Check if the module exists before
attempting to unload it.
Flush any pending invokes on the mainloop before destroying the impl.
Fixes#3199
Since the activation is in shared memory, a bad client could try to
modify them after we check the signal_time and prev_signal time and
cause a division by zero. Make a unique copy of the values and use
those.
Make a new method to parse parts of the audioinfo based on custom
keys, leaving unparsed values to defaults. Implement the generic audio
parsing with this.
We can then remove some duplicate code where the audio keys didn't match
or where only parts of the info needed to be parsed.
Also make a method to serialize the audioinfo to properties and use that
when making arguments to load the modules.
Avoid doing some custom property serialization, move all key/values into
properties and serialize those with the generic functions.
Have monitor streams not affect the latency calculation of the ports
they are connected to.
Connecting monitor streams to ports (e.g. volume level monitoring)
should not affect latency values of other streams connected to those
ports.
This fixes e.g. just running pavucontrol from modifying latencies of all
existing ports.
Add port.ignore-latency prop, which if true causes peer ports to ignore
the latency of the given port.
This is useful for ports that are not intended to affect latency
calculations of other ports, such as ports in monitor streams.
A DBusMessage needs to be unref-ed after sending it regardless
whether or not it was successfully sent. So do that in
`mm_dbus_connection_send_with_reply()` so that the callers
do not need to deal with that.