[pulseaudio-discuss] Transporting sound from 'mpd' server to laptop
tanu.kaskinen at linux.intel.com
Sun Oct 20 08:25:23 CEST 2013
On Sat, 2013-10-19 at 21:33 +0200, Thomas Martitz wrote:
> Am 19.10.2013 19:53, schrieb Paul LeoNerd Evans:
> > 4) This mode accumulates latency. One of the reasons I wanted to avoid
> > icecast is because of the near-3second latency that happens between
> > the play/pause button on mpd, and the sound on the speakers.
> > Initially this pulseaudio tunnel is near-instant, though any sort
> > of network upset causes it to stutter into a latency it never
> > recovers, so after several hours it could be many seconds latent. I
> > once stopped timing it after 30 seconds of latency and just
> > restarted it.
Restarted what? PulseAudio or MPD? I would expect that restarting MPD is
> Yea, this is one of the most annoying properties of this set up. It is
> really annoying since it's almost a given over wifi.
> I guess to recover from intermittent latency increases you would need to
> skip some audio data which is as hearable as the drop that caused the
> latency increase in the first place. To avoid that you'd have to disable
> latency increase entirely. I can imagine a solution where you increase
> the playback speed (and pitch) slightly to recover but I don't think
> that's implemented.
> So while I find the latency accumulation hugely annoying as well I don't
> know a way out with the current code. But I would love to see this fixed.
Latency can only increase only if there is some buffer that is growing.
module-tunnel doesn't have such buffer. It sounds like MPD is working so
that it writes at a constant pace to an internal buffer, and reads from
the buffer at the rate that PulseAudio asks for more data. If network
glitches occur, PulseAudio will ask less often, so MPD's buffer will get
larger and larger. If this speculation is true, then MPD should be
fixed. It should define some maximum size for the buffer. 30 seconds is
silly. And if you're playing local files, this whole problem shouldn't
exist, because MPD should decode the files at the rate PulseAudio is
consuming the data, not at a constant wall-clock rate.
More information about the pulseaudio-discuss