[pulseaudio-tickets] [Bug 90489] New: [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 16 22:41:24 PDT 2015


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

            Bug ID: 90489
           Summary: [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
           Product: PulseAudio
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: modules
          Assignee: pulseaudio-bugs at lists.freedesktop.org
          Reporter: marcel132132 at gmail.com
        QA Contact: pulseaudio-bugs at lists.freedesktop.org
                CC: lennart at poettering.net

When sink_update_requested_latency() in src/modules/module-combine-sink.c:790
is called, it posts a SINK_INPUT_MESSAGE_SET_REQUESTED_LATENCY message to all
of it's output sinks. If one of the sinks is created by module-alsa-sink,
sink_update_requested_latency_cb() in src/alsa/alsa-sink.c:1507 is called to
handle the latency change. This function, except updating the latency,
sometimes also creates a rewind request. 

If the rewind request gets processed before the pa_sink_render_into_full() is
called, everything will work as supposed. However if not, the
"!s->thread_info.rewind_requested" assertion is being triggered on
src/pulsecore/sink.c:1323, causing whole server to abort.

Commit that introduced this is here:
http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=23f120aabbf4d48d7012e196cf95d89ec6b6d8c8

Here's the part of PulseAudio's output:

[...]
I: [pulseaudio] protocol-native.c: Requested tlength=272,11 ms, minreq=20,00 ms
D: [pulseaudio] protocol-native.c: Adjust latency mode enabled, configuring
sink latency to half of overall latency.
D: [pulseaudio] protocol-native.c: Requested latency=116,05 ms, Received
latency=116,05 ms
D: [pulseaudio] memblockq.c: memblockq requested: maxlength=4194304,
tlength=27528, base=4, prebuf=24004, minreq=3528 maxrewind=0
D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=4194304,
tlength=27528, base=4, prebuf=24004, minreq=3528 maxrewind=0
I: [pulseaudio] protocol-native.c: Final latency 272,11 ms = 116,05 ms +
2*20,00 ms + 116,05 ms
D: [combine] module-combine-sink.c: Sink update requested latency 116,05
D: [combine] protocol-native.c: max_request changed, trying to update from
27528 to 42336.
D: [combine] protocol-native.c: Notifying client about increased tlength
D: [alsa-sink-CX20757 Analog] alsa-sink.c: Latency set to 116,05ms
D: [alsa-sink-CX20757 Analog] alsa-sink.c: hwbuf_unused=332300
D: [alsa-sink-CX20757 Analog] alsa-sink.c: setting avail_min=87311
D: [alsa-sink-CX20757 Analog] module-combine-sink.c: Sink input update max
request 20468
D: [alsa-sink-CX20757 Analog] alsa-sink.c: Requesting rewind due to latency
change.
D: [combine] module-combine-sink.c: Sink update max request 20468
E: [alsa-sink-CX20757 Analog] sink.c: Assertion
'!s->thread_info.rewind_requested' failed at pulsecore/sink.c:1239, 

The assertion is almost always triggered when following conditions are met:

- /etc/pulse/default.pa contains:

# alsa_output.pci-0000_00_14.2.analog-stereo is the name of default output sink
load-module module-combine-sink sink_name=media
slaves=alsa_output.pci-0000_00_14.2.analog-stereo resample_method=speex-float-1
format=s16le rate=44100 channels=2 
load-module module-sine sink=media frequency=440

set-default-source media.monitor

- module-sine's outputs to the sink created by module-combine-sink and is muted
- Audacity is starting while some program (Rhythmbox in my case) is playing
sounds using the native protocol.

-- 
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/20150517/81f29cd2/attachment.html>


More information about the pulseaudio-bugs mailing list