Add sequence number to frames.
Fix mmap tracking.
Improve debug.
Set right flags on dupped fds.
Handle blocking dqbuf.
Set timestamp and field on buffers.
Dequeue buffers in streamoff.
By default, buffer negotiation favours the default property values of
the output node. Make this configurable and reverse this logic when the
output is a driver.
This makes it so that a stream connecting to a source will negotiate
with the preferences of the stream and not the source.
An example is a stream that wants 4 buffers from v4l2-source, because
v4l2-source has a default of 4 buffers, this will always result in 4
buffers, ignoring the preference of the stream.
When we get buffers from the driver, check if we have at least as many
as we requested. If we have more, that's ok, we will simply not queue
them.
Previously we would ignore the input number of buffers and use the
allocated amount to fill up the buffer array, which might be too small
and then we crash.
Only store the eventfd when valid or else we will try to close an
invalid fd.
Keep the errno value around, just in case it gets overwritten by
the free_file call.
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 sequence number to pw_param.
Add param_info to param_update to filter out the params of the latest
sequence number.
This can be used to track params from a certain sequence number. Update
node, port and device.
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.
Only increment the index when we find the requirested param, this
makes the params go from index 0 to the last instead of starting at some
random index. The random index is not really a problem but it is also
no so nice.
Set up the adapter and then set the started field to true before we
Start the follower and converter. It is possible that the follower will
start processing immediately so the started state needs to be set
correctly.
Similarly, first perform the Pause and Suspend calls on the follower
and converter before clearing our buffers and format so that things
are stopped properly.
See #2764
AVDTP in principle allows 62 endpoints, but in practice it appears some
devices (Samsung Galaxy Buds2 Pro, Redmi Buds 3 Lite, probably others)
fail to connect A2DP when the number is somewhere above 24. A2DP
connection works when initiated from the Central, but not when the
device itself does it, so these devices are not fully broken. We should
reduce the number of registered A2DP endpoints to avoid running into
problems with such broken devices.
Some of our source codecs are the same actual codec with the same
configuration, and don't need separate source endpoints.
Allow codecs to not have a registered endpoint (fill_caps == NULL), and
tolerate codecs with the same endpoint name. In codec switch, keep
track separately which of the codecs with the same endpoint name the
local endpoint is currently associated with.