On Sat, 2017-07-22 at 14:53 +0200, Colin Leroy wrote: > diff --git a/src/modules/raop/raop-sink.c b/src/modules/raop/raop-sink.c > index e5d219e..108f855 100644 > --- a/src/modules/raop/raop-sink.c > +++ b/src/modules/raop/raop-sink.c > @@ -118,6 +118,13 @@ static int64_t sink_get_latency(const struct userdata *u) { > Â Â Â Â now = pa_smoother_get(u->smoother, now); > Â > Â Â Â Â latency = pa_bytes_to_usec(u->write_count, &u->sink->sample_spec) - (int64_t) now; > +Â Â Â if (latency < 0) { > +Â Â Â Â Â Â Â latency = 0; > +Â Â Â } > + > +Â Â Â latency += 2000000; /* RAOP default latency */ > +Â Â Â latency += pa_raop_client_get_rtp_diff(u->raop) * 1000; /* plus last packet length in usec */ pa_raop_client_get_rtp_diff() returns the size of the last audio chunk in bytes divided by four, but you treat that as a time value. That's a clear bug. Adding the size of the last packet doesn't make sense to me anyway, though. The size of the last packet is already taken into account in u- >write_count. Now you're counting it twice. If the 2 second constant results in too low latency, I think the constant should be made bigger. -- Tanu https://www.patreon.com/tanuk