Dual imx708 cameras on Orin NX: Getting nvbuf_utils: dmabuf_fd -1 mapped entry NOT found

Hi,

I have hooked up 2 Arducam IMX708 camera modules (https://www.arducam.com/product/presalearducam-12mp-imx708-hdr-120-wide-angle-camera-module-with-m12-lens-for-raspberry-pi/) on the cam0 and cam1 CSI ports of my Orin NX 16GB (https://www.seeedstudio.com/reComputer-J4012-p-5586.html).

I’m running Arducam provided kernel and dtb (https://github.com/ArduCAM/MIPI_Camera/releases/download/v0.0.1-orin-nx/arducam-nvidia-l4t-kernel-t234-nx-5.10.192-tegra-35.5.0-20240307160102_arm64_imx708.deb) on the following software stack:
L4T 35.5.0
Jetpack: 5.1.3
Ubuntu: 20.04 focal
Release: 5.10.192-tegra

My gstreamer version is the following:

# gst-launch-1.0 --version
gst-launch-1.0 version 1.16.3
GStreamer 1.16.3
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

I have also enabled the camera ports using jetson-io.

Both cameras are getting detected and visible as v4l2 devices /dev/video0 and /dev/video1

# dmesg | grep imx708
[   12.972720] nv_imx708: no symbol version for module_layout
[   13.007427] imx708 9-001a: tegracam sensor driver:imx708_v2.0.6
[   13.308146] imx708 9-001a: imx708_board_setup: invalid sensor model id: 32
[   13.316166] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx708 9-001a bound
[   13.317293] imx708 10-001a: tegracam sensor driver:imx708_v2.0.6
[   13.617991] imx708 10-001a: imx708_board_setup: invalid sensor model id: 32
[   13.625615] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx708 10-001a bound

Also, the system works perfectly for a single camera on either cam0 / cam1 port.

When I run gstreamer, the camera on sensor-id=1 works:

# gst-launch-1.0 nvarguscamerasrc timeout=20 sensor-id=1 ! 'video/x-raw(memory:NVMM),width=2304,height=1296,framerate=14/1, format=NV12' ! nvv4l2h265enc ! filesink location=a.mp4 -e
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 4608 x 2592 FR = 14.000001 fps Duration = 71428568 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 500000, max 65487000;

GST_ARGUS: 2304 x 1296 FR = 55.000001 fps Duration = 18181818 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 500000, max 65487000;

GST_ARGUS: 1536 x 864 FR = 90.000001 fps Duration = 11111111 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 500000, max 65487000;

GST_ARGUS: Running with following settings:
   Camera index = 1
   Camera mode  = 1
   Output Stream W = 2304 H = 1296
   seconds to Run    = 20
   Frame Rate = 55.000001
GST_ARGUS: Setup Complete, Starting captures for 20 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
NvVideo: H265 : Profile : 1
NVMEDIA: Need to set EMC bandwidth : 1340266
NvVideo: bBlitMode is set to TRUE
GST_ARGUS: Cleaning up
Got EOS from element "pipeline0".
Execution ended after 0:00:20.072010697
Setting pipeline to NULL ...
CONSUMER: Done Success
GST_ARGUS: Done Success
Freeing pipeline ...

But the same pipeline on sensor-id=0 fails for all operations - be it jpeg encode or video encode:

# gst-launch-1.0 nvarguscamerasrc timeout=20 sensor-id=0 ! 'video/x-raw(memory:NVMM),width=2304,height=1296,framerate=14/1, format=NV12' ! nvv4l2h265enc ! filesink location=a.mp4 -e
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 4608 x 2592 FR = 14.000001 fps Duration = 71428568 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 500000, max 65487000;

GST_ARGUS: 2304 x 1296 FR = 55.000001 fps Duration = 18181818 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 500000, max 65487000;

GST_ARGUS: 1536 x 864 FR = 90.000001 fps Duration = 11111111 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 500000, max 65487000;

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 1
   Output Stream W = 2304 H = 1296
   seconds to Run    = 20
   Frame Rate = 55.000001
GST_ARGUS: Setup Complete, Starting captures for 20 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:702 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
Got EOS from element "pipeline0".
Execution ended after 0:00:04.004623610
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
GST_ARGUS: Done Success
Freeing pipeline ...

Any hint on what I should be looking at?

Thanks in advance.

Sorry for the late response.
Is this still an issue to support? Any result can be shared?

Yes, this issue still persists.

I have tried it out with dual IMX219-120 camera modules as well, and I see the same error strings pointing to some issue in gstnvarguscamerasrc.cpp - failure for 1st sensor and 2nd sensor works fine.

Thank you!

Check the tegra_sinterface in the sensor mode for example. It should be serial_b

/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a/mode0# cat tegra_sinterface

Thanks for the response, @ShaneCCC.

To verify things closely, I took a step back. I flashed my Orin NX with the following software pack:
L4T 35.5.0
Jetpack: 5.1.3
Ubuntu: 20.04 focal
Release: 5.10.192-tegra

No change to any part of the Orin Linux - kernel, dtbs, drivers all as provided by Nvidia.

I then connected 2 IMX219-120 camera modules (8MP IMX219 - Arducam Wiki) since they are supported out of the box.

The same story repeats - both cameras getting detected

# dmesg | grep imx
[   12.479549] imx219 9-0010: tegracam sensor driver:imx219_v2.0.6
[   12.495930] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 9-0010 bound
[   12.497297] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[   12.513476] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 10-0010 bound

And only 1 camera sensor works - sensor-id=1. sensor-id=0 fails with the same error:

# gst-launch-1.0 nvarguscamerasrc timeout=20 sensor-id=0 ! 'video/x-raw(memory:NVMM),width=2304,height=1296,framerate=14/1, format=NV12' ! nvv4l2h265enc ! filesink location=a.mp4 -e
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 8
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3280 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3280 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 1
   Output Stream W = 3280 H = 1848
   seconds to Run    = 20
   Frame Rate = 28.000001
GST_ARGUS: Setup Complete, Starting captures for 20 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:702 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
Additional debug info:
Argus Error Status
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Interrupt while waiting for EOS - stopping pipeline...
Execution ended after 0:00:09.993648974
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
Freeing pipeline ...

On your advice, here are the tegra_sinterface variables from the proc device-tree. I have tried this in both the imx219 and imx477 directories for all mode directories - and I see serial_b as expected.

root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# ls
compatible  devnode  mode0  mode1  mode2  mode3  mode4  name  phandle  physical_h  physical_w  ports  reg  reset-gpios  sensor_model  use_sensor_mode_id
root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode0/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode1/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode2/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode3/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode4/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10#

root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a# ls
compatible  devnode  mode0  mode1  name  phandle  physical_h  physical_w  ports  reg  reset-gpios  sensor_model  status  use_sensor_mode_id
root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a# cat mode0/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a# cat mode1/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a#

Please advise.

Thanks.

Can switch the camera to check.

Thanks

I switched the IMX219-120 camera modules on the cam ports.

No change in camera module behaviour - sensor-id=1 works, sensor-id=0 fails.

Also, no change seen in tegra_sinterface - serial_b everywhere.

root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# ls
compatible  devnode  mode0  mode1  mode2  mode3  mode4  name  phandle  physical_h  physical_w  ports  reg  reset-gpios  sensor_model  use_sensor_mode_id
root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode0/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode1/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode2/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode3/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10# cat mode4/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_imx219_a@10#
root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a# ls
compatible  devnode  mode0  mode1  name  phandle  physical_h  physical_w  ports  reg  reset-gpios  sensor_model  status  use_sensor_mode_id
root@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a# cat mode0/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a# cat mode1/tegra_sinterface
serial_broot@ubuntu:/proc/device-tree/cam_i2cmux/i2c@0/rbpcv3_imx477_a@1a#

Does v4l2-ctl working?

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap -d /dev/video0 

This command hangs the Orin - tried it multiple times.

I have captured the relevant dmesg output before it hanged:

[   51.192138] bwmgr API not supported
[   53.935794] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[   53.948529] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[   53.958126] (NULL device *): vi_capture_control_message: NULL VI channel received
[   53.965859] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=1, csi_port=1
[   53.976521] (NULL device *): vi_capture_control_message: NULL VI channel received
[   53.984896] ------------[ cut here ]------------
[   53.989726] channel context at 0 is busy
[   53.989753] WARNING: CPU: 3 PID: 2385 at /dvs/git/dirty/git-master_linux/kernel/nvidia/drivers/platform/tegra/rtcpu/capture-ivc.c:176 tegra_capture_ivc_notify_chan_id+0x18c/0x1b0
[   54.006126] Modules linked in: nvidia_modeset(O) fuse lzo_rle lzo_compress zram ramoops reed_solomon loop bnep iwlmvm snd_soc_tegra186_asrc snd_soc_tegra186_arad snd_soc_tegra210_ope snd_soc_tegra186_dspk snd_soc_tegra210_mvc mac80211 snd_soc_tegra210_iqc snd_soc_tegra210_afc snd_soc_tegra210_dmic snd_soc_tegra210_admaif snd_soc_tegra210_adx snd_soc_tegra210_amx snd_soc_tegra_pcm snd_soc_tegra210_sfc snd_soc_tegra210_i2s snd_soc_tegra210_mixer btusb btrtl btbcm btintel aes_ce_blk crypto_simd cryptd aes_ce_cipher ghash_ce sha2_ce sha256_arm64 sha1_ce snd_soc_tegra_machine_driver snd_soc_spdif_tx userspace_alert snd_soc_tegra210_adsp snd_hda_codec_hdmi fusb301 snd_soc_tegra_utils snd_soc_simple_card_utils snd_soc_tegra210_ahub nvadsp snd_hda_tegra tegra_bpmp_thermal nv_imx219 tegra210_adma snd_hda_codec snd_hda_core iwlwifi spi_tegra114 cfg80211 nvidia(O) r8168 binfmt_misc ina3221 pwm_fan nvgpu nvmap ip_tables x_tables [last unloaded: mtd]
[   54.006219] CPU: 3 PID: 2385 Comm: vi-output, imx2 Tainted: G           O      5.10.192-tegra #1
[   54.006220] Hardware name: NVIDIA Orin NX Developer Kit (DT)
[   54.006224] pstate: 60c00009 (nZCv daif +PAN +UAO -TCO BTYPE=--)
[   54.006226] pc : tegra_capture_ivc_notify_chan_id+0x18c/0x1b0
[   54.006228] lr : tegra_capture_ivc_notify_chan_id+0x18c/0x1b0
[   54.006230] sp : ffff80001468bae0
[   54.006232] x29: ffff80001468bae0 x28: 0000000000000000
[   54.006235] x27: 0000000000001043 x26: ffff72fffaf56400
[   54.006238] x25: ffff72ffe0ae2338 x24: ffff72ffc4340088
[   54.006241] x23: 0000000000000041 x22: ffff72ffc4340080
[   54.006245] x21: ffff72ffc43408a0 x20: 0000000000000000
[   54.006248] x19: 0000000000000041 x18: 0000000000000000
[   54.006251] x17: 0000000000000000 x16: 0000000000000000
[   54.006254] x15: ffff72fff8a3cf30 x14: ffffffffffffffff
[   54.006257] x13: ffffc74679919e28 x12: ffffc74679919a5b
[   54.006260] x11: 0000000000000000 x10: 0000000000000ab0
[   54.006264] x9 : ffff80001468bae0 x8 : 2073692030207461
[   54.006267] x7 : 20747865746e6f63 x6 : c0000000ffffefff
[   54.006270] x5 : ffff73032e8de978 x4 : ffffc74679617ba8
[   54.006273] x3 : 0000000000000001 x2 : ffff73032e8de980
[   54.006276] x1 : 0000000000000000 x0 : 0000000000000000
[   54.006279] Call trace:
[   54.006282]  tegra_capture_ivc_notify_chan_id+0x18c/0x1b0
[   54.006287]  vi_capture_setup+0x35c/0x670
[   54.006290]  tegra_channel_capture_setup+0xe8/0x2d0
[   54.006292]  vi5_channel_error_recover+0x140/0x200
[   54.006296]  tegra_channel_error_recover+0x78/0xa0
[   54.006299]  tegra_channel_kthread_capture_dequeue+0x130/0x1f0
[   54.006303]  kthread+0x148/0x170
[   54.006308]  ret_from_fork+0x10/0x18
[   54.006310] ---[ end trace 4a872d941626181f ]---
[   54.011078] tegra194-vi5 13e40000.host1x:vi0@15c00000: failed to update control callback
[   54.019446] tegra-camrtc-capture-vi tegra-capture-vi: vi capture setup failed
[   54.026803] tegra-camrtc-capture-vi tegra-capture-vi: fatal: error recovery failed

Get the trace log to check if more clue.

https://elinux.org/Jetson/l4t/Camera_BringUp#Steps_to_enable_more_debug_messages

Hi @ShaneCCC,

I flashed the JetPack 5.1.3 and L4T 35.5.0 using the CLI and not the SDKManager.

The 2 IMX219’s on Orin NX are now working fine.

The tegra_sinterfaces for IMX219 say “serial_a” and not “serial_b” BTW.

There is a similar thread on Seeed Studio forums mentioning this - they are using JetPack 5.1.2 here:
https://forum.seeedstudio.com/t/recomputer-j4011-dual-camera-issues-cannot-stream-from-cam1-j12/272126/7

So something is off-kilter with the SDKManager method of flashing - please ask your release team to look into this.

Thanks.

Do you mean using sdkmanager have problem to form imx219 on cam0?

1 Like

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