OV4689 bayer sensor support

Dear all,

Now I want to use ISP of tegra instead of ISP inside camera module so I decide to use OV4689 sensor.
Based on current OV5693 driver, I made OV4689 driver almost same. But now I can not capture or streaming anything.

This is the result when I run v4l2-compliance -d /dev/video0

Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output-0, ov4689 6-0010
	Bus info      : platform:vi:0
	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
		test VIDIOC_TRY_FMT: OK
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		fail: v4l2-test-formats.cpp(1257): doioctl(node, VIDIOC_G_SELECTION, &sel)
		fail: v4l2-test-formats.cpp(1270): testLegacyCrop(node)
		test Cropping: FAIL
		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

When I try to capture with this command

gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! "video/x-bayer, format=rggb, width=1920, height=1080" ! filesink location=test_1920x1080.bayer

Then the result like this

[  799.576029] [vunguyen] ov4689_power_on
[  799.647349] tegra_mipi_cal 700e3000.mipical: Mipi cal timeout,val:1178b0, lanes:300000
[  799.847400] video4linux video0: frame start syncpt timeout!0
[  800.057478] video4linux video0: frame start syncpt timeout!0
[  800.072565] [vunguyen] ov4689_power_off

If I use Nvcamerasrc :

DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink -e

then

[  935.055408] [vunguyen] ov4689_power_on
[  935.059499] [vunguyen] ov4689_power_off
[  935.083958] [vunguyen] ov4689_power_on
[  935.087741] [vunguyen] ov4689_power_off
[  935.092157] [vunguyen] ov4689_power_on
[  935.095952] [vunguyen] ov4689_power_off
[  935.100004] [vunguyen] ov4689_power_on
[  935.103827] [vunguyen] ov4689_power_off
[  935.125978] pgd = ffffffc0a8b8a000
[  935.129509] [00000000] *pgd=000000016debf003, *pmd=0000000000000000
[  935.135929] Library at 0x40322c: 0x400000 /usr/sbin/nvcamera-daemon
[  935.142338] Library at 0x403228: 0x400000 /usr/sbin/nvcamera-daemon
[  935.148629] vdso base = 0x7fabb69000

Thanks and Best Regards,
Vu Nguyen

Hi Nguyen

  1. Use the v4l2-ctl to debug first.
  2. Make sure the power sequence is correct.
  3. Probe the MIPI signal to make sure it MIPI compliance.
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov.raw

Hi ShaneCCC,

How can I debug with v4l2-ctl, any specific command ?

And when I try to run this command

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

It stuck and print out these lines till stopping by Ctrl + C

[  286.523491] tegra_mipi_cal 700e3000.mipical: Mipi cal timeout,val:1178c0, lanes:300000
[  286.723520] video4linux video0: frame start syncpt timeout!0

Thanks

Hi
That means the VI didn’t get any data from MIPI bus.
You need to make sure the sensor is output data correct. And you may need to change the width and height if your sensor is not this resolution.

Hi ShaneCCC,

Is there any way to check sensor output data on software side ?

The width and height are correct to my sensor configuration.

Thanks

Hi
I am sorry to tell.
No, there’s no way to make sure of it.

Hi ShaneCCC,

When I try to plug camera out of socket, I got error when writing register mode table (via I2C?).
And it got success when I plug camera into socket again. So I don’t think hardware problem because last time I used UYVY sensor at the same socket and I work well.

Now when I run this command

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

It stuck and print out only this line till stopping by Ctrl + C

[   53.701486] video4linux video0: frame start syncpt timeout!0
[   53.911505] video4linux video0: frame start syncpt timeout!0
[   54.111264] video4linux video0: frame start syncpt timeout!0
....

May you figure out something?

Thanks

Hi forever
The i2c and MIPI bus is different things. I2C bus use to program the sensor output data to MIPI bus. The problem is the MIPI timing or signal not follow the MIPI spec. And The MIPI timing can program the sensor to change it via i2c bus.