VI camera v4l2 sequence counting up in case of frame timeout

I have a TX1 with imx290 camera setup. Camera capture works fine in normal mode. When the imx290 is running in slave mode, and no frames are generated it generates syncpt timeout messages as would be expected. However, when frames are coming in eventually, the sequence counter is off by what seems to be the number of the timeout messages. I’ve looked in the kernel sources and it seems that the sequence counter is increased in the camera/vi/channel.c source in the release_buffer function.
Is there a way to only make it increase when a frame start has been received in the hardware?

hello jschwendner,

VI engine expect camera frame continuous coming without errors, please ensure there’s still MIPI signaling while switch to slave mode.
you may contact with your sensor vendor for correct sensor configuration of slave modes.

Yes, I understand that it should be continuous. However, one of the reasons for choosing the Jetson platform was to have better control over the pipeline. For multiple technical applications images can be non-continuous. Like e.g. what is described as infinite timeout mode. We’ve tested this use case without libargus, and it works - except for the frame counting issue.
I would still like to have a accurate information on the frame counting and timing from the VI, and not the kernel driver. I believe this is the case for libargus (at least for timestamping), but libargus is not an option for us as it doesn’t support raw-bayer.
Is there a way to pass meta information (frame count, timestamp) for a frame from the VI module to the v4l2 kernel driver?

hello jschwendner,

you may check below kernel sources for TX1’s VI driver, it uses sync-points to wait for sensor start-of-frame.
please have a try to increase the timeout values in the function calls.
for example,

static int tegra_channel_capture_frame_single_thread(
                err = nvhost_syncpt_wait_timeout_ext(chan->vi->ndev,
                        chan->syncpt[index][0], thresh[index],
                        chan->timeout, NULL, &ts);