CSI camera I2C readout orientation

Hello I am using a CSI IMX477 camera with jetson tx2/nano. I have no issues regarding running the deepstream app and getting a video stream.
My problem is that whenever I change CSI I2C readout orientation(having a upside down flipped video), my application crashes.

I know that my camera is in I2C bus 9 at adress 0x1a. So I use command below:

i2ctransfer -f -y 9 w3@0x1a 0x1 0x1 0x1

which successfully gives a mirrored stream(no upside down.) No crash.

But using this a flipped orientation like this:
i2ctransfer -f -y 9 w3@0x1a 0x1 0x1 0x2

or:
i2ctransfer -f -y 9 w3@0x1a 0x1 0x1 0x3

crashes the application.
What might be the reason of this issue? Which settings in device tree causes this?

Error log:

Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]: NvViErrorDecode Stream 0.0 failed: ts 189668146816 frame 214 error 7 data 0x00000001
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]: NvViErrorDecode CaptureError: ChanselShortFrame (7)
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]: NvViErrorDecode See https://wiki.nvidia.com/wmpwiki/index.php/Camera_Debugging/CaptureError_debugging for more information and links to documents.
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]: ChanselShortFrame : 0x00000001
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]:     Channels with PIXEL_INCOMPLETE [11: 0]:
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]:         Channels 0
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]:         This can happen for three reasons: PIXEL_SHORT_FRAME: FE packet arrives before last expected pixel of the uncropped image; EMPTY_FRAME: FE packet arrives before cropped pixels other embedded data been received; PIXEL_OPEN_LINE: A pixel line has been opened with line start but FE packet arrives before line end ever arrives.
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]: captureErrorCallback Stream 0.0 capture 3260 failed: ts 189668146816 frame 214 error 7 data 0x00000001
Oct 17 14:11:35 532a6c2 8800d6883fb1[5142]: 
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: SCF: Error Timeout: ISP port 0 timed out! (in src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 492)
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: Error: waitCsiFrameStart timeout guid 1
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI Stream Id = 0 Virtual Channel = 0
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ************VI Debug Registers**********
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI_CSIMUX_STAT_FRAME_0         = 0x000100d7
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI_CSIMUX_FRAME_STATUS_0         = 0x00000001
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI_CFG_INTERRUPT_STATUS_0         = 0x3f000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI_ISPBUFA_ERROR_0         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI_FMLITE_ERROR_0         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: VI_NOTIFY_ERROR_0         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: *****************************************
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: CSI Stream Id = 0 Brick Id = 0
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ************CSI Debug Registers**********
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: CILA_INTR_STATUS_CILA[0x10400]         = 0x00000089
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: CILB_INTR_STATUS_CILB[0x10c00]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: INTR_STATUS[0x100a4]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: INTR_STATUS[0x100a4]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ERR_INTR_STATUS[0x100ac]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ERROR_STATUS2VI_VC0[0x10094]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ERROR_STATUS2VI_VC1[0x10098]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ERROR_STATUS2VI_VC2[0x1009c]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: ERROR_STATUS2VI_VC3[0x100a0]         = 0x00000000
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: *****************************************
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: SCF: Error Timeout:  (propagating from src/common/Utils.cpp, function workerThread(), line 116)
Oct 17 14:11:36 532a6c2 8800d6883fb1[5142]: SCF: Error Timeout: Worker thread ViCsiHw frameStart failed (in src/common/Utils.cpp, function workerThread(), line 133)
Oct 17 14:11:39 532a6c2 8800d6883fb1[5142]: ERROR from src_elem: TIMEOUT
Oct 17 14:11:39 532a6c2 8800d6883fb1[5142]: Debug info: Argus Error Status
Oct 17 14:11:39 532a6c2 8800d6883fb1[5142]: CONSUMER: ERROR OCCURRED
Oct 17 14:11:39 532a6c2 8800d6883fb1[5142]: Quitting
Oct 17 14:11:40 532a6c2 8800d6883fb1[5142]: GST_ARGUS: Cleaning up
Oct 17 14:11:45 532a6c2 8800d6883fb1[5142]: waitForIdleLocked remaining request 3362 
Oct 17 14:11:45 532a6c2 8800d6883fb1[5142]: waitForIdleLocked remaining request 3361 
Oct 17 14:11:45 532a6c2 8800d6883fb1[5142]: waitForIdleLocked remaining request 3360 
Oct 17 14:11:45 532a6c2 8800d6883fb1[5142]: waitForIdleLocked remaining request 3359 
Oct 17 14:11:45 532a6c2 8800d6883fb1[5142]: waitForIdleLocked remaining request 3358

Thanks for your help in advance!

Hi @berkay.guler

I tested this with an IMX477 sensor in an Orin NX board and I did not see any issues. The flipped and mirrored orientation happened as expected.

So, based on this, I have some questions for you:

  1. Is this a custom driver created by you? Or is it the driver that comes in the NVIDIA sources?
  2. Are you using GStreamer only for testing? If so, could you please share the pipeline?
  1. Could you please test by using v4l2-ctl as follows:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160 --set-ctrl bypass_mode=0 --set-ctrl sensor_mode=0 --stream-mmap

and share the results?

  1. Do you have only 1 sensor for testing? If not, what happens if you test with another sensor?
  2. Are you using a custom board or a development kit board?

Regards,

Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Hi @EduardoSalazar96

  1. This is the driver that comes in NVIDIA sources.
  2. I was testing with native deepstream-app. I also tested with Jetson Nano development kit using this basic pipeline:
    gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink
  3. v4l2-ctl command on Jetson Nano development kit produces:
~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.92 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.94 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.95 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.95 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.80 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.82 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.84 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.82 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.84 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.84 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.85 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.86 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.85 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.86 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.87 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.87 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.87 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.87 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.87 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.89 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.89 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.89 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.89 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.89 fps
...
  1. It is an Arducam camera. I also have an UC-698 Revision-D camera for same model but that doesn’t have this issue. The issue seem to happen in UC-698 Revision-E cameras.(I have additional Revision Es having same problem.)
  2. I tested both in custom board and development kit board. Both produced same issue. It is either crashes the deepstream application or I have this weird video stream:

This is the video stream from pipeline above. Flipping is causing this weird glitch on upper side of the image.


Hi @berkay.guler

I am unsure if this is a glitch or not, do you have access to the sensor datasheet and extra documentation? You could check the documentation to see if that behavior is expected.

Does the issue happen also with the v4l2-ctl command?

Regards!

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