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
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
Some functions need to wait for the reply of the server before they can
complete but the JACK API does not allow us to emit notifications while
blocking a function.
Delay emiting notifications when we are in selected methods and send a
notify to an eventfd to call the queued notifications.
Fixes#3183
Port added before activate should trigger a port_register callback when
the client is activated.
When calling jack_deactivate, the port_register callback should be
called.
See #2638
There are core errors that should not trigger a shutdown, like invalid
or destroyed proxy replies. Only do shutdown when we get EPIPE, which is
when the server is stopped.
See #3070
Set the active state to false right when we start deactivate to make
sure that we don't call any callbacks anymore during shutdown.
One of the callbacks that might be called is the bufsize of samplerate
change callbacks when the node is moved to the dummy driver and this
might deadlock any app that doesn't expect this.
Fixes#2781
this event extends the bound_id event and sends the global properties as
well.
This can be used to get the object.serial, for example.
It can also be used in the future to let the server generate unique
property values, like the node.name, and let the client know about the
new property value.
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.