How can I give Argus lane_swizzle effect?

Hi,

I have an image sensor with data lane swapped [D0 ↔ D1].
Because I want to acquire images with this sensor, csi5_fops.c Set brick_config.lane_swizzle.

	/* Brick config */
	memset(&brick_config, 0, sizeof(brick_config));
	brick_config.phy_mode = (!is_cphy) ?
		NVCSI_PHY_TYPE_DPHY : NVCSI_PHY_TYPE_CPHY;
+	brick_config.lane_swizzle = NVCSI_LANE_SWIZZLE_A1A0B0B1;

And using the kernel image I built, I was able to get a RAW image via V4L2.

v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw
<

However, when I using nvarguscamerasrc, I got the same error as before changing lane_swizzle and couldn’t get the image.

GStreamer Error:

Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:694 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED

Camera Trace:

#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     kworker/3:0-2740    [003] ....  1234.231862: rtcpu_vinotify_event: tstamp:40085677986 cch:1 vi:0 tag:VIFALC_TDSTATE channel:0x0b frame:0 vi_tstamp:1282741483424 data:0x719cc80010000000
     kworker/3:0-2740    [003] ....  1234.231875: rtcpu_vinotify_event: tstamp:40085678164 cch:1 vi:0 tag:VIFALC_TDSTATE channel:0x0b frame:0 vi_tstamp:1282741526080 data:0x0000000031000001
     kworker/3:0-2740    [003] ....  1234.287754: rtcpu_nvcsi_intr: tstamp:40086607642 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:0 vc:0 status:0x00000001
     kworker/3:0-2740    [003] ....  1234.287764: rtcpu_nvcsi_intr: tstamp:40086607642 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:0 vc:0 status:0x00000001
     kworker/3:0-2740    [003] ....  1234.287767: rtcpu_nvcsi_intr: tstamp:40086608344 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:0 vc:0 status:0x00000001
     kworker/3:0-2740    [003] ....  1234.287769: rtcpu_nvcsi_intr: tstamp:40086608344 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:0 vc:0 status:0x00000001

I also tried the reverse pattern for verification.
If you use a kernel image with a normal sensor and a modified lane_swizzle, V4L2 fails and you can get the image in Argus.

How can I give Argus “lane_swizzle” effect?

I using

  • Orin NX module
  • L4T R35.3.1

hello fumiya.fujinaka,

Argus pipeline it uses device tree property, lane_polarity to configure a polarity swap.
you may see-also reference driver,
for example, $puiblic_sources/kernel_src/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi

Hello, @JerryChang

Thanks for your reply.

But, what I want to know is lane_swizzle, not lane_polarity.

I know about lane_polarity and have set it properly.
The problem is if I swapped the “D0” and “D1” lanes.

image

Bypassing the ISP with V4L2 was able to retrieve the data.
but, I am not able to get data only when using ArgusAPI.

hello fumiya.fujinaka,

I’ve checked this. it’s currently not support to configure LaneSwizzle via Argus due to there’s no RCE (i.e. Real-time Camera-control Engine) API’s to support this configuration yet.

it seems like a feature request, let me submit this for review internally.

Hi, @JerryChang

Okay, I understand.
It would be nice to see it implemented in the future.
For the time being, I will modify the circuit of this sensor module and use it.

Thank you very much for confirming!