Display problem using Analogue Camera Module ver. 2.0A and apalis IMX6

We get a result image with the two lines with right half black (with active deinterlace). command :

gst-launch-1.0 -v imxv4l2src ! imxipuvideotransform deinterlace=true ! imxv4l2sink

There is only one line with a default (the latest line of image) if no deinterlace, command :

gst-launch-1.0 -v imxv4l2src ! imxv4l2sink

We can also see the default with Freescale unit test :

/unit_tests/mxc_v4l2_tvin.out -ol 100 -ot 100 -ow 720 -oh 600

Is somethink need to be change in devicetree or adv7180.c file to avoid this problem ?

Best regards,
Gabriel GRANGE

Hi

I don’t really understand how your image looks from your description. Could you post a photo?

Note that on the ADV7280 has some sort of deinterlacer which we switched on in the Linux driver.
If you want to do the deinterlacing on the i.MX6 you would need to change the ADV7280 configuration in the driver. (the file is adv7280.c not 7180.c)

There is no device tree property which changes the adv7280 configuration.

What colour encoding schema does your analog source have? PAL, NTSC …

Max

link text

Hi,

I sent photo to show the problem. The input video signal is PAL 720x576 configuration. I test with two different video sources (pattern generator and PAL camera).
The problem is also present with freescale unit test :
/unit_tests/mxc_v4l2_tvin.out -ol 100 -ot 100 -ow 720 -oh 600
If we use it with desktop we can also see that the last line has a problem (black in end of line)
I send 20170926_mxc_v4l2_tvin_3.jpg file with /unit_tests/mxc_v4l2_tvin.out -ol 0 -ot 0 -ow 1024 -oh 768

Can you try if you have the same problem with PAL video source?
Best regards,
G.Grange
link text

I sent again photo we took with the problem :

[upload|Z8cAUlNHkwwTML8lu5lhaVuKvp0=]

[upload|JD4rE4HkUbTAvMi34ljfARm171Q=]

With /unit_tests/mxc_v4l2_tvin.out we have :

[upload|33RBvJtP39WE7VFMWITdXWQvpbY=]

[upload|iw6gJwCnhzLPMn7cNTwfRGlaV0Q=]

[upload|rCsUObCdO0vA6NlnsV5lBklZMCQ=]

Video source signal is PAL.
Regards,
G.Grange

Hi

The starting and ending in a half line is there by design. In interlaced PAL (and NTSC) the first field ends in the middle of the screen, the second fields first line starts in the middle. Compare with this picture.

The Canon camera I usually use as a CVBS source outputs ‘black’ in these two halve lines, so I do not notice the effect. I now also connected an old Panasonic video camera which also shows the effect.

I guess your pattern generator also provides a non black signal at both ‘halve’ lines and thus you see them in the digitized output.

Max

We made more test and it is perhaps a hardware problem with adv7180 because if we program a rectangle ad output ADV7180 digital signal, the result is correct. With shell we do :

Set ‘Boundary Box Test Pattern’ as output ADV7180 digital signal:

i2cset -f -y 3 0x21 0x14 0x5

The display result is perfect end lines are Ok:

gst-launch-1.0 -v imxv4l2src ! imxv4l2sink

or

/unit_tests/mxc_v4l2_tvin.out -ol 100 -ot 100 -ow 720 -oh 600

Do you think that is it a hardware ADV7180 problem with PAL 720x576 signal conversion ?

Best regards,
Gabriel GRANGE

Hi

Note that if you really have a ‘Analogue Camera Adapter V2.0A’ then the video ADC is a ADV7280, not ADV7180.

Do you think that is it a hardware ADV7180 problem with PAL 720x576 signal conversion ?

No, I think this is there by design. The analogue video signals are like that and if your video source does output something other than black on the top half line or on the bottom half line then you will see it in the digitized output.

You could crop the image e.g.

gst-launch-1.0 imxv4l2videosrc crop-meta-x=8 crop-meta-width=704 crop-meta-y=4 crop-meta-height=472  ! imxg2dvideotransform  ! imxeglvivsink -v

Maybe this wikipedia entry sheds also some light.

Max

Hi,

We test to change VBLANK management with adv7182 chip via EB/EC registers. But it has no change the begining and the end of acquisition result.

Of course, we can a good acquisition image result if we crop the last line :
gst-launch-1.0 -v imxv4l2src ! imxipuvideotransform deinterlace=true ! videocrop bottom=1 ! imxv4l2sink

But in fact, the end acquisition line is missing in that case.

I joint result for command :
gst-launch-1.0 imxv4l2videosrc crop-meta-x=8 crop-meta-width=704 crop-meta-y=4 crop-meta-height=472 ! imxg2dvideotransform ! imxeglvivsink -v
[upload|ITS9214braRUGJYoIe6KTOdXAvk=]
[upload|bRVo8l6lFBpF+r+d5AVO19crNVE=]

alt text
[upload|fd714CWFAkv2rbw3OkCI5N8PGTA=]

We still try to have correct 720x576 image from adv but it seem to be hard to change the acquisition system parameter.

Regards,
G.Grange

As Max already explained you, the half line issue is not an error, it is by design of the PAL interlace system. PAL was a completely analog TV system invented couple of decades ago. In order to create the interlaces image on a CRT screen, the first half image (field) had to end with a half line. This allows the vertical deflection of the CRT to wirte the lines of the second field between the lines of the first field. This half line creates the offset for write the lines of the second field to the correct position. The second field starts then with another half line. The issue is also explained in this paragraph of the wiki article Max already linked to you:

625-line analogue video contains 575 active video lines[12] (this includes two half lines). When the half lines are rounded up to whole lines for ease of digital representation, this gives 576 lines, which is also the nearest mod(16) value to 575. To maintain the same picture aspect ratio, the number of active pixels could be increased to 703.2, which can be rounded up to 704 https://en.wikipedia.org/wiki/Overscan#Analog_to_digital_resolution_issues

The reason why this effect can only be seen with certain sources is that some sources blank the two half lines. Therefore, the half lines are invisible. On CRTs you also do not see these half lines since the images on CRT TVs are always cropped. When you use a VHS tape signal as input, the last couple of lines are even worse. The head switching noise of the VHS system creates sync issues in the last couple of lines of each field ( see also Head Switching Noise | AVAA). Again, this noise was not an issue with CRT TVs since they cropped the image by design. Modern LCD, plasma, or OLED TV sets are usually still cropping the PAL input signal in order to prevent these issues. The cropping is called overscan.

The conclusion is: you have to crop your image if you need to avoid the effect of having half lines at the bottom and top of the image.