[MPlayer-dev-eng] [PATCH] reduce latency for ao_pulse

Dan Oscarsson Dan.Oscarsson at tieto.com
Sat Jul 24 18:10:49 CEST 2010


On 2010-07-24 at 01:39 +0300 Ivan Kalvachev wrote:
> On 7/18/10, Dan Oscarsson <Dan.Oscarsson at tieto.com> wrote:
> > Looking at what autosync does and testing a little, it does not fix the
> > problem, instead it reduces the visual effect by making the effect of an
> > unexpected get_delay value take slowly. Just like a-v sync correction is
> > normally done slowly instead of a quickly as possible. Depending of
> > screen you have and screen refresh rates, this correction is more or
> > less visible.
> >
> > I did some checking and my request to pulseaudio to lower the latency
> > results in an increase of 6-7 % on pulseaudio usage (on my system). So
> > it does increase CPU usage, but not very much.
> 
> I'm not really familiar with audio handling, so forgive me if my
> thoughts are a little naive.
> 
> You mentioned that the sink latency is increased after pause. Could it
> be that mplayer fails to signal properly to pulse that it have been
> pause. As result pulse thinks the application (mplayer) is still
> supposed to feed data and calculates it into the lag/delay.

>From what I can see ao_pulse does the correct thing.

> 
> One way to workaround this would be to completely close the pulse
> link, in a way very similar to how oss closes device file at pause
> (something I never liked).

Yes, I have seen that in oss, and have a patch to make mplayer handle
that. I have only tested to flush the data which do not work. But
closing the connection works fine - except from the fact that at least
on my system, closing pulseaudio makes a noise (I can hear it by just
doing "quit" when playing a movie). If I can find a way to get it to
close the steam quietly, this would work.

  Dan



More information about the MPlayer-dev-eng mailing list