Porting Camera driver to TX2

Hello,
We acquire 3 camera sensor from Leopard Imaging, and they provided a reference driver for the sensor IMX230, and it works partially on TX1, kernel 3.10 and L4t 24.2.1 Nvidia devkit board, since the driver crashes sometimes when you change resolution, and it only works for the first camera, no luck with 3.
Nonetheless, we tried to port it to TX2 with no success, Leopard Imaging has no timelines for us and we seem to be stranded, and stuck with non functional camera system :( ( !@#!@##E$D! ).

We also tried to port them to another carrier board from Connected tech, it also doesnt work, but apparently because they wired the cameras to the regulators gpio expanders ( tca 9539 @74). and it seems the only problem is that the camera driver loads before the expanders are initialized, since it doesn’t recognize the gpio pins for reset nor power; which are needed to complete the camera powr on sequence, and we get this message.

[ 4.696090] imx230 13-001a: pwdn gpios not in DT
[ 4.696113] imx230 13-001a: reset gpios not in DT

and this

[ 4.695947] ------------[ cut here ]------------
[ 4.695954] WARNING: at drivers/gpio/gpiolib.c:126 gpio_to_desc+0x28/0x50()
[ 4.695956] invalid GPIO -2
[ 4.695958] Modules linked in:
[ 4.695963] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 3.10.96-test #6
[ 4.695965] Call trace:
[ 4.695969] [] dump_backtrace+0x0/0xf4
[ 4.695971] —[ end trace 2e70cfbc10c10169 ]—

and later on if add a gpio hog on those expanders they are shown at the end of the dmesg output, so I would like to know if there is any way to delay the driver for the sensor, until the gpio expander driver is fully loaded???, perhaps this will let the cameras initialise properly.

Any help would be appreciated.

@amatasan
Try not to access the gpio in the sensor probe function.

Hi Shane,
I tried removing any gpio related functions from the driver, and while it doesn’t complain at probing time:

[ 1.386525] imx230 13-001a: reset gpios not in DT
[ 1.386557] imx230 13-001a: camera_common_parse_sensor_mode: mode 5344 x 4016:
[ 1.389136] imx230 13-001a: camera_common_parse_sensor_mode: line_length = 6024, pixel_clock = 597380000
[ 1.391952] imx230 13-001a: camera_common_parse_sensor_mode: mode 1920 x 1080:
[ 1.394953] imx230 13-001a: camera_common_parse_sensor_mode: line_length = 2080, pixel_clock = 576000000
[ 1.398207] imx230 13-001a: imx230_probe: name imx274_c
[ 1.398226] imx230 13-001a: imx230_ctrls_init++
[ 1.398248] imx230 13-001a: Detected IMX230 sensor

it does complain later again

[ 3.801392] imx230 11-001a: imx230_open:
[ 3.801421] imx230 8-001a: imx230_open:
[ 3.802038] imx230 13-001a: imx230_open:

[ 3.802090] Unable to handle kernel NULL pointer dereference at virtual address 00000058
[ 3.803409] Unable to handle kernel NULL pointer dereference at virtual address 00000058
[ 3.803411] pgd = ffffffc0f10fb000
[ 3.803413] [00000058] *pgd=0000000000000000
[ 3.803416] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 3.803418] Enter nvdumper_crash_setup_regs
[ 3.803424] nvdumper: all registers are saved.
[ 3.803426] nvdumper: all registers are saved.
[ 3.811569] nvdumper: all registers are saved.
[ 3.812268] nvdumper: all registers are saved.
[ 3.812903] pgd = ffffffc0f1699000
[ 3.812906] [00000058] *pgd=0000000000000000
[ 3.814839] Modules linked in: bluedroid_pm
[ 3.815517] CPU: 2 PID: 392 Comm: v4l_id Not tainted 3.10.96-viooa #12
[ 3.816204] task: ffffffc0f7a225c0 ti: ffffffc0f1614000 task.ti: ffffffc0f1614000
[ 3.817597] PC is at clk_set_rate+0x0/0x1cc
[ 3.818314] LR is at camera_common_mclk_enable+0x7c/0xcc
[ 3.819947] pc : [] lr : [] pstate: 20000145
[ 3.821446] sp : ffffffc0f1617b00
[ 3.822202] x29: 0000007fc388b0e0 x28: ffffffc0ff802ec0
[ 3.822989] x27: ffffffc0f1617d64 x26: 0000000000000000
[ 3.823776] x25: ffffffc0f796a6a8 x24: ffffffc0f796a018
[ 3.824564] x23: ffffffc0f796a038 x22: ffffffc0f4800480
[ 3.825350] x21: 0000000000000001 x20: 00000000016e3600
[ 3.826143] x19: ffffffc0fcafd018 x18: 0000000000000a03
[ 3.826935] x17: 0000007f9792ffc8 x16: 0000007f97948000
[ 3.828664] x15: 0000007f97948030 x14: 0000000000000040
[ 3.829402] x13: 000000037ffff000 x12: 0000000000000001
[ 3.830230] x11: 0000000000000000 x10: 0000000000000000
[ 3.830906] x9 : ffffffc000bb5b58 x8 : 0000000000000001
[ 3.831573] x7 : ffffffc001215df8 x6 : 0000000000001340
[ 3.832234] x5 : ffffffc0f1614000 x4 : 0000000000000000
[ 3.832881] x3 : 0000000036b7917f x2 : ffffffc0006d61bc
[ 3.833524] x1 : 00000000016e3600 x0 : 0000000000000000
[ 3.834165]
PC: 0xffffffc00081b5f8:
[ 3.835445] b5f8 aa1303e0 97fffd4f 2a1403e0 14000018 128004a0 d65f03c0 128004a0 d65f03c0
[ 3.836888] b618 eb1702bf 1a9f97e1 39422260 6a00003f 54000141 52800018 17ffffbb aa1503e1
[ 3.838423] b638 aa1303e0 97fff1a1 2a0003f4 52800038 34fff6a0 17ffffeb aa1503e1 aa1303e0
[ 3.839997] b658 97fff19a 52800018 34fff5e0 a9415bf5 a94263f7 f9401bfe a8c453f3 d65f03c0
[ 3.841591] b678 f9402c02 b4000d22 f9401042 b4000d22 a9bc53f3 a9015bf5 a90263f7 f9001bfe
[ 3.843246] b698 aa0103f8 aa0003f5 2a0103f4 910003e1 d0005600 91026000 b9400800 34000360
[ 3.844926] b6b8 f9404eb7 9272c421 b9404c36 b9404820 11000400 b9004820 d0005600 91026000
[ 3.846684] b6d8 f9401013 b4000133 f9400264 2a1603e3 2a1403e2 aa1703e1 f9400660 d63f0080
[ 3.848544]
LR: 0xffffffc0006d6060:
[ 3.850341] 6060 d65f03c0 a9be53f3 f9000bfe f9402013 b981bc14 b5000153 f00025c2 912d4042
[ 3.852265] 6080 9108e042 f0004941 91202021 f9400c00 97f83a76 12800240 14000023 f0006101
[ 3.854314] 60a0 794f7421 36100181 aa1403e4 f00025c3 912d4063 9108e063 f0004942 9120a042
[ 3.856479] 60c0 f9400c01 f0006100 9115a000 9108c000 97f16ad8 aa1403e1 f9401260 94051567
[ 3.860594] 60e0 35000220 f9401273 52800002 52800c81 900045a0 91112000 97e80f39 aa1303e0
[ 3.862962] 6100 94051370 2a0003f3 340000e0 52800002 52800ee1 900045a0 91112000 97e80f30
[ 3.865410] 6120 2a1303e0 f9400bfe a8c253f3 d65f03c0 a9bf7bf3 f9402013 b5000153 f9400800
[ 3.869500] 6140 f00025c2 912d4042 91096042 f0004941 91202021 9100a000 97f83a44 14000016
[ 3.871952]
SP: 0xffffffc0f1617a80:
[ 3.874244] 7a80 016e3600 00000000 00000001 00000000 f4800480 ffffffc0 f796a038 ffffffc0
[ 3.876560] 7aa0 f796a018 ffffffc0 f796a6a8 ffffffc0 00000000 00000000 f1617d64 ffffffc0
[ 3.878875] 7ac0 ff802ec0 ffffffc0 c388b0e0 0000007f 006d60e0 ffffffc0 f1617b00 ffffffc0
[ 3.881190] 7ae0 0081b678 ffffffc0 20000145 00000000 01001420 ffffffc0 00000000 00000000
[ 3.883509] 7b00 fcafee60 ffffffc0 fcafee18 ffffffc0 006d61e8 ffffffc0 f798a018 ffffffc0
[ 3.885865] 7b20 00000000 00000000 f798a018 ffffffc0 f798a440 ffffffc0 006d79e8 ffffffc0
[ 3.888312] 7b40 006d9e7c ffffffc0 006d9d94 ffffffc0 f798a028 ffffffc0 f4800480 ffffffc0
[ 3.890769] 7b60 f798a0b0 ffffffc0 00000000 00000000 001a66e8 ffffffc0 f4800490 ffffffc0
[ 3.893223]

dumps a lot of information.

and obviously doesn’t work when i try to pull information from the camera, and it gets stuck

v4l2-ctl --device /dev/video0 --set-fmt-video=width=5344,height=4016,pixelformat=RG10 --stream-mmap --stream-to=frame0.raw --stream-count=1 --verbose

process stays there with no output whatsoever.

Please check the sensor power/reset pin is working normally by the v4l2-ctl command. Then check any timeout kernel message from the dmesg.

Hi Shane,
Yeah i manage to get cameras turning on (they respond on the i2c address when gpio is set to high), by hogging the gpios on low on the dts for the respective reset pins ( pwdn pins are not wired, thus not required ), and turning them on on the driver by setting to high the reset pin. but i am getting this now, when i try to pull an image from the camera.


[ 26.756540] imx230 30-001a: imx230_power_on: power on
[ 26.775387] imx230 30-001a: could not find device ctrl.
[ 27.399174] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:9881, lanes:300000
[ 27.406847] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL 0x04 0x2a000010
[ 27.415583] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS 0x0c 0x00009881
[ 27.423879] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2 0x10 0x00000000
[ 27.432545] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG 0x18 0x00200000
[ 27.441098] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG 0x1c 0x00200000
[ 27.449661] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG 0x20 0x00000000
[ 27.458215] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG 0x24 0x00000000
[ 27.466917] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG 0x28 0x00000000
[ 27.475473] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG 0x2c 0x00000000
[ 27.483763] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG 0x3c 0x00000200
[ 27.483767] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG 0x40 0x00000200
[ 27.483770] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG 0x44 0x00000200
[ 27.483773] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG 0x48 0x00000200
[ 27.483776] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0 0x5c 0x00000000
[ 27.483778] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1 0x60 0x00000000
[ 27.483781] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2 0x64 0x00010010
[ 27.483784] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2 0x68 0x00000002
[ 27.483787] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2 0x6c 0x00000002
[ 27.483789] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2 0x74 0x00000002
[ 27.483793] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2 0x78 0x00000002
[ 27.483833] imx230 30-001a: imx230_s_stream++ enable 1
[ 27.635839] imx230 30-001a: imx230_set_gain - val = -1872301073255890944
[ 27.642562] imx230 30-001a: input gain value: 73020735488
[ 27.647991] imx230 30-001a: imx230_set_gain: gain 07a3 val: 73020735488
[ 27.655222] imx230 30-001a: imx230_s_stream: error gain override
[ 27.661244] imx230 30-001a: imx230_set_frame_rate: val: -266723900232
[ 27.667691] imx230 30-001a: imx230_set_frame_length length = 0
[ 27.673532] imx230 30-001a: imx230_set_frame_length: val: 0
[ 27.680051] imx230 30-001a: imx230_s_stream: error frame length override
[ 27.686762] imx230 30-001a: imx230_set_exposure: val: 50670495149850624
[ 27.693387] imx230 30-001a: imx230_set_coarse_time
[ 27.698191] imx230 30-001a: imx230_set_coarse_time: input val: 53070561
[ 27.704826] imx230 30-001a: imx230_clamp_coarse_time: 53070561 to 4538
[ 27.711361] imx230 30-001a: imx230_set_coarse_time: set val: 12
[ 27.717912] imx230 30-001a: imx230_s_stream: error exposure override
[ 27.731701] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 27.744763] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000200, hubc_int_status=0x00000000
[ 27.754605] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000200, hubc_int_status=0x00000000
[ 27.764446] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000200, hubc_int_status=0x00000000
[ 27.774273] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000200, hubc_int_status=0x00000000
[ 27.784097] mc-err: Too many MC errors; throttling prints
[ 28.723221] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 28.762483] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 28.775574] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 28.785429] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 28.795266] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 28.805094] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 28.814916] mc-err: Too many MC errors; throttling prints
[ 29.727772] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 29.746406] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 29.759497] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 29.769331] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 29.779170] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 29.788995] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 29.798830] mc-err: Too many MC errors; throttling prints
[ 30.731208] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 30.777185] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 30.790305] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 30.800146] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 30.809991] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 30.819826] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 30.829668] mc-err: Too many MC errors; throttling prints
[ 31.735200] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 31.761110] arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0
[ 31.774212] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 31.784045] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 31.793878] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 31.803706] unknown mcerr fault, int_status=0x00001040, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 31.813534] mc-err: Too many MC errors; throttling prints
[ 32.739209] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!
[ 32.745049] imx230 30-001a: imx230_s_stream++ enable 0
[ 32.768356] imx230 30-001a: imx230_power_off: power off

