Add new context config clock.power-of-two-quantum to make it possible to
not round quantum to closest lower power of two. This makes it possible
to match the quantum of a source node with the quantum of a client
node.
Allows monitors (eg. bluez5) free any sm_objects they hold in
session_destroy. In session_shutdown, destroy such objects before the
event, and free them only afterward.
Fixes double-free in bluez monitor.
WE can only delay the start for drivers that are driving. Remote
nodes are driving themselves but are not drivers so they need to
start early.
See #879
A node starts out as passive but becomes non-passive when there
is a non-passive link to an active node. If there is a link to
an inactive node, the node remains passive.
This fixes suspend of drivers in all cases.
Fixes#898
Start with an extra period of silence.
Reconfigure a new timeout if we are too far off from the desired
buffer fill level. Reduce this level to the maximum error we
tollerate.
With this we use the extra period of silence to reconfigure the
timeout until we are close enough and we can start the dll with a
small error.
See #892
Don't always try to restore the saved profile when it's available
but only do this the first time. From then on, try to follow the
best profile when it changes.
If a driver node is linked with a non-passive link to itself, it
should also become running.
One example of this is the Midi bridge, that needs to start when you
link one device to another. The devices are all on the same node
so linking devices would result in loopback connections.
libcamera + bluez5 devices should be freed/unloaded via the sm_object
free callback, similarly as in alsa and v4l2 monitors. This ensures
they are run at session_shutdown.
To resolve monitor and policy core global ids racing with each other,
use separate registry event handlers for both cores. Each handles only
their own objects, determined by where the object handle was created.
Postpone handling of policy core new global events after monitor sync,
which orders them after the corresponding monitor proxy and registry
events. Monitor core is then more up-to-date, so we resolve id clashes
in favor of monitor globals, which avoids duplicate objects.
Fix use-after-free by tracking whether a monitor holds references to
sm_object. Keep also objects pending for id in a list, so that they can
be cleaned up on session_shutdown (monitors may leak objects at
shutdown, because spa objectinfo events won't be handled then).
Caveats:
Zombie objects may still created if policy core is late by several
events, but in those cases the corresponding remove events are already
in the queue.
Also, there's a (theoretical) possibility that pw_registry_bind will
bind the wrong object, if the registry event is handled too late and an
id is reused by the server.
For details, see reverted 77e4fdb1e4
for which this is a another approach.
Pass the right value for the rate, we need to pass the graph rate.
Don't reduce bandwidth, it is not needed.
Fixes timings for reading the alsa-sequencer.
Don't try to move closer to the read/write pointers in the ringbuffer
to compensate for the resampler delay. We might not have enough time
anymore to complete a cycle without xruns. The delay is properly
reported in the clock times and should also be reported on the port
latency eventually.
This simplifies the code and also avoids a warning with _FORTIFY_SOURCE:
../pipewire/src/modules/module-protocol-pulse/pulse-server.c: In function ‘create_pid_file’:
../pipewire/src/modules/module-protocol-pulse/pulse-server.c:6028:2: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6028 | write(fd, pid_str, strlen(pid_str) + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~