Track the end-to-end latency of the stream and use that to drive
the resampler.
Hard reset the ringbuffer when under/overflow happens so that we
can recover quickly.
See #2230
Assign half the latency to the internal ringbuffer and half on the
network and remote end.
Use a dll to calculate the drift from our target ringbuffer fill
level and use the stream rate property to driver the resampler.
This should reduce uncontrolled latency over the tunnel.
PulseAudio wants us to be a driver will pull requests from the remote
side. We would need to provide a clock based on the remote end and
also try to follow it when we are not a driver. It would be slightly
better because in the normal playback case we would be able to
avoid resampling. We might do this eventually.
For the modules that require a driver, don't add ourselves to
the pipewire.dummy group but instead just use the NODE_WANT_DRIVER
property to be assigned to a driver.
This makes it possible for the nodes to move to another driver than the
dummy driver (which has very high priority) and it avoids resampling in
cases where the nodes are linked to an audio source or sink.
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.
Patch generated with concinelle with a few manual fixes.