[b]

and I am still getting this at probe, even though i am skipping the errors and continuing[/b]


[ 3.260940] imx230 32-001a: imx230_probe
[ 3.260987] imx230 32-001a: pwdn gpios not in DT
[ 3.265642] imx230 32-001a: camera_common_parse_sensor_mode: mode 5344 x 4016:
[ 3.272875] imx230 32-001a: camera_common_parse_sensor_mode: line_length = 6024, pixel_clock = 597380000
[ 3.282366] imx230 32-001a: camera_common_parse_sensor_mode: mode 1920 x 1080:
[ 3.289601] imx230 32-001a: camera_common_parse_sensor_mode: line_length = 2800, pixel_clock = 576000000
[ 3.299083] imx230 32-001a: imx230_power_get
[ 3.299334] imx230 32-001a: imx230_power_on: power on
[ 3.303018] imx230 32-001a: imx230_probe: name imx230_e
[ 3.303037] imx230 32-001a: imx230_ctrls_init++
[ 3.303046] imx230 32-001a: Failed to init Gain ctrl
[ 3.308027] imx230 32-001a: Failed to init Exposure ctrl
[ 3.313354] imx230 32-001a: Failed to init Frame Rate ctrl
[ 3.318848] imx230 32-001a: Failed to init Fuse ID ctrl
[ 3.324082] imx230 32-001a: Failed to init Sensor Mode ctrl
[ 3.329661] imx230 32-001a: Failed to init Group Hold ctrl
[ 3.335154] imx230 32-001a: Failed to init HDR enable ctrl
[ 3.340648] imx230 32-001a: Error -34 adding controls
[ 3.345711] imx230 32-001a: imx230_power_off: power off

This is the probe code on the driver:

static int imx230_ctrls_init(struct imx230 *priv)
{
struct i2c_client *client = priv->i2c_client;
struct v4l2_ctrl *ctrl;
int num_ctrls;
int err;
int i;

dev_dbg(&client->dev, "%s++\n", __func__);

num_ctrls = ARRAY_SIZE(ctrl_config_list);
v4l2_ctrl_handler_init(&priv->ctrl_handler, num_ctrls);

for (i = 0; i < num_ctrls; i++) {
	ctrl = v4l2_ctrl_new_custom(&priv->ctrl_handler,
		&ctrl_config_list[i], NULL);
	if (ctrl == NULL) {
		dev_err(&client->dev, "Failed to init %s ctrl\n",
			ctrl_config_list[i].name);
		continue;
	}
	if (ctrl_config_list[i].type == V4L2_CTRL_TYPE_STRING &&
		ctrl_config_list[i].flags & V4L2_CTRL_FLAG_READ_ONLY) {
		ctrl->p_new.p_char = devm_kzalloc(&client->dev,
			ctrl_config_list[i].max + 1, GFP_KERNEL);
		if (!ctrl->p_new.p_char) {
			dev_err(&client->dev,
				"Failed to allocate otp data\n");
			return -ENOMEM;
		}
	}
	priv->ctrls[i] = ctrl;
}
    priv->num_ctrls = num_ctrls;
priv->subdev->ctrl_handler = &priv->ctrl_handler;
if (priv->ctrl_handler.error) {
	dev_err(&client->dev, "Error %d adding controls\n",
		priv->ctrl_handler.error);
	err = priv->ctrl_handler.error;
	[u]//goto error;[/u] Error skipping
}

err = v4l2_ctrl_handler_setup(&priv->ctrl_handler);
if (err) {
	dev_err(&client->dev,
		"Error %d setting default controls\n", err);
	goto error;
}
    return 0;

error:
v4l2_ctrl_handler_free(&priv->ctrl_handler);
return err;
}

@amatasan
Looks like this sensor output embedded metadata, Please check with sensor vendor to add the
“embedded_metadata_height = x”

You can reference to tegra-camera-imx185-a00.dtsi for more information.

@ShaneCCC
I already added and played with that value, from 1 to 4, vendor is of no help, they actually commented those lines, on their “reference” driver. If I retrieve an image from the camera with v4l2-ctl the image comes out corrupted and it takes a bit longer to pull it out.

nvidia@tegra-ubuntu:~$ v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame0.raw --stream-count=1 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
	Index    : 0
	Type     : Video Capture
	Flags    : mapped, done
	Field    : None
	Sequence : 0
	Length   : 43180032
	Bytesused: 43180032
	Timestamp: 479.580182s (Monotonic, End-of-Frame)

VIDIOC_STREAMOFF: ok

still after change image comes out corrupted, and i get this on the dmesg

[  104.859992] imx230 30-001a: imx230_power_on: power on
[  105.420995] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:9981, lanes:300000

[  105.428720] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL                  0x04 0x2a000010
[  105.437130] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS            0x0c 0x00009981
[  105.445479] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2          0x10 0x00000000
[  105.453853] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG           0x18 0x00200000
[  105.462201] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG           0x1c 0x00200000
[  105.470528] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG           0x20 0x00000000
[  105.478828] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG           0x24 0x00000000
[  105.487139] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG           0x28 0x00000000
[  105.495445] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG           0x2c 0x00000000
[  105.503729] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG           0x3c 0x00000200
[  105.512016] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG           0x40 0x00000200
[  105.520320] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG           0x44 0x00000200
[  105.528611] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG           0x48 0x00000200
[  105.536891] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0             0x5c 0x00000000
[  105.545170] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1             0x60 0x00000000
[  105.553454] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2             0x64 0x00010010
[  105.561736] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2         0x68 0x00000002
[  105.570018] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2         0x6c 0x00000002
[  105.578298] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2         0x74 0x00000002
[  105.586576] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2         0x78 0x00000002
[  105.594873] imx230 30-001a: imx230_s_stream++ enable 1
[  105.660142] imx230 30-001a: imx230_set_gain - val = 0
[  105.665219] imx230 30-001a: input gain value: 0
[  105.669787] imx230 30-001a: imx230_set_gain: gain 0800 val: 0
[  105.676308] imx230 30-001a: imx230_s_stream: error gain override
[  105.682349] imx230 30-001a: imx230_set_frame_rate: val: -344685384
[  105.688576] imx230 30-001a: imx230_set_frame_length length = 0
[  105.694449] imx230 30-001a: imx230_set_frame_length: val: 0
[  105.701032] imx230 30-001a: imx230_s_stream: error frame length override
[  105.707762] imx230 30-001a: imx230_set_exposure: val: 0
[  105.713023] imx230 30-001a: imx230_set_coarse_time
[  105.717826] imx230 30-001a: imx230_set_coarse_time: input val: 0
[  105.723863] imx230 30-001a: imx230_set_coarse_time: set val: 4546
[  105.730609] imx230 30-001a: imx230_s_stream: error exposure override
[  105.990730] tegra-vi4 15700000.vi: Status:  5 channel:00 frame:0007
[  105.997015] tegra-vi4 15700000.vi:          timestamp sof 116212975904 eof 116213089536 data 
0x00000001
[  106.006432] tegra-vi4 15700000.vi:          capture_id 5 stream  0 vchan  0

[  106.013442] imx230 30-001a: imx230_s_stream++ enable 0
[  106.054027] imx230 30-001a: imx230_power_off: power off

@amatasan
After you add the embedded metadata help to fix the iommu error, You need 100% percent to make sure the sensor output how many embedded lines. After that you have to make sure the sensor output resolution is totally as the sensor driver report.

arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0

@ShaneCCC
Well I tried several values, and 4 seems to be cutting it, but whatever image comes out is still corrupted and some it comes with big chunks of 3FFF values, which would suggest 14 bit pixels, theoritically the driver it should be delivering RGGB10, but values like this are coming out it suggests Little Endian and 16 bit per pixel, not RGGB10:

frame0.raw                                                                      
0000 0000: 22 08 72 08 02 08 22 08  32 08 F1 07 C1 07 62 08  ".r...". 2.....b.  
0000 0010: 02 08 72 08 E1 07 22 08  62 08 62 08 32 08 12 08  ..r...". b.b.2...  
0000 0020: 12 08 42 08 42 08 82 08  62 08 82 08 D1 07 52 08  ..B.B... b.....R.  
0000 0030: 22 08 42 08 52 08 62 08  32 08 B2 08 E2 08 C2 08  ".B.R.b. 2.......  
0000 0040: 12 08 A2 08 C2 08 D2 08  92 08 A2 08 52 08 C2 08  ........ ....R...  
0000 0050: 92 08 52 08 C2 08 92 08  52 08 D2 08 92 08 52 09  ..R..... R.....R.  
0000 0060: E2 08 B2 08 D2 08 A2 08  C2 08 22 09 F2 08 52 09  ........ .."...R.  
0000 0070: 02 09 B2 08 B2 08 C2 08  B2 08 E2 08 62 08 E2 08  ........ ....b...  
0000 0080: D2 08 32 09 42 08 E2 08  C2 08 02 09 42 09 42 09  ..2.B... ....B.B.  
0000 0090: 12 09 C2 08 12 09 C2 08  12 09 D2 08 F2 08 A2 08  ........ ........  
0000 00A0: D2 08 92 08 22 09 22 09  B2 08 F2 08 82 08 C2 08  ....".". ........  
0000 00B0: F2 08 C2 08 02 09 B2 08  C2 08 D2 08 D2 08 C2 08  ........ ........  
0000 00C0: D2 08 02 09 32 09 A2 08  02 09 82 08 02 09 52 09  ....2... ......R.  
0000 00D0: 42 09 22 09 52 08 22 09  D2 08 02 09 B2 08 12 09  B.".R.". ........  
0000 00E0: 42 09 12 09 02 09 42 09  E2 08 02 09 D2 08 62 09  B.....B. ......b.  
0000 00F0: A2 08 A2 08 B2 08 C2 08  C2 08 72 08 12 09 F2 08  ........ ..r.....  
0000 0100: 52 08 B2 08 A2 08 42 09  02 09 82 08 E2 08 12 09  R.....B. ........  
0000 0110: C2 08 72 08 F2 08 C2 08  32 09 72 08 F2 08 72 09  ..r..... 2.r...r.  
0000 0120: 72 08 22 09 B2 08 52 09  32 09 22 09 E2 08 12 09  r."...R. 2.".....  
0000 0130: 32 09 02 09 A2 08 42 09  82 08 42 09 A2 08 02 09  2.....B. ..B.....  
0000 0140: 42 09 22 09 A2 09 D2 08  D2 08 E2 08 02 09 32 09  B."..... ......2.  
0000 0150: D2 08 F2 08 82 09 12 09  02 09 D2 08 42 09 52 09  ........ ....B.R.  
0000 0160: 72 09 E2 08 32 09 52 09  22 09 42 09 82 09 82 09  r...2.R. ".B.....  
0000 0170: 12 09 F2 08 22 09 62 09  52 09 42 09 02 09 22 09  ....".b. R.B...".  
0000 0180: F2 08 62 09 C2 08 02 09  D2 08 32 09 02 09 42 09  ..b..... ..2...B.  
0000 0190: 52 09 42 09 62 09 52 09  12 09 32 09 F2 08 32 09  R.B.b.R. ..2...2.  
0000 01A0: 22 09 22 09 32 09 52 09  42 09 E2 08 82 09 32 09  ".".2.R. B.....2.  
0000 01B0: 32 09 02 09 52 09 12 09  52 09 52 09 52 09 02 09  2...R... R.R.R...  
0000 01C0: 22 09 32 09 E2 08 62 09  32 09 72 09 92 09 C2 08  ".2...b. 2.r.....  
.....

.....

frame0.raw                                                                      
0000 0EE0: 33 0D F2 0B 33 0C 73 0C  43 0D 13 0C 53 0D 83 0C  3...3.s. C...S...  
0000 0EF0: 03 0D F3 0C 43 0D 43 0C  13 0D D3 0C 83 0D B3 0D  ....C.C. ........  
0000 0F00: 03 0E F3 0D 53 0E 13 0D  A3 0D 53 0D F3 0D 83 0D  ....S... ..S.....  
0000 0F10: 03 0E 93 0E 53 0E E3 0D  E3 0D 53 0E 53 0E 13 0E  ....S... ..S.S...  
0000 0F20: E3 0E E3 0E E3 0E F3 0E  03 0F 83 0F B3 0F A3 0E  ........ ........  
0000 0F30: 93 0F 33 0F 63 0F 83 0F  B3 0F 54 10 34 10 44 10  ..3.c... ..T.4.D.  
0000 0F40: 84 10 B4 10 B4 11 B4 11  34 11 A4 11 24 11 14 12  ........ 4...$...  
0000 0F50: 04 12 F4 12 54 12 74 13  34 13 D4 12 84 13 75 14  ....T.t. 4.....u.  
0000 0F60: 74 13 95 14 15 14 85 16  A5 15 55 16 05 16 66 18  t....... ..U...f.  
0000 0F70: 55 17 85 17 D5 17 D6 18  96 19 07 1C E6 1B 37 1D  U....... ......7.  
0000 0F80: 97 1D 18 22 E9 25 2B 2D  FD 34 FF 3F FF 3F FF 3F  ...".%+- .4.?.?.?  
0000 0F90: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 0FA0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 0FB0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 0FC0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 0FD0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 0FE0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 0FF0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1000: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1010: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1020: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1030: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1040: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1050: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1060: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1070: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1080: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 1090: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?  
0000 10A0: FF 3F FF 3F FF 3F FF 3F  FF 3F FF 3F FF 3F FF 3F  .?.?.?.? .?.?.?.?

this las 3FFF pattern repeats every 0x54X bytes or so.

dmesg: on each image pulled

[  105.990730] tegra-vi4 15700000.vi: Status:  5 channel:00 frame:0007
[  105.997015] tegra-vi4 15700000.vi:          timestamp sof 116212975904 eof 116213089536 data 
0x00000001
[  106.006432] tegra-vi4 15700000.vi:          capture_id 5 stream  0 vchan  0

And no mention whatsoever of this:

arm-smmu 12000000.iommu: Unhandled context fault: iova=0x00000000, fsynr=0x250011, cb=19, sid=4(0x4 - VI), pgd=0, pud=0, pmd=0, pte=0

After playing a bit here and there, with no much success we requested the sensor datasheet information, and after checking it we confirm the number of embedded lines sent by the sensor, which fixed much of the problems, but still the image comes with tail information, apparently it is also sending information of the called “dummy pixels”, which is a 00 pattern at the end of each line, could you please point me on how to change this so that the driver ignores that at the end or beggining of each line ?

frame0.raw                                                                      
0000 2870: 31 07 D1 07 B1 07 D1 07  01 07 C1 07 41 07 91 07  1....... ....A...  
0000 2880: 21 07 81 07 21 07 61 07  31 07 E1 07 21 07 D1 07  !...!.a. 1...!...  
0000 2890: 51 07 C1 07 61 07 B1 07  31 07 B1 07 E1 06 D1 07  Q...a... 1.......  
0000 28A0: 51 07 81 07 51 07 A1 07  F1 06 01 07 01 07 41 07  Q...Q... ......A.  
0000 28B0: D1 06 21 07 31 07 51 07  F1 06 C1 07 11 07 71 07  ..!.1.Q. ......q.  
0000 28C0: C1 06 81 07 31 07 91 07  F1 06 81 07 E1 06 71 07  ....1... ......q.  
0000 28D0: 51 07 71 07 11 07 41 07  E1 06 21 07 51 07 61 07  Q.q...A. ..!.Q.a.  
0000 28E0: E1 06 41 07 01 07 01 07  F1 06 31 07 D1 06 F1 06  ..A..... ..1.....  
0000 28F0: 11 07 41 07 11 07 61 07  B1 06 11 07 C1 06 F1 06  ..A...a. ........  
0000 2900: A1 06 41 07 01 07 71 07  D1 06 31 07 C1 06 31 07  ..A...q. ..1...1.  
0000 2910: B1 06 21 07 B1 06 F1 06  C1 06 01 07 21 07 41 07  ..!..... ....!.A.  
0000 2920: 01 07 31 07 A1 06 21 07  C1 06 31 07 71 06 E1 06  ..1...!. ..1.q...  
0000 2930: 71 06 F1 06 B1 06 31 07  C1 06 B1 06 81 06 31 07  q.....1. ......1.  
0000 2940: 91 06 A1 06 91 06 21 07  D1 06 A1 06 91 06 11 07  ......!. ........  
0000 2950: 91 06 B1 06 81 06 D1 06  71 06 A1 06 61 06 D1 06  ........ q...a...  
0000 2960: 71 06 F1 06 51 06 F1 06  81 06 11 07 A1 06 B1 06  q...Q... ........  
0000 2970: 41 06 C1 06 91 06 A1 06  61 06 11 07 61 06 D1 06  A....... a...a...  
0000 2980: 61 06 B1 06 51 06 D1 06  01 06 91 06 11 06 C1 06  a...Q... ........  
0000 2990: 11 06 A1 06 11 06 81 06  01 06 51 06 F1 05 81 06  ........ ..Q.....  
0000 29A0: 51 06 21 06 21 06 71 06  01 06 A1 06 61 06 81 06  Q.!.!.q. ....a...  
0000 29B0: 31 06 91 06 11 06 91 06  11 06 41 06 21 06 71 06  1....... ..A.!.q.  
0000 29C0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 29D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 29E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 29F0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2A00: 42 08 91 05 02 08 C1 05  F1 07 91 05 12 08 C1 05  B....... ........

@amatasan
Try to add the dummy pixels to your sensor driver. Like if your sensor driver report 1920x1080 and have 2 dummy pixels try to report 1920x1010 in you sensor driver.

@ShaneCCC
You mean adding the reported resolution on the driver’s code or in the device tree, because I tried both, and it doesn’t seem to cut it.

nvidia@tegra-ubuntu:~$ sudo v4l2-compliance -f
[sudo] password for nvidia: 
Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output, imx230 30-001a
	Bus info      : platform:15700000.vi:0
	Driver version: 4.4.38
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		fail: v4l2-test-controls.cpp(437): invalid minimum range check
		test VIDIOC_G/S_CTRL: FAIL
		fail: v4l2-test-controls.cpp(528): returned control value out of range
		fail: v4l2-test-controls.cpp(669): s_ext_ctrls returned invalid control contents (009a200a)
		test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 13

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		test VIDIOC_TRY_FMT: OK
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		test Scaling: OK (Not Supported)

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:

Stream using all formats:
	test MMAP for Format RGGB, Frame Size 5344x4016@21.00 Hz:
		Stride 5376, Field None: OK                                 
		Stride 5632, Field None: OK                                 
	test MMAP for Format RG10, Frame Size 5344x4016@21.00 Hz:
		Stride 10752, Field None: OK                                
		Stride 11008, Field None: OK                                
	test MMAP for Format BG10, Frame Size 5344x4016@21.00 Hz:
		Stride 10752, Field None: OK                                
		Stride 11008, Field None: OK                                
	test MMAP for Format RG12, Frame Size 5344x4016@21.00 Hz:
		Stride 10752, Field None: OK                                
		Stride 11008, Field None: OK                                

Total: 50, Succeeded: 48, Failed: 2, Warnings: 0

As you can tell the stride value doesn’t match with the stride size.
width x byte depth ( 10 bit )
5344×2 = 10688
reported one is 10752, which would be 5376 per line… which means 32 bytes more than the reported resolution.

@amatasan
Could you try report the resolution as 5360x4032 or 5408x4112.

@ShaneCCC
So I’ve tried that, and no matter where I tell the sensor to report different resolution, either kernel driver or device tree, it makes no difference I get the zeroes after each line. on the IMX230 this is on 0x29C0 = 5344x2:

frame230.raw                                                                    
0000 28B0: 71 05 91 05 91 05 91 05  91 05 C1 05 A1 05 E1 05  q....... ........  
0000 28C0: 41 05 B1 05 81 05 B1 05  71 05 D1 05 71 05 91 05  A....... q...q...  
0000 28D0: 51 05 01 06 91 05 A1 05  51 05 D1 05 81 05 C1 05  Q....... Q.......  
0000 28E0: A1 05 91 05 51 05 81 05  91 05 B1 05 61 05 C1 05  ....Q... ....a...  
0000 28F0: A1 05 91 05 31 05 B1 05  71 05 71 05 81 05 D1 05  ....1... q.q.....  
0000 2900: 91 05 11 06 81 05 B1 05  41 05 A1 05 51 05 E1 05  ........ A...Q...  
0000 2910: 51 05 81 05 31 05 91 05  81 05 C1 05 41 05 C1 05  Q...1... ....A...  
0000 2920: 31 05 A1 05 41 05 81 05  41 05 71 05 51 05 D1 05  1...A... A.q.Q...  
0000 2930: 41 05 71 05 41 05 71 05  61 05 71 05 81 05 A1 05  A.q.A.q. a.q.....  
0000 2940: 61 05 E1 05 51 05 91 05  71 05 91 05 21 05 71 05  a...Q... q...!.q.  
0000 2950: 71 05 71 05 51 05 41 05  21 05 91 05 31 05 81 05  q.q.Q.A. !...1...  
0000 2960: 01 05 61 05 11 05 B1 05  51 05 81 05 71 05 91 05  ..a..... Q...q...  
0000 2970: 31 05 61 05 41 05 71 05  51 05 61 05 51 05 71 05  1.a.A.q. Q.a.Q.q.  
0000 2980: 51 05 A1 05 41 05 71 05  11 05 91 05 11 05 71 05  Q...A.q. ......q.  
0000 2990: 31 05 81 05 31 05 21 05  61 05 71 05 F1 04 81 05  1...1.!. a.q.....  
0000 29A0: 21 05 51 05 01 05 81 05  41 05 B1 05 01 05 61 05  !.Q..... A.....a.  
0000 29B0: F1 04 51 05 21 05 81 05  F1 04 81 05 21 05 61 05  ..Q.!... ....!.a.  
0000 29C0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 29D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 29E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 29F0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2A00: C2 09 91 06 12 0A A1 06  32 09 E1 06 82 09 C1 06  ........ 2.......  
0000 2A10: 32 09 A1 06 B2 09 F1 06  72 09 A1 06 E2 08 A1 06  2....... r.......  
0000 2A20: 92 09 21 07 62 09 C1 06  12 09 11 07 52 09 01 07  ..!.b... ....R...  
0000 2A30: 42 09 21 07 32 09 01 07  72 09 01 07 E2 08 91 06  B.!.2... r.......  
0000 2A40: D2 09 61 06 D2 09 81 06  62 09 01 07 72 09 C1 06  ..a..... b...r...  
0000 2A50: 72 09 E1 06 42 09 A1 06  F2 09 F1 06 F2 09 21 07  r...B... ......!.  
0000 2A60: B2 09 D1 06 12 0A 11 07  A2 09 31 07 72 09 21 07  ........ ..1.r.!.  
0000 2A70: C2 09 F1 06 B2 09 11 07  A2 09 D1 06 E2 09 21 07  ........ ......!.  
0000 2A80: C2 09 D1 06 52 09 E1 06  B2 09 21 07 92 09 D1 06  ....R... ..!.....  
0000 2A90: 02 0A 31 07 72 09 C1 06  02 0A B1 06 02 0A 31 07  ..1.r... ......1.  
0000 2AA0: 82 09 21 07 02 0A E1 06  E2 09 D1 06 F2 09 51 07  ..!..... ......Q.

DMESG:

[  250.100880] imx230 32-001a: imx230_power_on: power on
[  250.666727] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:9981, lanes:3000000
[  250.674532] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL                  0x04 0x2a000010
[  250.682933] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS            0x0c 0x00009981
[  250.691289] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2          0x10 0x00000000
[  250.699672] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG           0x18 0x00000000
[  250.707982] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG           0x1c 0x00000000
[  250.716334] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG           0x20 0x00000000
[  250.724626] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG           0x24 0x00000000
[  250.732920] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG           0x28 0x00200000
[  250.741237] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG           0x2c 0x00200000
[  250.749549] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG           0x3c 0x00000200
[  250.757868] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG           0x40 0x00000200
[  250.766182] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG           0x44 0x00000200
[  250.774485] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG           0x48 0x00000200
[  250.782783] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0             0x5c 0x00000000
[  250.791073] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1             0x60 0x00000000
[  250.799358] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2             0x64 0x00010010
[  250.807650] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2         0x68 0x00000002
[  250.815965] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2         0x6c 0x00000002
[  250.824250] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2         0x74 0x00000002
[  250.832547] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2         0x78 0x00000002
[  250.840866] imx230 32-001a: imx230_s_stream++ enable 1
[  250.906170] imx230 32-001a: imx230_set_gain - val = 4194304
[  250.911789] imx230 32-001a: imx230_set_gain: gain 0000 val: 256
[  250.918481] imx230 32-001a: imx230_set_frame_rate: val: 251658240
[  250.924602] imx230 32-001a: imx230_set_frame_length length = 1652
[  250.930744] imx230 32-001a: imx230_set_frame_length: val: 1652
[  250.937581] imx230 32-001a: imx230_set_exposure: val: 125, line length: 6024, FPSF: 4194304,coarse time: 2
[  250.947279] imx230 32-001a: imx230_set_coarse_time
[  250.952105] imx230 32-001a: imx230_set_coarse_time: input val: 2
[  250.958140] imx230 32-001a: imx230_set_coarse_time: set val: 4548
[  251.236891] tegra-vi4 15700000.vi: Status:  5 channel:00 frame:0007
[  251.243189] tegra-vi4 15700000.vi:          timestamp sof 261366185664 eof 261366299808 data 0x00000001
[  251.252606] tegra-vi4 15700000.vi:          capture_id 13 stream  4 vchan  0
[  251.259712] imx230 32-001a: imx230_s_stream++ enable 0
[  251.306934] imx230 32-001a: imx230_power_off: power off

Moreover, we got an IMX377 and porting the driver to TX2, L4T 28.1, the results seem to be the same, but in this case the zeroes start on 0x2010 = 4104*2.

frame377.raw                                                                    
0000 1F40: 1C 03 20 03 20 03 20 03  1C 03 1C 03 20 03 18 03  .. . . . .... ...  
0000 1F50: 20 03 18 03 20 03 1C 03  1C 03 18 03 20 03 1C 03   ... ... .... ...  
0000 1F60: 24 03 1C 03 18 03 1C 03  1C 03 1C 03 1C 03 28 03  $....... ......(.  
0000 1F70: 18 03 24 03 28 03 20 03  20 03 20 03 1C 03 20 03  ..$.(. .  . ... .  
0000 1F80: 1C 03 14 03 20 03 14 03  1C 03 14 03 1C 03 14 03  .... ... ........  
0000 1F90: 1C 03 18 03 20 03 1C 03  24 03 18 03 20 03 1C 03  .... ... $... ...  
0000 1FA0: 24 03 1C 03 1C 03 18 03  28 03 18 03 20 03 20 03  $....... (... . .  
0000 1FB0: 18 03 20 03 1C 03 18 03  20 03 14 03 20 03 1C 03  .. .....  ... ...  
0000 1FC0: 1C 03 20 03 20 03 1C 03  28 03 1C 03 20 03 1C 03  .. . ... (... ...  
0000 1FD0: 24 03 20 03 1C 03 20 03  1C 03 18 03 1C 03 1C 03  $. ... . ........  
0000 1FE0: 28 03 1C 03 20 03 1C 03  20 03 18 03 1C 03 14 03  (... ...  .......  
0000 1FF0: 20 03 20 03 18 03 14 03  24 03 14 03 18 03 24 03   . ..... $.....$.  
0000 2000: 24 03 14 03 18 03 18 03  1C 03 20 03 1C 03 18 03  $....... .. .....  
0000 2010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2020: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2030: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2040: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2050: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2060: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2070: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2080: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2090: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 20A0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 20B0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 20C0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 20D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 20E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 20F0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 2100: 18 03 18 03 18 03 20 03  18 03 20 03 18 03 14 03  ...... . .. .....  
0000 2110: 18 03 18 03 1C 03 18 03  20 03 20 03 18 03 18 03  ........  . .....  
0000 2120: 20 03 1C 03 1C 03 1C 03  20 03 18 03 18 03 18 03   .......  .......  
0000 2130: 1C 03 18 03 20 03 20 03  1C 03 10 03 14 03 20 03  .... . . ...... .

DMESG:

[  325.005079] imx377 31-001a: imx377_power_on: power on
[  325.039138] imx377 31-001a: imx377_s_stream++ enable 1
[  325.137526] imx377 31-001a: imx377_set_gain - val = 4194304
[  325.143161] imx377 31-001a: input gain value: 256
[  325.147996] imx377 31-001a: imx377_set_gain: gain 00 val: 256
[  325.154668] imx377 31-001a: imx377_set_frame_rate: val: 125829120
[  325.160798] imx377 31-001a: imx377_set_frame_length length = 3200
[  325.166982] imx377 31-001a: imx377_set_frame_length: val: 3200
[  325.173984] imx377 31-001a: imx377_set_exposure: val: 125
[  325.179426] imx377 31-001a: imx377_set_coarse_time: input val: 22
[  325.185587] imx377 31-001a: imx377_set_coarse_time: set val: 3178
[  326.190788] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  327.194789] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  328.198786] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  329.202776] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  330.206808] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!
[  330.213098] imx377 31-001a: imx377_s_stream++ enable 0
[  330.312471] imx377 31-001a: imx377_set_gain - val = 4194304
[  330.318110] imx377 31-001a: input gain value: 256
[  330.322933] imx377 31-001a: imx377_set_gain: gain 00 val: 256
[  330.329523] imx377 31-001a: imx377_set_frame_rate: val: 125829120
[  330.335711] imx377 31-001a: imx377_set_frame_length length = 3200
[  330.341876] imx377 31-001a: imx377_set_frame_length: val: 3200
[  330.348846] imx377 31-001a: imx377_set_exposure: val: 125
[  330.354287] imx377 31-001a: imx377_set_coarse_time: input val: 22
[  330.360444] imx377 31-001a: imx377_set_coarse_time: set val: 3178
[  330.383853] imx377 31-001a: imx377_power_off: power off

So it leads me to think that the issue is not on the drivers, nor any of the values reported nor on the driver or device tree. So I hope you help me get rid of this pesky zeroes.

If I use Gstreamer I get this on the nvcamera-daemon:

nvidia@tegra-ubuntu:~$ sudo nvcamera-daemon 
[sudo] password for nvidia: 
OFParserEnumerateDriverNode: v4l2_sensor: failed to parse device-tree to driver node
OFParserEnumerateDriverNode: v4l2_sensor: failed to parse device-tree to driver node
OFFileToString: fgets() error.  No characters have been read
OFDPropertyAdd: could not read path /proc/device-tree/i2c@3180000/tca9546@70/i2c@0/imx230_a@1a/use-cam-gpio [use-cam-gpio]
OFDriverNodeToDict: Failed to store property 'use-cam-gpio'
OFParserEnumerateDriverNode: v4l2_sensor: failed to parse device-tree to driver node
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
PCLHW_DTParser
LoadOverridesFile: looking for override file [/Calib/camera_override.isp] 1/16LoadOverridesFile: looking for override file [/data/nvcam/settings/camera_overrides.isp] 2/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/camera_overrides.isp] 3/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/camera_overrides.isp] 4/16LoadOverridesFile: looking for override file [/data/nvcam/camera_overrides.isp] 5/16LoadOverridesFile: looking for override file [/data/nvcam/settings/imx230_bottomleft_liimx230.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/imx230_bottomleft_liimx230.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/imx230_bottomleft_liimx230.isp] 8/16---- imager: No override file found. ----
(NvOdmDevice) Error NotInitialized: hDev Table not initialized (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 87)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0x3)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 596)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 781)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 276)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 439)
Segmentation fault (core dumped)

Hi @ShaneCC
So After playing a bit also with the IMX377 I managed to get the right side full of zeroes out of the image, but now apparently I am getting a left portion of the image on a dark colour, which impedes proper colour processing. I’ve also tested other driver modes, and even cropping, but whatever i can do with the driver cannot get rid of the blank areas, so I assume there must be somewhere else on the CSI/MIPI that is passing the whole image w blanks and ignored areas, and the driver doesn’t know how to handle it, if you don’t match the desired resolution + blanks, which in the case of the IMX377 is 4096x3046, which gave the attached images.

On the IMX377 there are 48 pixels on the left always present, as per defined on their specs, whereas on the IMX230 there is not, but there is always zeroes blanking at the end, which makes sense, my point is, where can i tell the driver to ignore that part of the image, or is it something introduced on recent patches, changes ? and perhaps it works for certain sensors, but not for all of them, which ironically everyone seems to have troubles with. on the TX2, L4T 28.1.

Thanks
croppedIMX377.jpg
IMX377.jpg
IMX230.jpg

croppedIMX377.jpg

IMX377.jpg

IMX230.jpg

Updates:

After playing a bit also, with what was suggested here: https://devtalk.nvidia.com/default/topic/1021058/jetson-tx2/-dev-video0-not-populated-in-28-1-with-yuv-camera/
,here:
https://devtalk.nvidia.com/default/topic/1016796/jetson-tx2/porting-ar0135-ds90ub964-driver-to-jetson-tx2-chansel-fault-/1
and here:
https://devtalk.nvidia.com/default/topic/1007058/jetson-tx2/porting-tx1-camera-driver-to-kernel-4-4-15-pxl_sof-syncpt-timeout/3

changing this values

#define T18X_BYPASS_LP_SEQ          (0x1 << 7)
#define DEFAULT_THS_SETTLE                  (0x14 << 0)

I managed to get buffers from the cameras with: v4l2-ctl --device /dev/video2 --set-ctrl bypass_mode=0 --stream-mmap --stream-to=frame230-2.raw --stream-count=1 --verbose

Although I still get the black bars ( either left or right side,depending on the sensor ), now I’ve only get this on dmesg, which relates with pretty much all the same problems other people has reported on the TX2, and there seems to be no solution yet.

DMESG:

[  190.758333] imx230 30-001a: imx230_power_on: power on
[  191.333618] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:9981, lanes:300000
[  191.341339] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL                  0x04 0x2a000010
[  191.349744] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS            0x0c 0x00009981
[  191.358086] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2          0x10 0x00000000
[  191.366446] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG           0x18 0x00200000
[  191.374793] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG           0x1c 0x00200000
[  191.383129] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG           0x20 0x00000000
[  191.391430] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG           0x24 0x00000000
[  191.399736] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG           0x28 0x00000000
[  191.408044] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG           0x2c 0x00000000
[  191.416346] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG           0x3c 0x00000200
[  191.424641] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG           0x40 0x00000200
[  191.432936] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG           0x44 0x00000200
[  191.441215] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG           0x48 0x00000200
[  191.449495] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0             0x5c 0x00000000
[  191.457778] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1             0x60 0x00000000
[  191.466057] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2             0x64 0x00010010
[  191.474340] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2         0x68 0x00000002
[  191.482622] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2         0x6c 0x00000002
[  191.490894] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2         0x74 0x00000002
[  191.499154] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2         0x78 0x00000002
[  191.507450] imx230 30-001a: imx230_s_stream++ enable 1
[  191.571816] imx230 30-001a: imx230_set_gain - val = 4194304
[  191.577409] imx230 30-001a: imx230_set_gain: gain 0000 val: 256
[  191.584041] imx230 30-001a: imx230_set_frame_rate: val: 251658240
[  191.590158] imx230 30-001a: imx230_set_frame_length length = 1242
[  191.596296] imx230 30-001a: imx230_set_frame_length: val: 1242
[  191.603105] imx230 30-001a: imx230_set_exposure: val: 125, line length: 8016, FPSF: 4194304,coarse time: 2
[  191.612773] imx230 30-001a: imx230_set_coarse_time
[  191.617596] imx230 30-001a: imx230_set_coarse_time: input val: 2
[  191.623624] imx230 30-001a: imx230_set_coarse_time: set val: 2
[  191.902962] tegra-vi4 15700000.vi: Status:  5 channel:00 frame:0007
[  191.909283] tegra-vi4 15700000.vi:          timestamp sof 202035573440 eof 202035688320 data 0x00000001
[  191.918683] tegra-vi4 15700000.vi:          capture_id 5 stream  0 vchan  0
[  191.925680] imx230 30-001a: imx230_s_stream++ enable 0
[  192.119083] imx230 30-001a: imx230_power_off: power off
[  194.258892] imx377 31-001a: imx377_power_on: power on
[  194.814259] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:9981, lanes:c00000
[  194.821986] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL                  0x04 0x2a000010
[  194.830393] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS            0x0c 0x00009981
[  194.838737] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2          0x10 0x00000000
[  194.847089] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG           0x18 0x00000000
[  194.855435] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG           0x1c 0x00000000
[  194.863768] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG           0x20 0x00200000
[  194.872069] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG           0x24 0x00200000
[  194.880372] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG           0x28 0x00000000
[  194.888676] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG           0x2c 0x00000000
[  194.896974] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG           0x3c 0x00000200
[  194.905247] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG           0x40 0x00000200
[  194.913548] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG           0x44 0x00000200
[  194.921828] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG           0x48 0x00000200
[  194.930110] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0             0x5c 0x00000000
[  194.938392] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1             0x60 0x00000000
[  194.946672] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2             0x64 0x00010010
[  194.954985] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2         0x68 0x00000002
[  194.963302] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2         0x6c 0x00000002
[  194.971592] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2         0x74 0x00000002
[  194.979872] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2         0x78 0x00000002
[  194.988199] imx377 31-001a: imx377_s_stream++ enable 1
[  195.089074] imx377 31-001a: imx377_set_gain - val = 4194304
[  195.094703] imx377 31-001a: input gain value: 256
[  195.099534] imx377 31-001a: imx377_set_gain: gain 00 val: 256
[  195.106267] imx377 31-001a: imx377_set_frame_rate: val: 125829120
[  195.112492] imx377 31-001a: imx377_set_frame_length length = 3125
[  195.118676] imx377 31-001a: imx377_set_frame_length: val: 3125
[  195.125784] imx377 31-001a: imx377_set_exposure: val: 125
[  195.131217] imx377 31-001a: imx377_set_coarse_time: input val: 22
[  195.137351] imx377 31-001a: imx377_set_coarse_time: set val: 3103
[  195.155076] tegra-vi4 15700000.vi: Status:  4 channel:00 frame:0000
[  195.161394] tegra-vi4 15700000.vi:          timestamp sof 205288334176 eof 205288342688 data 0x00000100
[  195.170868] tegra-vi4 15700000.vi:          capture_id 6 stream  2 vchan  0
[  196.151897] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  197.154040] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!
[  197.159946] imx377 31-001a: imx377_s_stream++ enable 0
[  197.265200] imx377 31-001a: imx377_set_gain - val = 4194304
[  197.270834] imx377 31-001a: input gain value: 256
[  197.275628] imx377 31-001a: imx377_set_gain: gain 00 val: 256
[  197.282360] imx377 31-001a: imx377_set_frame_rate: val: 125829120
[  197.288563] imx377 31-001a: imx377_set_frame_length length = 3125
[  197.294734] imx377 31-001a: imx377_set_frame_length: val: 3125
[  197.302125] imx377 31-001a: imx377_set_exposure: val: 125
[  197.307574] imx377 31-001a: imx377_set_coarse_time: input val: 22
[  197.313725] imx377 31-001a: imx377_set_coarse_time: set val: 3103
[  197.344904] imx377 31-001a: imx377_power_off: power off
[  230.344318] imx230 32-001a: imx230_power_on: power on
[  230.899986] tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:9981, lanes:3000000
[  230.908266] tegra_mipi_cal 3990000.mipical: MIPI_CAL_CTRL                  0x04 0x2a000010
[  230.916613] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS            0x0c 0x00009981
[  230.924971] tegra_mipi_cal 3990000.mipical: CIL_MIPI_CAL_STATUS_2          0x10 0x00000000
[  230.933276] tegra_mipi_cal 3990000.mipical: CILA_MIPI_CAL_CONFIG           0x18 0x00000000
[  230.941577] tegra_mipi_cal 3990000.mipical: CILB_MIPI_CAL_CONFIG           0x1c 0x00000000
[  230.949869] tegra_mipi_cal 3990000.mipical: CILC_MIPI_CAL_CONFIG           0x20 0x00000000
[  230.958215] tegra_mipi_cal 3990000.mipical: CILD_MIPI_CAL_CONFIG           0x24 0x00000000
[  230.966587] tegra_mipi_cal 3990000.mipical: CILE_MIPI_CAL_CONFIG           0x28 0x00200000
[  230.974941] tegra_mipi_cal 3990000.mipical: CILF_MIPI_CAL_CONFIG           0x2c 0x00200000
[  230.983260] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG           0x3c 0x00000200
[  230.991569] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG           0x40 0x00000200
[  230.999902] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG           0x44 0x00000200
[  231.008219] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG           0x48 0x00000200
[  231.016517] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG0             0x5c 0x00000000
[  231.024807] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG1             0x60 0x00000000
[  231.033097] tegra_mipi_cal 3990000.mipical: MIPI_BIAS_PAD_CFG2             0x64 0x00010010
[  231.041380] tegra_mipi_cal 3990000.mipical: DSIA_MIPI_CAL_CONFIG_2         0x68 0x00000002
[  231.049666] tegra_mipi_cal 3990000.mipical: DSIB_MIPI_CAL_CONFIG_2         0x6c 0x00000002
[  231.057955] tegra_mipi_cal 3990000.mipical: DSIC_MIPI_CAL_CONFIG_2         0x74 0x00000002
[  231.066239] tegra_mipi_cal 3990000.mipical: DSID_MIPI_CAL_CONFIG_2         0x78 0x00000002
[  231.074564] imx230 32-001a: imx230_s_stream++ enable 1
[  231.143452] imx230 32-001a: imx230_set_gain - val = 4194304
[  231.149062] imx230 32-001a: imx230_set_gain: gain 0000 val: 256
[  231.155805] imx230 32-001a: imx230_set_frame_rate: val: 251658240
[  231.161918] imx230 32-001a: imx230_set_frame_length length = 1242
[  231.168078] imx230 32-001a: imx230_set_frame_length: val: 1242
[  231.175072] imx230 32-001a: imx230_set_exposure: val: 125, line length: 8016, FPSF: 4194304,coarse time: 2
[  231.184775] imx230 32-001a: imx230_set_coarse_time
[  231.189614] imx230 32-001a: imx230_set_coarse_time: input val: 2
[  231.195669] imx230 32-001a: imx230_set_coarse_time: set val: 2
[  231.521608] tegra-vi4 15700000.vi: Status:  5 channel:00 frame:0008
[  231.527923] tegra-vi4 15700000.vi:          timestamp sof 241654034784 eof 241654153152 data 0x00000001
[  231.537374] tegra-vi4 15700000.vi:          capture_id 12 stream  4 vchan  0
[  231.544526] imx230 32-001a: imx230_s_stream++ enable 0
[  231.604981] imx230 32-001a: imx230_power_off: power off

