Audio artefacts with interaudiosrc/interaudiosink based pipelines

Hugo Melder via gstreamer-devel <[email protected]> Mon, 9 Oct 2023 13:41:22 +0200
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <[email protected]>
Hi,

I am currently developing a daemon that aggregates various AV streams, produces a combined stream of camera and presentation, and seperate streams for camera and presentation for our Live-streaming and VoD service at TUM (https://tum.de/) called TUM-live (https://tum.live <https://tum.live/>). All streams are seperate GStreamer pipelines and managed by the GStreamer RTSP server as mount points.

As I have multiple pipelines using the same streams, I opted to use intervideo* and interaudio* elements for clean separation between source pipelines, and
Pipelines managed by the GStreamer RTSP server.

The Problem
When using interaudiosink and interaudiosrc, I experience strange audio artefacts and skipping when more than one interaudiosrc elements are listening to a interaudiosink channel.

This is an isolated example of a GStreamer audio issue that exists when using interaudio* elements for pipeline seperation.

You can find the test code here: https://gist.github.com/hmelder/4a30bbee0748c48a2263d5233b2f3508

OS: NixOS 23.05.4076.8a4c17493e5c (Stoat) aarch64
Kernel: 6.1.55
CPU: Apple M1 Pro (Virt)
Memory: 8.0GiB
gst-launch-1.0 version: 1.22.5
GStreamer: 1.22.5
Everything works as normal when starting the first and second pipeline. When we start a new instance of the third pipeline (different port) skipping and audio artefacts start appearing on the first and second UDP stream.

audiotestsrc is-live=1 ! capsfilter caps=audio/x-raw,format=S16LE,layout=interleaved,channels=2 ! queue ! interaudiosink channel=audio
interaudiosrc channel=audio0 ! queue ! audioconvert ! audioresample ! opusenc ! rtpopuspay ! udpsink host=127.0.0.1 port=5000
interaudiosrc channel=audio0 ! queue ! audioconvert ! audioresample ! opusenc ! rtpopuspay ! udpsink host=127.0.0.1 port=5001

This problem does not occur when using a tee element and just one pipeline.

Demonstration

Here is a small demonstration video: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/uploads/8fe06d0c8469ac54e302246c6d0a87e5/gstreamer-audio.mp4 

I am fairly new to AV and GStreamer, and would appreciate any help :)

Best Regards

Hugo Melder