3

HTTP stream from my MPD lags, i.e. audio from Pulse and HTTP output are not in sync, with HTTP output lagging Pulse. This also means that starting/pausing/stopping music from MPD is not reflected immediately on the HTTP stream.

Also, the perceived lag on HTTP stream keeps increasing with time. When I first start MPD, the lag is ~2sec, but this balloons to almost half a minute after playing continuously for an hour or so.

Following is the setup from my ~/.mpdconf

audio_output {
    type "pulse"
    name "My Pulse Output"
}
audio_output {
    type        "httpd"
    name        "My HTTP Stream"
    encoder     "vorbis"        # optional, vorbis or lame
    port        "6601"
    bind_to_address "any"       # optional, IPv4 or IPv6
#   quality     "5.0"           # do not define if bitrate is defined
    bitrate     "128"           # do not define if quality is defined
    format      "44100:16:1"
#   max_clients "0"         # optional 0=no limit
    always_on   "yes"
}
Rocket Singh
  • 53
  • 1
  • 4

1 Answers1

2

Players employ caches to hide connectivity problems from the users; that's probably where the delay comes from. Check your player's settings to see if you can tweak the buffer size.

As for ever-growing delay, it might be caused by lack of bandwidth. You should enable logging in your player and see if it ever pauses waiting for cache to fill. If it does, you'll have to figure out where the bandwidth is lacking (it might be either server not having enough upstream or the client not having enough downstream), and then either increase the bandwidth or lower the bitrate.

Alexander Batischev
  • 2,363
  • 11
  • 19
  • I think this is correct. My XBMC player lags behind the desktop which serves the stream. When i test with mplayer on my localhost, the time mplayer spends caching is about the same as the lag. But even calling mplayer with -nocache it's behind. – andrew lorien May 08 '17 at 10:16