Skip to contentSkip to conversation

TDA9887 PAL-Nc fix

PATCH In review Gonzalo de la Vega 4 participants 6 messages Apr 18, 2012 – Apr 20, 2012 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TDA9887 PAL-Nc fix

The tunner IF for PAL-Nc norm, which AFAIK is used only in Argentina, was being defined as equal to PAL-M but it is not. It actually uses the same video IF as PAL-BG (and unlike PAL-M) but the audio is at 4.5MHz (same as PAL-M). A separate structure member was added for PAL-Nc.

drivers/media/common/tuners/tda9887.c +13 -2
index cdb645d..b560b5d 100644
@@ -168,8 +168,8 @@ static struct tvnorm tvnorms[] = {
 			   cAudioIF_6_5   |
 			   cVideoIF_38_90 ),
 	},{
-		.std   = V4L2_STD_PAL_M | V4L2_STD_PAL_Nc,
-		.name  = "PAL-M/Nc",
+		.std   = V4L2_STD_PAL_M,
+		.name  = "PAL-M",
 		.b     = ( cNegativeFmTV  |
 			   cQSS           ),
 		.c     = ( cDeemphasisON  |
@@ -179,6 +179,17 @@ static struct tvnorm tvnorms[] = {
 			   cAudioIF_4_5   |
 			   cVideoIF_45_75 ),
 	},{
+		.std   = V4L2_STD_PAL_Nc,
+		.name  = "PAL-Nc",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis75  |
+			   cTopDefault),
+		.e     = ( cGating_36     |
+			   cAudioIF_4_5   |
+			   cVideoIF_38_90 ),
+	},{
 		.std   = V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H,
 		.name  = "SECAM-BGH",
 		.b     = ( cNegativeFmTV  |
#1 lore raw
Quoted 3 lines · Gonzalo de la Vega

The tunner IF for PAL-Nc norm, which AFAIK is used only in Argentina, was being defined as equal to PAL-M but it is not. It actually uses the same video IF as PAL-BG (and unlike PAL-M) but the audio is at 4.5MHz (same as PAL-M). A separate structure member was added for PAL-Nc.

Hmmm.

The Video IF for N systems is 45.75 MHz according to this popular book (see page 29 of the PDF):
http://www.deetc.isel.ipl.pt/Analisedesinai/sm/downloads/doc/ch08.pdf

The Video IF is really determined by the IF SAW filter used in your tuner assembly, and how the tuner data sheet says to program the mixer/oscillator chip to mix down from RF to IF.

What model analog tuner assembly are you using? It could be that the linux tuner-simple module is setting up the mixer/oscillator chip wrong.

Regards,
Andy

Quoted 38 lines
drivers/media/common/tuners/tda9887.c +13 -3
index cdb645d..b560b5d 100644
@@ -168,8 +168,8 @@ static struct tvnorm tvnorms[] = {
 			   cAudioIF_6_5   |
 			   cVideoIF_38_90 ),
 	},{
-		.std   = V4L2_STD_PAL_M | V4L2_STD_PAL_Nc,
-		.name  = "PAL-M/Nc",
+		.std   = V4L2_STD_PAL_M,
+		.name  = "PAL-M",
 		.b     = ( cNegativeFmTV  |
 			   cQSS           ),
 		.c     = ( cDeemphasisON  |
@@ -179,6 +179,17 @@ static struct tvnorm tvnorms[] = {
 			   cAudioIF_4_5   |
 			   cVideoIF_45_75 ),
 	},{
+		.std   = V4L2_STD_PAL_Nc,
+		.name  = "PAL-Nc",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis75  |
+			   cTopDefault),
+		.e     = ( cGating_36     |
+			   cAudioIF_4_5   |
+			   cVideoIF_38_90 ),
+	},{
 		.std   = V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H,
 		.name  = "SECAM-BGH",
 		.b     = ( cNegativeFmTV  |
--

To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 15 lines · Andy Walls
Quoted 3 lines · Gonzalo de la Vega

The tunner IF for PAL-Nc norm, which AFAIK is used only in Argentina, was being defined as equal to PAL-M but it is not. It actually uses the same video IF as PAL-BG (and unlike PAL-M) but the audio is at 4.5MHz (same as PAL-M). A separate structure member was added for PAL-Nc.

Hmmm.

The Video IF for N systems is 45.75 MHz according to this popular book (see page 29 of the PDF):
http://www.deetc.isel.ipl.pt/Analisedesinai/sm/downloads/doc/ch08.pdf

The Video IF is really determined by the IF SAW filter used in your tuner assembly, and how the tuner data sheet says to program the mixer/oscillator chip to mix down from RF to IF.

Quoted 5 lines

What model analog tuner assembly are you using?  It could be that the linux tuner-simple module is setting up the mixer/oscillator chip wrong.

Regards,
Andy

Hi Andy,
first of all and to clarify things: I could not tune analog TV without this patch, or I could barely see a BW image. With the patch applied, I can see image in full color and with good sound. So it works with the patch, it does not work without it.

Now, I'm not an expert on TV (I am an electronics engineer thou) so I am having some trouble trying to put together what I read in the TDA9887 datasheet and the reference you sent. The thing with PAL-Nc is that it has a video bandwidth of 4.2MHz not 5.0MHz (page 51) and the attenuation of color difference signals for >20dB is at 3.6MHz instead of 4MHz (page 54). You can just search for "Argentina" inside the document.

So, this works... but now I'm not sure why. I guess cVideoIF_38_90 is compensating for the bandwidth difference. I need to study this.

Gonzalo

Quoted 41 lines
Quoted 39 lines
drivers/media/common/tuners/tda9887.c +0 -0
index cdb645d..b560b5d 100644
@@ -168,8 +168,8 @@ static struct tvnorm tvnorms[] = {

                         cAudioIF_6_5   | cVideoIF_38_90 ),
      },{
-             .std   = V4L2_STD_PAL_M | V4L2_STD_PAL_Nc,
-             .name  = "PAL-M/Nc",
+             .std   = V4L2_STD_PAL_M,
+             .name  = "PAL-M",
              .b     = ( cNegativeFmTV  |
                         cQSS           ),
              .c     = ( cDeemphasisON  |

drivers/media/common/tuners/tda9887.c +0 -0
@@ -179,6 +179,17 @@ static struct tvnorm tvnorms[] = {

                         cAudioIF_4_5   |
                         cVideoIF_45_75 ),
      },{
+             .std   = V4L2_STD_PAL_Nc,
+             .name  = "PAL-Nc",
+             .b     = ( cNegativeFmTV  |
+                        cQSS           ),
+             .c     = ( cDeemphasisON  |
+                        cDeemphasis75  |
+                        cTopDefault),
+             .e     = ( cGating_36     |
+                        cAudioIF_4_5   |
+                        cVideoIF_38_90 ),
+     },{
              .std   = V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H, .name  = "SECAM-BGH",
              .b     = ( cNegativeFmTV  |
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#3 lore raw

Buenos dias Gonzalo,

Em 20-04-2012 11:01, Gonzalo A. de la Vega escreveu:

Quoted 36 lines · Andy Walls
Quoted 15 lines · Gonzalo de la Vega
Quoted 3 lines

The tunner IF for PAL-Nc norm, which AFAIK is used only in Argentina, was being defined as equal to PAL-M but it is not. It actually uses the same video IF as PAL-BG (and unlike PAL-M) but the audio is at 4.5MHz (same as PAL-M). A separate structure member was added for PAL-Nc.

Hmmm.

The Video IF for N systems is 45.75 MHz according to this popular book (see page 29 of the PDF):
http://www.deetc.isel.ipl.pt/Analisedesinai/sm/downloads/doc/ch08.pdf

The Video IF is really determined by the IF SAW filter used in your tuner assembly, and how the tuner data sheet says to program the mixer/oscillator chip to mix down from RF to IF.

Quoted 5 lines

What model analog tuner assembly are you using? It could be that the linux tuner-simple module is setting up the mixer/oscillator chip wrong.

Regards,
Andy

Hi Andy,
first of all and to clarify things: I could not tune analog TV without this patch, or I could barely see a BW image. With the patch applied, I can see image in full color and with good sound. So it works with the patch, it does not work without it.

Now, I'm not an expert on TV (I am an electronics engineer thou) so I am having some trouble trying to put together what I read in the TDA9887 datasheet and the reference you sent. The thing with PAL-Nc is that it has a video bandwidth of 4.2MHz not 5.0MHz (page 51) and the attenuation of color difference signals for >20dB is at 3.6MHz instead of 4MHz (page 54). You can just search for "Argentina" inside the document.

Quoted 4 lines

So, this works... but now I'm not sure why. I guess cVideoIF_38_90 is compensating for the bandwidth difference. I need to study this.

From other discussions we've had at the ML, it seems that devices sold in

Argentina with analog tuners sometimes come with a NTSC tuner, and sometimes come with an European PAL tuner. They solve the frequency shifts that happen there via some tda9887 (and/or tuner-simple) adjustments.

It seems that the setup, when using one type, is different than the other.

That's why we need to know exactly what it is the tuner that your device has.

So, from time to time, we receive patches from someone in Argentina fixing support for one type, but breaking support for the other type.

What we need is that someone with technical expertise and with the two types of devices, with access to real PAL-Nc signals, to work on a solution that would set it accordingly, depending on the actual tuner used on it.

Regards,
Mauro

#4 lore raw

Hola ;)

Quoted 11 lines

From other discussions we've had at the ML, it seems that devices sold in Argentina with analog tuners sometimes come with a NTSC tuner, and sometimes come with an European PAL tuner. They solve the frequency shifts that happen there via some tda9887 (and/or tuner-simple) adjustments.

It seems that the setup, when using one type, is different than the other.

That's why we need to know exactly what it is the tuner that your device has.

Quoted 7 lines

So, from time to time, we receive patches from someone in Argentina fixing support for one type, but breaking support for the other type.

What we need is that someone with technical expertise and with the two types of devices, with access to real PAL-Nc signals, to work on a solution that would set it accordingly, depending on the actual tuner used on it.

I live in Argentina, and have access to digital signal and some tuners. Perhaps I could
help, provided someone cares to send me the relevant devices?

Gonzalo: What device is that?

#5 lore raw
In reply to Gonzalo A. de la Vega
Quoted 19 lines · Gonzalo A. de la Vega
Quoted 18 lines · Andy Walls
Quoted 3 lines · Gonzalo de la Vega

The tunner IF for PAL-Nc norm, which AFAIK is used only in Argentina, was being defined as equal to PAL-M but it is not. It actually uses the same video IF as PAL-BG (and unlike PAL-M) but the audio is at 4.5MHz (same as PAL-M). A separate structure member was added for PAL-Nc.

Hmmm.

The Video IF for N systems is 45.75 MHz according to this popular book (see page 29 of the PDF):
http://www.deetc.isel.ipl.pt/Analisedesinai/sm/downloads/doc/ch08.pdf

The Video IF is really determined by the IF SAW filter used in your tuner assembly, and how the tuner data sheet says to program the mixer/oscillator chip to mix down from RF to IF.

What model analog tuner assembly are you using? It could be that the linux tuner-simple module is setting up the mixer/oscillator chip wrong.

Quoted 8 lines
Quoted 2 lines

Regards,
Andy

Hi Andy,
first of all and to clarify things: I could not tune analog TV without this patch, or I could barely see a BW image. With the patch applied, I can see image in full color and with good sound. So it works with the patch, it does not work without it.

I believe you. However, I beleive your fix is in the wrong place. Every M/N tuner datahseet that I have seen, specifies a Video IF of 45.75 MHz.

Quoted 3 lines

Now, I'm not an expert on TV (I am an electronics engineer thou) so I am having some trouble trying to put together what I read in the TDA9887 datasheet and the reference you sent.

Here's a datasheet for the LG TAPE-H091F tuner (M/N using a TDA9887):
http://dl.ivtvdriver.org/datasheets/tuners/TAPE-H091F_MK3.pdf
Look at the block diagram on page 26. This design is very typical of analog tuner assemblies.

The IF SAW filter is fixed. I could program the mixer/oscialltor chip and the TDA9887 IF decoder chip so the Video IF in use was 38.90 MHz, and probably get a viewable TV picture. That doesn't mean using 38.90 MHz is right, if the IF SAW filter is fixed and centered at 45.75 MHz.

Quoted 6 lines

The thing with PAL-Nc is
that it has a video bandwidth of 4.2MHz not 5.0MHz (page 51) and the attenuation of color difference signals for >20dB is at 3.6MHz instead of 4MHz (page 54). You can just search for "Argentina" inside the document.

Yes, that's fine.

The Video IF is what I am concerned about. Your change could break other tuners and/or the linux tuner-simple.ko module is programming some(?) tuners wrong for PAL-N and PAL-Nc

By the way, this document describes PAL Combination N (-Nc) as a difference from PAL-N:
ITU-R BT.470-6
http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf

Argentine Law 21.895, October 1978, wasn't much help in describing the technical aspects of PAL-Nc:
http://www.infojus.gov.ar/index.php?kk_seccion=documento&registro=LEYNAC&docid=LEY%2520C%2520021895%25201978%252010%252030

Quoted 1 line

So, this works... but now I'm not sure why.

Likely the tuner-simple.ko module is programming the mixer oscillator component for the 38.90 MHz IF. That may be right or wrong, depending on you exact tuner model.

Again, what exact tuner assembly are you using?

Quoted 2 lines

I guess cVideoIF_38_90 is
compensating for the bandwidth difference. I need to study this.

Nope. It is just matching how the tuner-simple.ko module programmed the mixer/oscillator chip.

Regards,
Andy

Quoted 47 lines

Gonzalo

Quoted 31 lines
Quoted 31 lines
drivers/media/common/tuners/tda9887.c +12 -2
index cdb645d..b560b5d 100644
@@ -168,8 +168,8 @@ static struct tvnorm tvnorms[] = {
                         cAudioIF_6_5   |
                         cVideoIF_38_90 ),
      },{
-             .std   = V4L2_STD_PAL_M | V4L2_STD_PAL_Nc,
-             .name  = "PAL-M/Nc",
+             .std   = V4L2_STD_PAL_M,
+             .name  = "PAL-M",
              .b     = ( cNegativeFmTV  |
                         cQSS           ),
              .c     = ( cDeemphasisON  |
@@ -179,6 +179,17 @@ static struct tvnorm tvnorms[] = {
                         cAudioIF_4_5   |
                         cVideoIF_45_75 ),
      },{
+             .std   = V4L2_STD_PAL_Nc,
+             .name  = "PAL-Nc",
+             .b     = ( cNegativeFmTV  |
+                        cQSS           ),
+             .c     = ( cDeemphasisON  |
+                        cDeemphasis75  |
+                        cTopDefault),
+             .e     = ( cGating_36     |
+                        cAudioIF_4_5   |
+                        cVideoIF_38_90 ),
Quoted 10 lines
Quoted 8 lines
drivers/media/common/tuners/tda9887.c +1 -1
+     },{
              .std   = V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H,
              .name  = "SECAM-BGH",
              .b     = ( cNegativeFmTV  |
--

To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html