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.
Implement a port recalculate latency method that takes the min
and max latency of all peer ports and sets that as the new port
latency.
When a link is made, let the output and input port recalculate
latencies.
Pass latency param in audioconvert.
When we add a new listener to an object, it will emit the full state
of the object. For this it temporarily sets the change_mask to all
changes. Restore the previous state after this or else we might not
emit the right change_mask for the next listener.
Consider the case where one there are two listeners on an object.
The object emits a change and the first listener wants to enumerate the
changed params. For this is adds a new listener and then triggers the
enumeration. If we set the change_mask to 0 after adding the listener,
the second listener would get a 0 change_mask and fail to update
its state.
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
Keep all the children param flags around and use those to decide
if something changed. Also don't change the param flag serial when
we are simply adding a listener.
This should reduce the number of param updates, most notably the
PropInfo that was updated along with the Props on volume changes.
Keep track of the param changes with the user counter. Make sure to
flip the serial switch whenever a change is pending. Previously
we copied the param from the channelmixer or follower but that
did not always result in a serial change.
Fixes#764
Keep track of the subelement we're iterating in the result index upper
bits. Use enum_sync to iterate each param and switch to the next
element when we run out of params.
See !468