As I noticed, when I enable primary GIE based on YOLOv7 for DeepStream from this repository, after a while the application has the following error:
g_signal_handler_unblock: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
instance with invalid (NULL) class pointer
g_signal_handler_block: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
instance with invalid (NULL) class pointer
g_signal_handler_unblock: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
instance with invalid (NULL) class pointer
g_signal_handler_block: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
instance with invalid (NULL) class pointer
g_signal_handler_unblock: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
NVPARSER: HEVC: Seeking is not performed on IRAP picture
gst_mini_object_unlock: assertion 'state >= SHARE_ONE' failed
gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
g_object_unref: assertion 'G_IS_OBJECT (object)' failed
g_object_ref: assertion 'G_IS_OBJECT (object)' failed
gst_allocator_free: assertion 'GST_IS_ALLOCATOR (allocator)' failed
gst_object_unref: assertion '((GObject *) object)->ref_count > 0' failed
gst_mini_object_unlock: assertion 'state >= SHARE_ONE' failed
gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
The application most likely crashes, but sometimes it can continue to work, but data from one of the RTSP camera is not processed further.
Also I have a dynamic pipeline, so every n seconds it writes the video to a new file (example of this pipeline I mentioned here).
Yes, the error is probably related to the YOLOv7 repository, but maybe you can help.
Without the primary-gie module everything works fine, but if it is enabled, this error appears.
I made a reproducible case, you can check the attached zip file. Logs are here too. It took me about 2 hours to get this error. test.zip (92.2 MB)
** INFO: <perf_cb:49>: **PERF: 5.02 (4.72) what is your RTSP source’s fps? as the logs shown, the pipeline’s fps is only about 5, please check the memory usage because frame will be buffered if can’t process ASAP.
RTSP source’s FPS is 8. But pipeline FPS on single camera is about 4.5. I’ve already made an experiment with memory, but I didn’t notice something abnormal. I described results in the same GitHub issue as this.
I also tried skipping frames in the primary GIE using interval=1, but the problem is still there.
Also I noticed a warning which also appears sometimes:
GStreamer-CRITICAL **: 19:18:30.202:
Trying to dispose element fakesink, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
It happens when I try to remove fakesink from the pipeline (video_logs.c file):
I have a dynamic pipeline, so I always have to switch between usual sink and fakesink to create new output file depends on some registered event. Yeah, I can use smart record, but it’s not flexible in my case.
As it turned out, the error doesn’t depend on the static or dynamic pipeline. So I run code on simple pipeline: source->streammux->GIE->demuxer->fakesink and I also have this error.
Also I made some mistake here:
I launched primary GIE using interval=1 on usual pipeline again and after 20 hours problem still doesn’t appear.
So with interval=0 the problem is here and with interval=1 the problem is gone.
So if there isn’t enough FPS to process everything, the pipeline will crash, as you mentioned here:
I updated code for reproducible case with pipeline source->streammux->GIE->demuxer->fakesink. Now it’s more easy to understand code. Logs with the error are also here. test.zip (92.2 MB)
So what should be the solution to this problem? Can I handle this error in code?
Yeah, interval=1 will do inference every second frame, so performance will increase. But can we handle this error in code to prevent it in the future? Because the solution to make interval=1 seems unreliable.
Yeah, I can use filesink, but it should work with fakesink also.
Also I tried running yolov7 in the default deepstream-app application. For one rtsp source it works fine, but for multiple sources (I tested with 4 sources) it crashes.
I have described the results here.
I haven’t tested the two rtsp sources yet. For 4 cameras crashes in 20 minutes.
For one source, the deepstream-app worked for 30 hours, after which I stopped it.
Also I’ve noticed a new error, I set interval=0 instead of 3 in this config for deepstream-app. So with any 1 and 2 rtsp streams everything is ok, but when I have 3 or 4 rtsp sources, than I get a new error something like that:
**PERF: 1.63 (1.63) 1.62 (1.55) 1.61 (1.58) 1.63 (1.65)
** INFO: <perf_cb:189>: 2022-10-31__19_17_57
**PERF: 1.63 (1.57) 1.63 (1.59) 1.63 (1.61) 1.63 (1.59)
** INFO: <perf_cb:189>: 2022-10-31__19_17_58
** WARN: <watch_source_status:738>: No data from source 2 since last 5 sec. Trying reconnection
NVMEDIA: NVMEDIABufferProcessing: 1099: Consume the extra signalling for EOS
** INFO: <reset_source_pipeline:1546>: Resetting source 2
**PERF: 1.64 (1.60) 1.64 (1.62) 1.64 (1.56) 1.64 (1.62)
** INFO: <perf_cb:189>: 2022-10-31__19_17_59
ERROR from src_elem2: Unhandled error
Debug info: gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin2/GstRTSPSrc:src_elem2:
Option not supported (551)
ERROR from src_elem2: Could not write to resource.
Debug info: gstrtspsrc.c(8244): gst_rtspsrc_pause (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin2/GstRTSPSrc:src_elem2:
Could not send message. (Generic error)
NvMMLiteOpen : Block : BlockType = 279
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 279
Opening in BLOCKING MODE
**PERF: 1.57 (1.56) 1.52 (1.58) 1.55 (1.60) 1.55 (1.65)
** INFO: <perf_cb:189>: 2022-10-31__19_18_00
NVPARSER: HEVC: Seeking is not performed on IRAP picture
NVPARSER: HEVC: Seeking is not performed on IRAP picture
NVPARSER: HEVC: Seeking is not performed on IRAP picture
NVPARSER: HEVC: Seeking is not performed on IRAP picture
NVPARSER: HEVC: Seeking is not performed on IRAP picture
NVPARSER: HEVC: Seeking is not performed on IRAP picture
NVPARSER: HEVC: Seeking is not performed on IRAP picture
**PERF: 1.56 (1.59) 1.58 (1.61) 1.59 (1.56) 1.59 (1.61)
** INFO: <perf_cb:189>: 2022-10-31__19_18_01
But the application does not crash completely, after this error it continues to work (at least for 2 hours).
Maybe this problem is also somehow related to the original problem.
Now I’m going to run tests with the batch-size and will write about the results later.