[pulseaudio-discuss] Should corking be acknowledged by pa_sink_suspend()?

Ville Sundell ville.sundell at nomovok.com
Wed Nov 5 01:34:06 PST 2014


Greetings everyone!
I am having some problems with corking: pulseaudio policy enforcer will 
cork all the streams which belongs to a corked group. However, despite 
the fact corking itself happens correctly (via pa_sink_input_cork() at 
pulseaudio-policy-enforcement:src/policy-group.c) the stream will not 
end up being corked, instead it will be set to PA_SINK_RUNNING.

After some tracing, it seems that it happens because of sink_set_state() 
is called from pa_sink_suspend() (at pulseaudio:src/pulsecore/sink.c) 
right after the corking. The end of the function is:

     if (s->suspend_cause)
         return sink_set_state(s, PA_SINK_SUSPENDED);
     else
         return sink_set_state(s, pa_sink_used_by(s) ? PA_SINK_RUNNING : 
PA_SINK_IDLE);
}

Should it be something like:

     if (s->suspend_cause)
         return sink_set_state(s, PA_SINK_SUSPENDED);
     else if (s->state != PA_SINK_INPUT_CORKED)
         return sink_set_state(s, pa_sink_used_by(s) ? PA_SINK_RUNNING : 
PA_SINK_IDLE);
     else
         return 0;
}

...to take corking into account? This fix proposal is also attached to 
this e-mail as a patch.

Best regards,
Ville Sundell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pa_sink_suspend_can_now_handle_corked_streams.patch
Type: text/x-patch
Size: 840 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20141105/c8b4e962/attachment.bin>


More information about the pulseaudio-discuss mailing list