[R35.1]Jetson Orin nvargus_nvraw can not capture image

I porting Ar0820 camera to my Jetson Orin kit。
I can use v4l2-ctrl cmd to capture rawimg,the image is correct 。
use this command , it is work 。
v4l2-ctl -V --set-fmt-video=width=3848,height=2168,pixelformat=‘RG12’ --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 -d /dev/video0 --stream-to=0820.raw

but when i use nvargus_nvraw to capture,
nvargus_nvraw can find the camera , but it does not work when i capture images .it here is nvargus log and kernel trace.

root@orin-desktop:/home/orin# nvargus_nvraw --lps
nvargus_nvraw version 1.13.1
Number of supported sensor entries 1
Entry Source Mode Uniquename Resolution FR BitDepth Mode
Index Index Index CSI Dyn Type
0 0 0 ar0820_rear_p1 3840x2160 29 12 12 Bayer

root@orin-desktop:/home/orin# nvargus_nvraw --c 0 --mode 0 --file 1.raw --format “nvraw”
nvargus_nvraw version 1.13.1
(“nvargus_nvraw”) Error BadParameter (0x04): No events in queue (in capture_nvraw/src/mobile/ArgusNvRawCapture.cpp,
func captureRequest(), line 656)
(“nvargus_nvraw”) Error BadParameter (0x04): (propagating from capture_nvraw/src/mobile/ArgusNvRawCapture.cpp,
func capture(), line 766)
(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 91)
(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 91)
(Argus) Error InvalidState: Argus client is exiting with 2 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 355)
(“nvargus_nvraw”) Error BadParameter (0x04): Unable to capture (propagating from capture_nvraw/src/mobile/main.cpp,
func main(), line 97)

root@orin-desktop:/home/orin# cat /sys/kernel/debug/tracing/trace

tracer: nop

entries-in-buffer/entries-written: 21/21 #P:8

_-----=> irqs-off

/ _----=> need-resched

| / _—=> hardirq/softirq

|| / _–=> preempt-depth

||| / delay

TASK-PID CPU# |||| TIMESTAMP FUNCTION

| | | |||| | |

 kworker/3:4-202     [003] ....   129.604759: rtcpu_string: tstamp:4868763103 id:0x04010000 str:"VM0 deactivating."
 kworker/3:4-202     [003] ....   138.028749: rtcpu_string: tstamp:5132163132 id:0x04010000 str:"VM0 activating."

nvargus-daemon-2700 [000] … 138.144062: tegra_channel_open: vi-output, ar0820 30-0010
nvargus-daemon-2700 [000] … 138.144151: tegra_channel_close: vi-output, ar0820 30-0010
nvargus-daemon-2700 [000] … 138.144999: tegra_channel_open: vi-output, ar0820 30-0010
nvargus-daemon-2700 [000] … 138.145037: tegra_channel_close: vi-output, ar0820 30-0010
nvargus-daemon-2700 [005] … 138.168675: tegra_channel_open: vi-output, ar0820 30-0010
nvargus-daemon-2700 [005] … 138.168695: tegra_channel_close: vi-output, ar0820 30-0010
nvargus-daemon-2700 [005] … 138.168708: tegra_channel_open: vi-output, ar0820 30-0010
nvargus-daemon-2700 [005] … 138.168764: tegra_channel_close: vi-output, ar0820 30-0010
nvargus-daemon-2700 [005] … 138.168785: tegra_channel_open: vi-output, ar0820 30-0010
nvargus-daemon-2700 [005] … 138.168856: tegra_channel_close: vi-output, ar0820 30-0010
CaptureSchedule-2716 [001] … 138.327772: tegra_channel_open: vi-output, ar0820 30-0010
CaptureSchedule-2716 [001] … 138.342351: tegra_channel_set_power: ar0820 30-0010 : 0x1
CaptureSchedule-2716 [001] … 138.342357: camera_common_s_power: status : 0x1
CaptureSchedule-2716 [001] … 138.342568: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
CaptureSchedule-2716 [001] … 138.342572: csi_s_power: enable : 0x1
CaptureSchedule-2716 [001] … 138.342905: tegra_channel_set_stream: enable : 0x1
CaptureSchedule-2716 [003] … 138.355302: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
CaptureSchedule-2716 [003] … 138.355306: csi_s_stream: enable : 0x1
CaptureSchedule-2716 [003] … 138.355307: tegra_channel_set_stream: ar0820 30-0010 : 0x1

please give some suggest, thanks.

Hello @whn ,
Can you let us know where did you get the nvargus_nvraw utility? Are you from our camera partners?

the nvargus_nvraw is build in the rootfs with version R35.1

hello whn,

let’s narrow down the issue,
you may refer to Approaches for Validating and Testing the V4L2 Driver,
are you able to enable gst pipeline with nvarguscamerasrc plugin to access camera stream?

Hi
i used gst tools to access camera firstly , it does not work, so i try nvargus_nvraw , both tools have the same log, get frame timeout.
then i add some debug info in kernel, i find when i use nvargus_nvraw , the vi channel works in bypass mode, this is different with v4l2-ctrl tools.
right now, i have no idea how to debug this issue.

hello whn,

port bindings should be correct,
it usually device tree property setting cause capture failure by Argus,
could you please try below commands to boost all the VI/CSI/ISP clocks.
for example,

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

Hi Jerry
the follow print:
root@orin-desktop:/home/orin# cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
832000000
root@orin-desktop:/home/orin# cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
1011200000
root@orin-desktop:/home/orin# cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
642900000
root@orin-desktop:/home/orin# cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate
3199000000

