every first frame error "frame start syncpt timeout!0"

hi

i made 4 channel HD camera H/W solution
my camera output is UYVY 1280x720 30fps.
so i captured video v4l2 and h.264 encoding simultaneous save of 4 channels(Like a DVR)

my camera did not initialize the driver, but in the application(I2C)(My camera driver is dummy v4l2 driver.)

MIPI Output start after camera initialization from app.

The starting order of the application is as follows.

  1. sensor init(by app)
  2. gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=900 ! ‘video/x-raw,format=UYVY,width=1280 ,height=720’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=I420’ ! omxh264enc ! ‘video/x-h264,stream-format=byte-stream’ ! h264parse ! qtmux ! filesink location=1.mp4

in such a case, sometimes first frame loss occurs.
“[ 4819.437205] video4linux video0: frame start syncpt timeout!0”

so i play that file then first frame is green. and play ok.

What is the problem.?

mipi output point? v4l2? app?
CSI_PHY_CILA_CONTROL0_0 tune? CILA_THS_SETTLE? CILA_CLK_SETTLE?
my mipi clock is continuous

My BSP Version is L4T 24.2.1


Hi walterkim,
Could you set to discontinuous mode and try?

i would like to try your answer…

Unfortunately my camera is not supported discontinuous mode.

i want to drop first frame when gst-launch every start time.

where is modify kernel driver? (kernel/drivers/media/platform/tegra/camera/*)

This seems to be a problem because the driver dose not know exactly when to start the frame in continuous mode.

Hi walterkim,
Please refer to kernel/drivers/media/platform/tegra/camera/channel.c

free_ring_buffers() sends frames to userspace. You can try to skip frames here.

Have you tried to to set in “channel.c” :
chan->timeout = 20” into “chan->timeout = -1” ?

Hi walterkim,

Is this still an issue?
Any result can be shared?

Thanks

i tryed chan->timeout = -1

it is first time no error.

but next time run gst-launch not terminated

um… do you have other solutions?

Hi
I think your sequence is not correct. You should move the sensor initialize to the sensor driver.

i ckeched first frame buffer value … that is zero
yuv data all zero is green (yuv data all 0xff is pink)

yuv data all 0x8000 is black

i would like to init capture buffer 0x8000.

where is modify? help me

Hi walterkim
In the vi2_fops.c you can see the buffer address write to the REG TEGRA_VI_CSI_SURFACE0_OFFSET_LSB, you can try here. But it’s a DMA buffer and could have problem access by CPU.

void vi2_channel_capture_frame_init(struct tegra_channel *chan,
				struct tegra_channel_buffer *buf,
				u32 *thresh)
{
	int index = 0;
	int valid_ports = chan->valid_ports;
	int bytes_per_line = chan->format.bytesperline;
	u32 val, frame_start, mw_ack_done;
	u32 release_thresh[TEGRA_CSI_BLOCKS] = { 0 };

	for (index = 0; index < valid_ports; index++) {
		/* Program buffer address by using surface 0 */
		vi2_channel_csi_write(chan, index,
				TEGRA_VI_CSI_SURFACE0_OFFSET_MSB, 0x0);
		vi2_channel_csi_write(chan, index,
			TEGRA_VI_CSI_SURFACE0_OFFSET_LSB,
			(buf->addr + chan->buffer_offset[index]));
		vi2_channel_csi_write(chan, index,
			TEGRA_VI_CSI_SURFACE0_STRIDE, bytes_per_line);