[pulseaudio-discuss] [PATCH] pipe-sink: auto-drain the pipe on sink resume

Raman Shishniou rommer at ibuffed.com
Tue Feb 27 08:53:18 UTC 2018


On 02/26/2018 11:06 PM, Samo Pogačnik wrote:
> Dne 26.02.2018 (pon) ob 11:49 +0200 je Tanu Kaskinen napisal(a):
>> On Sat, 2018-02-24 at 17:41 +0100, Samo Pogačnik wrote:
>>>
>>> Added option auto_drain_pipe_on_resume to enable draining any
>>> remaining
>>> data from the pipe upon every pipe-sink resume out of suspend.
>>> ---
>>>  src/modules/module-pipe-sink.c | 37
>>> ++++++++++++++++++++++++++++++++++++-
>>>  1 file changed, 36 insertions(+), 1 deletion(-)
>> I didn't review the patch yet, I just wanted to point out that the
>> commit message doesn't explain what problem the patch solves. What's
>> your use case?
>>
> When a pipe reader fails, the pipe sink fills up the pipe and starts
> dropping instead of writing new data. Old data remains in the pipe to
> be consumed by the eventually recovered or replaced reader. By each new
> drop a gap between the pipe content and new data to be written grows.
> If the sink suspends while dropping, resuming from suspend is going to
> clear the pipe and start writing new data into an empty pipe, thus
> removing the gap (old, potentially irrelevant data).
> 
> I had also prepared a supplementary change (not yet posted), which
> enables the pipe to auto-leak at the consumers end, whenever a pipe is
> full. When a pipe is full, the size of the unwritten data is first read
> to make room for the repeated write. This way dropping would be
> replaced by leaking and the pipe always contains latest data
> independent of when a real consumer reader get started, stopped or
> replaced, ... However, i am not sure how to preserve content format,
> if necessary.
> 
> I thought at some point, that this second change might be sufficient,
> however it makes sense (in terms of pipe content relevance and data
> processing time) to drain the whole pipe upon each resume from suspend.
> 

If the pipe reader fails (crashed?), how can the sink be suspended?
Why the reader can't just drain the pipe before resume?

> regards, Samo
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
> 


More information about the pulseaudio-discuss mailing list