ADV7280m configuration

hi,
after reading the configuration of the ADV7280m this is the best that I could get to.

I have attached the driver that I have slightly modified, the device tree (camera-dummy), gstreamer debug data, terminal log, and trace data.

adv7180.c (48.6 KB) camera-dummy.dtsi (3.6 KB) gstreamer debug (12.0 KB) Terminal Log.txt (9.3 KB) trace (72.6 KB)

It looks like there might be format issues “libv4l2: error set_fmt gave us a different result then try_fmt!

Moreover if I run the following line
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY,width=720,height=576,framerate=(fraction)25/1’ ! xvimagesink
it fails to start a window with the encoded stream,

Only If I run the following for while:
gst-launch-1.0 v4l2src --gst-debug=GST_DEBUG=*:3,v4l2src:5 device=/dev/video0 ! nvvidconv ! fakesink
and then
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY,width=720,height=576,framerate=(fraction)25/1’ ! xvimagesink

Then it starts to display alternatly green screen and then an artifical screen from the ADV7280m, a movie is attached. I do not understnad why.

Another thing that I have noticed was running the following line
v4l2-compliance -d /dev/video0
I get a failure, which I think is because dv_timing reserved struct is not nullified, but I do, so I do not know the reason:

Driver Info:
Driver name : tegra-video
Card type : vi-output, adv7180 6-0021
Bus info : platform:15700000.vi:0
Driver version: 4.4.38
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

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)
fail: v4l2-test-io-config.cpp(174): TIMINGS cap not set, but could still get timings
fail: v4l2-test-io-config.cpp(239): Timings check failed for input 0.
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: FAIL
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: 6 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)
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

Any support will be appreciated.

Check the trace log.

https://elinux.org/Jetson_TX2_Camera_BringUp

@ShaneCCC, hi,

I’ve looked at the log, and it says that there is not signal while as the attached stream depicts there is a signal though not stable. could you tell what is the reason for the instability?

You need to make sure the signal is as the MIPI spec.

@ShaneCCC, hi,

it looks like we have a firm and good signal.

the following message libv4l2: error set_fmt gave us a different result then try_fmt! is printed because of the following:
src_fmt.fmt.pix.height = 576
req_pix_fmt.height=288 // 576/2

just a reminder PAL is 576 lines interlaced.

What’s v4l2-ctl --list-formats-ext shows, if report many formats modify the driver to report only one format should be able avoid the error.

@ShaneCCC, hi,

this is what I got, though the driver replies with a single format:

v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘UYVY’
Name : UYVY 4:2:2

Index : 1
Type : Video Capture
Pixel Format: ‘RGB3’ (emulated)
Name : RGB3

Index : 2
Type : Video Capture
Pixel Format: ‘BGR3’ (emulated)
Name : BGR3

Index : 3
Type : Video Capture
Pixel Format: ‘YU12’ (emulated)
Name : YU12

Index : 4
Type : Video Capture
Pixel Format: ‘YV12’ (emulated)
Name : YV12

Though, I have modified the driver and removed line 687-688

if (state->field == V4L2_FIELD_ALTERNATE)
fmt->height /= 2;
and now the drriver only replies with 576, though I’m not sure if this is correct for the analog interlaced video.
The warning message went a way, but I am still can see the interleaving video as above “Luma ramp” and green. I still get the time out errors.
any suggestions?

Still the same trace log?

@ShaneCCC, hi,

yes the same log. What puzzles me is the fact that the video outputs for many frames (~30, 1 second) and displays the color bar or whatever sinthetic pattern I select (color bar, rectangle, Luma ramp, this patterns are generated internally by the A2D) in good shape, each frame which is a combination of two interlaced fields provided by the A2D as a “good” progressive frame. So there cannot be any electrical issue between the A2D and the TX2. A Scope does not depict any discripancies to CSI (though I do not parse it).
I have also overwritten the A2D driver’s configuration by a script that analog devices provide (they are the same), with the same results.

any suggestions?

The solution was found upon implemention of the patch @ TX2-4GB NVCSI/VI error with JetPack 4.3 - #2 by ShaneCCC