L4T-32.2 Tegra_Multimedia_API : cannot acquire from more than one camera

Hello,

We have an acquisition application that we developed using the Tegra Multimedia API. We used the samples provided in the package as reference. This application was developed on TX2 with L4T-28.2.1 with ConnectTech’s BSP that supports the Spacely carrier and x3 IMX274 Leopard Imaging cameras. Our application runs properly in this environment.

We recently replaced our TX2 with a TX2i and flashed it with the brand new L4T-32.2 (JetPack-4.2.1) with the accurate ConnectTech’s BSP. We are having troubles updating our application with modifications brought to the Argus API and get it running.
We used following samples provided with the JetPack (installed with SDKManager after manually flashing the board with ConnectTech’s BSP) as reference in order to update our application : tegra_multimedia_api/samples/09_camera_jpeg_capture
; tegra_multimedia_api/samples/13_multi_camera
; tegra_multimedia_api/argus/samples/syncSensor
. Our application’s architecture is very close to those displayed inside those examples (same objects, same order in calling methods…).

Our application does work when using only a single camera captured in a single capture session. But trying to capture several cameras at a time (either with a single capture session or several sessions with one camera per session) fails at the call of iCaptureSession->repeat(request.get())
and produce the following output:

Argus version : 0.97.3 (single-process)

(some verbose from our application...)

(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1856)
updateOutputSettings: Set Control failed. Use cached values
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1856)
updateOutputSettings: Set Control failed. Use cached values
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function streamControl(), line 1661)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function apply(), line 205)
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1856)
updateOutputSettings: Set Control failed. Use cached values
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1856)
updateOutputSettings: Set Control failed. Use cached values
(NvCamV4l2) Error IoctlFailed:  (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function setControlValMultiple(), line 792)
(NvOdmDevice) Error IoctlFailed:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1856)
updateOutputSettings: Set Control failed. Use cached values
Error: waitCsiFrameEnd timeout guid 4
VI Stream Id = 1 Virtual Channel = 0
************VI Debug Registers**********
VI_CSIMUX_STAT_FRAME_4	 = 0x00000000
VI_CSIMUX_FRAME_STATUS_0	 = 0x00000100
VI_CFG_INTERRUPT_STATUS_0	 = 0x3f000000
VI_ISPBUFA_ERROR_0	 = 0x00000000
VI_FMLITE_ERROR_0	 = 0x00000000
VI_NOTIFY_ERROR_0	 = 0x00000000
*****************************************
CSI Stream Id = 1 Brick Id = 0
************CSI Debug Registers**********
CILA_INTR_STATUS_CILA[0x10400]	 = 0x00000089
CILB_INTR_STATUS_CILB[0x10c00]	 = 0x00000000
INTR_STATUS[0x108a4]	 = 0x00000000
INTR_STATUS[0x108a4]	 = 0x00000000
ERR_INTR_STATUS[0x108ac]	 = 0x00000000
ERROR_STATUS2VI_VC0[0x10894]	 = 0x00000000
ERROR_STATUS2VI_VC1[0x10898]	 = 0x00000000
ERROR_STATUS2VI_VC2[0x1089c]	 = 0x00000000
ERROR_STATUS2VI_VC3[0x108a0]	 = 0x00000000
*****************************************
SCF: Error BadValue: timestamp cannot be 0 (in src/services/capture/NvViCsiHw.cpp, function waitCsiFrameEnd(), line 711)
SCF: Error BadValue:  (propagating from src/common/Utils.cpp, function workerThread(), line 116)
SCF: Error BadValue: Worker thread ViCsiHw frameComplete failed (in src/common/Utils.cpp, function workerThread(), line 133)
Error: waitCsiFrameStart timeout guid 4
VI Stream Id = 1 Virtual Channel = 0
************VI Debug Registers**********
VI_CSIMUX_STAT_FRAME_4	 = 0x00000000
VI_CSIMUX_FRAME_STATUS_0	 = 0x00000100
VI_CFG_INTERRUPT_STATUS_0	 = 0x3f000000
VI_ISPBUFA_ERROR_0	 = 0x00000000
VI_FMLITE_ERROR_0	 = 0x00000000
VI_NOTIFY_ERROR_0	 = 0x00000000
*****************************************
CSI Stream Id = 1 Brick Id = 0
************CSI Debug Registers**********
CILA_INTR_STATUS_CILA[0x10400]	 = 0x00000089
CILB_INTR_STATUS_CILB[0x10c00]	 = 0x00000000
INTR_STATUS[0x108a4]	 = 0x00000000
INTR_STATUS[0x108a4]	 = 0x00000000
ERR_INTR_STATUS[0x108ac]	 = 0x00000000
ERROR_STATUS2VI_VC0[0x10894]	 = 0x00000000
ERROR_STATUS2VI_VC1[0x10898]	 = 0x00000000
ERROR_STATUS2VI_VC2[0x1089c]	 = 0x00000000
ERROR_STATUS2VI_VC3[0x108a0]	 = 0x00000000
*****************************************
SCF: Error BadValue: timestamp cannot be 0 (in src/services/capture/NvViCsiHw.cpp, function waitCsiFrameStart(), line 624)
SCF: Error BadValue:  (propagating from src/common/Utils.cpp, function workerThread(), line 116)
SCF: Error BadValue: Worker thread ViCsiHw frameStart failed (in src/common/Utils.cpp, function workerThread(), line 133)
SCF: Error Timeout:  (propagating from src/components/amr/Snapshot.cpp, function waitForNewerSample(), line 92)
SCF_AutocontrolACSync failed to wait for an earlier frame to complete.

