Hi,
Iam having 2 GMSL2 custom sensors (AR0820 imager) connected via a GMSL2-Deserializer aggregating both streams to CSI-E port of the jetson TX2 NX device. First sensor is sending on VC=0 while the other is sending on VC=1.
Using v4l2-ctl tool along with bypass mode = 0 the “dis-aggregation” seems to work good:
v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --set-fmt-video=width=3840,height=2160,pixelformat=BA12 --stream-mmap --stream-count=1 --stream-to=image0.raw
gives me the picture of sensor with VC=1 and
v4l2-ctl -d /dev/video1 --set-ctrl bypass_mode=0 --set-fmt-video=width=3840,height=2160,pixelformat=BA12 --stream-mmap --stream-count=1 --stream-to=image1.raw
gives me a picture for snesor with VC=0
Streaming via ISP and argus for sensor-id=0:
./test-launch "nvarguscamerasrc sensor-mode=0 sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)NV12, framerate=(fraction)23/1 ! nvv4l2h264enc bitrate=28000000 ! h264parse ! rtph264pay name=pay0 pt=96"
also gives me pictures for sensor with VC=0, however when I try to stream sensor-id=1 via following command:
./test-launch "nvarguscamerasrc sensor-mode=0 sensor-id=1 ! video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)NV12, framerate=(fraction)23/1 ! nvv4l2h264enc bitrate=28000000 ! h264parse ! rtph264pay name=pay0 pt=96"
I get the following error message:
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:744 Invalid camera device specified 1 specified, 0 max index
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Do you have an idea why via v4l2-ctl (using VI-nonbypass) dis-aggregation is working, while going via ISP I get an error message when trying to stream sensor-id 1?
I also attached my device-tree-source file, please don’t be confused about the Raspberry PI camera in the source, I based my trialls and development on this driver…
Thanks for any support on this issue.
/ {
host1x {
vi@15700000 {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv2_imx219_vi_in0: endpoint {
port-index = <4>;
bus-width = <4>;
vc-id = <0>;
remote-endpoint = <&rbpcv2_imx219_csi_out0>;
};
};
port@1 {
reg = <1>;
rbpcv2_imx219_vi_in1: endpoint {
port-index = <4>;
bus-width = <4>;
vc-id = <1>;
remote-endpoint = <&rbpcv2_imx219_csi_out1>;
};
};
};
};
nvcsi@150c0000 {
num-channels = <2>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv2_imx219_csi_in0: endpoint@0 {
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&rbpcv2_imx219_out0>;
};
};
port@1 {
reg = <1>;
rbpcv2_imx219_csi_out0: endpoint@1 {
remote-endpoint = <&rbpcv2_imx219_vi_in0>;
};
};
};
};
channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv2_imx219_csi_in1: endpoint@2 {
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&rbpcv2_imx219_out1>;
};
};
port@1 {
reg = <1>;
rbpcv2_imx219_csi_out1: endpoint@3 {
remote-endpoint = <&rbpcv2_imx219_vi_in1>;
};
};
};
};
};
};
i2c@3160000 {
rbpcv2_imx219_a@12 {
compatible = "nvidia,imx219";
/* I2C device address */
reg = <0x12>;
/* V4L2 device node location */
devnode = "video1";
reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
/* Physical dimensions of sensor */
physical_w = "3.680";
physical_h = "2.760";
sensor_model = "imx219";
use_sensor_mode_id = "true";
mode0 { /* IMX219_MODE_3264x2464_21FPS */
mclk_khz = "2500000";
num_lanes = "4";
tegra_sinterface = "serial_e";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "3840";
active_h = "2160";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "grbg";
readout_orientation = "90";
line_length = "3840";
inherent_gain = "1";
mclk_multiplier = "9.33";
pix_clk_hz = "190771200";
serdes_pix_clk_hz = "833333333";
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 = "2200000"; /* 2.0 fps */
max_framerate = "24000000"; /* 21.0 fps */
step_framerate = "1";
default_framerate = "23000000"; /* 21.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "683709"; /* us */
step_exp_time = "1";
default_exp_time = "2495"; /* us */
embedded_metadata_height = "0";
};
mode1 { /* IMX219_MODE_1920x1080_30FPS */
mclk_khz = "2500000";
num_lanes = "4";
tegra_sinterface = "serial_e";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1920";
active_h = "1080";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "grbg";
readout_orientation = "90";
line_length = "1920";
inherent_gain = "1";
mclk_multiplier = "9.33";
pix_clk_hz = "47692800";
serdes_pix_clk_hz = "833333333";
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 = "22000000"; /* 2.0 fps */
max_framerate = "24000000"; /* 30.0 fps */
step_framerate = "1";
default_framerate = "23000000"; /* 30.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "683709"; /* us */
step_exp_time = "1";
default_exp_time = "2495"; /* us */
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv2_imx219_out1: endpoint {
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&rbpcv2_imx219_csi_in1>;
};
};
};
};
rbpcv2_imx219_c@11 {
compatible = "nvidia,imx219";
/* I2C device address */
reg = <0x11>;
/* V4L2 device node location */
devnode = "video0";
reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
/* Physical dimensions of sensor */
physical_w = "3.680";
physical_h = "2.760";
sensor_model = "imx219";
use_sensor_mode_id = "true";
mode0 { /* IMX219_MODE_3264x2464_21FPS */
mclk_khz = "2500000";
num_lanes = "4";
tegra_sinterface = "serial_e";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "3840";
active_h = "2160";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "grbg";
readout_orientation = "90";
line_length = "3840";
inherent_gain = "1";
mclk_multiplier = "9.33";
pix_clk_hz = "190771200";
serdes_pix_clk_hz = "833333333";
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 = "2200000"; /* 2.0 fps */
max_framerate = "24000000"; /* 21.0 fps */
step_framerate = "1";
default_framerate = "23000000"; /* 21.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "683709"; /* us */
step_exp_time = "1";
default_exp_time = "2495"; /* us */
embedded_metadata_height = "0";
};
mode1 { /* IMX219_MODE_1920x1080_30FPS */
mclk_khz = "2500000";
num_lanes = "4";
tegra_sinterface = "serial_e";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1920";
active_h = "1080";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "grbg";
readout_orientation = "90";
line_length = "1920";
inherent_gain = "1";
mclk_multiplier = "9.33";
pix_clk_hz = "47692800";
serdes_pix_clk_hz = "833333333";
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 = "2200000"; /* 2.0 fps */
max_framerate = "24000000"; /* 30.0 fps */
step_framerate = "1";
default_framerate = "23000000"; /* 30.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "683709"; /* us */
step_exp_time = "1";
default_exp_time = "2495"; /* us */
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
rbpcv2_imx219_out0: endpoint {
status = "okay";
port-index = <4>;
bus-width = <4>;
remote-endpoint = <&rbpcv2_imx219_csi_in0>;
};
};
};
};
};
lens_imx219@RBPCV2 {
min_focus_distance = "0.0";
hyper_focal = "0.0";
focal_length = "3.04";
f_number = "2.0";
aperture = "0.0";
};
};
/ {
tcp: tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
/**
* Physical settings to calculate max ISO BW
*
* num_csi_lanes = <>;
* Total number of CSI lanes when all cameras are active
*
* max_lane_speed = <>;
* Max lane speed in Kbit/s
*
* min_bits_per_pixel = <>;
* Min bits per pixel
*
* vi_peak_byte_per_pixel = <>;
* Max byte per pixel for the VI ISO case
*
* vi_bw_margin_pct = <>;
* Vi bandwidth margin in percentage
*
* max_pixel_rate = <>;
* Max pixel rate in Kpixel/s for the ISP ISO case
*
* isp_peak_byte_per_pixel = <>;
* Max byte per pixel for the ISP ISO case
*
* isp_bw_margin_pct = <>;
* Isp bandwidth margin in percentage
*/
num_csi_lanes = <4>;
max_lane_speed = <2500000>;
min_bits_per_pixel = <12>;
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.
*/
/* badge number remains same for 186 and 194 for them to share the same config */
modules {
module0 {
badge = "lanai_rear_ar0820";
position = "topright";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx219 0-0011";
proc-device-tree = "/proc/device-tree/i2c@3160000/rbpcv2_imx219_c@11";
};
module1 {
badge = "lanai_front_ar0820";
position = "topleft";
orientation = "1";
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx219 2-0012";
proc-device-tree = "/proc/device-tree/i2c@3160000/rbpcv2_imx219_a@12";
};
};
};
};
};
};
Kind regards,
Steve