stream: always call the process function when triggered

When we are triggered, always call the process function, even if we
don't have buffers yet.

We need to do this because a usual pattern is to dequeue a buffer from
the capture stream and feed it into a playback stream. When we don't
call the process function if the playback stream is not negotiated yet,
we will run out of buffers in the capture stream and stall.

This might also be able to fix this by calling the process function of
the capture stream when we still have queued buffers that need to be
processed but this might require some more adapter changes.

Fixes #3028
This commit is contained in:
Wim Taymans 2023-03-07 19:15:34 +01:00
parent a2b391b5c7
commit 92c4a916fb

View file

@ -388,8 +388,10 @@ static inline uint32_t update_requested(struct stream *impl)
struct buffer *buffer; struct buffer *buffer;
struct spa_io_rate_match *r = impl->rate_match; struct spa_io_rate_match *r = impl->rate_match;
if (spa_ringbuffer_get_read_index(&impl->dequeued.ring, &index) < 1) if (spa_ringbuffer_get_read_index(&impl->dequeued.ring, &index) < 1) {
return 0; pw_log_debug("%p: no free buffers %d", impl, impl->n_buffers);
return impl->using_trigger ? 1 : 0;
}
id = impl->dequeued.ids[index & MASK_BUFFERS]; id = impl->dequeued.ids[index & MASK_BUFFERS];
buffer = &impl->buffers[id]; buffer = &impl->buffers[id];