The events are duplicated when linking an unliking elements to the sink pads of nvstreamux

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
NVIDIA GeForce RTX 3060 Laptop GPU
• DeepStream Version
6.3.0
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
535.104.05
• Issue Type( questions, new requirements, bugs)
bug
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

Here’s the code to reproduce the issue:

duplicated_events.zip (2.4 KB)

Build a docker image with the Dockerfile in the archive and run it for a few seconds (for me 5 seconds is enough):

docker build -t duplicated_events .
docker run --gpus all -it --rm duplicated_events 2>&1 | tee test.log

Then check for duplicated events in the log:

grep 'log_event_pad_probe.*nvstreamdemux0.src_0' test.log | sed -re 's/.*Event type: (.*)\. Seqnum: ([0-9]+)\..*/\2\t\1/' | sort | uniq -c | sort

...
      3 7324	<enum GST_EVENT_CAPS of type Gst.EventType>
      3 7433	<enum GST_EVENT_CAPS of type Gst.EventType>
      3 8467	<enum GST_EVENT_CAPS of type Gst.EventType>
grep 'Seqnum: 7324' test.log

2023-09-22 05:16:34,832 [log_event_pad_probe] [INFO] [Dummy-1] Pad: nvstreamdemux0.src_0. Event type: <enum GST_EVENT_CAPS of type Gst.EventType>. Seqnum: 7324. Struct: GstEventCaps, caps=(GstCaps)"video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ multiview-mode\=\(string\)mono\,\ format\=\(string\)I420\,\ block-linear\=\(boolean\)false\,\ nvbuf-memory-type\=\(string\)nvbuf-mem-cuda-device\,\ gpu-id\=\(int\)0\,\ batch-size\=\(int\)1\,\ num-surfaces-per-frame\=\(int\)1";.
2023-09-22 05:16:34,832 [log_event_pad_probe] [INFO] [Dummy-3] Pad: nvstreamdemux0.src_0. Event type: <enum GST_EVENT_CAPS of type Gst.EventType>. Seqnum: 7324. Struct: GstEventCaps, caps=(GstCaps)"video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ multiview-mode\=\(string\)mono\,\ format\=\(string\)I420\,\ block-linear\=\(boolean\)false\,\ nvbuf-memory-type\=\(string\)nvbuf-mem-cuda-device\,\ gpu-id\=\(int\)0\,\ batch-size\=\(int\)1\,\ num-surfaces-per-frame\=\(int\)1";.
2023-09-22 05:16:34,832 [log_event_pad_probe] [INFO] [Dummy-1] Pad: nvstreamdemux0.src_0. Event type: <enum GST_EVENT_CAPS of type Gst.EventType>. Seqnum: 7324. Struct: GstEventCaps, caps=(GstCaps)"video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ multiview-mode\=\(string\)mono\,\ format\=\(string\)I420\,\ block-linear\=\(boolean\)false\,\ nvbuf-memory-type\=\(string\)nvbuf-mem-cuda-device\,\ gpu-id\=\(int\)0\,\ batch-size\=\(int\)1\,\ num-surfaces-per-frame\=\(int\)1";.
grep 'log_event_pad_probe.*nvstreamdemux0.src_0' test.log | grep -v 'GST_EVENT_' | sed -re 's/.*Event type: (.*)\. Seqnum: ([0-9]+)\..*/\2\t\1/' | sort | uniq -c | sort

...
      2 34270	<enum 102942 of type Gst.EventType>
      2 41327	<enum 102942 of type Gst.EventType>
      2 6606	<enum 102942 of type Gst.EventType>
grep 'Seqnum: 6606' test.log

2023-09-22 05:16:34,795 [log_event_pad_probe] [INFO] [Dummy-3] Pad: nvstreammux0.src. Event type: <enum 102942 of type Gst.EventType>. Seqnum: 6606. Struct: nv-stream-eos-1-114, source-id=(uint)1;.
2023-09-22 05:16:34,796 [log_event_pad_probe] [INFO] [Dummy-3] Pad: nvstreamdemux0.src_0. Event type: <enum 102942 of type Gst.EventType>. Seqnum: 6606. Struct: nv-stream-eos-1-114, source-id=(uint)1;.
2023-09-22 05:16:34,797 [log_event_pad_probe] [INFO] [Dummy-3] Pad: nvstreamdemux0.src_0. Event type: <enum 102942 of type Gst.EventType>. Seqnum: 6606. Struct: nv-stream-eos-1-114, source-id=(uint)1;.
2023-09-22 05:16:34,797 [log_event_pad_probe] [INFO] [Dummy-3] Pad: nvstreamdemux0.src_1. Event type: <enum 102942 of type Gst.EventType>. Seqnum: 6606. Struct: nv-stream-eos-1-114, source-id=(uint)1;.
2023-09-22 05:16:34,797 [log_event_pad_probe] [INFO] [Dummy-3] Pad: nvstreammux0.src. Event type: <enum 102942 of type Gst.EventType>. Seqnum: 6606. Struct: nv-stream-eos-1-114, source-id=(uint)1;.

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Can you provide a detailed description of the duplicated events from your log and the problems it brings?

In the logs you can see the same event GST_EVENT_CAPS (seqnum=7324) was received by nvstreamdemux0.src_0 3 times, event nv-stream-eos-1-114 (seqnum=6606) was generated by nvstreammux0.src 2 times. In our project (Savant) we’re using nv-stream-eos events to dynamically unlink elements from src pad of nvstreamdemux and remove them. Duplicating of this event can lead to removing those elements before all frames were handled. I.e.

  1. Link elements to nvstreammux.sink_0 and nvstreamdemux.src_0.
  2. Unlink those elements after the first EOS on nvstreammux.sink_0 and nv-stream-eos on nvstreamdemux.src_0 are received.
  3. Link new elements to nvstreammux.sink_0 and nvstreamdemux.src_0.
  4. nvstreamdemux.src_0 receives the same nv-stream-eos again and we’re unlinking elements from that pad. But nvstreammux.sink_0 didn’t receive EOS and frames are still passing through it. That leads to errors.

As a workaround we’re tracking seqnum of already processed events to skip duplicates. But it looks like a bug in deepstream that nvstreammux or nvstreamdemux are sending the same event again sometimes.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Could you refer to our demo code : deepstream_rt_src_add_del.py.

  1. send flush stop event
  2. release the pad of streammux
  3. remove the plguin

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.