Loop over the servers and use its family and port to publish the
zeroconf services.
This avoids exposing the services when we don't have any TCP servers
running to accept connections.
It also avoids exposing the services twice with both IP4 and IP6
addresses.
It also exposes the services with a port that is actually usable, in
case it's not the same as the default port.
Just like the optional build, make all field parsing optional. This
will leave the fields with their default values if they are not parsed
from the param.
We can then remove our custom functions and use the generic ones in
various places.
Add a new seq field in the param-info struct. Users can use this
field to keep track of pending param updates.
Store the latest seq number of the param update in the seq field. Remove
all params that don't match the sequence number because they are too
old. This avoids duplicate old params in pw-dump output.
Rework the pulseaudio manager with this same method.
Add a target.delay.sec property to module-loopback that uses a
ringbuffer to further delay the signal to the requested value. This
also takes into account the graph delay to get an end-to-end delay.
Add a -d property to pw-loopback to control this.
Implement latency_msec on the pulse module with this new property so
that it behaves similar to pulseaudio.
uint32_t i;
for (i = 0; i < SPA_N_ELEMENTS(some_array); i++)
.. stuff with some_array[i].foo ...
becomes:
SPA_FOR_EACH_ELEMENT_VAR(some_array, p)
.. stuff with p->foo ..
When no maxlength is given, we use the MAXLENGTH value but we need to
round it DOWN (instead of up) because our buffer is only MAXLENGTH big.
Use CLAMP where we can.
When in capture mode, the maxlength exceeds MAXLENGTH, scale down the
fragsize instead.
Fixes noise in audacious when playing 6 channels sounds. float32 * 6
channels with the maximum buffer size would result in the ringbuffer
being overwritten.
Reducing the latency is just papering over the issue in #2702. The
real fix is to limit the blocksize to the fragsize like what is done
in 00a234daf2
Reducing the latency then also causes regressions like #2715 so don't
do that anymore.
Fixes#2715
When a client writes more then requested, let the requested field go
negative so that it is taken into account the next time we ask for more
data.
Also the requested field follows the difference in the write pointer
caused by seeks.
See #2626Fixes#2674
A client can sometimes send more data than we requested. PulseAudio
keeps the extra data around, it just asks for more data when it consumed
some of it.
PipeWire however always tries to keep tlength worth of data, as
specified in the PulseAudio docs... Keep track of how much extra data
has been sent and keep this around as well. Make sure we flush this
extra data as well.
Fixes#2626
Move the latency fraction calculation to fix_ functions so that the
new latency rate can be used when creating the streams.
Actually set the requested record attributes on the stream instead
of modifying the defaults.
See #2671
PulseAudio configures half of the fragsize as the source latency. It
also sends chunks as soon as they become available.
This means that we also need to configure the source with half of
the fragsize latency and send in chunks of fragsize/2. Keep this in
the unused (for record) minreq field.
Some Flatpak apps want to manage sound fully (change default outputs,
move streams from other applications). Real Pulseaudio always grants
full permissions, but pipewire-pulse doesn't, which breaks some
applications, e.g. Zoom.
Work around this by granting the manager permission if the application
also has devices=all access.
To do things properly, this probably should use the Portal media roles,
but this would need further work elsewhere.
The default metadata update may be delayed for some time after
SET_DEFAULT, since the session manager has to work on it.
MOVE_* commands need to know what the client thinks is the current
default sink, so that they can decide between "move to default" and
"move to specific device".
To avoid race condition here, stash the default value set by the client
and use it in the MOVE_* commands, until the metadata update arrives.