If anyone has an update, It will be appreciated.

Additional notes:

  • As per mentioned on other posts, embedded_metadata_height, must match the specified number on lines for the sensor
  • There is also some changes on the 128 bit alignment of the reported resolutions for the driver to receive properly the buffers
  • Disabling the Plugin Manager allowed proper population of all /dev/videoX nodes if you have multiple sensors.

Not solved yet:

  • errors reported by the VI/CSI
  • Gstreamer or argus_camera programs won’t work with any combination/option

I have exactly the same issue! (it looks like a very popular TX2 camera driver bug) any luck solving it?

@Robotdude

There is still no solution yet, it’s been very frustrating that cameras work on TX1 but not on TX2, even trying different sensors and boards, and getting to the same point. And it seems to be an issue for quite some time, since even camera suppliers are also dealing with this problem as well.

I’ll keep you posted.

Guys
Please follow below step to get the log to check the problem.

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

Hi @ShaneCCC,
So, due to a lack of progress on the TX2, I decided to go back to the TX1 to test again multiple cameras, on their highest resolution, And I found something very interesting… :) .
The TX1 driver works until version L4T 24, Jetpack_2.3.1. But as I mentioned before it is not a full driver, since only provides one resolution mode, and it doesn’t work properly with all applications, it works for gstreamer like so:

gst-launch-1.0 nvcamerasrc  sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)4096, height=(int)3046, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv  ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e

But it doesn’t work for V4l mmap nor any other V4l application

ubuntu@tegra-ubuntu:~$ v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame0.raw --stream-count=1 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
	Index    : 0
	Type     : Video Capture
	Flags    : mapped, done, error
	Field    : None
	Sequence : 0
	Length   : 25279872
	Bytesused: 25279872
	Timestamp: 3166.119254s (Monotonic, End-of-Frame)

	Index    : 1
	Type     : Video Capture
	Flags    : mapped, done, error
	Field    : None
	Sequence : 1
	Length   : 25279872
	Bytesused: 25279872
	Timestamp: 3166.153102s (Monotonic, End-of-Frame)

	Index    : 2
	Type     : Video Capture
	Flags    : mapped, done
	Field    : None
	Sequence : 2
	Length   : 25279872
	Bytesused: 25279872
	Timestamp: 3166.186483s (Monotonic, End-of-Frame)

VIDIOC_STREAMOFF: ok
frame0.raw                                                                      
0000 0000: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0020: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0030: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0040: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0050: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0060: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0070: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0080: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0090: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 00A0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 00B0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 00C0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 00D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 00E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 00F0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0100: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0110: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0120: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0130: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0140: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0150: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0160: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0170: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0180: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 0190: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
0000 01A0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........

And by doing so I just noticed that even with gstreamer, I get the black bars on the same spots I get them on the TX2 with V4l, like the attached image ( see attacment ). Which leads me to think that the patches introduced on 27.1 see ( https://devtalk.nvidia.com/default/topic/1007058/jetson-tx2/porting-tx1-camera-driver-to-kernel-4-4-15-pxl_sof-syncpt-timeout/post/5140823/#5140823) might had gotten this broken in the first place, it is possible that some sensors manage it differently and thus made it work for certain sensors, but breaking it for others, so i will try to remove those changes from the L4T 28.1 on the TX2 and see if that helps to bring the gstreamer function back on the TX2, even if it breaks V4l.

Wish me Luck.