Trigger mode camera in Jetson Xavier NX

Hello

we are developing a HW board that use Jetson Xavier NX. We are able to acquire images from a deserializer DS90UB954 using the 2 virtual channels.
Using the sensor in streaming mode all works fine. We are able to acquire using V4L2 or gst pipelines.
Using sensor in triggered mode locks gst capture but V4L2 no.
For explaining better

  • I set the sensor in triggered mode (no data will be sent out from the sensor)
  • I run the V4L2 pipeline that waits for a frame (forever, I suppose…)
  • I trigger 1 frame (externally, using a gpio to the sensor)
  • A frame arrives to the Xavier and a file is correctly saved

If I try the same with the gst pipeline, I see these logs

[gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer
[gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer
[gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer
received SIGINT
[gstreamer] gstCamera::Capture() -- a timeout occurred waiting for the next image buffer
video-viewer:  shutting down...
[gstreamer] gstCamera -- stopping pipeline, transitioning to GST_STATE_NULL
CONSUMER: ERROR OCCURRED

I tryed also to run the pipeline when the sensor is streaming and after change to trigger mode and send a trigger to the sensor. The chain does not acquire anymore.

How to manage this scenario?

hello f.ortolano,

may I know what’s your gst pipeline? are you capturing with v4l2src or nvarguscamerasrc plugin?

Hello

for V4L2 I use

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=GB12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test0.raw

for gst I use

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1' ! nvoverlaysink

Actually, I work with @dusty_nv “video-viewer” pipeline, inside it calls a similar string.

Using V4L2, it waits forever. When I trigger 1 snaphot, it saves the frame and as I can see is good.
Using gst pipeline, it seems that doesn’t not listen the frames (of course, because they are not arriving), and it does not exit from this error situation even if I trigger or I set the sensor in continous mode.

hello f.ortolano,

it might be timed out by nvarguscamerasrc plugin, which by default waiting 2500ms for camera frames.
please try enabling Infinite Timeout Support for verificaiton.

BTW,
may I know which Jetpack release version you’re working with?

Hello

these are my versions

videosystems@ubuntu:~$ dpkg-query --show nvidia-l4t-core 
nvidia-l4t-core	32.7.5-20240611161504
videosystems@ubuntu:~$ uname -a
Linux ubuntu 4.9.337-tegra #1 SMP PREEMPT Tue Jun 11 16:10:01 PDT 2024 aarch64 aarch64 aarch64 GNU/Linux

Hello

I tried this commands

$ sudo service nvargus-daemon stop
$ sudo enableCamInfiniteTimeout=1 nvargus-daemon

but nothing changes.

hello f.ortolano,

A timeout failure should not reported if the infinite timeout support has enabled correctly.
could you please collect nvargus-daemon logs for checking.
for instance, $ sudo journalctl -b -u nvargus-daemon

Hello

Ok I will try this command.
Just to be clear

  • with enableCamInfiniteTimeout=0
videosystems@ubuntu:~$ sudo enableCamInfiniteTimeout=0 nvargus-daemon
[sudo] password for videosystems: 
=== NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections...=== video-viewer[10122]: Connection established (7FA4CDE1D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module2
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module3
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
=== video-viewer[10122]: CameraProvider initialized (0x7fa08a3580)LSC: LSC surface is not based on full res!
  • with enableCamInfiniteTimeout=1
=== NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections...=== video-viewer[10202]: Connection established (7FB0DDD1D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module2
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module3
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
=== video-viewer[10202]: CameraProvider initialized (0x7fac821180)LSC: LSC surface is not based on full res!
PowerServiceCore:handleRequests: timePassed = 6417
PowerServiceCore:handleRequests: timePassed = 767
PowerServiceCore:handleRequests: timePassed = 664
PowerServiceCore:handleRequests: timePassed = 585
PowerServiceCore:handleRequests: timePassed = 591
PowerServiceCore:handleRequests: timePassed = 497
PowerServiceCore:handleRequests: timePassed = 8750

So, every trigger it prints the last rows. If i resume the sensor to “continous” I face on the logs a lot of

(Argus) Error OverFlow: Too many pending events, ignoring new events (in src/api/EventProviderImpl.cpp, function addEvent(), line 158)

Hello

mmm I suppose that I have to enable something else because this command

sudo journalctl -b -u nvargus-daemon

shows only this

videosystems@ubuntu:~$ sudo journalctl -b -u nvargus-daemon
-- Logs begin at Thu 2023-03-02 13:58:02 CET, end at Fri 2024-11-08 09:52:37 CET. --
Nov 07 17:15:42 ubuntu systemd[1]: Started Argus daemon.
Nov 08 09:09:59 ubuntu systemd[1]: Stopping Argus daemon...
Nov 08 09:09:59 ubuntu nvargus-daemon[4672]: === NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections...
Nov 08 09:09:59 ubuntu systemd[1]: Stopped Argus daemon.

Hello @JerryChang

could the parameters inside DTS influence in this behaviour? I have this configuration for the sensor. Maybe something in the parameters of framerate (eg, the minimum must be set to 0?)

			mt9p031vs_cam0: mt9p031vs_a@5d {	
			
				status = "okay";

				compatible = "nvidia,mt9p031vs";

				/* I2C device address */
				reg = <0x5d>;

				/* V4L2 device node location */
				devnode = "video0";

				/* Physical dimensions of sensor */
				physical_w = "5.7";
				physical_h = "4.28";

				sensor_model = "mt9p031";

				use_sensor_mode_id = "true";

				mode0 { /* MT9P031_MODE_1280x720_60FPS */

					vc_id = "0";

					mclk_khz = "27000";
					num_lanes = "4";
					tegra_sinterface = "serial_a";
					phy_mode = "DPHY";
					discontinuous_clk = "yes";
					dpcm_enable = "false";
					cil_settletime = "0";

					active_w = "1280";
					active_h = "720";
					
					/*pixel_t = "bayer_bggr"; */
					mode_type = "bayer";
					csi_pixel_bit_depth = "12";
					pixel_phase = "gbrg"; //"rggb"; //"gbrg"; "rggb"; /*"bggr";*/


					readout_orientation = "0";
					line_length = "2180";
					inherent_gain = "1";
					mclk_multiplier = "12";
					pix_clk_hz = "300000000";//"48 000 000";

					gain_factor = "16";
					framerate_factor = "1000000";
					exposure_factor = "1000000";
					min_gain_val = "16"; /* 1.00x */
					max_gain_val = "170"; /* 10.66x */
					step_gain_val = "1";
					default_gain = "16"; /* 1.00x */
					min_hdr_ratio = "1";
					max_hdr_ratio = "1";
					min_framerate = "2000000"; /* 2.0 fps */
					max_framerate = "60000000"; /* 400.0 fps */
					step_framerate = "1";
					default_framerate = "60000000"; /* 60.0 fps */
					min_exp_time = "13"; /* us */
					max_exp_time = "683709"; /* us */
					step_exp_time = "1";
					default_exp_time = "2495"; /* us */

					embedded_metadata_height = "0";
				};

				ports {
					#address-cells = <1>;
					#size-cells = <0>;

					port@0 {
						reg = <0>;
						mt9p031_out0: endpoint {
							status = "okay";
							vc-id = <0>; 
							port-index = <CSIPORT_A>;
							bus-width = <4>;
							remote-endpoint = <&mt9p031_csi_in0>;
						};
					};
				};
			};

hello f.ortolano,

I don’t see any logs reported by nvarguscamerasrc. may I also how many external triggers you’ve given to the sensor?

Is this still an issue to support? Any result can be shared?

Hello
yes I have to complete other test regarding other issues (not concerning camera’s development), I think I resume this topic next week, so I will come back as soon as possible.