Dear All,
We are developing our own simple driver for getting HDMI video as input to Jetson Xavier via CSI interface. By simple we mean that I2C control is ignored at first phase. Inspired from other thread, we could have /dev/video0 show-up. Brief information about the custom device tree :
$ vi /path/to/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-0000-camera-toto.dtsi
host1x {
vi@15c10000 {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
toto_vi_in0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&toto_csi_out0>;
};
};
};
};
nvcsi@15a00000 {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
toto_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&toto_out0>;
};
};
port@1 {
reg = <1>;
toto_csi_out0: endpoint@1 {
remote-endpoint = <&toto_vi_in0>;
};
};
};
};
};
};
i2c@3180000 {
toto_a@2b {
compatible = "nvidia,toto";
/* I2C device address */
reg = <0x2b>;
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
avdd-reg = "vana";
iovdd-reg = "vif";
dvdd-reg = "vdig";
/* Sensor output flip settings */
vertical-flip = "true";
/* if true, delay gain setting by one frame to be in sync with exposure */
delayed_gain = "true";
clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
<&bpmp_clks TEGRA194_CLK_PLLP_OUT0>;
clock-names = "extperiph1", "pllp_grtba";
clock-frequency = <24000000>;
mclk = "extperiph1";
reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
mode0 { // TOTO_MODE_3840X2160
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_a";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "3840";
active_h = "2160";
mode_type = "bayer";
pixel_phase = "rggb";
csi_pixel_bit_depth = "10";
readout_orientation = "0";
line_length = "4208";
inherent_gain = "1";
mclk_multiplier = "24";
pix_clk_hz = "576000000";
gain_factor = "1000000";
min_gain_val = "1000000";
max_gain_val = "44400000";
step_gain_val = "1";
default_gain = "1000000";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "1500000";
max_framerate = "60000000";
step_framerate = "1";
default_framerate= "60000000";
exposure_factor = "1000000";
min_exp_time = "44";
max_exp_time = "478696";
step_exp_time = "1";
default_exp_time = "16667";/* us */
embedded_metadata_height = "1";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
toto_out0: endpoint {
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&toto_csi_in0>;
};
};
};
};
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
...
num_csi_lanes = <4>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <750000>;
isp_peak_byte_per_pixel = <2>;
isp_bw_margin_pct = <25>;
...
modules {
module0 {
badge = "toto_front_123";
position = "front";
orientation = "1";
drivernode0 {
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver v4l2 device name */
devname = "toto 2-002b";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/i2c@3180000/toto_a@2b";
};
};
};
};
However, the video cannot be displayed using Cheese Webcam Booth or guvcview applications. They say “no device found” or “could not start a video stream in the device”. v4l2-ctl shows following information :
Jetson-Xavier:~$ v4l2-ctl -d /dev/video0 --all
Driver Info (not using libv4l2):
Driver name : tegra-video
Card type : vi-output, toto 2-002b
Bus info : platform:15c10000.vi:0
Driver version: 4.9.140
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 0: ok)
Format Video Capture:
Width/Height : 3840/2160
Pixel Format : 'RG10'
Field : None
Bytes per Line : 7680
Size Image : 16588800
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Camera Controls
group_hold 0x009a2003 (bool) : default=0 value=0 flags=execute-on-write
hdr_enable 0x009a2004 (intmenu): min=0 max=1 default=0 value=0
gain 0x009a2009 (int64) : min=0 max=0 step=0 default=0 value=1000000 flags=slider
exposure 0x009a200a (int64) : min=0 max=0 step=0 default=0 value=44 flags=slider
frame_rate 0x009a200b (int64) : min=0 max=0 step=0 default=0 value=1500000 flags=slider
exposure_short 0x009a200c (int64) : min=0 max=0 step=0 default=0 value=44 flags=slider
sensor_configuration 0x009a2032 (u32) : min=0 max=0 step=0 default=0 flags=read-only, volatile, has-payload
sensor_mode_i2c_packet 0x009a2033 (u32) : min=0 max=0 step=0 default=0 flags=read-only, volatile, has-payload
sensor_control_i2c_packet 0x009a2034 (u32) : min=0 max=0 step=0 default=0 flags=read-only, volatile, has-payload
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 (int) : min=1 max=1 step=1 default=1 value=1
sensor_signal_properties 0x009a2069 (u32) : min=0 max=0 step=0 default=0 flags=read-only, has-payload
sensor_image_properties 0x009a206a (u32) : min=0 max=0 step=0 default=0 flags=read-only, has-payload
sensor_control_properties 0x009a206b (u32) : min=0 max=0 step=0 default=0 flags=read-only, has-payload
sensor_dv_timings 0x009a206c (u32) : min=0 max=0 step=0 default=0 flags=read-only, has-payload
low_latency_mode 0x009a206d (bool) : default=0 value=0
sensor_modes 0x009a2082 (int) : min=0 max=30 step=1 default=30 value=1 flags=read-only
I really need your help for being able to debug for having idea about what happened and to get the video from the HDMI input later.
Thanks very much in advance for your helps.
K.