[pulseaudio-discuss] Transporting sound from 'mpd' server to laptop

Thomas Martitz kugel at rockbox.org
Sun Oct 20 18:23:50 CEST 2013


Am 20.10.2013 18:08, schrieb Paul LeoNerd Evans:
> On Sun, 20 Oct 2013 07:25:23 +0100
> Tanu Kaskinen <tanu.kaskinen at linux.intel.com> wrote:
>
>> 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.
> In fact, I have just used tcpdump to prove this isn't the case.
>
> Because the TCP tunnel contains pure uncompressed PCM audio, a tcpdump
> with hexdump of the raw TCP segments contains pure zeroes during
> silence. With mpd paused, I see lots of zeroes go by.
>
> The /moment/ I unpause mpd, those zeros turn into varying numbers,
> containing real audio data. Yet my speakers remain silent... a number
> of seconds afterwards, sound now comes out. So then I hit pause.
> Instantly, those numbers in tcpdump are all zeroes again, but yet it
> takes a number of seconds for the sound to stop coming out of the
> speakers.
>
> This latency is occurring entirely with the tunnel receiver in my
> laptop, and not mpd.
>

Interesting find. That indeed proves pulseaudio at the receiving end 
accumulates latency. I have always felt it must be that way because the 
progressbars of all media players I have tried correspond to where the 
app is at decoding (and not what the speaker output).

I wonder if it's really in the tunnel module or somewhere deeper. I also 
wonder if this works differently with the rewritten tunnel module (this 
year's GSoC brought it, it's in git master but not released yet).

Best regards


More information about the pulseaudio-discuss mailing list