When a client produces output on a port and there is a link between the
output port and an input port of the client, make sure that the new
data appears on the input port.
We do this by keeping track of what links are between our ports and when
we get the peer id of a port input, we can related this to our port
again. Some mixer inputs will then fetch content from our own ports and
so we can prepare the output for them. This can be converting midi to
control messages or moving the output buffer id to the io area so that
the input mixer can pick up the new buffer.
Fixes#1839
Always pause processing until the main loop has processed the buffer
change callback. This makes it less likely for clients in the same
process to use a new buffersize before the other client has received
the callback.
In carla, one client is receiving the buffer size callback and the other
clients are expexted to be paused until the callback for the client is
completed.
Move some warnings when a wakeup was missed to info messages. The
warning can repeat a lot and is otherwise quite useless and already
reported elsewhere.
Don't do the default latency calculation, it might interfere with
the client latency values. Instead just use the client values and
fold multiples of quantum in the quantum latency field.
0 is a valid min latency so we can't use it as an unset value. Use
some large value instead and when nothing was configured, assume it
is 0.
Fixes#1839
Keep per type free_lists so that we can't reuse an old port object for
a link/node. This makes it more likely that ports are still available
after being freed.
Keep all allocated objects indexed in a global cache map. Use the global
cache index as the jack_port_id_t in connection and port registration
callbacks. Since the port_id is unique per allocated object and since
the objects types are never changed, we can always find a port with the
given port_id in the cache.
This vastly improves tools like catia that insist on querying objects
after they have been removed/destroyed.
Sort ports per node and then per node-specific port_id. This will
keep related ports together and will sort them based on when they
were created.
Fixes#1780
Add a jack.show-monitor option (default true) that makes it possible
to hide the monitor ports.
Monitor ports are not enabled by default on JACK and maybe they also
should not for PipeWire. Or maybe we need some tweaks for some apps.
See #1760
Dequeue a new buffer only once and reuse this queued buffer when
jack_port_get_buffer() is called multiple times in process().
Recycle an old buffer in the next cycle.
After calling process, mark all input buffers as consumed, process the
empty buffers and move the output buffers to the mix ports.
Fixes#1748
For our own ports, wait with emiting the connect_callback until we have
negotiated buffers on them (and have the peer_id). Some applications
use the connect_callback to decide when to start processing so we need
those buffers before we can do that.
Fixes startup issues with jack_midi_latency_test.
As long as we are inactive, don't update our internal buffer_size or
sample rate. This way, when we become active, we will emit the right
callback with the right value instead of doing nothing.
Fixes crashes in Carla.
When the node support transport sync. That is, when it will clear the
pending_sync flag from its activation area when it completed a new
seek.
Before this patch, the pending sync was always automatically cleared,
which broke some applications that are time masters such as bitwig.
Fixes#1589
Whenever a timebase owner is moved to a new driver, try to install it as
a timebase owner on the driver.
Before this patch, the timebase owner would only be installed on the
first driver is was assigned to, which was most likely a dummy driver.
See #1589
Change the buffer_size and sample_rate when we are sure the proces
callback is not running.
Delay process callback until we have called the buffer_size or
samplerate callback. Otherwise the jack application might be called with
the new buffer_size/sample_rate before the callback has been called.
Some applications might expect the process function to run concurrently
with the callbacks. PipeWire tries to avoid this by using a lock for the
duration of the process callback. Make an option to disable this.
See #1576
We just check the initial size of the buffer and remember that, we
should not emit (or schedule) a bufsize change callback.
Emiting the callback should really only be done after the buffer size
changes after activate completed.
Fixes some jconvolver startup problems.
Keep track of the last scheduled sync operation and wake up listeners
when it completes.
The waiters also compare against the last issued sync so that when multiple
syncs are pending from multiple threads, they will all wakeup instead of
just one.
Fixes some lockups with ardour6.
Keep the original type of the object around in the free list so that we
can still look it up.
Make most methods only find the still active object by checking if the
client matches.
Make some methods (jack_port_by_id() for example) also find the removed
objects for as long as they are in the cache and not overwritten.
This make carla and catia work better because they expect to access the
old object after it has been destroyed.
See #1531
Move the free object list as a global so that we can even access old
objects after client_closed.
Move the objects from a client to the global free list when we close
the client.
Ardour wants to access objects even after calling client_close() so
we need to keep them around a little longer.
See #1546
Almost no one will see that warning just like the rest of Meson
configuration warnings. So, if it's gonna yield a build with
dysfunctional JACK SDK, then it's best to make it explicitly fail
before people file bugs about missing jack.pc file.
To generate a correct jack pkg-config file unescape_variable
is required which was introduced with Meson 0.59.0.
When using an older version a warning is printed that no
jack.pc file is generated.
Use the port_set_mix_info event to get the id of the peer port for the
mixer input.
When asked for the buffer of one of those peer ports, we can get it from
the mixer input buffers.
Fixes#1471