NTSC field order flipped with e-CAMNT_MX53x

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NTSC field order flipped with e-CAMNT_MX53x

Jump to solution
3,369 Views
fcs
Contributor IV

We are capturing NTSC video using an e-consystems e-CAMNT_MX53x (using tvp5147m1_tvin.ko) plugged into an i.MX53 Quick Start Board.

We run the e-consystems demo program selecting option 2 for NTSC and option 5 to combine the odd and even fields.

The field order is flipped, I think it is related to analog PAL being "upper field first" and NTSC being "lower field first". It is as if the capture board never switches to NTSC field order.

We have tried two different NTSC video sources, one of which was a camcorder.

However there is no field order problem with PAL signals.

We believe there is something missing from the e-consystems drivers that tells the capture board to interpret the fields correctly. We have looked in the i.MX53 Reference Manual but haven't found what hardware interface controls this.

Labels (3)
0 Kudos
Reply
1 Solution
2,061 Views
fcs
Contributor IV

The NTSC field flip problem is solved.

I have found a bug in ipu_param_mem.h, the macro ipu_ch_param_mod_field can't handle negative signed values properly, as required to set a negative interlace offset (ILO). Same would probably apply to macro ipu_ch_param_set_field

View solution in original post

0 Kudos
Reply
6 Replies
2,061 Views
fcs
Contributor IV

TI replied to my query on their site very promptly

http://e2e.ti.com/support/data_converters/videoconverters/f/376/p/260421/911152.aspx

Seems the problem needs to be fixed using a negative Interlace Offset.

0 Kudos
Reply
2,062 Views
fcs
Contributor IV

The NTSC field flip problem is solved.

I have found a bug in ipu_param_mem.h, the macro ipu_ch_param_mod_field can't handle negative signed values properly, as required to set a negative interlace offset (ILO). Same would probably apply to macro ipu_ch_param_set_field

0 Kudos
Reply
2,061 Views
donfreiling
Contributor III

Hello,

Would you be able to post a patch for ipu_param_mem.h that fixes those macros? Thanks!

0 Kudos
Reply
2,061 Views
fcs
Contributor IV

I haven't written a patch for the macros, instead I used an unsigned value that yielded the desired signed value.

0 Kudos
Reply
2,061 Views
augusto
Contributor II

I have solved the problem setting NTSC active_top field to 4 in mxc_v4l2_capture.c

with a value of 3 as recommended around the community (instead of the default value 13), the captured frames stop rolling but the fields are flipped.

{   /*! NTSC */

     .v4l2_id = V4L2_STD_NTSC,

     .name = "NTSC",

     .raw_width = 720,   /* SENS_FRM_WIDTH */
     .raw_height = 525,   /* SENS_FRM_HEIGHT */
     .active_width = 720,   /* ACT_FRM_WIDTH */
     .active_height = 480,   /* ACT_FRM_HEIGHT */

     .active_top = 4,

     .active_left = 0,

     },

0 Kudos
Reply
2,061 Views
fcs
Contributor IV

I am looking into the control registers for the TVP5147M1. I have tried setting

tvp5147m1_write_reg(REG_SYNC_CONTROL, 0x10);

to change the polarity of the FID (Field ID?)

and

tvp5147m1_write_reg(REG_FID_CONTROL, 0x01 );

where I’ve defined

#define REG_FID_CONTROL                         (0x57)

http://pdf1.alldatasheet.com/datasheet-pdf/view/227323/TI/TVP5147M1.html

I have tried each of the above together and alone (with the other defaulted) and nothing has changed the field order problem with NTSC. I note that it looks OK when the image is slowly rolling before synchronisation, but not when it has ceased rolling.

2.11.26 Sync Control Register

Subaddress 32h

Default 00h

7 6 5 4 3 2 1 0

Reserved Polarity FID Polarity VS Polarity HS VS/VBLK HS/CS

Polarity FID: determines polarity of FID terminal

0 = First field high, second field low (default)

1 = First field low, second field high

2.11.48 Field ID Control Register

Subaddress 57h

Default 00h

7 6 5 4 3 2 1 0

656 version FID control

656 Version

0 = ITU-R BT.656-4 (default)

1 = ITU-R BT.656-3

FID control

0 = 0→1 adapts to field 1, 1→0 adapts to field 1+ field 2 (default)

1 = 0→1 adapts to field 2, 1→0 adapts to field 1+ field 2 (for TVP5147M1 EVM)

0 Kudos
Reply