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
spa_strstartswith() is more immediately understandable.
Coccinelle spatch file:
@@
expression E1, E2;
@@
- strstr(E1, E2) != E1
+ !spa_strstartswith(E1, E2)
@@
expression E1, E2;
@@
- strstr(E1, E2) == E1
+ spa_strstartswith(E1, E2)
Applied to the tree except for alsa/acp/compat.h because it looks like
that header is still mostly as-is from PA.
Because we only remove the client from the list after doing the lookup,
we will always find the removed node and the unregister event is
never called.
Fix this by marking the object as removing so that the lookup function
can skip the nodes being removed.
We should actually emit the graphorder callback whenever something
changed, also when a client or port was added/removed.
Also emit the graphorder callback right after a client is activated to
make jackdbus work.
Try harder to get the transport frame_rate from the position.
If we can't find an activation structure, use the configured frame_rate
instead of 0.
Fixes#1432
Use the pw_thread_utils interface to create/join and acquire/drop
RT priority. This allows JACK apps to also use the configured module to
handle RT priorities.
Add a function in data-loop to get the natvive thread and use that
in client_thread_id() so that it returns the pthread of the
data thread instead of the caller thread.
Make jack_client_create_thread() create FIFO threads, like the
JACK implementation did. We should probably hook that into the
module-rt functions somehow.
Fixes#1349
Make an invalid object type and mark removed objects as invalid.
Make sure we don't reference an invalid object for the various
callbacks and methods.
See #1265
Lookup of globals needs a thread lock or context lock. There is no
need to take the context lock when we already have the thread lock.
Make a new method to find an object of a type.
Check that link objects are referencing valid ports. Check that the
connect callback is referencing valid ports.
Only return connections with valid ports.
See #1265
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
Make structure with defaults that holds the defaults as they are loaded
from the config file or initialized with default values.
Copy this structure to a settings version that is used at runtime.
Add a force-quantum and force-rate field in the settings that can be
used to force a quantum and samplerate if != 0.
Ensure all callbacks are called from the thread_loop and release
the thread lock before calling the callback.
Introduce a new rt_lock that is taken while the callbacks are called.
Only call the process_callback when we can acquire the rt_lock in the
data thread. This ensures the process callback is never called
concurrently with any other callback.
Give a warning when we try to call do_sync from the thread_loop
itself. We would deadlock because the thread that is supposed to do
the sync operation would be blocked in wait().
Fixes#1313
Check if the port id and direction is valid before accessing the
port array.
Handle unknown and invalid ports in many methods.
Free the port item after we removed the item from pipewire because
more methods are being called while removing the port and we don't
want them to fail.
Also keep the context lock locked with emiting the registration,
portregistration and connect callbacks.
All the other callbacks are emited with the lock and it makes sense to
also emit these ones with the lock so that code in the callback gets
a consitent view.
See #1265
Setting a NULL value for the property will remove the property and
will thus not send an update to the server and will thus not stop
freewheeling. Use "" to remove ourselves from the freewheel group
instead of looping forever.
See #1265
Keep both input and output latency on the ports.
When setting the port latency only apply the rate latency values
and assume the node latency does not depend on buffer-size or time.
This is likely true because jack only knows about latency relative
to the rate.
It combines all latency from one direction and sets it as the latency
for the other direction.
Also keep only one latency value per port, in the object.
Rework the param handling a little.
Keep properties for ports. Use this in the client and port info.
Trigger the latency callback when the port latency changed.
Update the port latency when it changed.