Kernel panic occurs while running gstreamer pipeline

Hi,

ORIN NX Carrier board JP - 5.1.2

I have two drivers - OV5693 and IMX296. I want to stream video on two video nodes video0 and video1 respectively. I am able to get cat /dev/video0 and cat /dev/video1 as expected from both cameras.
However when I run the gstreamer pipeline for video0 (ov5693 driver)

gst-launch-1.0 -e v4l2src device=/dev/video0 ! 'video/x-raw, width=640, height=480, framerate=30/1' ! videoconvert ! ximagesink

the kernel freezes and dumps the below:

$ gst-launch-1.0 -e v4l2src device=/dev/video0 ! 'video/x-raw, width=640, height=480, framerate=30/1' ! videoconvert ! ximagesink 
Setting pipeline to PAUSED ... 
Pipeline is live and does not need PREROLL ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock Message from syslogd@XXXXX1 at Feb  5 10:00:06 ... kernel:[ 72.020760] Internal error: Oops: 9600004e [#1] PREEMPT SMP

and causes the system to reboot.

i tried autovideosink, fpsdisplaysink etc - the issue persists and the system freezes.

However, when there is only ov5693 driver and only one video node, i am able to run the above pipeline and stream video.


~$ v4l2-ctl -d /dev/video0 --all
Driver Info:
	Driver name      : tegra-video
	Card type        : vi-output, ov5693 2-0036
	Bus info         : platform:tegra-capture-vi:0
	Driver version   : 5.10.120
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : tegra-camrtc-ca
	Model            : NVIDIA Tegra Video Input Device
	Serial           : 
	Bus info         : 
	Media version    : 5.10.120
	Hardware revision: 0x00000003 (3)
	Driver version   : 5.10.120
Interface Info:
	ID               : 0x0300000b
	Type             : V4L Video
Entity Info:
	ID               : 0x00000009 (9)
	Name             : vi-output, ov5693 2-0036
	Function         : V4L2 I/O
	Pad 0x0100000a   : 0: Sink
	  Link 0x0200000f: from remote pad 0x1000003 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Priority: 2
Video input : 0 (Camera 0: ok)
Format Video Capture:
	Width/Height      : 640/480
	Pixel Format      : 'YUYV' (YUYV 4:2:2)
	Field             : None
	Bytes per Line    : 1280
	Size Image        : 614400
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 
Selection Video Capture: crop, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection Video Output: crop, Left 0, Top 0, Width 640, Height 480, Flags: 

Camera Controls

                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                     hdr_enable 0x009a2004 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                    eeprom_data 0x009a2005 (str)    : min=0 max=2048 step=2 value='' flags=read-only, has-payload
                       otp_data 0x009a2006 (str)    : min=0 max=1024 step=2 value='' flags=read-only, has-payload
                        fuse_id 0x009a2007 (str)    : min=0 max=16 step=2 value='' flags=read-only, has-payload
                           gain 0x009a2009 (int64)  : min=10 max=160 step=1 default=10 value=10 flags=slider
                       exposure 0x009a200a (int64)  : min=34 max=550385 step=1 default=33334 value=34 flags=slider
                     frame_rate 0x009a200b (int64)  : min=1816577 max=30000000 step=1 default=30000000 value=1816577 flags=slider
                 exposure_short 0x009a200c (int64)  : min=34 max=550385 step=1 default=33334 value=34 flags=slider
           sensor_configuration 0x009a2032 (u32)    : min=0 max=4294967295 step=1 default=0 [22] flags=read-only, volatile, has-payload
         sensor_mode_i2c_packet 0x009a2033 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
      sensor_control_i2c_packet 0x009a2034 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
				0: 1 (0x1)
				1: 65536 (0x10000)
				2: 131072 (0x20000)
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=1 flags=read-only
$ v4l2-ctl -d /dev/video1 --all
Driver Info:
	Driver name      : tegra-video
	Card type        : vi-output, vc_mipi 9-001a
	Bus info         : platform:tegra-capture-vi:2
	Driver version   : 5.10.120
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : tegra-camrtc-ca
	Model            : NVIDIA Tegra Video Input Device
	Serial           : 
	Bus info         : 
	Media version    : 5.10.120
	Hardware revision: 0x00000003 (3)
	Driver version   : 5.10.120
Interface Info:
	ID               : 0x0300001b
	Type             : V4L Video
Entity Info:
	ID               : 0x00000019 (25)
	Name             : vi-output, vc_mipi 9-001a
	Function         : V4L2 I/O
	Pad 0x0100001a   : 0: Sink
	  Link 0x0200001f: from remote pad 0x1000006 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Priority: 2
Video input : 0 (Camera 2: no power)
Format Video Capture:
	Width/Height      : 1440/1080
	Pixel Format      : 'RG10' (10-bit Bayer RGRG/GBGB)
	Field             : None
	Bytes per Line    : 2880
	Size Image        : 3110400
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 
Selection Video Capture: crop, Left 0, Top 0, Width 1440, Height 1080, Flags: 
Selection Video Output: crop, Left 0, Top 0, Width 1440, Height 1080, Flags: 

Camera Controls

                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                    sensor_mode 0x009a2008 (int64)  : min=0 max=1 step=1 default=0 value=0 flags=slider
                           gain 0x009a2009 (int64)  : min=0 max=48000 step=100 default=0 value=0 flags=slider
                       exposure 0x009a200a (int64)  : min=1 max=15533515 step=1 default=10000 value=1 flags=slider
                     frame_rate 0x009a200b (int64)  : min=100 max=60816 step=100 default=60000 value=100 flags=slider
                   trigger_mode 0x009a200e (int)    : min=0 max=7 step=1 default=0 value=0
                        io_mode 0x009a200f (int)    : min=0 max=5 step=1 default=0 value=0
                    black_level 0x009a2010 (int)    : min=0 max=2147483647 step=1 default=0 value=0
                 single_trigger 0x009a2011 (button) : flags=write-only, execute-on-write
           sensor_configuration 0x009a2032 (u32)    : min=0 max=4294967295 step=1 default=0 [22] flags=read-only, volatile, has-payload
         sensor_mode_i2c_packet 0x009a2033 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
      sensor_control_i2c_packet 0x009a2034 (u32)    : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
				0: 0 (0x0)
				1: 1 (0x1)
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
				0: 1 (0x1)
				1: 65536 (0x10000)
				2: 131072 (0x20000)
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=1 flags=read-only

this the device tree:
dts.txt (417.2 KB)

dump message:
dmesg.txt (70.6 KB)

Please advice.

Hi,
The device tree and driver of Ov5693 and IMX296 may not be correct, so it does not work properly when two cameras are present. Please refer to Camera Development in
Camera Development — Jetson Linux Developer Guide documentation

And try to launch both cameras successfully in v4l2-ctl commands first.

@DaneLLL ,

whenever i try to run v4l2-ctl test for video0, the kernel freezes

video0:

$ v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=YUYV --stream-mmap --stream-count=100 -d /dev/video0

Message from syslogd@XXXXX1 at Mar 15 15:29:26 ...
 kernel:[ 1518.891334] Internal error: Oops: 9600004e [#1] PREEMPT SMP

video1:

$ v4l2-ctl --set-fmt-video=width=1080,height=1080,pixelformat=RG10 --stream-mmap --stream-count=100 -d /dev/video1
<<<<< 0.88 fps
< 0.88 fps
< 0.88 fps
< 0.88 fps
< 0.88 fps

hello san1998,

I assume it’s referring to NULL pointer and causing kernel panic.
you may examine your driver implementation, could you please see-also developer guide, Verifying the V4L2 Sensor Driver.

@JerryChang ,

yes, the compliance test freezes at this point for video0:

$ v4l2-compliance -d /dev/video0
v4l2-compliance SHA: not available, 64 bits

Compliance test for tegra-video device /dev/video0:

Driver Info:
	Driver name      : tegra-video
	Card type        : vi-output, ov5693 2-0036
	Bus info         : platform:tegra-capture-vi:0
	Driver version   : 5.10.120
	Capabilities     : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : tegra-camrtc-ca
	Model            : NVIDIA Tegra Video Input Device
	Serial           : 
	Bus info         : 
	Media version    : 5.10.120
	Hardware revision: 0x00000003 (3)
	Driver version   : 5.10.120
Interface Info:
	ID               : 0x0300000b
	Type             : V4L Video
Entity Info:
	ID               : 0x00000009 (9)
	Name             : vi-output, ov5693 2-0036
	Function         : V4L2 I/O
	Pad 0x0100000a   : 0: Sink
	  Link 0x0200000f: from remote pad 0x1000003 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled

Required ioctls:
	test MC information (see 'Media Driver Info' above): OK
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second /dev/video0 open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK
	test for unlimited opens: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls (Input 0):
	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
	test VIDIOC_QUERYCTRL: OK
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 1 Private Controls: 24

Format ioctls (Input 0):
		fail: v4l2-test-formats.cpp(280): duplicate format 56595559 (YUYV)
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL
		fail: v4l2-test-formats.cpp(1280): ret && node->has_frmintervals
	test VIDIOC_G/S_PARM: FAIL
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
	**test VIDIOC_TRY_FMT: OK**    --->freezes

hello san1998,

it’s basic IOCTL test to sensor for checking valid pixel formats.
please review your sensor driver, please check you’ve control operations implemented correctly.
you may see-also developer guide, Setter Control Handlers (for Writing Settings), and Control Operations.

@JerryChang

I found out that some extra controls / formats were added which were not used by the video0 - v4l2 device. The driver was modified and now I am able to stream video from the node video0.

Thank you.

For streaming on video1, i get the following error : No cameras available

$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1440,height=1080,framerate=60/1,format=NV12' ! nvvidconv ! fpsdisplaysink video-sink=xvimagesink sync=false -v


Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstXvImageSink:xvimagesink0: sync = false
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:751 **No cameras available**
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1440, height=(int)1080, format=(string)NV12, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1440, height=(int)1080, format=(string)NV12, framerate=(fraction)60/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1, format=(string)YUY2
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1, format=(string)YUY2
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:src: caps = video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1, format=(string)YUY2
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstXvImageSink:xvimagesink0.GstPad:sink: caps = video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1, format=(string)YUY2
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:video_sink: caps = video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1, format=(string)YUY2
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = video/x-raw, width=(int)1440, height=(int)1080, framerate=(fraction)60/1, format=(string)YUY2
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1440, height=(int)1080, format=(string)NV12, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1440, height=(int)1080, format=(string)NV12, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstXvImageSink:xvimagesink0: sync = false
Got EOS from element "pipeline0".
Execution ended after 0:00:00.005163072
Setting pipeline to NULL ...
Freeing pipeline ...

hello san1998,

can video1 streaming via v4l2 IOCTL?
if yes, please examine all those DT settings within tegra-camera-platform{}

@JerryChang,

Yes.
I get cat /dev/video1dump and stream on v4l2 IOCTL

Here is my device tree settings:

lens@vc_mipi {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "6.0";
		f_number = "2.0";
		aperture = "0.0";
	};

	e3326_lens_ov5693@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <0x02>;
		max_lane_speed = <0x16e360>;
		min_bits_per_pixel = <0x0a>;
		vi_peak_byte_per_pixel = <0x02>;
		vi_bw_margin_pct = <0x19>;
		max_pixel_rate = <0x3a980>;
		isp_peak_byte_per_pixel = <0x05>;
		isp_bw_margin_pct = <0x19>;
		phandle = <0x48f>;

		modules {

			module0 {
				status = "okay";
				badge = "e3326_front_P5V27C";
				position = "rear";
				orientation = [31 00];
				phandle = <0x490>;

				drivernode0 {
					status = "okay";
					pcl_id = "v4l2_sensor";
					devname = "ov5693 2-0036";
					proc-device-tree = "/proc/device-tree/i2c@3180000/ov5693_c@36";
					phandle = <0x491>;
				};

				drivernode1 {
					status = "okay";
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
					phandle = <0x492>;
				};
			};

			module1 {
				status = "okay";
				badge = "jakku_rear_vc_mipi";
				position = "rear";
				orientation = [31 00];
				phandle = <0x493>;

				drivernode0 {
					status = "okay";
					pcl_id = "v4l2_sensor";
					devname = "vc_mipi 10-001a";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@1a";
					phandle = <0x494>;
				};

				drivernode1 {
					status = "okay";
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
					phandle = <0x495>;
				};
			};
		};

i have defined vc_mipi@1a in i2c@0 node under cam_i2cmux …
there is no i2c@1 node
is this why?

@JerryChang

I figured out that the “devname” in tegra-camera-platform was incorrect.
I am now able to stream both videos.

Thank you.

1 Like

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