Make a new variable to iterate the other ports so that we can use the
original port to emit notifications.
Fixes Latency and other params set on DSP ports.
When we are simply enumerating the params, just collect the info
but don't act on them, like clearing the format or recalculating
the latency.
This avoids some useless work when enumerating params.
Use the more complete configure_format function to clear the format
and buffers when the EnumFormat param changed.
When the follower updates EnumFormat, it probably wants to renegotiate
to a new format, so clear the current format so that we do that when
starting the next time.
EnumFormat should also not only return the current format in case we
are negotiated but it should return all possible formats.
See #2832
This reverts commit 6c963ed933.
This code was meant to set a filter on the format for the follower
but is not implemented yet.
Problem is that the unit tests and wireplumber call this code and would
need to be patched.
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.
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
A flush command is not supposed to stop playback but just clear the
current state. Normally, to avoid complications, an application will
Pause, Flush and optionally Start to do things smoothly without
interfering with the process loop, but things should not crash if that's
not the case.
Fixes#2726
When we are actively driving the stream and the converter needs more
data, call the stream process function again to get it so that we
don't underrun.
Fixes#2494
Use the NEAREST flag when setting a format. This only works for raw
formats and will update the format with the nearest accepted rate
or channels. We can then query the real configured format and use that
for the converter.
This makes things work when a driver tells us it can do 44100Hz but then
refuses and changes the rate to 48000.
See #2197, #2457, #2455, rhbz#2096193
If the follower of the adapter emits an error event, the adapter needs
to forward it to upper levels so that they know the node has errored,
and handle the situation.
Improve the debug_params output.
Always either print the failed filter or that there was no filter.
Print the index of the enumerated failed param or a message when
there are no params.
See #2383
After emiting the node info, remove the properties from the info again
so that we don't accidentally emit them again later, when the
info and properties are out of scope.
Try 8 times to make progress, if nothing after that, xrun.
A stream that keeps sending 0 sized buffers would otherwise get into
an endless loop.
See #2359
We alwats want to adapt to the rate of the graph and not the
samplerate that was configured with the PortConfig.
This fixes samplerate switching again.
Keep track of the format as given in the PortConfig.
Instead of blindly fixating the negotiated format to whatever default,
use the PortConfig format to fixate to something better.
This makes the channels/position, rate or format match the PortConfig
format when this is possible and results in the least amount of conversions.
It mostly improves the handling of wildcard formats, were a stream only
specifies some fields and leaves the other free.
A concrete case is WINE that uses the pulseaudio FIX flags to omit the
number of channels and rate. With this change, the stream will negotiate
to the format of the linked sink and obtain the channelmap from it.
See #876
When the follower has no param to enumerate we would keep on enumerating
the params of the converter forever. Fix this by setting the next value
to something that would then stop the iteration.
Also increase the amount of bits for the follower because it might need
them.
Make the alignment parameter optional when negotiating buffers.
Default to a 16 bytes alignment and adjust for the max cpu
alignment.
Remove the useless align buffer parameter in plugins, we always
set it to 16 anyway.
Some follower nodes don't support all audioadapter params (For example, param
SPA_PARAM_Props is not supported by 'support.null-sink'). This change adds a
check to avoid unsuported errors when requesting a param that is not supported
by the follower.
We need to manage our own flags based on the direction of the follower.
We also need to make sure we only clear the NEED_CONFIGURE flag
after we are actually configured, not just when we configured our
internal converter.
See #1548
When in passthrough mode, use the position io to update the
io_rate_match fields for the follower. This makes it possible for the
follower to also provide the right amount of data when the converter
is not selected in passthrough.
Add an option to configure the converter in None port config where it
removes all the ports. We can use this when removing the converter to
make sure all it's ports are removed.
When we remove the converter, make sure we expose the follower ports
directly so we can use them for passthrough.