node: add an ASYNC flag

The flag means that the process function might not complete
synchronously.

We can use this knowledge to improve the adapter. In sync mode we
can pull before scheduling the converter. In async mode we need to
schedule the follower after the converter to get the data ready for
the next iteration.

We can also improve the stream when it is operating async to schedule
a process call when a new buffer is ready to be filled.

This reduces a cycle latency from alsa and improves latency in
pulse.
This commit is contained in:
Wim Taymans 2020-09-25 17:02:54 +02:00
parent 9dfd261c71
commit d2d722efb3
4 changed files with 72 additions and 43 deletions

View file

@ -67,6 +67,10 @@ struct spa_node_info {
* PortConfig parameter */
#define SPA_NODE_FLAG_NEED_CONFIGURE (1u<<5) /**< node needs configuration before it can
* be started. */
#define SPA_NODE_FLAG_ASYNC (1u<<6) /**< the process function might not
* immediateley produce or consume data
* but might offload the work to a worker
* thread. */
uint64_t flags;
struct spa_dict *props; /**< extra node properties */
struct spa_param_info *params; /**< parameter information */