[pulseaudio-tickets] [Bug 90489] [regression] DYNAMIC_LATENCY introduced in module-combine causes a race contition between pa_sink_render_into_full and sink_update_requested_latency_cb in alsa-sink.c

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat May 30 04:51:49 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90489

--- Comment #12 from Tanu Kaskinen <tanuk at iki.fi> ---
I looked a bit into this. The problem is that module-combine-sink can generate
rewind requests during the sink input pop() callback. That should never happen.
Each output struct has member inq, which is a message queue containing messages
from the combine sink thread to the output thread. There are basically only two
messages that are transmitted in that queue: POST and SET_REQUESTED_LATENCY.
Processing a SET_REQUESTED_LATENCY message results in a rewind request.

There are two places where the message queue may get processed during the pop()
callback: render_memblock() and request_memblock() both call
pa_asyncmsgq_process_one() in a loop to make sure the message queue has no
buffered audio before requesting the combine sink to render more audio. If
there is a SET_REQUESTED_LATENCY message in the queue when it's drained, this
crash will happen.

I think the queue draining code could be removed from both places without
totally breaking things, but it might cause a situation where audio is rendered
earlier than necessary. That might cause some issues.

A safer fix would be to have two queues for the two messages. That way the
SET_REQUESTED_LATENCY messages could be processed only when it's safe to do so.
I'll hopefully get around writing a patch tomorrow.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20150530/92f1308d/attachment.html>


More information about the pulseaudio-bugs mailing list