I am trying to gstreamer video from an IMX477 camera connected to a 22 pin MIPI 4 lane port on the Jetson Orin NX. The same camera works when using a 15 pin MIPI dual lane connection instead. Below is some debug data to set the context.
v4l2-ctl --list-devices --all:
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
/dev/media0
vi-output, imx477 10-001a (platform:tegra-capture-vi:1):
**/dev/video0**
Driver Info:
Driver name : tegra-video
Card type : vi-output, imx477 10-001a
Bus info : platform:tegra-capture-vi:1
Driver version : 5.15.136
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.15.136
Hardware revision: 0x00000003 (3)
Driver version : 5.15.136
...
cat /boot/extlinux/extlinux.conf:
LABEL JetsonIO
MENU LABEL Custom Header Config: <CSI Camera IMX477 Dual 4 lane> <M2KE User Custom [2024-09-09-171806]>
LINUX /boot/Image
FDT /boot/dtb/kernel_tegra234-p3768-0000+p3767-0000-nv.dtb
INITRD /boot/initrd
APPEND ${cbootargs} root=PARTUUID=ad065378-dc75-4fec-9dc3-8331b2bac9c3 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0
OVERLAYS **/boot/tegra234-p3767-camera-p3768-imx477-dual-4lane.dtbo**
NvMMLiteBlockCreate : Block : BlockType = 8
0:00:00.247571445 3255 0xaaaae473ed80 WARN v4l2bufferpool gstv4l2bufferpool.c:1116:gst_v4l2_buffer_pool_start:<nvv4l2h265enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:803 **Failed to create CaptureSession**
So from what I can tell the everything on the I2C side is correct but maybe something in the device tree overlay is messed up?
I have decompiled /boot/tegra234-p3767-camera-p3768-imx477-dual-4lane.dtbo and checked several times but the lane numbers and camera config all looks fine to me. Any ideas what could be causing this Failed to create CaptureSession error? Thanks!
Hi @bcastor
Could you share the overlay file to see if you are missing changes?
The main thing would be to check the polarity but this only applies to some ports. The other possibility is that you are missing changes specific to capturing on 4-lanes.
You would need to update both the device-tree and the image sensor register tables to be able to correctly capture at 4-lanes.
Hi Jafeth. Please see below. I have tried changing lane_priority to 6 for both modes under i2c@0 without any improvement. I do not know what the image sensor register tables are.
Is there a reason why? I’m actually using a custom carrier breakout board (see diagram above). Also I just want to be able to get a single camera working over our MIPI 4 lane pinout.
@bcastor The image sensor also needs to be correctly set to output for 4-lane MIPI. When outputting in this mode it is likely that the sensor will need to change some register settings to correctly output for 4-lanes.
If you are basing this on RidgeRun’s driver, these register tables would be in the imx477_mode_tbls.h file. However, I believe RidgeRun had not added 4-lane support to this driver.
If the image sensor registers have not been updated correctly for 4-lane, the output frames will be output wrong or discarded.
I see no major issues with the device-tree overlay. Is it possible to move the 4-lane camera to another port to check that polarity is not the only problem?
We can connect and gstream the camera from the 2 lane MIPI (i2c@1 bus serial_c) just fine (where lane_polarity=0). The issue is with the i2c@0 connection (serial_a and serial_b). imx477_mode_tbls.h is not present in the file system.
Is there a way to use cam0 as two 2 lanes (and split out serial a and b somehow)? Given the above image why can’t the exact same camera work in either cam port?
Otherwise, is this a devkit HW limitation or something intrinsic to the Orin NX?
@jafeth.garcia are you aware of any way to make a single imx477 work on cam0 on the devkit? Assuming you can, my hope is that whatever overlay/driver change is required would also work when the orin is connected to my third party carrier board.