Camera v4l2 image sequence issue


my camera has 4 contexts, which I can configure them individually and get the raw image from each context. Theoretically The first image should be from context0, and the raw data should also beginn with the first image from context0. But in face often the very first image in raw data is the image from context1, the image from context0 is just missing.

does someone have a similar experience?

Not very clear your problem !

Hi @ShaneCCC

please have a look at this video, the first image should be the darkst one with lowst exposure time from context0, but in the raw data the first image is the brightest one with highst exposure time from context3.

Does the stream like below?

context0 → context1 → context2 ->context3 ->context0 ->context1 → context2 ->context3 ->context0 …

yes, exactly.

The context0 always lost or one the first context0 lost?
If only the first context0 lost that could be the sensor streaming on timing before the CSI/VI ready.

only the first context0 is lost.
how to optimize the timing?

Maybe have some delay to output frame data after stream_on command.

which function controls the output of frame data?

I just found the start_streaming function, added some delay before this function, but nothing changed…

static struct camera_common_sensor_ops xxxx_common_ops = {
.numfrmfmts = ARRAY_SIZE(xxxx_frmfmt),
.frmfmt_table = xxxx_frmfmt,
.power_on = xxxx_power_on,
.power_off = xxxx_power_off,
.write_reg = xxxx_write_reg,
.read_reg = xxxx_read_reg,
.parse_dt = xxxx_parse_dt,
.power_get = xxxx_power_get,
.power_put = xxxx_power_put,
.set_mode = xxxx_set_mode,
.start_streaming = xxxx_start_streaming,
.stop_streaming = xxxx_stop_streaming,

For normal sensor there should have REG to enable the steaming.
And the sensor driver xxx_start_streaming to control the sensor streaming eanble.

Problem resolved by adding delay:
in file: tegracam_v4l2.c
in function: static int v4l2sd_stream(struct v4l2_subdev *sd, int enable)
after line: tc_dev->is_streaming = true;

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