port bindings i think is correct, v4l2-ctrl can work well, so is Argus capture stream is different with v4l2-ctrl??

by the way, i find that.
when i use argus tools , the kernel trace miss tegra_channel_capture_setup which executes when i use v4l2-ctrl tool.
v4l2-ctl-2712 [003] … 282.491758: tegra_channel_capture_setup: vnc_id 0 W 3840 H 2160 fmt c4

camera.dtsi (5.7 KB)
This file is my camera dtsi

hello whn,

Argus and v4l2 they’re went through different pipelines, you may see-also Camera Architecture Stack for reference.

according to VI tracing logs, there’s no validate frames.

I’ve examine your sensor device tree, it looks you’ve comment serdes_pix_clk_hz property setting, it means you’re not using virtual channel support, right?
if yes, please also remove vc-id and vc_id property to avoid confusion.

in addition, may I also know how you obtain this value, pix_clk_hz = "500000000";
could you please see-also Sensor Pixel Clock session to double check the clock settings.

1,remove vc-id and vc_id
2,change pix_clk_hz to 248832000 which calc form 3840 * 2160 * 30.
is pix_clk_hz correct???
after modify this, vl42 work well,but Argus still can not capture buffer form vi.

Hi Jerry
i add some debug info, i find that, when i use Argus tools, the kernel function vi_capture_setup do not execute, can you provide a nornal kernel trace by Argus tools works well。

Hi jerry
i catch some nvargus-daemon log can you find the root cause???

root@orin-desktop:/boot# === NVIDIA Libargus Camera Service (0.98.3)=== Listening for connections…
root@orin-desktop:/boot# === nvargus_nvraw[3083]: Connection established (FFFFAEE3C900)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
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: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
(Argus) Error BadParameter: Unidentified sensor placement (in src/common/ScfTranslate.cpp, function fromScfSensorPlacement(), line 592)
=== nvargus_nvraw[3083]: CameraProvider initialized (0xffffa8654270)SCF: Error BadValue: NvPHSSendThroughputHints (in src/common/CameraPowerHint.cpp, function sendCameraPowerHint(), line 56)
CAM: serial no file already exists, skips storing againLSC: LSC surface is not based on full res!
SCF: Error BadParameter: Invalid GUID (in src/services/power/PowerServiceRequest.cpp, function setRequest(), line 96)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureRecord.cpp, function makePowerRequest(), line 422)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureRecord.cpp, function setPowerRequirements(), line 749)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureRecord.cpp, function issueCapture(), line 472)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1291)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureServiceDevice.cpp, function issueCaptures(), line 1122)
SCF: Error Timeout: (propagating from src/api/Buffer.cpp, function waitForUnlock(), line 643)
SCF: Error Timeout: (propagating from src/components/CaptureContainerImpl.cpp, function returnBuffer(), line 373)
SCF: Error BadParameter: (propagating from src/common/Utils.cpp, function workerThread(), line 114)
SCF: Error BadParameter: Worker thread CaptureScheduler frameStart failed (in src/common/Utils.cpp, function workerThread(), line 133)
SCF: Error InvalidState: 1 buffers still pending during EGLStreamProducer destruction (propagating from src/services/gl/EGLStreamProducer.cpp, function freeBuffers(), line 302)
SCF: Error InvalidState: (propagating from src/services/gl/EGLStreamProducer.cpp, function ~EGLStreamProducer(), line 50)
SCF: Error Timeout: (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
waitForIdleLocked remaining request 102
SCF: Error Timeout: waitForIdle() timed out (in src/api/Session.cpp, function waitForIdleLocked(), line 909)
(Argus) Error Timeout: (propagating from src/api/CaptureSessionImpl.cpp, function destroy(), line 169)

hello whn,

that’s reported erroneous sensor placement.
may I know what’s the device tree property settings within tegra-camera-platform{..}

tegra-camera-platform {
compatible = “nvidia, tegra-camera-platform”;
/**
* Physical settings to calculate max ISO BW
*
* num_csi_lanes = <>;
* Total number of CSI lanes when all cameras are active
*
* max_lane_speed = <>;
* Max lane speed in Kbit/s
*
* min_bits_per_pixel = <>;
* Min bits per pixel
*
* vi_peak_byte_per_pixel = <>;
* Max byte per pixel for the VI ISO case
*
* vi_bw_margin_pct = <>;
* Vi bandwidth margin in percentage
*
* max_pixel_rate = <>;
* Max pixel rate in Kpixel/s for the ISP ISO case
*
* isp_peak_byte_per_pixel = <>;
* Max byte per pixel for the ISP ISO case
*
* isp_bw_margin_pct = <>;
* Isp bandwidth margin in percentage
*/
num_csi_lanes = <4>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;

/**
 * The general guideline for naming badge_info contains 3 parts, and is as follows,
 * The first part is the camera_board_id for the module; if the module is in a FFD
 * platform, then use the platform name for this part.
 * The second part contains the position of the module, ex. "rear" or "front".
 * The third part contains the last 6 characters of a part number which is found
 * in the module's specsheet from the vender.
 */
modules {
	module0 {
		badge = "ar0820_rear_p1";
		position = "rear ";
		orientation = "0";
		drivernode0 {
			/* Declare PCL support driver (classically known as guid)  */
			pcl_id = "v4l2_sensor";
			/* Driver v4l2 device name */
			devname = "ar0820 30-0010";
			/* Declare the device-tree hierarchy to driver instance */
			proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/ar0820_a@10";
		};
	};
};

};

there’s a space behind rear string. please try removing that for testing.

this work, thanks

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