[vlc-devel] [PATCH] pulse: fix audio dropout when the input buffering takes too long
Rémi Denis-Courmont
remi at remlab.net
Sun Feb 22 18:46:52 CET 2015
Le dimanche 22 février 2015, 18:17:13 Jonathan Calmels a écrit :
> From my understanding, even though the negative latency is counter
> intuitive as you said,
Negative latency is physically impossible. I suppose, in theory, you could
define a virtual output with negative latency, but that would be mostly
pointless and (AFAICT) against the PulseAudio design.
> it works because the core compensates when it sees the drift.
Mathematically, a negative PulseAudio stream latency would result in a high
positive VLC TimeGet delay. In extreme cases, it might cancel out.
But in not so extreme cases, it will trigger unwanted up-sampling.
> I still don't know how to fix it properly though. Hence my request for
> better suggestions.
I don't know what problem you are trying to solve, because the patch
description makes no sense.
Ignoring the description and looking only at the patch, it seems you want to
deal with the read pointer overtaking write pointer. That is not called
negative latency, that is called buffer under-run.
Treating it as negative latency will *not* solve audio drop-outs. At best,
PulseAudio will discard the written samples up to the read pointer. Since they
would anyway be discarded, resetting the stream or fast-forwarding up to the
point of zero delay is preferable.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list