How to open CSI Camera which is connected using MIPI connector?

I have aetina board with Jetson TX2 module and currently using Jetpack 3.3. I have 1 CSI camera only and connected using MIPI connector.

This command will show this message :

ls /dev/video*
/dev/video0  /dev/video1  /dev/video2  /dev/video3  /dev/video4  /dev/video5

And this :

v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'RG12'
	Name        : 12-bit Bayer RGRG/GBGB
		Size: Discrete 1948x1096
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1948x1096
			Interval: Discrete 0.033s (30.000 fps)

When I tried to open the camera using gstreamer using below command, it produced this message and my monitor turned into green screen for a moment and failed

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e
Setting pipeline to PAUSED ...

Available Sensor modes : 
1948 x 1096 FR=30.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=12 DynPixelBitDepth=12
1948 x 1096 FR=60.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=12 DynPixelBitDepth=12
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 1 WxH = 1948x1096 FrameRate = 60.000000 ...

Received error from camera daemon....exiting....
Socket read error. Camera Daemon stopped functioning.....
Got EOS from element "pipeline0".
Execution ended after 0:00:17.080498486
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Any help? Thanks

Hi ivandi5hj8,

You can refer to below docs.

@vickyy

aetina board has its own driver for IMX290 Camera and I already installed it.

I’ve tried the command written on the doc, but still it produces error and green screen is shown

gst-launch-1.0 nvcamerasrc !  'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, \
 format=(string)NV12, framerate=(fraction)30/1' !  nvivafilter cuda-process=true  customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e
Setting pipeline to PAUSED ...

Available Sensor modes : 
1948 x 1096 FR=30.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=12 DynPixelBitDepth=12
1948 x 1096 FR=60.000000 CF=0x1009208a10 SensorModeType=4 CSIPixelBitDepth=12 DynPixelBitDepth=12
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 0 WxH = 1948x1096 FrameRate = 30.000000 ...

Received error from camera daemon....exiting....
Socket read error. Camera Daemon stopped functioning.....
Got EOS from element "pipeline0".
Execution ended after 0:00:17.514956341
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

According to the doc, “Legacy nvcamerasrc plugin support is deprecated”.
Could you try with nvarguscamerasrc mentioned in the doc?

@vickyy isn’t nvcamerasrc is deprecated in Jetpack 4.2? I’m using Jetpack 3.3

Anyway using argus will produces this error :

gst-launch-1.0 nvarguscamerasrc !  'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, \
 format=(string)NV12, framerate=(fraction)30/1' !  nvivafilter cuda-process=true  customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 0 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 0 
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Done Success
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 214)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 317)

Sorry that not notice you’re using jetpack 3.3.

How about v4l2-ctl? Please clarify from v4l2 first.

@ivandi5hj8
Have a try the v4l2-ctl to make sure the sensors driver/hardware without problem first.

v4l2-ctl --set-fmt-video=width=1948,height=1096,pixelformat=RG12 --stream-mmap --set-ctrl=sensor_mode=0 --stream-count=10

@vickyy @ShaneCCC after I input the commend above, nothing is shown. Does it mean there’s a problem with the driver?

Have a check kernel message and reference to below like to enable the trace to confirm.
Enable the trace then run the v4l2-ctl then cat the cat /sys/kernel/debug/tracing/trace again.

https://elinux.org/Jetson_TX2/28.1_Camera_BringUp

Thank you for all the supports, I finally have found a right pipeline to open my camera using this command :

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=640, height=540,format=NV12, framerate=30/1' ! nvoverlaysink -e