Get the full greenscreen preview image when I use my dts file for imx219

system info :linux kernel 3.10.96 ,tx1 devkit.
1)I am porting the camera imx219 to tx1.Using my own dts. I attach my dts named tegra210-imx219-1cam.dts
And now I can see /dev/video and /dev/media0 after tx1 boot up ; I attach the boot dmesg named dmesg_6_0010_boot.log.in line 922-936 there are:

[    7.215543] vi vi: vi_probe: ++
[    7.223948] vi vi: initialized
[    7.230443] vi vi: parsing node /host1x/vi
[    7.237653] vi vi: handling endpoint /host1x/vi/ports/port@0/endpoint
[    7.247225] vi vi: parsing node /host1x/i2c@546c0000/imx219_c@10
[    7.256349] vi vi: handling endpoint /host1x/i2c@546c0000/imx219_c@10/ports/port@0/endpoint
[    7.267811] vi vi: subdev imx219 6-0010 bound
[    7.275209] vi vi: notify complete, all subdevs registered
[    7.283735] vi vi: creating links for entity imx219 6-0010
[    7.292251] vi vi: processing endpoint /host1x/i2c@546c0000/imx219_c@10/ports/port@0/endpoint
[    7.303850] vi vi: skipping channel port /host1x/i2c@546c0000/imx219_c@10:0
[    7.313863] vi vi: creating links for channels
[    7.321333] vi vi: processing endpoint /host1x/vi/ports/port@0/endpoint
[    7.331057] vi vi: creating link for channel vi-output-2
[    7.339476] vi vi: creating imx219 6-0010:0 -> vi-output-2:0 link

When I run the command

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvoverlaysink -ev

I get the full greenscreen preview image, and then the terminal shows:

Setting pipeline to PAUSED ...
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and Mjstreaming
Available Sensor modes : 
3280 x 2464 FR=21.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1920 x 1080 FR=30.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1640 x 1232 FR=30.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1280 x 720 FR=30.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
820 x 616 FR=30.000000 CF=0xf09208a10 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 1920x1080 FrameRate = 30.000000 ...

/GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstNvOverlaySink-nvoverlaysink:nvoverlaysink-nvoverlaysink0.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
Socket read error. Camera Daemon stopped functioning.....
Received error from camera daemon....exiting....
Got EOS from element "pipeline0".
Execution ended after 0:00:01.629210615
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I attach the dmesg_6_0010_preview_fail.log. at the end area , there is "cdma_timeout_handler:timeout ".
when I see then greenscreen, I see the nvcamera-daemon message:

ubuntu@tegra-ubuntu:~$ NvPclHwGetModuleList: No module data found
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
Sensor_LoadModeModeType: mode 3: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 3: Failed to load pixeltype
Sensor_LoadModeModeType: mode 4: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 4: Failed to load pixeltype
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
launchCC abort cc 104

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 105

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 106

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 107

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 108

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 109

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 110

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
Error: waitCsiFrameStart timeout guid 0
Error: waitCsiFrameStart Something went wrong with waiting on frame start
Error: waitCsiFrameStart Something went wrong with waiting on frame start

2)I also try v4l2-ctl

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=1 --stream-to=imx219.raw

dmesg shows:

[  247.880233] tegra_mipi_cal 700e3000.mipical: Mipi cal timeout,val:69a1, lanes:400000
[  248.080048] video4linux video0: frame start syncpt timeout!0

I attach the dmesg as dmesg_6_0010_v4l2_error_mipi_cal_timeout.log

  1. when I run media-ctl -d /dev/media0 -p ,I get:
Failed to enumerate /dev/media0 (-13)

And the result of command : v4l2-compliance :

ubuntu@tegra-ubuntu:~$ v4l2-compliance 
Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output-2, imx219 6-0010
	Bus info      : platform:vi:2
	Driver version: 3.10.96
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 1 Private Controls: 7

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		G_FMT:     1920x1080, 30314752, 1, 3840, 4147200, 8, 0, 0, feedcafe
		TRY/S_FMT: 3280x2464, 30314752, 1, 3840, 9461760, 8, 0, 0, feedcafe
		fail: v4l2-test-formats.cpp(668): Video Capture: TRY_FMT(G_FMT) != G_FMT
		test VIDIOC_TRY_FMT: FAIL
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		test Scaling: OK (Not Supported)

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:


Total: 42, Succeeded: 41, Failed: 1, Warnings: 0

that’s all. sorry for having so much messages .Because I don’t know which message is useful ,I write them all.
I search the forum for the problem similar to mine,and use the methord ,but I still haven’t solve my problem.
Regards.
tegra210-imx219-1cam.dts.c (4.34 KB)
dmesg_6_0010_boot.log (74.8 KB)
dmesg_6_0010_preview_fail.log (109 KB)
dmesg_6_0010_v4l2_error_mipi_cal_timeout.log (90.9 KB)

The camera daemon does not handle timeouts gracefully. If it doesn’t get an image it will crash, which is what you’re seeing. The green screen is just the default color being shown before it gets filled with actual image data (which doesn’t come).

Looks like the specific error is:

Sensor_LoadModeModeType: mode 0: Failed to load pixeltype

But your dts has the pixel type defined as “bayer_rggb” which should work.

Can you check to see if your s_stream function is being called? Just put a print at the top of it. The ISP is probably failing before it even calls it (which would cause the timeout). Is the source for your driver public? I could take a look.

As for that failure in the v4l2-compliance test it’s most likely because you haven’t implemented V4L2_CID_HDR_EN. Nvidia say’s it’s optional, but if you don’t have it then camera_common_try_fmt fails.

Here’s the repository for my working camera driver at r24.2, it can help to have multiple examples to look at.

https://github.com/DaxBot/daxc02/tree/r24.2

Hello Atrer,

thanks for your suggestion ,that is helpful.
As you suggested, I put a print on the top of the s_stream function. When I see the green screen , I find the program get in the s_stream function.
I connect the tx1 CVM to j106 without any extra modifications, and I can see the preview image on csi-c port.Then I check my camera board ,I find an hardware error. I will design a new camera board to see if I could get the preview successfully.
Even I can preview, using nacamera-daemon I still see the info “Failed to load pixeltype”.so i think that’s not the main reason that causes the green screen.
another quesion. I read your camera example.
I find there are 7 i2c busses in tx1, which are i2c0~i2c6. in your example they are :

i2c0 = "/i2c@7000c000";
i2c1 = "/i2c@7000c400";
i2c2 = "/i2c@7000c500";
i2c3 = "/i2c@7000c700";
i2c4 = "/i2c@7000d000";
i2c5 = "/i2c@7000d100";
i2c6 = "/host1x/i2c@546c0000";

I wanna use i2c to control six cameras which have the same i2c address 0x10,and design the camera board connecting to the 120pin port (camera connector) on tx1 devkit board. I intend to use one i2c bus control one camera.that is:
CSI-A -> i2c1 -> camera0
CSI-B -> i2c2 -> camera1
CSI-C -> i2c3 -> camera2
CSI-D -> i2c4 -> camera3
CSI-E -> i2c5 -> camera4
CSI-F -> i2c6 -> camera5
Do you think if my idea could work?
Thank you very much.

@BradleyY
Due to not all i2c pin were lay to expansion header. It’s better to use a i2c mux for multi sensor design. You can reference to E3333 to know it.

@ShaneCCC

Thanks for your reply,I find that the 120pin on tx devkit board only has i2c0 ,2 and 6.
I wonder why i2c6 is the subnode of /host1x, but the others are subnode of /.

Regards.

@ShaneCCC

I find the dts file for e3333. Doesn’t e3333 need extra c source code for making zImage ?
E3333 use tca9548 (i2c switch), we don’t need c file for tca9548?

Regards.

A side note, not really part of your current issue: zImage isn’t used with the 64-bit Tegras. Just the Image (uncompressed). You will probably have problems if you actually try to boot a zImage (not sure if it is predictable what would happen).

You may want to get a 6 camera kit from Leopard Imaging and they can provide you with schematics and drivers:
https://leopardimaging.com/product-category/nvidia-jetson-camera/nvidia_tx1tx2_camera_kit/

This only for your reference. If your design 100% the same with this board you don’t need any extra c source code. And tca95xx can enable by the kernel config.