Do a do_sync after setting the metadata to ensure the messages are
flushed to the server and processed. Fixes an issue where jack_property
would exit before the messages are flushed and so nothing happens.
Change the shellcheck job so that we configure the build and check the
preprocessed versions of the scripts, not the bare ones, which might not
be syntactically valid yet.
The buffer io area is used to enable/disable a port and should be
synchronized with the processing loop. Use invoke to safely update the
mixer io area.
Keep track of the number of mixers on a port and clear the global mixer
buffer io when there are none. Check and use the global mixer io when
processing output to avoid using an inactive output without buffers and
crashing.
Fixes#3506
When we activate, emit the port registration events of our own port,
even when they were suppressed (and marked registered) when we created
them. This is what JACK2 does as well.
When we don't manage to emit the notify, still mark the object as
registered. Otherwise we might not emit the unregistered
notify later on.
This usually happens when a client connects and the notifies are
suppressed for all the objects in the graph. When they later disappear
we do want to emit the unregistered notify.
We can't really do zero copy because our downstream peer does not have
access to the memfd of our upstream peer. Instead, just memcpy the
data for now.
When the buffer frames change, make sure we emit a latency recalculation
even if we don't have a buffer_size callback.
Remove the unused GRAPH notify.
Protect ringbuffer writes to the notify queue with a lock because we
can't know what thread they execute in.
Make a new TOTAL_LATENCY notify type to trigger a complete latency
recalculation.
Node that have the node.always-process = false property do not conform
to the jack API because they will be suspended even when they don't
inactivate themselves. Don't hide the ports for those clients when
inactive.
Fixes#3416
The jack client API expects the ports to unregister when a jack client is
deactivated and to register when it is activated. We use pause/resume
for deactivate/activate and don't really destroy the ports.
Track the state of the node (client) and emit port registration when it
changes state. Also make sure we don't emit a port registration when the
node is deactivated.
Fixes#3260
For all the modules that include the private header we require that the
library and compiler versions match.
Otherwise we might end up poking into new or old fields that got moved or
changed in the private struct and crash.
See #3243
Remove some includes of private.h
Add some methods to get the mempool of client and context so that we can
remove direct access.
Move some things around.
Use methods to get pw_loop variables.
See #3243
When we create a port, we should make the SPA_ID_INVALID mix_id for the
shared info on the mixer ports.
Only mix_info should create and destroy mix structures.
Use the port_set_mix_info to add and remove mix info information to the
client.
Previously it was impossible to clean up mix_info.
With this change we can also simplify the jack peer port detection.
Because the mix info is always sent before the link appears we can
simply look up the info when the link appears.
When we have a callback installed but the bufsize/srate can not be
notified yet because the client is inactive, try again in the next
cycle.
Fixes#3297
When we skip the notify because we are not active or we don't have a
callback, still update the buffer_size and sample_rate fields or else
we will keep on trying forever.
Fixes#3226
JACK does not automatically generate aliases, so don't do that either.
The problem is that no new ports can be created if one already exists
with the same name or any of the aliases. This causes problems when a
port is renamed and a new port is created with the old name because the
alias might still be the old name and port creation fails.
Add a jack.fill-aliases for this purpose.
Fixes#3154
When a jack client is opened, the thread_utils from the context are
stored globaly. Replace this with a generic thread_utils when we close
the client again to avoid referencing freed memory.
In jack_port_unregister(), don't free the port completely but mark it
as removing. This will then do the portregistration callback before
freeing the port.
Add some more debug.
It is possible that the callback notify event is dispatched in do_wait()
while we are blocking for a method reply. In that case, don't perform
the callbacks, they will be rescheduled before the function exits.
Try to only dispatch the notify event when there are callbacks pending.
Fixes#3183