Internal data stream error due to stream position with interleave and audiomixer
mark.wattier at eqware.net
mark.wattier at eqware.net
Fri Jul 19 19:31:47 UTC 2019
I am developing a gstreamer app in C that receives multiple RTP audio streams over UDP, sends a copy of each to a WAV file, and sends another copy to an alsasrc. To select which stream goes to alsasrc, I am using an audiomixer element and I set the volume on the sink pads appropriately. This all works when I have a single channel going to alsasrc.
I need to have two streams going to alsasrc, each of which can be selected independently. For this, I have set up an interleave element and a second audiomixer. Each of the 8 incoming streams has a tee, sending the output to each audiomixer.
This also works, but only when I use a single stream for input. When I add a second stream, I get an Internal data stream error, reason: not-negotiated. With debug on, I chased this back to the audiomixer element, where I got the following message:
0:00:15.634352592 ^[[332m 1297^[[00m 0x243920 ^[[37mDEBUG ^[[00m ^[[00m audiomixer gstaudiomixer.c:402:gst_audiomixer_setcaps:<audiomixer0:sink_1>^[[00m got input caps
audio/x-raw, layout=(string)interleaved, rate=(int)16000, format=(string)S16LE, channels=(int)1, channel-mask=(bitmask)0x0000000000000001, but current caps are
audio/x-raw, layout=(string)interleaved, rate=(int)16000, format=(string)S16LE, channels=(int)1, channel-mask=(bitmask)0x0000000000000001
The caps are the same. I dug deeper, adding my own GST_DEBUG statements and found that gst_audio_info_is_equal was returning false to gst_audiomixer_setcaps, because of this section:
if (memcmp (info->position, other->position,
GST_AUDIO_INFO_CHANNELS (info) * sizeof (GstAudioChannelPosition)) !=
0)
return FALSE;
I have tried many combinations of properties for the audiomixer and interleave elements. I admit I do not completely understand how to use the start-time or alignment threshold properties, but they seem like that could lead to a solution.
I am stuck using gstreamer 1.12.2 for this embedded product, using yocto, branch rocko. I have a hunch that 1.14.4, from yocto branch thud, might resolve this problem, but I would rather not mix up versions in our SDK if I can help it, and it can be difficult to port versions across yocto branches.
The following is a simplified gst-launch pipeline which results in a very similar failure. In this example, the error propogates back to the udpsrc rather than coming up in audiomixer.
gst-launch-1.0 -v interleave name=i ! \
audioconvert ! \
alsasink sync=false buffer-time=1000 \
\
udpsrc port=5000 buffer-size=1000 ! \
"application/x-rtp, media=(string)audio, clock-rate=(int)16000, encoding-name=(string)L16" ! \
rtpL16depay ! \
queue ! \
audio/x-raw,format=S16BE,layout=interleaved,rate=16000,channels=1 ! \
audioconvert ! \
"audio/x-raw,channels=1,channel-mask=(bitmask)0x1" ! \
tee name=t0 ! queue ! audiomixer name=mix0 !\
i.sink_0 \
\
udpsrc port=5001 buffer-size=1000 ! \
"application/x-rtp, media=(string)audio, clock-rate=(int)16000, encoding-name=(string)L16" ! \
rtpL16depay ! \
queue ! \
audio/x-raw,format=S16BE,layout=interleaved,rate=16000,channels=1 ! \
audioconvert ! \
"audio/x-raw,channels=1,channel-mask=(bitmask)0x2" ! \
tee name=t1 ! queue ! audiomixer name=mix1 !\
i.sink_1 \
t0. ! queue ! mix1. \
t1. ! queue ! mix0.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190719/d2df48bd/attachment.html>
More information about the gstreamer-devel
mailing list