keeping multiple audio streams synchronized when applying LADSPA filters

Charlie Laub charleslaub at sbcglobal.net
Mon Dec 11 23:08:40 UTC 2017


I have written a text-based, interactive gstreamer application to stream
audio across my LAN from a "music server" computer to multiple "client"
computers. More info and code here:

http://audio.claub.net/GSASysCon.html

My question is about the client side of this system. 

 

The client computers are located in/at/near active loudspeakers and I have
been passing gstreamer's audio output, via an alsa loopback, to another
program (ecasound) that performs routing and implements LADSPA plugins. This
comprises audio DSP and the crossover for the loudspeaker system. 

 

When testing some recent single board computers, the OS releases came
without the alsa loopback. Despite trying other ways to pass audio between
gstreamer and ecasound on the client I have not been able to duplicate the
low-latency performance of the loopback, which has created a roadblock for
me. But just recently I learned that gstreamer is able to implement LADSPA
plugins, including LADSPA plugins that are external to gstreamer (I wrote my
own). This means that I could possibly implement the "DSP crossover"
functionality right in gstreamer itself and I would no longer need to rely
on the alsa loopback (or ecasound). To do this I need to duplicate
ecasound's routing functions, and its time alignment of the various channels
obtained by splitting the input. 

 

Currently in ecasound, each input channel (e.g. mono or L&R stereo) is
duplicated N times (once per band of the loudspeaker crossover system), a
varying number of LADSPA filters are applied to each channel. There may be
other operations like merging/mxing channels, etc. At the end of the process
all channels are output via a multichannel DAC. I understand that in
gstreamer I can use 'deinterleave' and 'tee' to copy/split the input
channels. My concern is that varying latency will result depending on how
many LADSPA filters are applied to each of the N channels. Each LADSPA
filter has some finite processing overhead and this overhead varies by
filter type and will change depending on the computing hardware employed. 

 

How do I properly interleave the channels back together after applying an
arbitrary number of LADSPA filters and other operations to each channel so
that the timing is correct? Should I employ a multiqueue just prior to
interleave? What other approaches are needed so that the N channels remain
properly synchronized?

 

If I am able to migrate from alsa_loopback+ecasound to running everything
via gstreamer that will streamline and improve the application in many ways.
Any advice and guidance to that end is appreciated. 

 

-Charlie

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20171211/0ef54514/attachment.html>


More information about the gstreamer-devel mailing list