[pulseaudio-discuss] Flushing other programs' streams
arun at arunraghavan.net
Mon Jul 25 03:55:47 UTC 2016
On Fri, 24 Jun 2016, at 08:31 AM, Julian Orth wrote:
> I have a program that automatically mutes/unmutes other programs'
> streams. A problem I've encountered is that, after unmuting, a small
> portion of the audio that was supposed to be muted is played.
> I think this is related to buffering. Is there a way to work around
> this problem? Ideally I would like to discard the buffers every time I
> unmute a sink-input. I've considered using a timer that delays the
> unmute action by the buffer length (as reported in the
> pa_sink_input_info structure) but I'm afraid that might not work if
> the other program flushes its buffer at the same time.
> pacmd reports that the sink-input I'm dealing with has a latency of 1
> second. I don't know how latency and buffering are related but maybe
> this information makes a difference.
You should not need to do this (and you can't). If there's some data
left over after resuming, that's a bug. If you're able to reproduce this
with current PulseAudio, it would be nice to pin down the exact
circumstances under which this happens.
More information about the pulseaudio-discuss