Hi ,
I am using Orin NX to adapt to the OV5647 driver, but there is an issue with nvgstcapture-1.0 not displaying.The interface used is cam0.Do you have any suggestions for modification.
dtb
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
/dts-v1/;
/plugin/;
#define CAM0_RST TEGRA234_MAIN_GPIO(H, 3)
#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)
#include <dt-bindings/tegra234-p3767-0000-common.h>
#include <dt-bindings/clock/tegra234-clock.h>
#include <dt-bindings/gpio/tegra234-gpio.h>
/ {
overlay-name = "Camera ov5647-test";
jetson-header-name = "Jetson 24pin CSI Connector";
compatible = JETSON_COMPATIBLE_P3768;
/* ov5647 sensor module on CSI PORT B / cam0 */
fragment@0 {
target-path = "/";
__overlay__ {
tegra-capture-vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port1: port@1 {
reg = <0>;
rbpcv2_ov5647_vi_in1: endpoint {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&rbpcv2_ov5647_csi_out1>;
};
};
};
};
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 = <2>;
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>;
/**
* 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 vendor.
*/
modules {
cam_module1: module1 {
badge = "jakku_rear_RBP194";
// badge = "porg_front_RBPCV2";
position = "rear";
orientation = "1";
cam_module1_drivernode0: drivernode0 {
pcl_id = "v4l2_sensor";
sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/rbpcv2_ov5647_c@36";
};
cam_module1_drivernode1: drivernode1 {
pcl_id = "v4l2_lens";
sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/lens_ov5647@RBPCV2";
};
};
};
};
bus@0 {
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
csi_chan1: channel@1 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
csi_chan1_port0: port@0 {
reg = <0>;
rbpcv2_ov5647_csi_in1: endpoint@2 {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&rbpcv2_ov5647_out1>;
};
};
csi_chan1_port1: port@1 {
reg = <1>;
rbpcv2_ov5647_csi_out1: endpoint@3 {
remote-endpoint = <&rbpcv2_ov5647_vi_in1>;
};
};
};
};
};
};
cam_i2cmux {
status = "okay";
compatible = "i2c-mux-gpio";
#address-cells = <1>;
#size-cells = <0>;
mux-gpios = <&gpio_aon CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
i2c-parent = <&cam_i2c>;
i2c@0 {
rbpcv2_ov5647_a@10 {
status = "disabled";
};
};
i2c@1 {
status = "okay";
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
rbpcv2_ov5647_c@36 {
//reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio CAM0_RST GPIO_ACTIVE_HIGH>;
pwdn-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
compatible = "ovti,ov5647";
// compatible = "sony,imx219";
/* I2C device address */
reg = <0x36>;
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.670";
physical_h = "2.740";
sensor_model = "ov5647";
use_sensor_mode_id = "true";
clocks = <&bpmp TEGRA234_CLK_EXTPERIPH2>,
<&bpmp TEGRA234_CLK_PLLP_OUT0>;
clock-names = "extperiph2", "pllp_grtba";
mclk = "extperiph2";
clock-frequency = <24000000>;
mode0 { /* ov5647_MODE_3280x2464_21FPS */
mclk_khz = "25000";
num_lanes = "2";
// lane_polarity = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "2592";
active_h = "1944";
mode_type = "bayer";
pixel_phase = "bggr";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "2844";
inherent_gain = "1";
mclk_multiplier = "3.4999";
pix_clk_hz = "87499996";
gain_factor = "1";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "16"; /* 1.00x */
max_gain_val = "128"; /* 10.66x */
step_gain_val = "1";
default_gain = "16"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "15000000"; /* 2.0 fps */
max_framerate = "15000000"; /* 21.0 fps */
step_framerate = "1";
default_framerate = "15000000"; /* 21.0 fps */
min_exp_time = "65"; /* us */
max_exp_time = "60000"; /* us */
step_exp_time = "1";
default_exp_time = "10000"; /* us */
embedded_metadata_height = "0";
};
mode1 { /* ov5647_MODE_3280x1848_28FPS */
mclk_khz = "25000";
num_lanes = "2";
// lane_polarity = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1920";
active_h = "1080";
mode_type = "bayer";
// pixel_phase = "rggb";
pixel_phase = "bggr";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "2416";
inherent_gain = "1";
mclk_multiplier = "3.6669";
pix_clk_hz = "81666663";
gain_factor = "16";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "16"; /* 1.00x */
max_gain_val = "128"; /* 10.66x */
step_gain_val = "1";
default_gain = "16"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "30000000"; /* 2.0 fps */
max_framerate = "30000000"; /* 28.0 fps */
step_framerate = "1";
default_framerate = "30000000"; /* 28.0 fps */
min_exp_time = "60"; /* us */
max_exp_time = "30000"; /* us */
step_exp_time = "1";
default_exp_time = "10000"; /* us */
embedded_metadata_height = "0";
};
mode2 { /* ov5647_MODE_1920x1080_30FPS */
mclk_khz = "25000";
num_lanes = "2";
// lane_polarity = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "960";
mode_type = "bayer";
pixel_phase = "bggr";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "1896";
inherent_gain = "1";
mclk_multiplier = "3.66669";
pix_clk_hz = "81666663";
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 = "45000000"; /* 2.0 fps */
max_framerate = "45000000"; /* 30.0 fps */
step_framerate = "1";
default_framerate = "45000000"; /* 30.0 fps */
min_exp_time = "43"; /* us */
max_exp_time = "20000"; /* us */
step_exp_time = "1";
default_exp_time = "10000"; /* us */
embedded_metadata_height = "0";
};
mode3 { /* ov5647_MODE_1640x1232_30FPS */
mclk_khz = "25000";
num_lanes = "2";
// lane_polarity = "4";
tegra_sinterface = "serial_c";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1280";
active_h = "720";
mode_type = "bayer";
pixel_phase = "bggr";
csi_pixel_bit_depth = "10";
readout_orientation = "90";
line_length = "3448";
inherent_gain = "1";
mclk_multiplier = "3.66669";
pix_clk_hz = "81666663";
gain_factor = "16";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "16"; /* 1.00x */
max_gain_val = "168"; /* 10.66x */
step_gain_val = "1";
default_gain = "16"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "60000000"; /* 2.0 fps */
max_framerate = "60000000"; /* 60.0 fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0 fps */
min_exp_time = "43"; /* us */
max_exp_time = "10000"; /* us */
step_exp_time = "1";
default_exp_time = "1000"; /* us */
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv2_ov5647_out1: endpoint {
status = "okay";
port-index = <1>;
bus-width = <2>;
remote-endpoint = <&rbpcv2_ov5647_csi_in1>;
};
};
};
};
};
};
lens_ov5647@RBPCV2 {
min_focus_distance = "0.0";
hyper_focal = "0.0";
focal_length = "3.04";
f_number = "2.0";
aperture = "0.0";
};
gpio@2200000 {
camera-control-output-low {
status = "disable";
gpio-hog;
output-low;
gpios = <CAM0_RST 0>;
label = "cam0-rst";
};
};
gpio@6000d000 {
camera-control-output-low {
status = "disable";
gpio-hog;
output-low;
gpios = < CAM1_PWDN 0 CAM0_PWDN 0>;
label = "cam1-pwdn", "cam0-pwdn";
};
};
};
};
};
};
Here are some debug information about the driver I loaded, and it doesn’t seem to have any errors。
Here are some of my error messages:
Using winsys: x11
Opening in BLOCKING MODE
0:00:00.258585594 4526 0xaaaae96074a0 WARN v4l2 gstv4l2object.c:4682:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:00.326126307 4526 0xaaaae9f86860 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<nvarguscamerasrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
** Message: 07:51:24.994: <main:4732> iterating capture loop ....
0:00:00.338200786 4526 0xaaaae924a760 ERROR egladaption gstegladaptation.c:689:gst_egl_adaptation_choose_config:<eglglessink0> Could not find matching framebuffer config
0:00:00.338252659 4526 0xaaaae924a760 ERROR egladaption gstegladaptation.c:703:gst_egl_adaptation_choose_config:<eglglessink0> Couldn't choose an usable config
0:00:00.338263315 4526 0xaaaae924a760 ERROR nveglglessink gsteglglessink.c:2778:gst_eglglessink_configure_caps:<eglglessink0> Couldn't choose EGL config
0:00:00.338270739 4526 0xaaaae924a760 ERROR nveglglessink gsteglglessink.c:2836:gst_eglglessink_configure_caps:<eglglessink0> Configuring caps failed
0:00:00.338650042 4526 0xaaaae94cfea0 ERROR nveglglessink gsteglglessink.c:2869:gst_eglglessink_setcaps:<eglglessink0> Failed to configure caps
0:00:00.338713243 4526 0xaaaae94cfea0 ERROR nveglglessink gsteglglessink.c:2869:gst_eglglessink_setcaps:<eglglessink0> Failed to configure caps
0:00:00.338727099 4526 0xaaaae94cfea0 WARN GST_PADS gstpad.c:4351:gst_pad_peer_query:<nvegltransform0:src> could not send sticky events
0:00:00.339966448 4526 0xaaaae94cff60 WARN v4l2 gstv4l2object.c:3721:gst_v4l2_object_set_format_full:<nvv4l2h264enc0:sink> Unknown colorimetry tranfer 16
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:00.341442666 4526 0xaaaae94cff60 WARN v4l2bufferpool gstv4l2bufferpool.c:1130:gst_v4l2_buffer_pool_start:<nvv4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 8.000000; Exposure Range min 60000, max 30000000;
GST_ARGUS: 1280 x 960 FR = 45.000000 fps Duration = 22222222 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 43000, max 20000000;
GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.500000; Exposure Range min 43000, max 10000000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 2
Output Stream W = 1280 H = 720
seconds to Run = 0
Frame Rate = 59.999999
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:734 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:245 (propagating)
0:00:04.338075906 4526 0xaaaae94cfea0 ERROR nveglglessink gsteglglessink.c:2869:gst_eglglessink_setcaps:<eglglessink0> Failed to configure caps
0:00:04.338094978 4526 0xaaaae924a6a0 FIXME basesink gstbasesink.c:3395:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
0:00:04.338124739 4526 0xaaaae94cfea0 ERROR nveglglessink gsteglglessink.c:2869:gst_eglglessink_setcaps:<eglglessink0> Failed to configure caps
0:00:04.338149059 4526 0xaaaae94cfea0 ERROR nveglglessink gsteglglessink.c:2869:gst_eglglessink_setcaps:<eglglessink0> Failed to configure caps
0:00:04.338506825 4526 0xaaaae924a6a0 FIXME aggregator gstaggregator.c:1410:gst_aggregator_aggregate_func:<qtmux0> Subclass should call gst_aggregator_selected_samples() from its aggregate implementation.