Post Go back to editing

ADV7181C Letterbox detection issue

Thread Summary

The user encountered issues with letterbox detection on the ADV7181C when using a 16:9 PAL video source, with LB_LCT and LB_LCB registers always reading 0x00. The problem was resolved by testing with different PAL signal sources, confirming that the issue was specific to the original head station signal. The support engineer provided the correct LB_SL and LB_EL values for PAL and suggested checking the decoder lock status and experimenting with LB_TH, LB_SL, and LB_EL settings.
AI Generated Content

Hi!

We are using ADV7181c to receive CVBS analog video (PAL) in our system.

And we should implement some kind of aspect ratio detection with ADV7181c yet...

It's described in ADV7181C_Manual.pdf (document revision: Rev0, date: 07/2008) p.183 that the chip is suitable for letterbox detection.

But we've got an issue with this function.

The values received by reading LB_LCT and LB_LCB registers (0x9B and 0x9D) are always 0x00. So letterbox black lines are not detected.

But we use 16x9 wide screen PAL video for tests and see this black lines on TV screen...

I've tried to play with the Letterbox Threshold Control increasing and also decreasing threshold, but it didn't help.

I've also tried to change Letterbox Start Line / End Line (register 0xDD), but also without any effect... 

By the way, please, can you explain how LB_SL and LB_EL should be coded in case of PAL (what means 0100 = 23/286 NTSC etc) and what values are valid for PAL?

So, please, can you advice something to get this function working...

  • Hello,

    I'll check with an expert on this part. It's not a feature that gets used much that I'm aware of.

    Dave

  • Hello,

    Sorry for the delay-- we're going to run some tests in the lab on this.

    Dave

  • Hi,

    We ran some tests in the lab. We plugged in a PAL CVBS signal with a wide screen format from a DVD player into an evaluation board, and could observe the black bars at the top and bottom of the picture, and read back the number of black lines at the top and bottom with LB_LCT and LB_LCB.

    We used the ":AUTODETECT CVBS IN NTSC/PAL/SECAM, 8-Bit 422 encoder:" script from the ADV7181C_ADV7181C@_ADV7341-VER.3.2c.txt script file available here: https://ez.analog.com/docs/DOC-1621

    We observed that if the reserved bits (bits 5, 6 and 7) in Reg 0xDC were overwritten and set to 0 when changing the LB_TH value (Reg 0xDC[4:0]), we would no longer get the number of lines in LB_LCT and LB_LCB. They would always be 0x00.

    Did you overwrite the reserved bits in register 0xDC (Reg 0xDC[7:5]) when you get the issue? Or did you leave them to their default values (i.e. 0b101)?

  • Hi,

    1. We've checked the ":AUTODETECT CVBS IN NTSC/PAL/SECAM, 8-Bit 422 encoder:" script from the ADV7181C_ADV7181C@_ADV7341-VER.3.2c.txt  -  we are using the same script for ADV7181C.

    The only one difference in our case is that we use 27MHz Crystal for ADV7181C instead of 28MHz Crystal in script. So we've changed:

         42 1D 47 ; Enable 28MHz Crystal

    to

         42 1D 07

    to work with 27MHz.

    All other values are 100% the same...

    2. I leave the reserved bits in register 0xDC (Reg 0xDC[7:5]) to their defaults.

    To set LB_TH I read register 0xDC at first and then change only LB_TH bits (Reg 0xDC[4:0]) and write the value back to register. I've checked it also... The value I read always contains 0b101 in place of these bits.

    I've also tried to write 0xA0 | LB_TH_value for sure but it did not help...

    The values of LB_LCT and LB_LCB are always 0x00.

    Maybe the problem is in LB_SL and LB_EL (Reg 0xDD)? I've searched the docs from the link (https://ez.analog.com/docs/DOC-1621) but did not found any description of how to use it in case of PAL signal. I've met only something like :

         Example: 0100: 23/286 (NTSC)

         Example: 0101: 24/287 (NTSC) etc

    Can you please explain the usage of LB_SL and LB_EL in case of PAL (correspondence of the Reg values and the line numbers etc). And what may be the other possible reasons of the issue?

    I'll also run some tests with some other PAL CVBS signal sources for sure.

    Thanks in advance.

  • Hi,

    1. We tested this using a 27MHz crystal, still using the ":AUTODETECT CVBS IN NTSC/PAL/SECAM, 8-Bit 422 encoder:" script from the ADV7181C_ADV7181C@_ADV7341-VER.3.2c.txt, but with the crystal set to 27Mhz (42 1D 07).

    We could still observe the black bars at the top and bottom of the picture, and read back the number of black lines at the top and bottom with LB_LCT and LB_LCB. We left LB_TH, LB_SL and LB_EL set to the default values.

    2. For PAL, the values for LB_SL and LB_EL correspond to the following:

    LB_SL:

    0100 = line 23 for Field 1/line 336 for Field 2 in PAL mode

    0101 = line 24 for Field 1/line 337 for Field 2 in PAL mode

    etc...

    LB_EL:

    1101 = line 310 for Field 1/line 623 for Field 2 in PAL mode

    1100 = line 309 for Field 1/line 622 for Field 2 in PAL mode

    etc...

    3. Do you know the number of black lines per field provided by the video source you are using for your tests at the top and at the bottom of the active video?

    4. Can you experiment with LB_SL, LB_EL and LB_TH based on the characteristics of the video source you are using for your tests?

    5. Can you check the status register to make sure the decoder is properly locked to the CVBS input (IN_LOCK, Reg 0x10[0]; LOST_LOCK, Reg 0x10[1], INST_HLOCK, Reg 0x13[0])?

    6. Is your hardware different from the ADV7181C evaluation board (see evaluation board schematic available here:https://ez.analog.com/docs/DOC-1621)?

    7. Do you have an evaluation board? If yes, can you try your source with an ADV7181C evaluation board?

    8. Can you try different sources?

  • Hi,

    Thanks a lot for you help!

    We've tested letterbox detection with several other PAL signal sources and found that it works for ATV signal from TV broadcaster's cable with the default values (we've tested before with signal from our head station and letterbox was not detected in spite of the fact that we can see black lines on screen - perhaps the ATV modules of our head station are working not correct).

    So, thanks once more for the excellent support and kind regards!

  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin