VI: Image capture error

Hi,

I’m working on porting a sensor driver for Jetson Nano to Jetson AGX Orin with an additional camera expansion board (Auvidea J20).

The sensor is recognized by the driver. However, when I run the following command:

v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=AB24 --stream-mmap --stream-count=1 -d /dev/video0 --stream-to=capture.raw

I see the following errors in the kernel log:

[  112.258093] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 64
[  112.297334] bwmgr API not supported
[  118.348719] bwmgr API not supported
[  118.387080] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072

The trace log shows:

kworker/3:14-187     [003] ....   206.825841: rtcpu_vinotify_event: tstamp:7422664847 cch:0 vi:0 tag:CHANSEL_PXL_EOF channel:0x23 frame:0 vi_tstamp:237525128832 data:0x0000000001df0002
    kworker/3:14-187     [003] ....   206.825842: rtcpu_vinotify_event: tstamp:7422664983 cch:0 vi:0 tag:ATOMP_FRAME_DONE channel:0x23 frame:0 vi_tstamp:237525129440 data:0x0000000000000000
    kworker/3:14-187     [003] ....   206.825842: rtcpu_vinotify_event: tstamp:7422665132 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237525131936 data:0x0000000002020001
    kworker/3:14-187     [003] ....   206.825842: rtcpu_vinotify_event: tstamp:7422665262 cch:0 vi:0 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:237525147776 data:0x0000000001e00040
    kworker/3:14-187     [003] ....   206.825842: rtcpu_vinotify_event: tstamp:7422665410 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237525153696 data:0x0000000001020001
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422665539 cch:0 vi:0 tag:FE channel:0x00 frame:0 vi_tstamp:237525164608 data:0x0000000000000020
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422665691 cch:0 vi:0 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:237525164608 data:0x0000000800000000
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422665821 cch:0 vi:0 tag:FS channel:0x00 frame:0 vi_tstamp:237525183936 data:0x0000000000000010
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422983209 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:237525183936 data:0x0000000800000000
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422983348 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:237525201568 data:0x0000000000000001
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422983497 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237525203104 data:0x0000000008020002
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422983628 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:237525277920 data:0x359d580010000000
    kworker/3:14-187     [003] ....   206.825843: rtcpu_vinotify_event: tstamp:7422983777 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:237525284512 data:0x0000000031000003
    kworker/3:14-187     [003] ....   206.825844: rtcpu_vinotify_event: tstamp:7423188248 cch:0 vi:0 tag:CHANSEL_PXL_EOF channel:0x23 frame:0 vi_tstamp:237541863360 data:0x0000000001df0002
    kworker/3:14-187     [003] ....   206.825844: rtcpu_vinotify_event: tstamp:7423188401 cch:0 vi:0 tag:ATOMP_FRAME_DONE channel:0x23 frame:0 vi_tstamp:237541863968 data:0x0000000000000000
    kworker/3:14-187     [003] ....   206.825844: rtcpu_vinotify_event: tstamp:7423188538 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237541866944 data:0x0000000002020002
    kworker/3:14-187     [003] ....   206.825844: rtcpu_vinotify_event: tstamp:7423188686 cch:0 vi:0 tag:FE channel:0x00 frame:0 vi_tstamp:237541864384 data:0x0000000000000020
    kworker/3:14-187     [003] ....   206.825844: rtcpu_vinotify_event: tstamp:7423188820 cch:0 vi:0 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:237541864384 data:0x0000000800000000
    kworker/3:14-187     [003] ....   206.825844: rtcpu_vinotify_event: tstamp:7423188969 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237541873216 data:0x0000000000020002
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423189100 cch:0 vi:0 tag:FS channel:0x00 frame:0 vi_tstamp:237541883680 data:0x0000000000000010
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423189249 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:237541883712 data:0x0000000800000000
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423189379 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:237541901408 data:0x0000000000000001
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423189525 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237541902912 data:0x0000000008020003
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423189662 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:237541985216 data:0x359d550010000000
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423494628 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:237542009408 data:0x0000000031000004
    kworker/3:14-187     [003] ....   206.825845: rtcpu_vinotify_event: tstamp:7423779559 cch:0 vi:0 tag:CHANSEL_PXL_EOF channel:0x23 frame:0 vi_tstamp:237558563200 data:0x0000000001df0002
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423779712 cch:0 vi:0 tag:ATOMP_FRAME_DONE channel:0x23 frame:0 vi_tstamp:237558563808 data:0x0000000000000000
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423779843 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237558566720 data:0x0000000002020003
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423779991 cch:0 vi:0 tag:FE channel:0x00 frame:0 vi_tstamp:237558564224 data:0x0000000000000020
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423780149 cch:0 vi:0 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:237558564224 data:0x0000000800000000
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423780297 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237558573024 data:0x0000000000020003
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423780425 cch:0 vi:0 tag:FS channel:0x00 frame:0 vi_tstamp:237558583488 data:0x0000000000000010
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423780576 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:237558583488 data:0x0000000800000000
    kworker/3:14-187     [003] ....   206.825846: rtcpu_vinotify_event: tstamp:7423780705 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:237558601152 data:0x0000000000000001
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423780853 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237558602720 data:0x0000000008020004
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423780983 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:237558679616 data:0x359d580010000000
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423781129 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:237558686240 data:0x0000000031000005
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423781264 cch:0 vi:0 tag:FE channel:0x00 frame:0 vi_tstamp:237560876928 data:0x0000000000000020
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423781416 cch:0 vi:0 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:237560876928 data:0x0042200001000000
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423781544 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:237560886272 data:0x0000000001020004
    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7424108351 cch:-1 vi:0 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:237560876928 data:0x0000000800000000

