Deepstream-test5-app crashes when csi-camera source detects a object/human

Hi,

i’ve noticed the crash happens the moment inference is done for a csi source(Moved a picture filled with people infront of the camera). The error shown:

Segmentation fault (core dumped)

Additional warnings at the start:

(deepstream-test5-app:11119): GLib-GObject-WARNING **: 15:51:00.541: g_object_set_is_valid_property: object class 'avenc_mpeg4' has no property named 'iframeinterval'

(deepstream-test5-app:11119): GLib-GObject-WARNING **: 15:51:00.541: g_object_set_is_valid_property: object class 'avenc_mpeg4' has no property named 'bufapi-version'

My config file:

# Copyright (c) 2018 NVIDIA Corporation.  All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=1
rows=2
columns=2
width=1280
height=720
gpu-id=0
#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory, applicable for Tesla
#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory, applicable for Tesla
#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory, applicable for Tesla
#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=2
uri=file://../../../../../samples/streams/sample_1080p_h264.mp4
#num-sources=1
gpu-id=0
nvbuf-memory-type=0


[source1]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=5
camera-width=1280
camera-height=720
camera-fps-n=30
camera-fps-d=1
camera-csi-sensor-id=0


[source2]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=2
uri=file://../../../../../samples/streams/sample_1080p_h264.mp4
#num-sources=1
gpu-id=0
nvbuf-memory-type=0

[source3]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=2
uri=rtmp://semerkandglb.mediatriple.net:1935/semerkandliveedge/semerkand2
gpu-id=0
nvbuf-memory-type=0

[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File
type=2
sync=0
source-id=0
gpu-id=0
nvbuf-memory-type=0

[sink1]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=UDPSink 5=nvoverlaysink 6=MsgConvBroker
type=6
msg-conv-config=dstest5_msgconv_sample_config.txt
#(0): PAYLOAD_DEEPSTREAM - Deepstream schema payload
#(1): PAYLOAD_DEEPSTREAM_MINIMAL - Deepstream schema payload minimal
#(256): PAYLOAD_RESERVED - Reserved type
#(257): PAYLOAD_CUSTOM   - Custom schema payload
msg-conv-payload-type=1
msg-broker-proto-lib=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_azure_proto.so
msg-broker-config=cfg_azure.txt
#topic=mytopic
#Optional:


[sink2]
enable=1
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265 3=mpeg4
## only SW mpeg4 is supported right now.
codec=3
sync=1
bitrate=2000000
output-file=out.mp4
source-id=0

[osd]
enable=1
gpu-id=0
border-width=2
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Arial
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=1
batch-size=4
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
batched-push-timeout=40000
## Set muxer output width and height
width=1280
height=720
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
batch-size=4
## 0=FP32, 1=INT8, 2=FP16 mode
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;1;1;1
bbox-border-color3=0;1;0;1
nvbuf-memory-type=0
interval=0
gie-unique-id=1
#model-engine-file=../../../../../samples/models/Primary_Detector/resnet10.caffemodel_b4_int8.engine
model-engine-file=../../../../../samples/models/Primary_Detector_Nano/resnet10.caffemodel_b8_fp16.engine
labelfile-path=../../../../../samples/models/Primary_Detector_Nano/labels.txt
config-file=../../../../../samples/configs/deepstream-app/config_infer_primary.txt
#infer-raw-output-dir=../../../../../samples/primary_detector_raw_output/

[tracker]
enable=0
tracker-width=600
tracker-height=300
ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
#ll-config-file required for DCF/IOU only
#ll-config-file=tracker_config.yml
#ll-config-file=iou_config.txt
gpu-id=0
#enable-batch-process applicable to DCF only
enable-batch-process=0

[tests]
file-loop=1

I am able to replicate this error multiple times with the same action taken… The stream(1 rstp,2 file source,1 csi camera) works fine until the moment the csi camera detects an object, then it crashes. CSI camera is raspberry camera v2.

It is possible that the error is unique to me? Mr Valdivia is able to use his csi camera just fine.
(Shown here:)
https://www.youtube.com/watch?v=h8vA42f_xM0&t=309s

Hi,
We have a sample config for running CSI camera in deepstream-app:

deepstream_sdk_v4.0.1_jetson\samples\configs\deepstream-app\source1_csi_dec_infer_resnet_int8.txt

Could you modify it per your CSI camera(width,height,framerate,…) and check if the issue still exists?

Hi,

Running the sample config with frame rate 1280X720 at n=120,d=1 works fine. Camera and detection both works normally.
Here what i noticed: crash occurs when running a file source with csi camera
Tested scenarios on deepstream-test5-app:

  1. Csi camera only: works
  2. File and rtsp together: works (regardless of live-source being set to 1 or 0)
  3. File and csi camera together: crashes, when detection occurs at csi camera.
  4. Rtsp and csi camera together: works! Regardless of live-source being 1 or 0.

Hi,
For more information, do you use Jetson Nano? Or Xavier?

Hi,

I am using Jetson Nano.

Hi,
Please add the if condition to very beginning of extract_utc_from_uri() in deepstream_utc.c:

if (uri == NULL) {
  printf("csi source does not have uri \n");
  return utc_timespec;
}

Solved! Thank you for the prompt response.