Asynchrounous Audio Sample Rate Conversion with gstreamer

Maik Scholz Scholz.Maik at t-online.de
Wed May 25 13:04:55 UTC 2016


Hi,
thank you very much for the hints.
With your help, my pipeline is running quite well with ONE audio source.

My target is, having multiply audio sources with different sample rates and
different external clock sources.
That includes small sample rate mismatches (+- 50Hz) and drifts.

*My mixer pipeline prototype:*
GSTLAUNCH=gst-launch-1.0
STREAMDECHOST=127.0.0.1
PORT_SRC1=41001
PORT_SRC2=42001
PORT_SINK_DEBUG_1=45002

${GSTLAUNCH} \
                audiomixer name=sink_audiomixer latency=256000000 ! \
                tee name=sink_tee \
                \
                sink_tee. ! \
                queue name=outtcp_queue ! \
                tcpserversink name=tcpserversink host="0.0.0.0"
port=${PORT_SINK_DEBUG_1} \
                \
                sink_tee. ! \
                queue name=outdsp_queue ! \
                autoaudiosink name=autoaudiosink sync=true
slave-method=resample \
                \
                sink_tee. ! \
                queue name=file_queue ! \
                audioconvert name=fileconvert ! \
                filesink name=file_filesink location=/dev/null \
                \
                udpsrc name=src1_src port=${PORT_SRC1} do-timestamp=true ! \
                audio/x-raw,format=S16LE,channels=2,rate=32000 ! \
                queue name=src1_queue min-threshold-time=0 ! \
                audiorate name=src1_audiorate tolerance=256000000
skip-to-first=false ! \
                audioconvert name=src1_audioconvert ! \
                audioresample name=src1_audioresample quality=1 ! \
                audio/x-raw,format=S16LE,channels=2,rate=48000 ! \
                tee name=src1_tee \
                \
                src1_tee. ! \
                volume name=src1_volume volume=0.5 ! \
                sink_audiomixer. \
                \
                udpsrc name=src2_src port=${PORT_SRC2} do-timestamp=true ! \
                audio/x-raw,format=S16LE,channels=2,rate=48000 ! \
                queue name=src2_queue min-threshold-time=0 ! \
                audiorate name=src2_audiorate tolerance=256000000
skip-to-first=false ! \
                audioconvert name=src2_audioconvert ! \
                audioresample name=src2_audioresample quality=4 ! \
                audio/x-raw,format=S16LE,channels=2,rate=48000 ! \ 
                tee name=src2_tee \
                \
                src2_tee. ! \
                volume name=src2_volume volume=0.5 ! \
                sink_audiomixer.
               

*My SRC1 audio transmitter (32000 - 50Hz):*
gst-launch-1.0 audiotestsrc freq=100 !
audio/x-raw,format=S16LE,channels=2,rate=31950 ! udpsink host="127.0.0.1"
port=41001

*My SRC2 audio transmitter (48000 + 50Hz):*
gst-launch-1.0 audiotestsrc freq=300 !
audio/x-raw,format=S16LE,channels=2,rate=48050 ! udpsink host="127.0.0.1"
port=42001

When I run these pipelines with even the latest gst version, then I hear
"clicks" from time to time.
I expect, that the audiomixer has some problems with the differ sampling
frequencies.

My assumption is, I need a asynchronous SRC for each input
(src1_audioresample+src2_audioresample).
How can I implement this with available elements. Or if not available, what
is the best way to implement these?

Why is the audiomixer located in the bad plugins? What means bad?




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Asynchrounous-Audio-Sample-Rate-Conversion-with-gstreamer-tp4677252p4677765.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list