I instrumented the error message the driver puts out to see if I could learn anything further about the reason the driver is discarding frames. The capture status descr->status.status
indicates a value of 14:
[ 1158.082732] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 256, flags: 0, err_data 256, status = 14
[ 1158.182526] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 256, flags: 0, err_data 256, status = 14
The status value of 14 corresponds to CAPTURE_STATUS_FALCON_ERROR, I believe. In the camrtc-capture.h file it indicates there are falcon error bits that will give details. Those appear to be in notify_bits. Correct?
Printing those too indicates a hex value of 200000000, or bit 33:
[ 142.925601] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 256, flags: 0, err_data 256, status = 14, notify_bits = 200000000
[ 142.959134] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 256, flags: 0, err_data 256, status = 14, notify_bits = 200000000
Bit 33 looks to be CAPTURE_STATUS_NOTIFY_BIT_CHANSEL_PIXEL_LONG_LINE, or the line is too long. Our NTSC-width lines should be 720 pixels. I tried bumping up the size to 721, but then the notify_bits then indicate bit 34:
[ 137.459995] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 256, flags: 0, err_data 512, status = 14, notify_bits = 400000000
[ 137.493249] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 256, flags: 0, err_data 512, status = 14, notify_bits = 400000000
Bit 34 indicates the line is too short. So it seems to indicate that for some reason the 720 pixel width is correct, but is getting rejected for being too long.
For another test I tweaked the driver and device tree by setting the width to 721 pixels and ran the same two tests:
v4l2-ctl --set-fmt-video=width=721,height=480 --stream-mmap
which yielded status = 14, notify_bits = 400000000
or âPixel line is too shortâ meaning to me that the lines are less than 721 pixels.
v4l2-ctl --set-fmt-video=width=720,height=480 --stream-mmap
which yielded status = 14, notify_bits = 200000000
or âPixel line is too longâ meaning to me that the lines are more than 720 pixels.
How can 720 be too short and 721 be too long? Is there something else that can cause those bits to be set under certain circumstances?
Can you help solve this puzzle?
Thanks!