[pulseaudio-discuss] Adding delay in order to sync soundcard with a2dp stream

Tanu Kaskinen tanuk at iki.fi
Tue Dec 22 10:12:41 PST 2009


to, 2009-12-17 kello 11:50 +0100, Lennart Poettering kirjoitti:
> On Thu, 03.12.09 20:33, Alexander H Deriziotis (jackflap at lavabit.com) wrote:
> 
> > Hi all,
> > 
> > I'm outputting audio to both a bluetooth speaker via a2dp and the
> > internal soundcard by using module-combine to create a virtual sink.
> > 
> > The problem is that the sound arrives at the bluetooth speaker I think
> > around 0.5 seconds after it's played on the soundcard.
> > 
> > Is there any way to add a delay to the internal soundcard sink in
> > order to synchronize the audio coming out of the wired speakers and
> > the bluetooth speaker?
> 
> Nope there currently is not.
> 
> Ideally we'd determine the latencies automatically. Unfortunately some
> interfaces simply don't allow that, such as SPDIF, early HDMI, and BT
> audio. 
> 
> It should be trivial to write a module for PA that simply piggybacks
> on another sink and adds a configurable latency. However, ideally we'd
> fix this by implementing a more generic filter framework in PA that
> allows plugging stuff like this into an existing sink without
> introducing an additional piggybacked sink.

For these devices that have a stable but initially unknown or wrong
latency, wouldn't a configurable latency parameter be a more appropriate
fix? The parameter would be just added to the latency value that the
hardware reports (if it reports anything) and there wouldn't be need for
a separate delay buffer.

> There have been some
> discussions about that and tanuk even prepared some code for this, but
> this hasn't been finished yet.

If nobody else steps up, expect this to remain vaporware for quite some
time. I don't seem to be very productive nowadays... I hope I can get
the D-Bus stuff mostly fixed in a few weeks, then I can start thinking
again about this filter stuff. I want to have proper latency accounting
and support for fixed blocksize filters. I believe those features are
going to give me headaches, because the pipeline will have to do
buffering and the sinks (and other components) have to take that into
account in their own operation...

-- 
Tanu Kaskinen




More information about the pulseaudio-discuss mailing list