<head>
        <title></title>
</head>
<body>
<div class="userStyles" style=" font-family: Arial; font-size: 12pt; color: #000000;">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.<br>
<br>
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.<br>
<br>
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:<br>
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<br>
audio/x-raw, layout=(string)interleaved, rate=(int)16000, format=(string)S16LE, channels=(int)1, channel-mask=(bitmask)0x0000000000000001, but current caps are<br>
audio/x-raw, layout=(string)interleaved, rate=(int)16000, format=(string)S16LE, channels=(int)1, channel-mask=(bitmask)0x0000000000000001<br>
<br>
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:<br>
if (memcmp (info->position, other->position,<br>
          GST_AUDIO_INFO_CHANNELS (info) * sizeof (GstAudioChannelPosition)) !=<br>
      0)<br>
    return FALSE;<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
gst-launch-1.0 -v interleave name=i ! \<br>
 audioconvert ! \<br>
 alsasink sync=false buffer-time=1000  \<br>
\<br>
udpsrc port=5000 buffer-size=1000 ! \<br>
 "application/x-rtp, media=(string)audio, clock-rate=(int)16000, encoding-name=(string)L16" ! \<br>
 rtpL16depay ! \<br>
 queue ! \<br>
 audio/x-raw,format=S16BE,layout=interleaved,rate=16000,channels=1 ! \<br>
 audioconvert ! \<br>
 "audio/x-raw,channels=1,channel-mask=(bitmask)0x1" ! \<br>
 tee name=t0 ! queue ! audiomixer name=mix0 !\<br>
 i.sink_0  \<br>
\<br>
udpsrc port=5001 buffer-size=1000 ! \<br>
 "application/x-rtp, media=(string)audio, clock-rate=(int)16000, encoding-name=(string)L16" ! \<br>
 rtpL16depay ! \<br>
 queue ! \<br>
 audio/x-raw,format=S16BE,layout=interleaved,rate=16000,channels=1 ! \<br>
 audioconvert ! \<br>
"audio/x-raw,channels=1,channel-mask=(bitmask)0x2" ! \<br>
 tee name=t1 ! queue ! audiomixer name=mix1 !\<br>
 i.sink_1 \<br>
t0. ! queue ! mix1. \<br>
t1. ! queue ! mix0.<br>
<br>
<br>
 </div>


</body>