vc-mipi-modules / vc_mipi_nvidia Goto Github PK
View Code? Open in Web Editor NEWVision Components MIPI CSI-2 driver for NVIDIA Jetson Nano, Xavier NX, AGX Xavier, TX2 and Orin Nano, Orin NX
Vision Components MIPI CSI-2 driver for NVIDIA Jetson Nano, Xavier NX, AGX Xavier, TX2 and Orin Nano, Orin NX
Tested with
OS: Ubuntu 20.04
On my PC the device in recovery mode is shown as "Nvidia Corp.", so the flash.sh script does not work.
Adding a -i
to the grep
in check_recovery_mode()
resolves the issue.
check_recovery_mode() {
if [[ -z $(lsusb | grep -i "NVIDIA Corp.") ]]; then
echo "Recovery Mode not startet!"
exit 1
fi
}
Hi I've tried to install the camera driver for IMX327 to my Jetson nano, but keep running into this error.
make[2]: * No rule to make target 'arch/arm64/boot/dts/..//hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-a00.dts', needed by 'arch/arm64/boot/dts/ddot//hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-a00.dtb'. Stop.
make[2]: * Waiting for unfinished jobs....
DTC arch/arm64/boot/dts/ddot
cc1: fatal error: arch/arm64/boot/dts/..: No such file or directory
compilation terminated.
make[2]: * [/home/akbanshee/vc_mipi_nvidia/build/NanoSD_32.6.1/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:133: arch/arm64/boot/dts/ddot] Error 1
make[1]: * [arch/arm64/Makefile:154: dtbs] Error 2
make: *** [Makefile:171: sub-make] Error 2
Any idea on how to solve this issue?
After flashing with using branch '9-support-for-jetson-orin-nano', GUI or display not working.
Using Auvidea JNX30D with L4T 32.7.3
Camera: IMX568
I'm writing a module for setting camera controls with v4l, and when i try to get/set values of controls, i have got an error with specific controls.
Code block:
bool getControl(int controlId, int &value) {
struct v4l2_control ctrl;
std::memset(&ctrl, 0, sizeof(ctrl));
ctrl.id = controlId;
if (ioctl(_fd, VIDIOC_G_CTRL, &ctrl) == -1) {
std::perror(std::string("Error getting control of " + std::to_string(controlId)).c_str());
return false;
}
value = ctrl.value;
return true;
}
I'm getting the controlId with querying the controls:
void queryControls(const std::string &devicePath) {
int fd = open(devicePath.c_str(), O_RDWR);
if (fd == -1) {
std::perror("error opening device");
return;
}
v4l2_queryctrl queryctrl;
std::memset(&queryctrl, 0, sizeof(queryctrl));
queryctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
while (ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl) == 0) {
std::cout << "Control id = " << queryctrl.id << std::endl;
std::cout << "Control Name = " << queryctrl.name << std::endl;
// next control
queryctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
}
close(fd);
}
But when I try to get all control values, i have faced with this output:
ID Name Value
10100752 Black Level 0
10100836 Bypass Mode 1
Error getting control of 10092545: Permission denied
10092545 Camera Controls 1
Error getting control of 10100746: Invalid argument
10100746 Exposure 1
Error getting control of 10100747: Invalid argument
10100747 Frame Rate 1
Error getting control of 10100745: Invalid argument
10100745 Gain 1
10100739 Group Hold 0
10100838 Height Align 1
10100751 IO Mode 0
10100845 Low Latency Mode 0
10100837 Override Enable 1
10100846 Preferred Stride 0
Error getting control of 10100744: Invalid argument
10100744 Sensor Mode 0
10100866 Sensor Modes 1
Error getting control of 10100753: Permission denied
10100753 Single Trigger 1
10100839 Size Align 0
10100750 Trigger Mode 0
10100840 Write ISP format 1
Any ideas why and how to fix it?
Best regards.
I'm trying to apply the kernel patches listed in Integrate the driver in your own BSP to a kernel that I'm building for a Jetson AGX devkit. The kernel source is from R32.6.1. Unfortunately, the patches from the kernel_Xavier_32.6.1+
directory don't apply cleanly. Am I doing something wrong?
Using this simple shell snippet:
for patch in $vc_mipi_patch_dir/kernel_Xavier_32.6.1+/*.patch; do
echo "--- APPLYING PATCH FILE: $patch ---"
patch --dry-run --ignore-whitespace --binary -p1 -d $build_dir -i $patch
done
NOTE: I used a similar for-loop (without --dry-run
) to apply the patches from kernel_common_32.3.1+
before running the above. Those patches, except the one for .gitignore, applied cleanly.
The resulting output:
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0001-Added-RAW8-grey-RAW10-y10-and-RAW12-y12-format-to-th.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c
Hunk #1 succeeded at 126 (offset 5 lines).
checking file kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c
Hunk #1 FAILED at 227 (different line endings).
1 out of 1 hunk FAILED
checking file kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_formats.h
Hunk #1 FAILED at 95 (different line endings).
Hunk #2 FAILED at 115 (different line endings).
2 out of 2 hunks FAILED
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0001-Added-controls-trigger_mode-flash_mode-and-black_lev.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/tegracam_ctrls.c
checking file kernel/nvidia/include/media/camera_common.h
checking file kernel/nvidia/include/media/tegra-v4l2-camera.h
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0001-Bugfix-in-destroy_buffer_table-.-When-the-capture_bu.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/capture_common.c
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0001-Disable-VB2_BUF_STATE_REQUEUEING-in-vi5_fops.c.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_fops.c
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0002-Changed-control-flash_mode-to-io_mode.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/tegracam_ctrls.c
Hunk #1 FAILED at 186.
Hunk #2 FAILED at 341.
Hunk #3 FAILED at 696.
Hunk #4 FAILED at 889.
4 out of 4 hunks FAILED
checking file kernel/nvidia/include/media/camera_common.h
Hunk #1 FAILED at 193.
1 out of 1 hunk FAILED
checking file kernel/nvidia/include/media/tegra-v4l2-camera.h
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0002-Increased-tegra-channel-timeout-due-to-trigger-modes.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_fops.c
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0003-Added-RAW14-y14-format-to-the-tegra-framework.patch ---
checking file kernel/kernel-4.9/Documentation/media/uapi/v4l/pixfmt-y14.rst
checking file kernel/kernel-4.9/Documentation/media/uapi/v4l/yuv-formats.rst
checking file kernel/kernel-4.9/drivers/media/v4l2-core/v4l2-ioctl.c
checking file kernel/kernel-4.9/include/uapi/linux/media-bus-format.h
checking file kernel/kernel-4.9/include/uapi/linux/videodev2.h
checking file kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c
Hunk #1 succeeded at 126 with fuzz 2 (offset -15 lines).
checking file kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c
Hunk #1 FAILED at 241.
1 out of 1 hunk FAILED
checking file kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_formats.h
Hunk #1 succeeded at 116 with fuzz 2 (offset -6 lines).
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0003-Added-control-single_trigger-to-the-tegra-framework.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/tegracam_ctrls.c
Hunk #1 FAILED at 178.
Hunk #2 FAILED at 188.
Hunk #3 FAILED at 198.
Hunk #4 FAILED at 347.
Hunk #5 FAILED at 710.
Hunk #6 FAILED at 907.
6 out of 6 hunks FAILED
checking file kernel/nvidia/include/media/camera_common.h
Hunk #1 FAILED at 195.
1 out of 1 hunk FAILED
checking file kernel/nvidia/include/media/tegra-v4l2-camera.h
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0003-Changed-Interrupt-Mask-for-csi4-to-emit-CRC-and-mul.patch ---
checking file kernel/nvidia/drivers/media/platform/tegra/camera/csi/csi4_fops.c
--- APPLYING PATCH FILE: /home/build/vc_mipi_nvidia-0.12.3/patch/kernel_Xavier_32.6.1+/0004-Added-VC-MIPI-Driver-sources-to-Makefile.patch ---
checking file kernel/nvidia/drivers/media/i2c/Makefile
It appears that some of the problems are whitespace-related, despite passing --ignore-whitespace
and --binary
. I'm not sure if that's a problem with the version of patch
that I'm using (GNU patch 2.7.6
) or if there's something odd about the patch files themselves.
I've checked that $build_dir
is correct given the paths in the patch files. I've also tried without --dry-run
in case that was the problem.
Any other ideas?
How can we control which camera gets assigned to which device (/dev/videoX
).
The devnode
devicetree attribute is not honored (L4T 35.4.1), no matter what I put in there it will always assign it in the same way. But I want to switch video0
and video1
.
I have previously been using these drivers with Jetson nano dev kits, which are the ones produced by Nvidia themselves. Now we are looking at using the Xavier NX but Nvidia no longer produces these, it is down to third parties to build and sell their own based on the Xavier NX module. We have acquired one such device but it uses emmc rather than an SD card. This appears to cause an error when flashing, when we select the dev kit option through the quickstart.sh script. So we are currently unable to flash this dev kit with the drivers.
enter 8-1 in config script.
./setup.sh -camera brings up:
vc_mipi_nvidia/src/devicetree/Auvidea_J20_AGXXavier/tegra194-camera-vc-mipi-cam.dtsi
should bring up
home/mat/sb3d/newtx2nx/vc_mipi_nvidia/src/devicetree/Auvidea_JNX30D_TX2NX/tegra186-camera-vc-mipi-cam.dtsi
Hi,
I have Orin Nano developer kit and I’ve been trying to use a camera imx568c on Orin Nano with MIPI-CSI-2 by using this repo
Jetson 5.1.2
R35 (release), REVISION: 4.1
First I did quicksetup with the instructions. Setup completed and no error seen. I can see the camera but I think it shows the wrong model for the camera.
v4l2-ctl --list-devices
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
/dev/media0
vi-output, imx219 10-0010 (platform:tegra-capture-vi:2):
/dev/video0
My camera dtsi configuration is below.
/*
* Copyright (c) 2023, Vision Components GmbH. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <dt-bindings/media/camera.h>
// ------------------------------------------------------------------------------------------------
// Driver Configuration for NVIDIA Jetson Orin Nano on NVIDIA Jetson Orin Nano Developer Kit
// ------------------------------------------------------------------------------------------------
#define VC_MIPI_CAM_1 1 // 1: Enabled, 0: Disabled (serial_a => CSI Port 0 => VI Stream 0)
#define VC_MIPI_CAM_0 0 // 1: Enabled, 0: Disabled (serial_c => CSI Port 2 => VI Stream 2)
// ------------------------------------------------------------------------------------------------
// Supported number of lanes
// -----+------------------------------------------------------------------------------------------
// 1 | OV7251, IMX296, IMX297
// 2 | OV9281, IMX264, IMX265
// 2,4 | IMX178, IMX183, IMX226, IMX250, IMX252, IMX273, IMX290, IMX327, IMX335, IMX392,
// | IMX412, IMX415, IMX568
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_LANES 2 // 1, 2, 4 Lanes
// ------------------------------------------------------------------------------------------------
// Embedded Metadata Height
// -----+------------------------------------------------------------------------------------------
// 0 | IMX178, IMX183, IMX226, IMX250, IMX252, IMX264, IMX265, IMX273, IMX392, OV7251, OV9281
// 1 | IMX290, IMX327, IMX335, IMX415, IMX568
// 2 | IMX296, IMX297, IMX412
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_METADATA_H "1" // "0", "1", "2" Lines of meta data
// ------------------------------------------------------------------------------------------------
// Sensor Manufacturer
// -----+------------------------------------------------------------------------------------------
// 1 | Sony Sensor (IMX)
// 2 | Omni Vision Sensor (OV)
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_MANUFACTURER 1
// ------------------------------------------------------------------------------------------------
// GStreamer Support
// ------------------------------------------------------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc you have to adjust this settings in the
// device tree below. The sections which have to be modified are marked by a comment.
// To find the correct parameter values please follow the instruction in the main README.md of
// this repository https://github.com/VC-MIPI-modules/vc_mipi_nvidia#gstreamer-support
// ------------------------------------------------------------------------------------------------
#if VC_MIPI_LANES == 1
#define BUS_WIDTH 1
#define NUM_LANES "1"
#define NUM_CSI_LANES 2
#endif
#if VC_MIPI_LANES == 2
#define BUS_WIDTH 2
#define NUM_LANES "2"
#define NUM_CSI_LANES 4
#endif
#if VC_MIPI_LANES == 4
#define BUS_WIDTH 4
#define NUM_LANES "4"
#define NUM_CSI_LANES 8
#endif
#if VC_MIPI_CAM_1 == 1 && VC_MIPI_CAM_0 == 1
#define VC_MIPI_CAMERAS 2
#else
#define VC_MIPI_CAMERAS 1
#endif
/ {
tegra-capture-vi {
num-channels = <VC_MIPI_CAMERAS>;
ports {
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_CAM_1 == 1
vc_vi_port0: port@0 {
reg = <0>;
vc_vi_in0: endpoint {
port-index = <1>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_out0>;
};
};
#endif
#if VC_MIPI_CAM_0 == 1
vc_vi_port1: port@1 {
reg = <1>;
vc_vi_in1: endpoint {
port-index = <2>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_out1>;
};
};
#endif
}; // ports
};
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <VC_MIPI_CAMERAS>;
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_CAM_1 == 1
vc_csi_chan0: channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vc_csi_chan0_port0: port@0 {
reg = <0>;
vc_csi_in0: endpoint@0 {
port-index = <1>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_mipi_out0>;
};
};
vc_csi_chan0_port1: port@1 {
reg = <1>;
vc_csi_out0: endpoint@1 {
remote-endpoint = <&vc_vi_in0>;
};
};
};
};
#endif
#if VC_MIPI_CAM_0 == 1
vc_csi_chan1: channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vc_csi_chan1_port0: port@0 {
reg = <0>;
vc_csi_in1: endpoint@2 {
port-index = <2>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_mipi_out1>;
};
};
vc_csi_chan1_port1: port@1 {
reg = <1>;
vc_csi_out1: endpoint@3 {
remote-endpoint = <&vc_vi_in1>;
};
};
};
};
#endif
};
};
cam_i2cmux {
#if VC_MIPI_CAM_1 == 1
i2c@0 {
#if VC_MIPI_MANUFACTURER == 1
vc_mipi_cam0: vc_mipi@1a {
reg = <0x1a>;
#else
vc_mipi_cam0: vc_mipi@60 {
reg = <0x60>;
#endif
compatible = "nvidia,vc_mipi";
devnode = "video0";
use_sensor_mode_id = "false";
sensor_model = "vc_mipi";
num_lanes = NUM_LANES;
trigger_mode = "0";
io_mode = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings
physical_w = "6.773";
physical_h = "5.612";
// ----------------------------------------------------
// This node is needed by the Tegra framework.
// You don't have to change any settings if just want
// to use the V4L API.
mode0 {
num_lanes = NUM_LANES;
tegra_sinterface = "serial_b";
embedded_metadata_height = VC_MIPI_METADATA_H;
readout_orientation = "0";
lane_polarity = "6";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings.
active_l = "0";
active_t = "0";
active_w = "2472";
active_h = "2048";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
min_gain_val = "0"; // mdB
max_gain_val = "48000"; // mdB
step_gain_val = "1"; // mdB
default_gain = "0"; // mdB
min_exp_time = "1"; // us
max_exp_time = "1000000"; // us
step_exp_time = "1"; // us
default_exp_time = "10000"; // us
// For applications like argus_camera, there should
// be a minimal frame rate greater than zero!
min_framerate = "100"; // mHz
max_framerate = "60000"; // mHz
step_framerate = "100"; // mHz
default_framerate = "60000"; // mHz
// ----------------------------------------------------
gain_factor = "1000";
exposure_factor = "1000000";
framerate_factor = "1000";
inherent_gain = "1";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
line_length = "0";
phy_mode = "DPHY";
discontinuous_clk = "no";
mclk_khz = "24000";
pix_clk_hz = "215000000";
mclk_multiplier = "0.0"; // deprecated
cil_settletime = "0";
dpcm_enable = "false";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
vc_mipi_out0: endpoint {
port-index = <1>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_in0>;
};
};
};
};
};
#endif // VC_MIPI_CAM_1
#if VC_MIPI_CAM_0 == 1
i2c@1 {
#if VC_MIPI_MANUFACTURER == 1
vc_mipi_cam1: vc_mipi@1a {
reg = <0x1a>;
#else
vc_mipi_cam1: vc_mipi@60 {
reg = <0x60>;
#endif
compatible = "nvidia,vc_mipi";
devnode = "video1";
use_sensor_mode_id = "false";
sensor_model = "vc_mipi";
num_lanes = NUM_LANES;
trigger_mode = "0";
io_mode = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings
physical_w = "6.773";
physical_h = "5.655";
// ----------------------------------------------------
// This node is needed by the Tegra framework.
// You don't have to change any settings if just want
// to use the V4L API.
mode0 {
num_lanes = NUM_LANES;
tegra_sinterface = "serial_c";
embedded_metadata_height = VC_MIPI_METADATA_H;
readout_orientation = "0";
lane_polarity = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings.
active_l = "0";
active_t = "0";
active_w = "2472";
active_h = "2048";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
min_gain_val = "0"; // mdB
max_gain_val = "48000"; // mdB
step_gain_val = "100"; // mdB
default_gain = "0"; // mdB
min_exp_time = "1"; // us
max_exp_time = "1000000"; // us
step_exp_time = "1"; // us
default_exp_time = "10000"; // us
// For applications like argus_camera, there should
// be a minimal frame rate greater than zero!
min_framerate = "100"; // mHz
max_framerate = "57290"; // mHz
step_framerate = "100"; // mHz
default_framerate = "57290"; // mHz
// ----------------------------------------------------
gain_factor = "1000";
exposure_factor = "1000000";
framerate_factor = "1000";
inherent_gain = "1";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
line_length = "0";
phy_mode = "DPHY";
discontinuous_clk = "no";
mclk_khz = "24000";
pix_clk_hz = "600000000"; // 205000000 - 600000000 tested with IMX568
mclk_multiplier = "0.0"; // deprecated
cil_settletime = "0";
dpcm_enable = "false";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
vc_mipi_out1: endpoint {
port-index = <2>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_in1>;
};
};
};
};
};
#endif // VC_MIPI_CAM_0
};
lens@vc_mipi {
min_focus_distance = "0.0";
hyper_focal = "0.0";
focal_length = "6.0";
f_number = "2.0";
aperture = "0.0";
};
};
/ {
tcp: tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <NUM_CSI_LANES>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <240000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
#if VC_MIPI_CAM_1 == 1
cam_module0: module0 {
badge = "jakku_front_vc_mipi";
position = "front";
orientation = "1";
cam_module0_drivernode0: drivernode0 {
pcl_id = "v4l2_sensor";
#if VC_MIPI_MANUFACTURER == 1
devname = "vc_mipi 9-001a";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@1a";
#else
devname = "vc_mipi 9-0060";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@60";
#endif
};
cam_module0_drivernode1: drivernode1 {
pcl_id = "v4l2_lens";
proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
};
};
#endif // VC_MIPI_CAM_1
#if VC_MIPI_CAM_0 == 1
cam_module1: module1 {
badge = "jakku_rear_vc_mipi";
position = "rear";
orientation = "1";
cam_module1_drivernode0: drivernode0 {
pcl_id = "v4l2_sensor";
#if VC_MIPI_MANUFACTURER == 1
devname = "vc_mipi 10-001a";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/vc_mipi@1a";
#else
devname = "vc_mipi 10-0060";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/vc_mipi@60";
#endif
};
cam_module1_drivernode1: drivernode1 {
pcl_id = "v4l2_lens";
proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
};
};
#endif // VC_MIPI_CAM_0
};
};
};
#define CAM0_PWDN TEGRA234_MAIN_GPIO(H, 6)
#define CAM1_PWDN TEGRA234_MAIN_GPIO(AC, 0)
#define CAM_I2C_MUX TEGRA234_AON_GPIO(CC, 3)
/ {
cam_i2cmux {
status = "okay";
compatible = "i2c-mux-gpio";
#address-cells = <1>;
#size-cells = <0>;
mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
i2c-parent = <&cam_i2c>;
#if VC_MIPI_CAM_1 == 1
i2c@0 {
status = "okay";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_MANUFACTURER == 1
vc_mipi@1a {
#else
vc_mipi@60 {
#endif
reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
};
};
#endif
#if VC_MIPI_CAM_0 == 1
i2c@1 {
status = "okay";
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_MANUFACTURER == 1
vc_mipi@1a {
#else
vc_mipi@60 {
#endif
reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
};
};
#endif
};
gpio@2200000 {
camera-control-output-low {
gpio-hog;
output-low;
gpios = <CAM0_PWDN 0 CAM1_PWDN 0>;
label = "cam0-pwdn","cam1-pwdn";
};
};
};
Formats are listing as below
v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'RG10' (10-bit Bayer RGRG/GBGB)
Size: Discrete 3280x2464
Interval: Discrete 0.048s (21.000 fps)
Size: Discrete 3280x1848
Interval: Discrete 0.036s (28.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1640x1232
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
dmesg is here
[ 509.046577] EXT4-fs error (device mmcblk1p1): ext4_lookup:1706: inode #920955: comm dpkg: iget: checksum invalid
[ 509.060091] EXT4-fs error (device mmcblk1p1): ext4_lookup:1706: inode #920955: comm dpkg: iget: checksum invalid
[ 525.105837] EXT4-fs error (device mmcblk1p1): ext4_lookup:1706: inode #920955: comm dpkg: iget: checksum invalid
[ 525.254362] EXT4-fs error (device mmcblk1p1): ext4_lookup:1706: inode #920955: comm dpkg: iget: checksum invalid
[ 601.668422] EXT4-fs error (device mmcblk1p1): ext4_lookup:1706: inode #920955: comm dpkg: iget: checksum invalid
[ 601.679969] EXT4-fs error (device mmcblk1p1): ext4_lookup:1706: inode #920955: comm dpkg: iget: checksum invalid
[ 5415.167390] bwmgr API not supported
[ 5417.835568] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 5417.848323] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 5417.858831] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5417.866589] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 5417.877282] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5417.885015] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 5417.895891] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 5420.651514] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 5420.660677] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 5420.671110] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5420.678842] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 5420.689512] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5420.697235] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 5420.708118] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 5423.467267] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 5423.476422] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 5423.486985] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5423.494718] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 5423.505390] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5423.513105] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 5423.523945] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 5426.283216] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 5426.292372] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 5426.302817] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5426.310534] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 5426.321238] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5426.328967] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 5426.339831] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 5429.099162] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 5429.108314] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 5429.119772] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5429.127508] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 5429.138191] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 5429.145914] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 5429.156949] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
I’ve tried the commands like
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov1080.raw -d /dev/video0
the command execution frozen until I hit ctrl-c and ov1080.raw is 0 byte
gstreamer command that I tried
gst-launch-1.0 v4l2src ! videoconvert ! x264enc ! matroskamux ! filesink location=data.mkv
It is frozen until I hit ctrl-c and data.mkv cannot be opened by vlc also it’s size is 0 byte
I also tried vpc mipi demo
./vcmipidemo -ao 1000 -g 10
but it is black screen with 24.5mb size files
So, It looks it installed wrong driver? because it says imx219 but I’m sure my camera imx568c. Could the problem be related with L4T version?
Hello,
I have a problem while booting the Jetson Nano with kernel version 32.7.4 and JetPack release 4.6.4:
[ 4.988443] i2c 7-0010: +--------+---------------------------------------------+
[ 4.995872] i2c 7-0010: +--- Sensor Registers ------+--------+--------+--------+
[ 5.003289] i2c 7-0010: | | low | mid | high |
[ 5.010704] i2c 7-0010: +---------------------------+--------+--------+--------+
[ 5.018126] i2c 7-0010: | idle | 0x7000 | | |
[ 5.023113] usb 1-2.5: new high-speed USB device number 3 using tegra-xusb
[ 5.032394] i2c 7-0010: | horizontal start | 0x6013 | 0x6014 | |
[ 5.039783] i2c 7-0010: | vertical start | 0x600e | 0x600f | |
[ 5.047176] i2c 7-0010: | horizontal end | 0x0000 | 0x0000 | |
[ 5.054606] i2c 7-0010: | vertical end | 0x0000 | 0x0000 | |
[ 5.062040] i2c 7-0010: | hor. output width | 0x6015 | 0x6016 | |
[ 5.067153] usb 2-1: usb_suspend_both: status 0
[ 5.067264] usb 1-2.5: New USB device found, idVendor=0424, idProduct=7240
[ 5.067270] usb 1-2.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 5.067274] usb 1-2.5: Product: USB2 Controller Hub
[ 5.067278] usb 1-2.5: Manufacturer: Microchip Tech
[ 5.067526] usb usb2: usb_suspend_both: status 0
[ 5.102757] i2c 7-0010: | ver. output height | 0x6010 | 0x6011 | |
[ 5.110148] i2c 7-0010: | exposure | 0x3034 | 0x3035 | 0x3036 |
[ 5.117537] i2c 7-0010: | gain | 0x301f | 0x3020 | |
[ 5.124924] i2c 7-0010: +---------------------------+--------+--------+--------+
[ 5.132313] i2c 7-0010: | clock for ext. trigger | 74250000 Hz |
[ 5.139701] i2c 7-0010: | pixel clock | 74250000 Hz |
[ 5.147105] i2c 7-0010: | shutter offset | 0 us |
[ 5.154491] i2c 7-0010: +---------------------------+--------------------------+
[ 5.161879] i2c 7-0010: +--- Module Modes -------+---------+---------+---------+
[ 5.169265] i2c 7-0010: | # | rate | lanes | format | type | binning |
[ 5.176653] i2c 7-0010: +----+---------+---------+---------+---------+---------+
[ 5.184044] i2c 7-0010: | 0 | 1500 | 2 | RAW08 | STREAM | 0 |
[ 5.191434] i2c 7-0010: | 1 | 1500 | 2 | RAW10 | STREAM | 0 |
[ 5.198825] i2c 7-0010: | 2 | 1500 | 2 | RAW12 | STREAM | 0 |
[ 5.206215] i2c 7-0010: | 3 | 1500 | 2 | RAW14 | STREAM | 0 |
[ 5.213603] i2c 7-0010: | 4 | 1500 | 2 | RAW08 | EXT.TRG | 0 |
[ 5.220993] i2c 7-0010: | 5 | 1500 | 2 | RAW10 | EXT.TRG | 0 |
[ 5.228382] i2c 7-0010: | 6 | 1500 | 2 | RAW12 | EXT.TRG | 0 |
[ 5.235770] i2c 7-0010: | 7 | 1500 | 2 | RAW14 | EXT.TRG | 0 |
[ 5.243159] i2c 7-0010: | 8 | 1500 | 4 | RAW08 | STREAM | 0 |
[ 5.250547] i2c 7-0010: | 9 | 1500 | 4 | RAW10 | STREAM | 0 |
[ 5.257936] i2c 7-0010: | 10 | 1500 | 4 | RAW12 | STREAM | 0 |
[ 5.265325] i2c 7-0010: | 11 | 1500 | 4 | RAW14 | STREAM | 0 |
[ 5.272712] i2c 7-0010: | 12 | 1500 | 4 | RAW08 | EXT.TRG | 0 |
[ 5.280100] i2c 7-0010: | 13 | 1500 | 4 | RAW10 | EXT.TRG | 0 |
[ 5.287488] i2c 7-0010: | 14 | 1500 | 4 | RAW12 | EXT.TRG | 0 |
[ 5.294876] i2c 7-0010: | 15 | 1500 | 4 | RAW14 | EXT.TRG | 0 |
[ 5.302262] i2c 7-0010: +----+---------+---------+---------+---------+---------+
[ 5.309652] i2c 7-0010: vc_init_ctrl_imx178(): Initialising module control for IMX178
[ 5.317477] i2c 7-0010: +-------+--------+----------+-----------+
[ 5.323563] i2c 7-0010: | lanes | format | exposure | framerate |
[ 5.329650] i2c 7-0010: | | | max [us] | max [mHz] |
[ 5.335736] i2c 7-0010: +-------+--------+----------+-----------+
[ 5.341825] i2c 7-0010: | 2 | RAW08 | 1200265 | 51363 |
[ 5.347913] i2c 7-0010: | 2 | RAW10 | 1482704 | 41578 |
[ 5.354001] i2c 7-0010: | 2 | RAW12 | 1736833 | 35494 |
[ 5.360088] i2c 7-0010: | 2 | RAW14 | 2040504 | 30212 |
[ 5.366176] i2c 7-0010: | 4 | RAW08 | 1058980 | 58213 |
[ 5.372264] i2c 7-0010: | 4 | RAW10 | 1058980 | 58213 |
[ 5.378352] i2c 7-0010: | 4 | RAW12 | 1200265 | 51363 |
[ 5.384440] i2c 7-0010: | 4 | RAW14 | 2040504 | 30212 |
[ 5.390526] i2c 7-0010: +-------+--------+----------+-----------+
[ 5.396612] i2c 7-0010: VC MIPI Core succesfully initialized
[ 5.402266] vc_mipi 7-001a: vc_init_io(): Init trigger and flash mode
[ 5.408708] i2c 7-0010: vc_mod_set_trigger_mode(): Set trigger mode: DISABLED
[ 5.415838] i2c 7-0010: vc_mod_set_io_mode(): Set IO mode: DISABLED
[ 5.422103] vc_mipi 7-001a: vc_init_frmfmt(): Init frame (width: 3072, height: 2048, fps: 0)
[ 5.430892] extract_pixel_format: Need to extend formatbayer_gbrg8
[ 5.437072] vc_mipi 7-001a: Unsupported pixel format
[ 5.442033] vc_mipi 7-001a: Failed to read mode0 image props
[ 5.447690] vc_mipi 7-001a: Could not initialize sensor properties.
[ 5.453951] vc_mipi 7-001a: Failed to initialize vc_mipi
[ 5.459259] vc_mipi 7-001a: vc_probe(): Tegra camera device registration failed
sensor_common.c looks like this in the unpatched code:
static int extract_pixel_format(
const char *pixel_t, u32 *format)
{
size_t size = strnlen(pixel_t, OF_MAX_STR_LEN);
if (strncmp(pixel_t, "bayer_bggr10", size) == 0)
*format = V4L2_PIX_FMT_SBGGR10;
else if (strncmp(pixel_t, "bayer_rggb10", size) == 0)
*format = V4L2_PIX_FMT_SRGGB10;
else if (strncmp(pixel_t, "bayer_grbg10", size) == 0)
*format = V4L2_PIX_FMT_SGRBG10;
else if (strncmp(pixel_t, "bayer_gbrg10", size) == 0)
*format = V4L2_PIX_FMT_SGBRG10;
else if (strncmp(pixel_t, "bayer_bggr12", size) == 0)
*format = V4L2_PIX_FMT_SBGGR12;
else if (strncmp(pixel_t, "bayer_rggb12", size) == 0)
*format = V4L2_PIX_FMT_SRGGB12;
else if (strncmp(pixel_t, "bayer_gbrg12", size) == 0)
*format = V4L2_PIX_FMT_SGBRG12;
else if (strncmp(pixel_t, "bayer_grbg12", size) == 0)
*format = V4L2_PIX_FMT_SGRBG12;
else if (strncmp(pixel_t, "rgb_rgb88824", size) == 0)
*format = V4L2_PIX_FMT_RGB24;
else if (strncmp(pixel_t, "bayer_wdr_pwl_rggb12", size) == 0)
*format = V4L2_PIX_FMT_SRGGB12;
else if (strncmp(pixel_t, "bayer_wdr_pwl_gbrg12", size) == 0)
*format = V4L2_PIX_FMT_SGBRG12;
else if (strncmp(pixel_t, "bayer_wdr_pwl_grbg12", size) == 0)
*format = V4L2_PIX_FMT_SGRBG12;
else if (strncmp(pixel_t, "bayer_wdr_dol_rggb10", size) == 0)
*format = V4L2_PIX_FMT_SRGGB10;
else if (strncmp(pixel_t, "bayer_xbggr10p", size) == 0)
*format = V4L2_PIX_FMT_XBGGR10P;
else if (strncmp(pixel_t, "bayer_xrggb10p", size) == 0)
*format = V4L2_PIX_FMT_XRGGB10P;
else if (strncmp(pixel_t, "yuv_yuyv16", size) == 0)
*format = V4L2_PIX_FMT_YUYV;
else if (strncmp(pixel_t, "yuv_yvyu16", size) == 0)
*format = V4L2_PIX_FMT_YVYU;
else if (strncmp(pixel_t, "yuv_uyvy16", size) == 0)
*format = V4L2_PIX_FMT_UYVY;
else if (strncmp(pixel_t, "yuv_vyuy16", size) == 0)
*format = V4L2_PIX_FMT_VYUY;
else {
pr_err("%s: Need to extend format%s\n", __func__, pixel_t);
return -EINVAL;
}
return 0;
}
The patch from patch/kernel_Nano_32.6.1+/0002-Added-RAW8-grey-RAW10-y10-and-RAW12-y12-format-to-th.patch adds this:
diff --git a/kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c b/kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c
index 32f7c417a..dd040dee2 100644
--- a/kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c
+++ b/kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c
@@ -227,6 +227,14 @@ static int extract_pixel_format(
*format = V4L2_PIX_FMT_UYVY;
else if (strncmp(pixel_t, "yuv_vyuy16", size) == 0)
*format = V4L2_PIX_FMT_VYUY;
+ else if (strncmp(pixel_t, "gray", size) == 0)
+ *format = V4L2_PIX_FMT_GREY;
+ else if (strncmp(pixel_t, "y10", size) == 0)
+ *format = V4L2_PIX_FMT_Y10;
+ else if (strncmp(pixel_t, "y12", size) == 0)
+ *format = V4L2_PIX_FMT_Y12;
+ else if (strncmp(pixel_t, "bayer_rggb8", size) == 0)
+ *format = V4L2_PIX_FMT_SRGGB8;
else {
pr_err("%s: Need to extend format%s\n", __func__, pixel_t);
return -EINVAL;
can you please add the bayer_gbrg8 to that patch?
Thank you
In order to have a choice of image formats for a connected camera in V4L2, I have found that there have to be multiple modes in the device tree - one for each image format supported by the camera. The formats included in the modes are listed by the command
v4l2-ctl --list-formats-ext
Is this expected behaviour?
In the mode section of the device tree, before Linux V500, the field pixel_t was used to specify the image format. After Linux V500 this was split into three fields, "mode_type", "pixel_phase" and "csi_pixel_bit_depth".
#if LINUX_VERSION < 500
pixel_t = "bayer_rggb";
#else
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
#endif
It is not possible to specify the pixel formats "gray", "y10" or "y12" using the new fields "mode_type", "pixel_phase" and "csi_pixel_bit_depth" because in the code*, they are combined into a pixel format string that contains an underscore character. (The above example would be "bayer_rggb10".) The field "csi_pixel_bit_depth" is required by other code so must be present.
The code will prefer to read the "pixel_t" if it is present, so a work around seems to be to include both the "pixel_t" fields
and the other fields:
pixel_t = "gray";
#if LINUX_VERSION >= 500
mode_type = "";
pixel_phase = "gray";
csi_pixel_bit_depth = "8";
#endif
In trigger mode, the driver should dynamically adjust the CSI timeout to infinite. Otherwise the CSI interface will be resetted after this hardcoded time period. If the trigger event occures during this reset, the image will be dropped.
Increasing the hardcoded timeout in the driver seems not to be a valid option, because this makes the driver hang when the camera is stopped.
Tested on Jetson Nano, L4T 32.7.3/4
Hello,
I'm trying to include the drivers into my system, but the compilation fails at one point:
error: 'struct sensor_image_properties' has no member named 'left'
void vc_update_image_size_from_mode(struct tegracam_device *tc_dev, __u32 *left, __u32 *top, __u32 *width, __u32 *height)
{
struct vc_cam *cam = tegracam_to_cam(tc_dev);
struct device *dev = vc_core_get_sen_device(cam);
struct sensor_mode_properties *mode = NULL;
struct sensor_image_properties *image = NULL;
int mode_idx = 0;
if (tc_dev->s_data->use_sensor_mode_id)
mode_idx = tc_dev->s_data->sensor_mode_id;
mode = tegracam_to_mode(tc_dev, mode_idx);
if (mode == NULL)
return;
image = &mode->image_properties;
if (image->width != 0 && image->height != 0) {
*left = image->left;
*top = image->top;
*width = image->width;
*height = image->height;
vc_notice(dev, "%s(): Update image size from mode%u (l: %u, t: %u, w: %u, h: %u)\n",
__FUNCTION__, mode_idx, *left, *top, *width, *height);
}
}
in image = &mode->image_properties;
and the following lines, somehow the parameter left
is being accessed, but there is no left
defined in the struct sensor_image_properties
:
(from tegra-v4l2-camera.h):
struct sensor_image_properties {
__u32 width;
__u32 height;
__u32 line_length;
__u32 pixel_format;
__u32 embedded_metadata_height;
__u32 reserved[11];
};
How can this be resolved?
Jetson Orin Nano with VC IMX568 cam
VIDIOC_REQBUFS returned -1 (Device or resource busy)
-gstream command
gst-launch-1.0 nvarguscamerasrc sensor-id=0
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 2464 x 2048 FR = 78.800002 fps Duration = 12690355 ; Analog Gain range min 0.000000, max 48.000000; Exposure Range min 1000, max 1000000000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 2464 H = 2048
seconds to Run = 0
Frame Rate = 78.800002
GST_ARGUS: Setup Complete, Starting captures for 0 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:694 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
Execution ended after 0:00:00.420879376
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
[ 189.067207] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 41554 mHz
[ 189.074502] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 10000 us
[ 189.085201] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 189.092527] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 10000 us
[ 189.101261] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 189.107939] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 189.120776] bwmgr API not supported
[ 189.121080] vc_mipi 9-001a: vc_core_set_format(): Set format 0x300f (RG10)
[ 189.131793] vc_mipi 9-001a: vc_core_try_format(): Try format 0x300f (RG10, format: 0x2b)
[ 189.131798] vc_mipi 9-001a: vc_update_image_size_from_mode(): Update image size from mode0 (l: 0, t: 0, w: 2464, h: 2048)
[ 189.143094] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 189.149729] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 189.158418] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 189.165671] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 189.174355] i2c 9-0010: vc_mod_set_mode(): Set module mode: 10 (lanes: 4, format: RG10, type: EXT.TRG)
[ 189.183944] i2c 9-0010: vc_mod_set_power(): Set module power: down
[ 189.184213] i2c 9-0010: vc_mod_set_power(): Set module power: up
[ 189.585492] vc_mipi 9-001a: vc_sen_set_roi(): Set sensor roi: (left: 0, top: 0, width: 2464, height: 2048)
[ 189.596860] vc_mipi 9-001a: vc_sen_set_roi(): i2c_write_reg: 14658
[ 189.603358] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 189.612125] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 189.618818] vc_mipi 9-001a: vc_sen_set_blacklevel(): Set sensor black level: 60
[ 189.626657] vc_mipi 9-001a: vc_sen_start_stream(): Start streaming
[ 189.834097] bwmgr API not supported
[ 1034.174784] vc_mipi 9-001a: vc_sen_stop_stream(): Stop streaming
[ 1034.239951] bwmgr API not supported
[ 1036.795497] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 67060 mHz
[ 1036.806408] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1036.815174] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 0
[ 1036.823687] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 1036.830982] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1036.840442] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 1036.850549] bwmgr API not supported
[ 1036.850859] vc_mipi 9-001a: vc_core_set_format(): Set format 0x300f (RG10)
[ 1036.861586] vc_mipi 9-001a: vc_core_try_format(): Try format 0x300f (RG10, format: 0x2b)
[ 1036.861591] vc_mipi 9-001a: vc_update_image_size_from_mode(): Update image size from mode0 (l: 0, t: 0, w: 2464, h: 2048)
[ 1036.872915] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 1036.879591] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1036.888319] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 1036.895696] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1036.904479] vc_mipi 9-001a: vc_sen_set_roi(): Set sensor roi: (left: 0, top: 0, width: 2464, height: 2048)
[ 1036.915849] vc_mipi 9-001a: vc_sen_set_roi(): i2c_write_reg: 14658
[ 1036.922304] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1036.931055] vc_mipi 9-001a: vc_sen_start_stream(): Start streaming
[ 1037.138411] bwmgr API not supported
[ 1077.915361] vc_mipi 9-001a: vc_sen_stop_stream(): Stop streaming
[ 1077.980722] bwmgr API not supported
[ 1088.440177] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 67060 mHz
[ 1088.451107] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1088.459915] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 0
[ 1088.467680] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 1088.474980] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1088.483714] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 1088.493863] bwmgr API not supported
[ 1088.494171] vc_mipi 9-001a: vc_core_set_format(): Set format 0x300f (RG10)
[ 1088.504873] vc_mipi 9-001a: vc_core_try_format(): Try format 0x300f (RG10, format: 0x2b)
[ 1088.504878] vc_mipi 9-001a: vc_update_image_size_from_mode(): Update image size from mode0 (l: 0, t: 0, w: 2464, h: 2048)
[ 1088.516180] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 1088.522818] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1088.531503] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 1088.538774] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1088.547471] vc_mipi 9-001a: vc_sen_set_roi(): Set sensor roi: (left: 0, top: 0, width: 2464, height: 2048)
[ 1088.558607] vc_mipi 9-001a: vc_sen_set_roi(): i2c_write_reg: 14658
[ 1088.565067] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1088.573748] vc_mipi 9-001a: vc_sen_start_stream(): Start streaming
[ 1088.781042] bwmgr API not supported
[ 1101.227032] vc_mipi 9-001a: vc_sen_stop_stream(): Stop streaming
[ 1101.292261] bwmgr API not supported
[ 1102.786192] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 67060 mHz
[ 1102.797078] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1102.805919] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 0
[ 1102.814286] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 1102.821649] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1102.830543] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 1102.840631] bwmgr API not supported
[ 1102.840940] vc_mipi 9-001a: vc_core_set_format(): Set format 0x300f (RG10)
[ 1102.851634] vc_mipi 9-001a: vc_core_try_format(): Try format 0x300f (RG10, format: 0x2b)
[ 1102.851639] vc_mipi 9-001a: vc_update_image_size_from_mode(): Update image size from mode0 (l: 0, t: 0, w: 2464, h: 2048)
[ 1102.862928] vc_mipi 9-001a: vc_sen_set_gain(): Set sensor gain: 10
[ 1102.869546] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1102.878193] vc_mipi 9-001a: vc_core_set_framerate(): Set framerate 30000 mHz
[ 1102.885449] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1102.894117] vc_mipi 9-001a: vc_sen_set_roi(): Set sensor roi: (left: 0, top: 0, width: 2464, height: 2048)
[ 1102.905203] vc_mipi 9-001a: vc_sen_set_roi(): i2c_write_reg: 14658
[ 1102.911671] vc_mipi 9-001a: vc_sen_set_exposure(): Set sensor exposure: 33330 us
[ 1102.920319] vc_mipi 9-001a: vc_sen_start_stream(): Start streaming``
I have observed several problems while using VC-MIPI Driver version 0.14 on my Jetson Xavier NX with the Auvidea JNX30 Carrier Board to test it with the IMX183 Sensor.
Device Tree Selection Issue:
During the flashing process, the incorrect Device Tree was displayed. The message indicated the usage of a device tree camera file from the path: ../Auvidea_J20_AGXXavier/..., while I had selected XavierNX and Auvidea_JNX30 as shown below:
Pixelformat GREY Error:
After successfully flashing the Jetson, I installed V4L (Video for Linux) and attempted to select the Pixelformat GREY, which I had used previously. However, I encountered an error message stating that this Pixelformat was invalid. Only the RGGB 8 bit format was available in the list-formats output. (I had configured this Pixelformat in the devicetree.)
Streaming and Test Image Issue:
I also tried to create a test image using a V4L command, but this process failed. Whenever I attempt to start streaming, the system tries to capture an image every 10 seconds (as set in vi5_fops.c), but it fails to do so. The command I used is:
v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test_5440x3648.raw
Supports
Test this problem with newest camera revision (REV03?)
v4l2-ctl --list-ctrls
displays wrong values after boot:
Camera Controls
group_hold 0x009a2003 (bool) : default=0 value=0 flags=execute-on-write
sensor_mode 0x009a2008 (int64) : min=0 max=1 step=1 default=0 value=0 flags=slider
gain 0x009a2009 (int64) : min=0 max=51000 step=50 default=0 value=0 flags=slider
exposure 0x009a200a (int64) : min=1 max=1000000 step=1 default=10000 value=1 flags=slider
frame_rate 0x009a200b (int64) : min=1000 max=40000 step=100 default=40000 value=1000 flags=slider
trigger_mode 0x009a200e (int) : min=0 max=7 step=1 default=0 value=0
io_mode 0x009a200f (int) : min=0 max=5 step=1 default=0 value=0
black_level 0x009a2010 (int) : min=0 max=2147483647 step=1 default=0 value=0 flags=slider
single_trigger 0x009a2011 (button) : flags=write-only, execute-on-write
bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
height_align 0x009a2066 (int) : min=1 max=16 step=1 default=1 value=1
size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
write_isp_format 0x009a2068 (bool) : default=0 value=0
sensor_signal_properties 0x009a2069 (u32) : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
sensor_image_properties 0x009a206a (u32) : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
sensor_control_properties 0x009a206b (u32) : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
sensor_dv_timings 0x009a206c (u32) : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
low_latency_mode 0x009a206d (bool) : default=0 value=0
preferred_stride 0x009a206e (int) : min=0 max=65535 step=1 default=0 value=0
sensor_modes 0x009a2082 (int) : min=0 max=30 step=1 default=30 value=1 flags=read-only
For example, the value of the exposure control is 1. The actual value in the sensor register seems to be 10000. We encountered wrong initial values also for other controls (e.g. black level).
Hi,
I have two OV9281 EK0033311 V1.0 from you which I wanted to connect to my Jetson Nano B01 dev board. However when I try to use them with gstreamer it fails. I've tried L4T versions 32.6.1 and 32.7.2.
/*
* Copyright (c) 2020-2021, Vision Components GmbH. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
// ------------------------------------------------------------------------------------------------
// Driver Configuration for NVIDIA Jetson Nano 4GB/2GB on NVIDIA Jetson Nano Developer Kit
// ------------------------------------------------------------------------------------------------
#define VC_MIPI_CAM_0 1 // 1: Enabled, 0: Disabled (serial_a => CSI Port 0 => VI Stream 0)
#define VC_MIPI_CAM_1 1 // 1: Enabled, 0: Disabled (serial_e => CSI Port 4 => VI Stream 4)
// ------------------------------------------------------------------------------------------------
// Supported number of lanes
// -----+------------------------------------------------------------------------------------------
// 1 | OV7251, IMX296, IMX297
// 2 | OV9281, IMX264, IMX265
// 2,4 | IMX178, IMX183, IMX226, IMX250, IMX252, IMX273, IMX290, IMX327, IMX335, IMX392,
// | IMX412, IMX415, IMX568
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_LANES 2 // 1, 2 Lanes
// ------------------------------------------------------------------------------------------------
// Sensor Manufacturer
// -----+------------------------------------------------------------------------------------------
// 1 | Sony Sensor (IMX)
// 2 | Omni Vision Sensor (OV)
// -----+------------------------------------------------------------------------------------------
#define VC_MIPI_MANUFACTURER 2
// ------------------------------------------------------------------------------------------------
// GStreamer Support
// ------------------------------------------------------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc you have to adjust this settings in the
// device tree below. The sections which have to be modified are marked by a comment.
// To find the correct parameter values please follow the instruction in the main README.md of
// this repository https://github.com/VC-MIPI-modules/vc_mipi_nvidia#gstreamer-support
// ------------------------------------------------------------------------------------------------
#define VC_MIPI_METADATA_H "0"
#if VC_MIPI_LANES == 1
#define BUS_WIDTH 1
#define NUM_LANES "1"
#define NUM_CSI_LANES 2
#endif
#if VC_MIPI_LANES == 2
#define BUS_WIDTH 2
#define NUM_LANES "2"
#define NUM_CSI_LANES 4
#endif
#if VC_MIPI_CAM_0 == 1 && VC_MIPI_CAM_1 == 1
#define VC_MIPI_CAMERAS 2
#else
#define VC_MIPI_CAMERAS 1
#endif
/ {
host1x {
vc_vi_base: vi {
num-channels = <VC_MIPI_CAMERAS>;
ports {
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_CAM_0 == 1
vc_vi_port0: port@0 {
reg = <0>;
vc_vi_in0: endpoint {
port-index = <0>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_out0>;
};
};
#endif
#if VC_MIPI_CAM_1 == 1
vc_vi_port1: port@1 {
reg = <1>;
vc_vi_in1: endpoint {
port-index = <4>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_out1>;
};
};
#endif
};
};
vc_csi_base: nvcsi {
num-channels = <VC_MIPI_CAMERAS>;
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_CAM_0 == 1
vc_csi_chan0: channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vc_csi_chan0_port0: port@0 {
reg = <0>;
vc_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_mipi_out0>;
};
};
vc_csi_chan0_port1: port@1 {
reg = <1>;
vc_csi_out0: endpoint@1 {
remote-endpoint = <&vc_vi_in0>;
};
};
};
};
#endif
#if VC_MIPI_CAM_1 == 1
vc_csi_chan1: channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vc_csi_chan1_port0: port@0 {
reg = <0>;
vc_csi_in1: endpoint@2 {
port-index = <4>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_mipi_out1>;
};
};
vc_csi_chan1_port1: port@1 {
reg = <1>;
vc_csi_out1: endpoint@3 {
remote-endpoint = <&vc_vi_in1>;
};
};
};
};
#endif
};
};
cam_i2cmux {
#if VC_MIPI_CAM_0 == 1
i2c@0 {
#if VC_MIPI_MANUFACTURER == 1
vc_mipi_cam0: vc_mipi@1a {
reg = <0x1a>;
#else
vc_mipi_cam0: vc_mipi@60 {
reg = <0x60>;
#endif
compatible = "nvidia,vc_mipi";
devnode = "video0";
use_sensor_mode_id = "false";
sensor_model = "vc_mipi";
num_lanes = NUM_LANES;
trigger_mode = "0";
io_mode = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings
physical_w = "3.840";
physical_h = "2.400";
// ----------------------------------------------------
// This node is needed by the Tegra framework.
// You don't have to change any settings if just want to use the V4L API.
mode0 {
num_lanes = NUM_LANES;
tegra_sinterface = "serial_a";
embedded_metadata_height = VC_MIPI_METADATA_H;
readout_orientation = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings.
active_l = "0";
active_t = "0";
active_w = "1280";
active_h = "800";
pixel_t = "bayer_rggb";
min_gain_val = "0"; // mdB
max_gain_val = "12000"; // mdB
step_gain_val = "50"; // mdB
default_gain = "0"; // mdB
min_exp_time = "1"; // us
max_exp_time = "1000000"; // us
step_exp_time = "1"; // us
default_exp_time = "10000"; // us
min_framerate = "0"; // mHz
max_framerate = "120600"; // mHz
step_framerate = "100"; // mHz
default_framerate = "120600"; // mHz
// ----------------------------------------------------
gain_factor = "1000";
exposure_factor = "1000000";
framerate_factor = "1000";
inherent_gain = "1";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
line_length = "0";
phy_mode = "DPHY";
discontinuous_clk = "no";
mclk_khz = "24000";
pix_clk_hz = "800000000";
mclk_multiplier = "9.33";
cil_settletime = "0";
dpcm_enable = "false";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
vc_mipi_out0: endpoint {
port-index = <0>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_in0>;
};
};
};
};
};
#endif
#if VC_MIPI_CAM_1 == 1
i2c@1 {
#if VC_MIPI_MANUFACTURER == 1
vc_mipi_cam1: vc_mipi@1a {
reg = <0x1a>;
#else
vc_mipi_cam1: vc_mipi@60 {
reg = <0x60>;
#endif
compatible = "nvidia,vc_mipi";
devnode = "video1";
use_sensor_mode_id = "false";
sensor_model = "vc_mipi";
num_lanes = NUM_LANES;
trigger_mode = "0";
io_mode = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings
physical_w = "3.840";
physical_h = "2.400";
// ----------------------------------------------------
// This node is needed by the Tegra framework.
// You don't have to change any settings if just want to use the V4L API.
mode0 {
num_lanes = NUM_LANES;
tegra_sinterface = "serial_e";
embedded_metadata_height = VC_MIPI_METADATA_H;
readout_orientation = "0";
// ----------------------------------------------------
// If you want to use GStreamer with nvarguscamerasrc
// you have to adjust this settings.
active_l = "0";
active_t = "0";
active_w = "1280";
active_h = "800";
pixel_t = "bayer_rggb";
min_gain_val = "0"; // mdB
max_gain_val = "12000"; // mdB
step_gain_val = "50"; // mdB
default_gain = "0"; // mdB
min_exp_time = "1"; // us
max_exp_time = "1000000"; // us
step_exp_time = "1"; // us
default_exp_time = "10000"; // us
min_framerate = "0"; // mHz
max_framerate = "120600"; // mHz
step_framerate = "100"; // mHz
default_framerate = "120600"; // mHz
// ----------------------------------------------------
gain_factor = "1000";
exposure_factor = "1000000";
framerate_factor = "1000";
inherent_gain = "1";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
line_length = "0";
phy_mode = "DPHY";
discontinuous_clk = "no";
mclk_khz = "24000";
pix_clk_hz = "800000000";
mclk_multiplier = "9.33";
cil_settletime = "0";
dpcm_enable = "false";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
vc_mipi_out1: endpoint {
port-index = <4>;
bus-width = <BUS_WIDTH>;
remote-endpoint = <&vc_csi_in1>;
};
};
};
};
};
#endif
};
lens@vc_mipi {
min_focus_distance = "0.0";
hyper_focal = "0.0";
focal_length = "6.0";
f_number = "2.0";
aperture = "0.0";
};
};
/ {
tcp: tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <NUM_CSI_LANES>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <240000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
#if VC_MIPI_CAM_0 == 1
cam_module0: module0 {
status = "okay";
badge = "porg_front_vc_mipi";
position = "front";
orientation = "1";
cam_module0_drivernode0: drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
#if VC_MIPI_MANUFACTURER == 1
devname = "vc_mipi 7-001a";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@1a";
#else
devname = "vc_mipi 7-0060";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/vc_mipi@60";
#endif
};
cam_module0_drivernode1: drivernode1 {
status = "okay";
pcl_id = "v4l2_lens";
proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
};
};
#endif
#if VC_MIPI_CAM_1 == 1
cam_module1: module1 {
status = "okay";
badge = "porg_rear_vc_mipi";
position = "rear";
orientation = "1";
cam_module1_drivernode0: drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
#if VC_MIPI_MANUFACTURER == 1
devname = "vc_mipi 8-001a";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/vc_mipi@1a";
#else
devname = "vc_mipi 8-0060";
proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/vc_mipi@60";
#endif
};
cam_module1_drivernode1: drivernode1 {
status = "okay";
pcl_id = "v4l2_lens";
proc-device-tree = "/proc/device-tree/lens@vc_mipi/";
};
};
#endif
};
};
};
#define CAM1_PWDN TEGRA_GPIO(S, 7)
#define CAM2_PWDN TEGRA_GPIO(T, 0)
#define CAM_I2C_MUX TEGRA_GPIO(I, 0)
/ {
cam_i2cmux {
status = "okay";
compatible = "i2c-mux-gpio";
#address-cells = <1>;
#size-cells = <0>;
mux-gpios = <&gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
i2c-parent = <&i2c7>;
#if VC_MIPI_CAM_0 == 1
i2c@0 {
status = "okay";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_MANUFACTURER == 1
vc_mipi@1a {
#else
vc_mipi@60 {
#endif
status = "okay";
reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
};
};
#endif
#if VC_MIPI_CAM_1 == 1
i2c@1 {
status = "okay";
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
#if VC_MIPI_MANUFACTURER == 1
vc_mipi@1a {
#else
vc_mipi@60 {
#endif
status = "okay";
reset-gpios = <&gpio CAM2_PWDN GPIO_ACTIVE_HIGH>;
};
};
#endif
};
gpio@6000d000 {
camera-control-output-low {
gpio-hog;
output-low;
gpios = <CAM1_PWDN 0 CAM2_PWDN 0>;
label = "cam1-pwdn", "cam2-pwdn";
};
};
};
After setting
v4l2-ctl --set-fmt-video=pixelformat=RG10,width=1280,height=800
guvcview gives:
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev0
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev1
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev2
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev3
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120.599999; Analog Gain Range Min 0.000000, Max 12.000000, Exposure Range Min 1000, Max 1000000000
V4L2_CORE: Unable to find parent usb device.Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120.599999; Analog Gain Range Min 0.000000, Max 12.000000, Exposure Range Min 1000, Max 1000000000
V4L2_CORE: Unable to find parent usb device.GUVCVIEW: version 2.0.5
GUVCVIEW: couldn't open /home/<user>/.config/guvcview2/video0 for read: No such file or directory
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120,599999; Analog Gain Range Min 0,000000, Max 12,000000, Exposure Range Min 1000, Max 1000000000
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: Error opening device /dev/video0: video capture not supported.
GUVCVIEW (1): Guvcview error
no video device found
(guvcview:22823): Gtk-WARNING **: 21:17:12.386: Theme parsing error: <data>:1:17: not a number
(guvcview:22823): Gtk-WARNING **: 21:17:12.387: Theme parsing error: <data>:1:31: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
(guvcview:22823): Gtk-WARNING **: 21:17:12.387: Theme parsing error: <data>:1:17: not a number
(guvcview:22823): Gtk-WARNING **: 21:17:12.387: Theme parsing error: <data>:1:32: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
(guvcview:22823): Gtk-WARNING **: 21:17:12.387: Theme parsing error: <data>:1:17: not a number
(guvcview:22823): Gtk-WARNING **: 21:17:12.387: Theme parsing error: <data>:1:26: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
Gtk-Message: 21:17:12.479: GtkDialog mapped without a transient parent. This is discouraged.
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev0
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev1
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev2
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev3
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120.599999; Analog Gain Range Min 0.000000, Max 12.000000, Exposure Range Min 1000, Max 1000000000
V4L2_CORE: Unable to find parent usb device.Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120.599999; Analog Gain Range Min 0.000000, Max 12.000000, Exposure Range Min 1000, Max 1000000000
V4L2_CORE: Unable to find parent usb device.GUVCVIEW: version 2.0.5
GUVCVIEW: couldn't open /home/<user>/.config/guvcview2/video1 for read: No such file or directory
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120,599999; Analog Gain Range Min 0,000000, Max 12,000000, Exposure Range Min 1000, Max 1000000000
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: Error opening device /dev/video1: video capture not supported.
GUVCVIEW (1): Guvcview error
no video device found
(guvcview:23012): Gtk-WARNING **: 21:17:18.014: Theme parsing error: <data>:1:17: not a number
(guvcview:23012): Gtk-WARNING **: 21:17:18.014: Theme parsing error: <data>:1:31: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
(guvcview:23012): Gtk-WARNING **: 21:17:18.014: Theme parsing error: <data>:1:17: not a number
(guvcview:23012): Gtk-WARNING **: 21:17:18.015: Theme parsing error: <data>:1:32: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
(guvcview:23012): Gtk-WARNING **: 21:17:18.015: Theme parsing error: <data>:1:17: not a number
(guvcview:23012): Gtk-WARNING **: 21:17:18.015: Theme parsing error: <data>:1:26: Using Pango syntax for the font: style property is deprecated; please use CSS syntax
Gtk-Message: 21:17:18.061: GtkDialog mapped without a transient parent. This is discouraged.
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev0
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev1
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev2
Opening in O_NONBLOCKING MODE
libv4l2: error getting capabilities: Inappropriate ioctl for device
V4L2_CORE: ERROR opening V4L2 interface for /dev/v4l-subdev3
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120.599999; Analog Gain Range Min 0.000000, Max 12.000000, Exposure Range Min 1000, Max 1000000000
V4L2_CORE: Unable to find parent usb device.Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120.599999; Analog Gain Range Min 0.000000, Max 12.000000, Exposure Range Min 1000, Max 1000000000
V4L2_CORE: Unable to find parent usb device.GUVCVIEW: version 2.0.5
GUVCVIEW: couldn't open /home/<user>/.config/guvcview2/video0 for read: No such file or directory
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1280 x 800 ; Framerate = 120,599999; Analog Gain Range Min 0,000000, Max 12,000000, Exposure Range Min 1000, Max 1000000000
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
DEFAULT no IOCTL called
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Invalid argument
V4L2_CORE: Error opening device /dev/video0: video capture not supported.
GUVCVIEW (1): Guvcview error
no video device found
Running nvgstcapture-1.0 gives:
$ nvgstcapture-1.0 --camsrc=0 --cap-dev-node=0
Encoder null, cannot set bitrate!
Encoder Profile = High
Runtime USB Camera Commands:
Help : 'h'
Quit : 'q'
Set Capture Mode:
mo:<val>
(1): image
(2): video
Get Capture Mode:
gmo
Capture: enter 'j' OR
followed by a timer (e.g., jx5000, capture after 5 seconds) OR
followed by multishot count (e.g., j:6, capture 6 images)
timer/multihot values are optional, capture defaults to single shot with timer=0s
Start Recording : enter '1'
Stop Recording : enter '0'
Set Preview Resolution:
pcr:<val> e.g., pcr:2
(0) : 176x144
(1) : 320x240
(2) : 640x480
(3) : 1280x720
(4) : 1920x1080
NOTE: Preview/Encode resolution will be same as Capture resolution for USB-Camera
Get Preview Resolution:
gpcr
Get Image Capture Resolution:
gicr
Get Video Capture Resolution:
gvcr
Set Capture Device Node:
cdn:<val> e.g., cdn:0
(0): /dev/video0
(1): /dev/video1
(2): /dev/video2
Get Capture Device Node:
gcdn
Runtime encoder configuration options:
Set Encoding Bit-rate(in bytes):
br:<val> e.g., br:4000000
Get Encoding Bit-rate(in bytes):
gbr
Set Encoding Profile(only for H.264):
ep:<val> e.g., ep:1
(0): Baseline
(1): Main
(2): High
Get Encoding Profile(only for H.264):
gep
Force IDR Frame on video Encoder(only for H.264):
Enter 'f'
** Message: 21:27:49.643: <main:4670> iterating capture loop ....
ERROR on bus: by /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstV4l2Src:v4l2src0: Internal data stream error.
debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
** Message: 21:27:49.703: <main:4680> Capture completed
** Message: 21:27:49.703: <main:4729> Camera application will now exit
Have I forgotten some setting?
Test setup: JNX30 + Jetson nano with L4T 32.6.1 and driver 0.14.1.
When streaming (mode does not seem to matter, for example 2 lanes, 10-bit, streaming mode) with the standard resolution (2472 x 2048) the image is not ok. It looks like the image width is wrong. When the image width is changed to 2432, 2464 or 2496 for example, 1 image out of 3 image look good and 2 out of 3 images are black. Additionnally the kernel log output the error message "image height is too long" (or too short).
Use NV_DevKit_XavierNX. DTS from Auvidea_J20_AGXXavier is erroneously selected in scripts. But even if you turn on the right DTS, it still doesn't work.
vc@XavierNX:~$ sudo dmesg | grep -i i2c
[sudo] password for vc:
[ 2.911452] i2c /dev entries driver
[ 2.914621] tegra-i2c 3160000.i2c: Adding to iommu group 2
[ 2.920412] tegra-i2c c240000.i2c: Adding to iommu group 2
[ 2.926083] tegra-i2c 3180000.i2c: Adding to iommu group 2
[ 2.931133] tegra-i2c 3190000.i2c: Adding to iommu group 2
[ 2.936469] tegra-i2c 31b0000.i2c: Adding to iommu group 2
[ 2.942184] tegra-i2c 31c0000.i2c: Adding to iommu group 2
[ 2.947341] tegra-i2c c250000.i2c: Adding to iommu group 2
[ 5.508356] tegra-i2c 31e0000.i2c: Adding to iommu group 2
[ 7.914239] vc_mipi 9-001a: vc_mod_setup(): Unable to get module I2C client for address 0x10
[ 7.914714] i2c i2c-2: Added multiplexed i2c bus 9
[ 10.314191] vc_mipi 10-001a: vc_mod_setup(): Unable to get module I2C client for address 0x10
[ 10.314692] i2c i2c-2: Added multiplexed i2c bus 10
[ 10.314805] i2c-mux-gpio cam_i2cmux: 2 port mux on 3180000.i2c adapter
vc@XavierNX:~$ sudo dmesg | grep -i mipi
[ 0.006517] DTS File Name: /home/master/src/vc_mipi_nvidia/build/Xavier_35.3.1/Linux_for_Tegra/source/public/kernel/kernel-5.10/arch/arm64/boot/dts/../../../../../../hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-0001-p3509-0000.dts
[ 5.511250] vc_mipi 9-001a: vc_probe(): Probing UNIVERSAL VC MIPI Driver (v0.14.1)
[ 7.914239] vc_mipi 9-001a: vc_mod_setup(): Unable to get module I2C client for address 0x10
[ 7.914447] vc_mipi 9-001a: vc_probe(): Error in vc_core_init!
[ 7.915673] vc_mipi 10-001a: vc_probe(): Probing UNIVERSAL VC MIPI Driver (v0.14.1)
[ 10.314191] vc_mipi 10-001a: vc_mod_setup(): Unable to get module I2C client for address 0x10
[ 10.314427] vc_mipi 10-001a: vc_probe(): Error in vc_core_init!
I am currently trying to install the driver on an AGX Xavier with Nvidia L4T 35.2.1. So I create a folder, clone the file from Github with this command 'git clone https://github.com/pmliquify/vc_mipi_nvidia' and run the quickstart.sh. I make the necessary settings. The program runs and then unfortunately ends with: fatal: not in a git directory. See picture.
When I start the quickstart.sh again, then comes the following error:
Maybe someone can help me? Is the driver not working correctly at this point or am I doing something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.