Hi NVIDIA Support Team,
We’re facing intermittent corrupted frames (truncated data, packer overflows, CSI CRC faults, etc.) on JetPack 5.3 with the IMX219 sensor that cause Argus/V4L2 pipelines to have torn image (half image from previous frame). To prevent userspace from ever seeing those bad buffers/frames, we tried dropping them as early as possible in the VI driver.
Specifically, in capture-ivc.c we:
- Pull in the exact same status codes and flag bits that the RTCPU firmware sets by including:
#include <soc/tegra/camrtc-capture.h>
- In the IVC worker callback, only on the capture channel, we check:
- If
msg->resp
is NULL (to avoid a NULL-deref), we return. - If
status.status != CAPTURE_STATUS_SUCCESS
or any of these fatal flags is set:
CAPTURE_STATUS_FLAG_CHANNEL_IN_ERROR
CAPTURE_STATUS_NOTIFY_BIT_ATOMP_FRAME_TRUNCATED
CAPTURE_STATUS_NOTIFY_BIT_ATOMP_FRAME_TOSSED
CAPTURE_STATUS_NOTIFY_BIT_CSIMUX_FRAME_FS_FAULT
we log a warning and return—never invoking the client callback.
static inline void tegra_capture_ivc_recv_msg(
struct tegra_capture_ivc *civc,
uint32_t id,
const struct tegra_capture_ivc_resp *msg)
{
struct device *dev = &civc->chan->dev;
const struct capture_descriptor *desc = msg->resp;
if (civc == __scivc_capture) {
if (!desc) {
dev_warn(dev, "capture-ivc: missing payload for capture ch=%u\n", id);
return;
}
if (desc->status.status != CAPTURE_STATUS_SUCCESS ||
(desc->status.flags & (
CAPTURE_STATUS_FLAG_CHANNEL_IN_ERROR |
CAPTURE_STATUS_NOTIFY_BIT_ATOMP_FRAME_TRUNCATED |
CAPTURE_STATUS_NOTIFY_BIT_ATOMP_FRAME_TOSSED |
CAPTURE_STATUS_NOTIFY_BIT_CSIMUX_FRAME_FS_FAULT
))) {
dev_warn(dev,
"capture-ivc: drop corrupted frame ch=%u status=%u flags=0x%x\n",
id,
desc->status.status,
desc->status.flags);
return;
}
}
if (civc->cb_ctx[id].cb_func)
civc->cb_ctx[id].cb_func(msg, civc->cb_ctx[id].priv_context);
}
After rebuilding and flashing the kernel on an Xavier NX, the same GStreamer command:
gst-launch-1.0 nvarguscamerasrc sensor-id=3 ! \
"video/x-raw(memory:NVMM),width=1640,height=1232,framerate=15/1" ! \
queue ! nvvidconv ! autovideosink sync=false
This command is used to working correctly without above change.
But now produces a black screen and eventually a kernel panic in the IVC worker (see attached log).
Questions / Requests:
- Feasibility: Is it architecturally sound to drop corrupt frames in the VI driver at this level?
- Recommendations: What adjustments would you suggest to:
- Avoid intercepting control-plane messages or essential callbacks?
- Maintain proper buffer/IVC state so the worker thread doesn’t panic?
- Or, would you recommend a different hook (e.g. in V4L2 or vb2) for early frame filtering?
Thank you very much for your guidance!