SCF: Error Timeout:  (propagating from src/components/ac_stages/ACSynchronizeStage.cpp, function doHandleRequest(), line 126)
SCF: Error Timeout:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 137)
SCF: Error Timeout: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 990)
SCF: Error InvalidState: Session has suffered a critical failure (in src/api/Session.cpp, function capture(), line 667)
(Argus) Error InvalidState:  (propagating from src/api/ScfCaptureThread.cpp, function run(), line 109)
SCF: Error InvalidState: Session has suffered a critical failure (in src/api/Session.cpp, function capture(), line 667)

We tried running the samples (built by the SDKManager through SSH). The 09_camera_jpeg_capture runs alright (thought jpegs are not saved, but still we can see frames through the EGL rendered), but the 13_multi_cam also fails and produce :

[INFO] (NvEglRenderer.cpp:110) <renderer0> Setting Screen width 640 height 480
Argus Version: 0.97.3 (multi-process)
CONSUMER: Waiting until producer is connected...
CONSUMER: Producer has connected; continuing.
CONSUMER: Waiting until producer is connected...
CONSUMER: Producer has connected; continuing.
CONSUMER: Waiting until producer is connected...
CONSUMER: Producer has connected; continuing.
CONSUMER: Waiting until producer is connected...
CONSUMER: Producer has connected; continuing.
CONSUMER: Waiting until producer is connected...
CONSUMER: Producer has connected; continuing.
CONSUMER: Waiting until producer is connected...
CONSUMER: Producer has connected; continuing.
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 87)
Error generated. main.cpp, execute:430 Failed to submit capture request
(Argus) Error BadParameter:  (propagating from src/eglstream/FrameConsumerImpl.cpp, function acquireFrame(), line 261)
CONSUMER: Render frame 1
nvbuf_utils: dmabuf_fd 1049 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...
NvBufferGetParams failed for dst_dmabuf_fd
nvbuffer_composite Failed
nvbuf_utils: dmabuf_fd 1049 mapped entry NOT found
Segmentation fault

(Please note that the sample is actually hanging at line 14 for a while, with the EGL renderer only displaying a full black box, before displaying the errors.)

I can’t help but notice that despite the fact that the samples are reading an Argus version of type multi-process, our application is reading an Argus version of type single-process and wonder if it has anything to do with our issue. Unfortunately, I cannot tell if that was also the case on our properly working application on L4T-28.2.1 (I just added the argus version reading feature to our code)…

I have not tried yet running syncSensor, as it is not built yet. I will try it and update this post when it is done.

I have contacted ConnectTech’s support to ask them if their BSP supports having packages like Tegra_Multimedia_API being installed using SDKManager after flashing the board. I am still waiting for their answer.


Setup:

  • Board: TX2i
  • Carrier: ConnectTech Spacely
  • OS: L4T-32.2 (installed from JetPack-4.2.1
  • BSP ConnectTech: V126 (support for Spacely carrier + x6 IMX274 Leopard Imaging cameras
  • x3 IMX274 Leopard Imaging cameras

Thank you for any intel you might share.

Best regards,

Hi,
The device tree of TX2i is in another dts file. You may contact ConnectTech to offer you device tree patches for TX2i.

Hi,

Thank you DaneLLL for your answer.

We managed to fix the issue, but the device tree was not the cause.

We found out that we had a wrong hardware configuration, causing the problem:

  1. The Spacely carrier has several DIP switches to set CSI ports on 2-lanes or 4-lanes modes. We did not set it right (our previous config was 4-lanes and we flashed a 2-lanes configuration).
  2. We were trying to access cameras of index 0 - 1 - 2 but our 3 cameras were actually plugged into ports corresponding to indexes 0 - 2 - 4 (CSI port indexes are different in 2-lanes and 4-lanes configurations).

We also found that we can keep using only 3 cameras even in a 6-camera configured system as long as we do not try to access the missing cameras.

Regarding the 13_multi_cam sample, we just had to set the max number of output streams (parameter -n) to 3 after plugging the cameras to the right CSI ports to get it working.

Best regards,