Handle the case where the converter in a source needs more output
buffers (-EPIPE). Schedule the follower in that case and try to
run the converter again until we have output or we can't make progress
anymore.
If the converter needs more data, schedule the follower before we
exit the loop with the data. This gives the follower a chance to get
more data asynchronously for the next iteration.
Only try to reuse a buffer when the io area is not already in
the NEED_DATA state or else we might overwrite a previous buffer
reuse and run out of buffers.
We also always need more input.
For now, let's lower our priority in device reservation below that of
PulseAudio (which currently uses a priority of 0), so that it takes
priority while contending for the same device.
Before the node is started, we don't get a Format parameters and we
don't know the channelmap of the node. This forces us to invent a
channelmap that might be wrong. We can do better by using the
EnumFormat param to extract some defaults for the format, rate and
channelmap. Fixes wrong channels in gnome-control-center when testing
speakers.
A sink and source can have an array of pa_format_info structures
that contain the possible formats of the device. Parse them from
the EnumFormat and return them when introspecting.
Make sure the default node as the highest priority.
Fixes a problem with default nodes not being selected when their
priority happens to be too low (bluetooth devices)
The drain operation does not complete with a sync from the server but
with an event from the stream. Set a flag in the operation that it
completes with a sync. Keep all operations without a sync around in
the list.
If we are already in the loop thread and flushing, this means we
added a new invoke item on the list from a callback. Place the
item on the queue and let the flush code take care of it after the
callback completes.
Required to fix some issues with draining in pulse where a stream
is destroyed from the drained callback which then invokes a pause.
Release transport when endpoint connection property is updated to false.
This also checks if the transport is already created when receiving
endpoint properties update to prevent multiple transport creation.
A passive node can still be the fallback node. It becomes non-passive
if there is a node assigned to it.
This makes the Dummy node work again in the case of jack clients
that always need to be scheduled.
Because the signal can't be removed from the callback we can
simply iterate backwards and then forwards.
The first added hook (the unlock/lock pair) is called last before
going into the poll and first when leaving. This executes all other
callbacks inside a locked situation. And removing them with the lock
is not going to cause problems.