The imaging device properties are:

               mclk_khz = "24000";
                num_lanes = "2";
                tegra_sinterface = "serial_g";
                phy_mode = "DPHY";
                discontinuous_clk = "no";
                dpcm_enable = "false";
                cil_settletime = "0";

                active_w = "640";
                active_h = "480";
                pixel_t = "rgb_rgb88824";
                csi_pixel_bit_depth = "24";
                readout_orientation = "0";
                line_length = "694";
                /* inherent_gain = "1"; */
                /* mclk_multiplier = "9.33"; */
                pix_clk_hz = "20000000";

                /* unused */
                gain_factor = "16";
                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";

                /* framerate */
                framerate_factor = "1000000";
                min_framerate = "40000000"; /* 40 fps */
                max_framerate = "62000000"; /* 62 fps */
                step_framerate = "1";
                default_framerate = "60020000"; /* 60.020 fps */

                /* unused */
                min_exp_time = "13"; /* us */
                max_exp_time = "683709"; /* us */
                step_exp_time = "1";
                default_exp_time = "2495"; /* us */

                embedded_metadata_height = "0";

Before this I had timeout issues, but was resolved adjusting the link frequency in the device tree.
Related post: Image capture error - #11 by JerryChang

Thanks

Below message tell the output size doesn’t as expected.

    kworker/3:14-187     [003] ....   206.825842: rtcpu_vinotify_event: tstamp:7422665262 cch:0 vi:0 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:237525147776 data:0x0000000001e00040

    kworker/3:14-187     [003] ....   206.825847: rtcpu_vinotify_event: tstamp:7423781416 cch:0 vi:0 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:237560876928 data:0x0042200001000000

@ShaneCCC

Any ideas as to why that would happen when porting from a Jetson Nano to a Jetson AGX Orin?

Nano don’t check the size but AGX Orin/Xavier.

Thanks

@ShaneCCC

That would explain it.

How does the AGX Orin calculate the expected size ?

And is there any way to log the actual size ?

Thanks

VI driver can’t detect the expected size until receive the frame.
The sensor driver report the size.

@ShaneCCC

There seems to be something wrong with the framerate.

The actual frame rate is about 60Hz, which is expected.

user@jetson:~$ v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=AB24 --stream-mmap --stream-count=300 -d /dev/video0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 59.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 59.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 59.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 59.88 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

However V4L2-ctl reports a framerate of 40Hz:

user@jetson:~$ v4l2-ctl -d0 --get-ctr frame_rate
frame_rate: 40000000

Although the default frame rate should be 60.02Hz:
frame_rate 0x009a200b (int64) : min=40000000 max=62000000 step=1 default=60020000 value=40000000 flags=update, slider

Also see device tree in the first post.

Any ideas as to what could have gone wrong ?

Please check the sensor driver for the framerate CID.

Thanks

Seems like it was only a issue on the last frame when ending the stream.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.