Custom driver for Jetson tx2 bad preview image

Dear Sirs. We need your assistance.
We have JetsonTX2 board and custom camera board with Sony imx224 sensor.
The driver was created according to L4T-docs (
JetPack 3.2 ,28.1 Sensor Driver Programming Guide) which we currently using , based on ov9563 example.

No errors with 1312x977 from v4l2-ctl, but picture is broken.

We double checked sensor register settings and seen video from it on other board.
The sensor configured in 10 bit mode with 2 lanes QVGA mode: 1280 * 960.

We can`t get normal raw picture preview.

example of picture:
https://drive.google.com/open?id=1_seOhSaEPTopk_B2byedDQw7hSfTQPba

Sensor settings according to datasheet:
https://drive.google.com/open?id=19bwEkC8a_7lJjkT03b4TTMwPwQy2AFbj

Check please our calculations:
line_length = “1800”;
pix_clk_hz = 1800 * 1100 * 30 = 59400000 Hz
min_framerate = 60000000/1800*131071(max value of V lines VMAX) = 0,254315091

Our DTS file:
https://drive.google.com/open?id=1oEKLY0y0co-C2EtvUxD5R8eCdZr9WzZn

Settings in driver:

#include "../platform/tegra/camera/camera_gpio.h"

#include "imx224_mode_tbls.h"

#define IMX224_MAX_COARSE_DIFF		2

#define IMX224_GAIN_SHIFT		            8
#define IMX224_MIN_GAIN			1
#define IMX224_MAX_GAIN		       	72

#define IMX224_MIN_FRAME_LENGTH	          (0x0)
#define IMX224_MAX_FRAME_LENGTH	(0x1FFFF)//VMAX max val
#define IMX224_MIN_EXPOSURE_COARSE	(0x0002)
#define IMX224_MAX_EXPOSURE_COARSE	\
	(IMX224_MAX_FRAME_LENGTH-IMX224_MAX_COARSE_DIFF)
#define IMX224_DEFAULT_LINE_LENGTH	(0x708) //1800
#define IMX224_DEFAULT_PIXEL_CLOCK	(60)

#define IMX224_DEFAULT_GAIN		IMX224_MIN_GAIN
#define IMX224_DEFAULT_FRAME_LENGTH	(0x044C)
#define IMX224_DEFAULT_EXPOSURE_COARSE	\
	(IMX224_DEFAULT_FRAME_LENGTH-IMX224_MAX_COARSE_DIFF)

#define IMX224_DEFAULT_MODE	IMX224_MODE_1280X960_30_10bit
#define IMX224_DEFAULT_WIDTH    	1312
#define IMX224_DEFAULT_HEIGHT	977
#define IMX224_DEFAULT_DATAFMT	MEDIA_BUS_FMT_SRGGB10_1X10
#define IMX224_DEFAULT_CLK_FREQ	27000000

Resolution modes for sensor

Sensor configured in QVGA mode: 1280 * 960 but v4l2-ctl gives an error for all resolution (changed in driver and dts) except 1312*977.

horizontal:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1305,height=977,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=video.raw –verbose

VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
	Width/Height      : 1305/977
	Pixel Format      : 'RG10'
	Field             : None
	Bytes per Line    : 2816
	Size Image        : 2751232
	Colorspace        : sRGB
	Transfer Function : Default
	YCbCr Encoding    : Default
	Quantization      : Default
	Flags             : 
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
VIDIOC_DQBUF: failed: Input/output error
VIDIOC_STREAMOFF: ok

dmesg:

[  374.420179] tegra-vi4 15700000.vi: Status:  4 channel:00 frame:0008
[  374.426690] tegra-vi4 15700000.vi:  timestamp sof 377187982048 eof 377188004032 data 0x00000100
[  374.436268] tegra-vi4 15700000.vi:          capture_id 3 stream  2 vchan  0
 
[  375.401112] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  376.405089] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

vertical resolution else than 977:

tegra-vi4 15700000.vi: Status:  7 channel:00 frame:0008
tegra-vi4 15700000.vi:          timestamp sof 107324382848 eof 107353987488 data 0x00000001
tegra-vi4 15700000.vi:          capture_id 1 stream  2 vchan  0
 
tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

Currently there are no errors with v4l2-ctl with resolution 1312 * 977, however the output picture is broken.

Where can be the problem?

Should i use croping mode for sensor?

Does the line length (1800) correct in my case?
Does the V lines quantity (1100) correct in my case?

@shcherbak
Follow below link to enable the trace to get more information. It could be short frame or short line.

https://elinux.org/Jetson_TX2/28.1_Camera_BringUp

Thank you for your attention and for your quick reply.

Here is log after v4l2-ctl -d /dev/video0 --set-fmt-video=width=1312,height=977,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=64 --stream-to=video.raw --verbose

[url]https://drive.google.com/open?id=15gf40w667vjRevrWYT8SbkzI0ohrc4vA[/url]

i see an error
kworker/4:2-309 [004] …1 179.337880: rtos_queue_peek_from_isr_failed: tstamp:5690856790 queue:0x0b4a3c58
but i don’t know what does it mean.

Thank you in advance!

I found this thread
[url]Custom driver for csi-2 raw bayer sensor. (Use ISP for format conversion) - Jetson TX1 - NVIDIA Developer Forums
, which is very similar for my , but it is for TX1 and there are no such registers for TX2 .
I still need youre support. Where can be the problem? Can it be the memory alignment ?

Try to modify the TEGRA_SURFACE_ALIGHMENT to 1 in …/kernel/kernel-4.4/drivers/media/platform/tega/camera/vi/registers.h to check the raw image again.

The picture is changed, but still it’s bad
[url]https://drive.google.com/open?id=1qeO8CWXv2JUhpt7zav4lP7CLfKwGti0L[/url]
original ov5693 picture made the same method
[url]https://drive.google.com/open?id=1AFSwktel5SfBq7wYCH4L5mc7Gp8lL_nd[/url]

v4l2-ctl: no errors
debugging log:
Something has changed but still after each 5 i see fail message rtos_queue_peek_from_isr_failed

[url]https://drive.google.com/open?id=1d27dx_eKO9fSeSqBl4r4fTh1sq9Y1mun[/url]

It seems it is problem with line alignment.
Is there any way to find where can be the problem?

I think the rtos_queue_peek_from_isr_failed can be ignore. It’s show up when launch ov5693 too.

Could you try modify the 977 to 976 and launch camera by nvcamerasrc or argus sample app.

Thank you for your support.
I put 976 and got Status: 4 channel:00 frame:0008.
I found some errors in v4l2-compliance, i will try to solve them.
I will give feedback tomorrow

Thank you in advance.

Hello , i found out that picture was broken due to wrong resolution.
v4l2-ctl 1312*977 gives me Bytes per Line : 2816
in this case the resolution to transform raw to picture should be 1408
I changed TEGRA_STRIDE_ALIGNMENT from 256 to 64 it gives me
Bytes per Line : 2624
and now a can use 1312 to transform.

Here is the picture what is seems to be right.
[url]https://drive.google.com/open?id=1Q_NmDypHbIcbW66Vp5OtuG-KUhGdnFfW[/url]

Should it be like that? Should i use 64 or 256?

There is no video from it
gst-launch-1.0 nvcamerasrc fpsRange=“30.0 30.0” ! ‘video/x-raw(memory:NVMM), width=(int)1312, height=(int)977, format=(string)I420, framerate=(fraction)30/1’ ! nvvidconv flip-method=2 ! ‘video/x-raw(memory:NVMM), format=(string)I420’ ! fakesink silent=false -v

SCF: Error BadParameter: unsupported YUV format (odd w,h?) (in src/api/Session.cpp, function registerBuffer(), line 560)

it seems to be due to not standard resolution. What should i do in this case?

Help please.

@shcherbak.e
Correct my previous comment for the alignment. it should be TEGRA_STRIDE_ALIGNMENT in …/vi/core.h
For the unsupported resolution you need to modify it to none odd like 976

Where should i modify these values? There is 3 variants
: in dts
active_w = “1312”;
active_h = “976”;
: in tlbs
static const struct camera_common_frmfmt imx224_frmfmt = {
{{1312, 976}, imx224_30_fr, 1, 0, IMX224_MODE_1280X960},
{{1312, 976}, imx224_60_fr, 1, 0, IMX224_MODE_1280X960},

};
: in driver
#define IMX224_DEFAULT_WIDTH 1312
#define IMX224_DEFAULT_HEIGHT 977

if i put in driver IMX224_DEFAULT_HEIGHT to 976 i will get

[  374.420179] tegra-vi4 15700000.vi: Status:  4 channel:00 frame:0008
[  374.426690] tegra-vi4 15700000.vi:  timestamp sof 377187982048 eof 377188004032 data 0x00000100
[  374.436268] tegra-vi4 15700000.vi:          capture_id 3 stream  2 vchan  0
 
[  375.401112] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[  376.405089] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

if i put in driver IMX224_DEFAULT_HEIGHT to 978 i will get

tegra-vi4 15700000.vi: Status:  7 channel:00 frame:0008
tegra-vi4 15700000.vi:          timestamp sof 107324382848 eof 107353987488 data 0x00000001
tegra-vi4 15700000.vi:          capture_id 1 stream  2 vchan  0
 
tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

I left 977 in driver and changed it in tlbs and dtbs
no picture from gstreamer
gst-launch-1.0 nvcamerasrc num-buffers=200 sensor-id=0 ! ‘video/x-raw(memory:NVMM),width=1312, height=976, framerate=30/1, format=NV12’ ! omxh264enc ! qtmux ! filesink location=test.mp4 -ev

1

312 x 976 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1280 x 960 FR=60.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 0 WxH = 1312x976 FrameRate = 30.000000 ...

/GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4 
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a01481ee4001000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:video_0: caps = "video/x-h264\,\ alignment\=\(string\)au\,\ stream-format\=\(string\)avc\,\ width\=\(int\)1312\,\ height\=\(int\)976\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ codec_data\=\(buffer\)014240150301000a6742403495a01481ee4001000468ce3c80"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:src: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple"
/GstPipeline:pipeline0/GstQTMux:qtmux0.GstPad:src: caps = "video/quicktime\,\ variant\=\(string\)apple\,\ streamheader\=\(buffer\)\<\ 00000df76d6f6f760000006c6d76686400000000d68f82dfd68f82df0000070800000c10000100000100000000000000000000000001000000000000000000000000000000010000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000d467472616b0000005c746b686400000007d68f82dfd68f82df000000010000000000000c10000000000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000400000000520000003d0000000000ca56d646961000000206d64686400000000d68f82dfd68f82df00000bb80000141c000000000000002d68646c72000000006d686c72766964650000000000000000000000000c566964656f48616e646c657200000c506d696e6600000014766d68640000000100408000800080000000002168646c720000000064686c72616c6973000000000000000000000000000000002464696e660000001c6472656600000000000000010000000c616c69730000000100000bef7374626c0000009b7374736400000000000000010000008b61766331000000000000000100000000000000000000020000000200052003d0004800000048000000000000000100000000000000000000000000000000000000000000000000000000000000000018ffff0000002161766343014240150301000a6742403495a01481ee4001000468ce3c800000001462747274000000000000000000020ba5000004a07374747300000000000000920000000100001065000000010000000f0000000100000003000000010000000000000001000000020000000200000000000000010000001a000000020000000600000001000000000000000200000005000000020000000400000001000000020000000100000007000000010000000800000001000000060000000100000004000000010000000500000001000000040000000200000003000000010000000800000001000000060000000100000001000000010000000a0000000100000000000000010000000700000001000000010000000200000004000000010000000300000001000000050000000300000006000000020000000500000002000000040000000100000005000000010000000400000001000000030000000100000005000000010000000400000001000000050000000100000004000000010000000600000003000000050000000100000004000000010000000500000002000000040000000200000005000000010000000600000001000000040000000100000003000000010000000600000001000000050000000100000004000000010000000500000001000000060000000200000005000000010000000400000001000000050000000200000004000000010000000500000001000000040000000100000005000000010000000600000001000000050000000100000004000000020000000500000002000000040000000100000005000000010000000400000002000000050000000100000004000000010000000700000004000000040000000100000006000000010000000500000001000000040000000200000006000000020000000500000001000000040000000200000005000000020000000400000002000000050000000100000004000000030000000500000001000000040000000300000005000000010000000400000002000000050000000100000004000000030000000500000001000000040000000200000005000000010000000400000001000000070000000100000005000000010000000400000004000000050000000100000004000000010000000500000001000000040000000100000006000000010000000400000001000000050000000200000004000000010000000600000001000000030000000100000006000000040000000500000001000000040000000100000005000000010000000400000001000000080000000100000002000000010000000500000001000000040000000100000005000000010000000700000002000000050000000100000004000000050000000500000001000000030000000300000005000000010000000400000001000000060000000100000005000000010000000400000003000000050000000100000004000000020000000500000001000000040000000100000005000000010000000600000001000000040000000100000005000000010000000400000001000000050000000200000006000000010000000500000001000000040000000100000005000000010000000400000002000000060000000100000004000000010000000500000001000000030000000100000004000000010000000600000001000000000000002c737473730000000000000007000000010000001f0000003d0000005b0000007900000097000000b50000001c737473630000000000000001000000010000000100000001000003347374737a0000000000000000000000c800000ec10000000c0000000c0000000c0000000c0000000c0000000b0000000c0000000c0000000c0000000b0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec30000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c000003307374636f00000000000000c80000002400000ee500000ef100000efd00000f0900000f1500000f2100000f2c00000f3800000f4400000f5000000f5b00000f6700000f7300000f7f00000f8b00000f9700000fa300000faf00000fbb00000fc700000fd300000fdf00000feb00000ff7000010030000100f0000101b00001027000010330000103f00001f0200001f0e00001f1a00001f2600001f3200001f3e00001f4a00001f5600001f6200001f6e00001f7a00001f8600001f9200001f9e00001faa00001fb600001fc200001fce00001fda00001fe600001ff200001ffe0000200a00002016000020220000202e0000203a00002046000020520000205e00002f1f00002f2b00002f3700002f4300002f4f00002f5b00002f6700002f7300002f7f00002f8b00002f9700002fa300002faf00002fbb00002fc700002fd300002fdf00002feb00002ff7000030030000300f0000301b00003027000030330000303f0000304b00003057000030630000306f0000307b00003f3c00003f4800003f5400003f6000003f6c00003f7800003f8400003f9000003f9c00003fa800003fb400003fc000003fcc00003fd800003fe400003ff000003ffc0000400800004014000040200000402c0000403800004044000040500000405c0000406800004074000040800000408c0000409800004f5900004f6500004f7100004f7d00004f8900004f9500004fa100004fad00004fb900004fc500004fd100004fdd00004fe900004ff5000050010000500d0000501900005025000050310000503d0000504900005055000050610000506d0000507900005085000050910000509d000050a9000050b500005f7600005f8200005f8e00005f9a00005fa600005fb200005fbe00005fca00005fd600005fe200005fee00005ffa00006006000060120000601e0000602a00006036000060420000604e0000605a00006066000060720000607e0000608a00006096000060a2000060ae000060ba000060c6000060d200006f9300006f9f00006fab00006fb700006fc300006fcf00006fdb00006fe700006ff300006fff0000700b00007017000070230000702f0000703b00007047000070530000705f0000706b0000003d75647461000000356d657461000000000000002168646c72000000006d686c726d6469720000000000000000000000000000000008696c73740000003d75647461000000356d657461000000000000002168646c72000000006d686c726d6469720000000000000000000000000000000008696c7374\ \>"
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = "video/quicktime\,\ variant\=\(string\)apple\,\ streamheader\=\(buffer\)\<\ 00000df76d6f6f760000006c6d76686400000000d68f82dfd68f82df0000070800000c10000100000100000000000000000000000001000000000000000000000000000000010000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000d467472616b0000005c746b686400000007d68f82dfd68f82df000000010000000000000c10000000000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000400000000520000003d0000000000ca56d646961000000206d64686400000000d68f82dfd68f82df00000bb80000141c000000000000002d68646c72000000006d686c72766964650000000000000000000000000c566964656f48616e646c657200000c506d696e6600000014766d68640000000100408000800080000000002168646c720000000064686c72616c6973000000000000000000000000000000002464696e660000001c6472656600000000000000010000000c616c69730000000100000bef7374626c0000009b7374736400000000000000010000008b61766331000000000000000100000000000000000000020000000200052003d0004800000048000000000000000100000000000000000000000000000000000000000000000000000000000000000018ffff0000002161766343014240150301000a6742403495a01481ee4001000468ce3c800000001462747274000000000000000000020ba5000004a07374747300000000000000920000000100001065000000010000000f0000000100000003000000010000000000000001000000020000000200000000000000010000001a000000020000000600000001000000000000000200000005000000020000000400000001000000020000000100000007000000010000000800000001000000060000000100000004000000010000000500000001000000040000000200000003000000010000000800000001000000060000000100000001000000010000000a0000000100000000000000010000000700000001000000010000000200000004000000010000000300000001000000050000000300000006000000020000000500000002000000040000000100000005000000010000000400000001000000030000000100000005000000010000000400000001000000050000000100000004000000010000000600000003000000050000000100000004000000010000000500000002000000040000000200000005000000010000000600000001000000040000000100000003000000010000000600000001000000050000000100000004000000010000000500000001000000060000000200000005000000010000000400000001000000050000000200000004000000010000000500000001000000040000000100000005000000010000000600000001000000050000000100000004000000020000000500000002000000040000000100000005000000010000000400000002000000050000000100000004000000010000000700000004000000040000000100000006000000010000000500000001000000040000000200000006000000020000000500000001000000040000000200000005000000020000000400000002000000050000000100000004000000030000000500000001000000040000000300000005000000010000000400000002000000050000000100000004000000030000000500000001000000040000000200000005000000010000000400000001000000070000000100000005000000010000000400000004000000050000000100000004000000010000000500000001000000040000000100000006000000010000000400000001000000050000000200000004000000010000000600000001000000030000000100000006000000040000000500000001000000040000000100000005000000010000000400000001000000080000000100000002000000010000000500000001000000040000000100000005000000010000000700000002000000050000000100000004000000050000000500000001000000030000000300000005000000010000000400000001000000060000000100000005000000010000000400000003000000050000000100000004000000020000000500000001000000040000000100000005000000010000000600000001000000040000000100000005000000010000000400000001000000050000000200000006000000010000000500000001000000040000000100000005000000010000000400000002000000060000000100000004000000010000000500000001000000030000000100000004000000010000000600000001000000000000002c737473730000000000000007000000010000001f0000003d0000005b0000007900000097000000b50000001c737473630000000000000001000000010000000100000001000003347374737a0000000000000000000000c800000ec10000000c0000000c0000000c0000000c0000000c0000000b0000000c0000000c0000000c0000000b0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec30000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c00000ec10000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c0000000c000003307374636f00000000000000c80000002400000ee500000ef100000efd00000f0900000f1500000f2100000f2c00000f3800000f4400000f5000000f5b00000f6700000f7300000f7f00000f8b00000f9700000fa300000faf00000fbb00000fc700000fd300000fdf00000feb00000ff7000010030000100f0000101b00001027000010330000103f00001f0200001f0e00001f1a00001f2600001f3200001f3e00001f4a00001f5600001f6200001f6e00001f7a00001f8600001f9200001f9e00001faa00001fb600001fc200001fce00001fda00001fe600001ff200001ffe0000200a00002016000020220000202e0000203a00002046000020520000205e00002f1f00002f2b00002f3700002f4300002f4f00002f5b00002f6700002f7300002f7f00002f8b00002f9700002fa300002faf00002fbb00002fc700002fd300002fdf00002feb00002ff7000030030000300f0000301b00003027000030330000303f0000304b00003057000030630000306f0000307b00003f3c00003f4800003f5400003f6000003f6c00003f7800003f8400003f9000003f9c00003fa800003fb400003fc000003fcc00003fd800003fe400003ff000003ffc0000400800004014000040200000402c0000403800004044000040500000405c0000406800004074000040800000408c0000409800004f5900004f6500004f7100004f7d00004f8900004f9500004fa100004fad00004fb900004fc500004fd100004fdd00004fe900004ff5000050010000500d0000501900005025000050310000503d0000504900005055000050610000506d0000507900005085000050910000509d000050a9000050b500005f7600005f8200005f8e00005f9a00005fa600005fb200005fbe00005fca00005fd600005fe200005fee00005ffa00006006000060120000601e0000602a00006036000060420000604e0000605a00006066000060720000607e0000608a00006096000060a2000060ae000060ba000060c6000060d200006f9300006f9f00006fab00006fb700006fc300006fcf00006fdb00006fe700006ff300006fff0000700b00007017000070230000702f0000703b00007047000070530000705f0000706b0000003d75647461000000356d657461000000000000002168646c72000000006d686c726d6469720000000000000000000000000000000008696c73740000003d75647461000000356d657461000000000000002168646c72000000006d686c726d6469720000000000000000000000000000000008696c7374\ \>"
Got EOS from element "pipeline0".
Execution ended after 0:00:02.529158592
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
^C

I hangs in the end

i cant start it second time

Setting pipeline to PAUSED ...
Socket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL ...
Freeing pipeline ...

Give me the manual where to change and where to leave 977 if it needed?

Should i increase or decrease max lines registers , because i use recommended parameter for this mode?

You can’t just change the DT and driver define you have to modify the sensor output size as 1312*976

Thank you for your help.
I`ve made a little progress. As i mentioned in my very first question I still have to use the coping mode for sensor. In my case vertical resolution is 4(blank pixels) + 1276(winwow size). There are no any mistakes in dmesg, the raw image is good.

The problem in color:

gst-launch-1.0 nvcamerasrc num-buffers=200 sensor-id=0 ! ‘video/x-raw(memory:NVMM),width=1280, height=960, framerate=30/1, format=NV12’ ! omxh264enc ! qtmux ! filesink location=test.mp4 -ev

[url]https://drive.google.com/open?id=1YHjcEV0ZbEijZSEZ6N-i-AgKWMMZ8ln0[/url]

Why it could happening ?
How to solve it ?

Thank you in advance

@shcherbak.e
That must be the color format is not as expect. Check the sensor driver to make sure the reg setting is correct.