diff mbox

tda8290 regression fix

Message ID 505EF455.9080604@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Sept. 23, 2012, 11:36 a.m. UTC
Em 22-09-2012 11:32, Anders Eriksson escreveu:
> Not to my knowledge. It's a standard antenna cable to my cabletv box. I watch tv over hdmi to get HD. I only use analogue (and this htpc card) to record stuff.

(please, don't top-post - it makes harder to preserve the history of the
 discussions)


Then, maybe that's the reason why you're having troubles with this board.

The tda8290-based devices have two components:

	1) a tda8275 tuner, at address 0x61 at the 7-bit I2C address notation
	  (or 0xc2, at the 8-bit notation);
	2) a tda8290 analog demod at address 0x4b (7-bit notation).

Some devices provide a way to send power to a low noise amplifier located at the
antenna or at the device itself (called LNA). The way to activate the LNA is
board-dependent.

On some devices the tda8290 can also be used to enable/disable a linear amplifier
(LNA). Enabling/disabling the LNA and its gain affects the quality of the signal.

In the case of tda8275/tda8290 based devices, the LNA setup type is stored at
priv->cfg->config, where:

	0 - means no LNA control at all - device won't use it;
	1, 2 - LNA is via a pin at tda8290 (GPIO 0):
		When config is 1, LNA high gain happens writing a 0;
		When config is 2, LNA high gain happens writing a 1;
	3 - The LNA gain control is via a pin at saa713x.

For modes 1 and 2, the switch_addr should be equal to 0x4b, as the commands
sent to the device are for the tda8290 chip; sending them to tda8275 will
likely produce no results or would affect something else there.

I suspect that, in the case of your board, the LNA is at the antenna bundled
together with the device. If I'm right, by enabling LNA, your board is sending
some voltage through the cabling (you could easily check it with a voltmeter).

What I think that your patch is actually doing is to disable LNA. As such, it
should be equivalent to:




Please test if the above patch fixes the issue you're suffering[1]. If so, then
we'll need to add a modprobe parameter to allow disabling LNA for saa7134 devices
with LNA.

[1] Note: the above is not the fix, as some users of this board may be using the
original antenna, and changing tuner_config will break things for them; the right
fix is likely to allow controlling the LNA via userspace.

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Anders Thomson Sept. 23, 2012, 5:54 p.m. UTC | #1
On 2012-09-23 13:36, Mauro Carvalho Chehab wrote:
> Em 22-09-2012 11:32, Anders Eriksson escreveu:
> >  Not to my knowledge. It's a standard antenna cable to my cabletv box. I watch tv over hdmi to get HD. I only use analogue (and this htpc card) to record stuff.
>
> (please, don't top-post - it makes harder to preserve the history of the
>   discussions)
Sorry about that. I was using my notsosmartphone.
>
> Then, maybe that's the reason why you're having troubles with this board.
>
> The tda8290-based devices have two components:
>
> 	1) a tda8275 tuner, at address 0x61 at the 7-bit I2C address notation
> 	  (or 0xc2, at the 8-bit notation);
> 	2) a tda8290 analog demod at address 0x4b (7-bit notation).
>
> Some devices provide a way to send power to a low noise amplifier located at the
> antenna or at the device itself (called LNA). The way to activate the LNA is
> board-dependent.
>
> On some devices the tda8290 can also be used to enable/disable a linear amplifier
> (LNA). Enabling/disabling the LNA and its gain affects the quality of the signal.
>
> In the case of tda8275/tda8290 based devices, the LNA setup type is stored at
> priv->cfg->config, where:
>
> 	0 - means no LNA control at all - device won't use it;
> 	1, 2 - LNA is via a pin at tda8290 (GPIO 0):
> 		When config is 1, LNA high gain happens writing a 0;
> 		When config is 2, LNA high gain happens writing a 1;
> 	3 - The LNA gain control is via a pin at saa713x.
>
> For modes 1 and 2, the switch_addr should be equal to 0x4b, as the commands
> sent to the device are for the tda8290 chip; sending them to tda8275 will
> likely produce no results or would affect something else there.
>
> I suspect that, in the case of your board, the LNA is at the antenna bundled
> together with the device. If I'm right, by enabling LNA, your board is sending
> some voltage through the cabling (you could easily check it with a voltmeter).
I actually have a multimeter somewhere. We're talking about the
antenna-in (unconnected) on the card, right? And what voltages
should I expect?
>
> What I think that your patch is actually doing is to disable LNA. As such, it
> should be equivalent to:
>
>
> diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c
> index bc08f1d..98b482e 100644
> --- a/drivers/media/pci/saa7134/saa7134-cards.c
> +++ b/drivers/media/pci/saa7134/saa7134-cards.c
> @@ -3288,13 +3288,13 @@ struct saa7134_board saa7134_boards[] = {
>   		.name           = "Pinnacle PCTV 310i",
>   		.audio_clock    = 0x00187de7,
>   		.tuner_type     = TUNER_PHILIPS_TDA8290,
>   		.radio_type     = UNSET,
>   		.tuner_addr     = ADDR_UNSET,
>   		.radio_addr     = ADDR_UNSET,
> -		.tuner_config   = 1,
> +		.tuner_config   = 0,
>   		.mpeg           = SAA7134_MPEG_DVB,
>   		.gpiomask       = 0x000200000,
>   		.inputs         = {{
>   			.name = name_tv,
>   			.vmux = 4,
>   			.amux = TV,
>
>
> Please test if the above patch fixes the issue you're suffering[1]. If so, then
> we'll need to add a modprobe parameter to allow disabling LNA for saa7134 devices
> with LNA.
>
> [1] Note: the above is not the fix, as some users of this board may be using the
> original antenna, and changing tuner_config will break things for them; the right
> fix is likely to allow controlling the LNA via userspace.
Tried that patch on 3.5.3. No improvement, unfortunately.

Regards,
/Anders
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mauro Carvalho Chehab Sept. 23, 2012, 6:14 p.m. UTC | #2
Em 23-09-2012 14:54, Anders Thomson escreveu:
> On 2012-09-23 13:36, Mauro Carvalho Chehab wrote:
>> Em 22-09-2012 11:32, Anders Eriksson escreveu:

>> I suspect that, in the case of your board, the LNA is at the antenna bundled
>> together with the device. If I'm right, by enabling LNA, your board is sending
>> some voltage through the cabling (you could easily check it with a voltmeter).
> I actually have a multimeter somewhere. We're talking about the
> antenna-in (unconnected) on the card, right? And what voltages
> should I expect?

zero (or close to zero) if LNA is disabled; some volts when LNA is enabled ;)
According with Wikipedia[1]:

Usually LNA require less operating voltage in the range of 2 .. 10 V. MAX 2640 operate at +2.7 .. +5.5 V.

[1] http://en.wikipedia.org/wiki/Low-noise_amplifier

(Satellites amplifiers are typically 13V-18V - I never actually tried to use LNA for
 terrestrial systems).

>>
>> What I think that your patch is actually doing is to disable LNA. As such, it
>> should be equivalent to:
>>
>>
>> diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c
>> index bc08f1d..98b482e 100644
>> --- a/drivers/media/pci/saa7134/saa7134-cards.c
>> +++ b/drivers/media/pci/saa7134/saa7134-cards.c
>> @@ -3288,13 +3288,13 @@ struct saa7134_board saa7134_boards[] = {
>>           .name           = "Pinnacle PCTV 310i",
>>           .audio_clock    = 0x00187de7,
>>           .tuner_type     = TUNER_PHILIPS_TDA8290,
>>           .radio_type     = UNSET,
>>           .tuner_addr     = ADDR_UNSET,
>>           .radio_addr     = ADDR_UNSET,
>> -        .tuner_config   = 1,
>> +        .tuner_config   = 0,
>>           .mpeg           = SAA7134_MPEG_DVB,
>>           .gpiomask       = 0x000200000,
>>           .inputs         = {{
>>               .name = name_tv,
>>               .vmux = 4,
>>               .amux = TV,
>>
>>
>> Please test if the above patch fixes the issue you're suffering[1]. If so, then
>> we'll need to add a modprobe parameter to allow disabling LNA for saa7134 devices
>> with LNA.
>>
>> [1] Note: the above is not the fix, as some users of this board may be using the
>> original antenna, and changing tuner_config will break things for them; the right
>> fix is likely to allow controlling the LNA via userspace.
> Tried that patch on 3.5.3. No improvement, unfortunately.

That's weird. Well, then we need to read tda827x datasheets and to try get information
data from Pinnacle about this specific device configuration.

> 
> Regards,
> /Anders

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Anders Thomson Sept. 23, 2012, 6:39 p.m. UTC | #3
On 2012-09-23 19:54, Anders Thomson wrote:
> >  diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c
> >  index bc08f1d..98b482e 100644
> >  --- a/drivers/media/pci/saa7134/saa7134-cards.c
> >  +++ b/drivers/media/pci/saa7134/saa7134-cards.c
> >  @@ -3288,13 +3288,13 @@ struct saa7134_board saa7134_boards[] = {
> >    		.name           = "Pinnacle PCTV 310i",
> >    		.audio_clock    = 0x00187de7,
> >    		.tuner_type     = TUNER_PHILIPS_TDA8290,
> >    		.radio_type     = UNSET,
> >    		.tuner_addr     = ADDR_UNSET,
> >    		.radio_addr     = ADDR_UNSET,
> >  -		.tuner_config   = 1,
> >  +		.tuner_config   = 0,
> >    		.mpeg           = SAA7134_MPEG_DVB,
> >    		.gpiomask       = 0x000200000,
> >    		.inputs         = {{
> >    			.name = name_tv,
> >    			.vmux = 4,
> >    			.amux = TV,
> >
> >
> >  Please test if the above patch fixes the issue you're suffering[1]. If so, then
> >  we'll need to add a modprobe parameter to allow disabling LNA for saa7134 devices
> >  with LNA.
> >
> >  [1] Note: the above is not the fix, as some users of this board may be using the
> >  original antenna, and changing tuner_config will break things for them; the right
> >  fix is likely to allow controlling the LNA via userspace.
> Tried that patch on 3.5.3. No improvement, unfortunately.
I have to retract that. It turns out that there is some strange interaction
between the cabletv box and the card. When I rebooted into 'my' patch
I still got the noisy signal. I then power cycled the cabletv box, and 
voila,
I got a good signal on my own patch. Wondering what I had actually tested
with your patch, I tested it again, and indeed it works!

So, 1) you're on to something, that's for sure, and 2) there is 
_something_ in
the cabletv box which can make all this fall into a bad state too.

Cheers,
/Anders




--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Anders Thomson Sept. 23, 2012, 9:06 p.m. UTC | #4
On 2012-09-23 20:39, Anders Thomson wrote:
> On 2012-09-23 19:54, Anders Thomson wrote:
> >  >   diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c
> >  >   index bc08f1d..98b482e 100644
> >  >   --- a/drivers/media/pci/saa7134/saa7134-cards.c
> >  >   +++ b/drivers/media/pci/saa7134/saa7134-cards.c
> >  >   @@ -3288,13 +3288,13 @@ struct saa7134_board saa7134_boards[] = {
> >  >     		.name           = "Pinnacle PCTV 310i",
> >  >     		.audio_clock    = 0x00187de7,
> >  >     		.tuner_type     = TUNER_PHILIPS_TDA8290,
> >  >     		.radio_type     = UNSET,
> >  >     		.tuner_addr     = ADDR_UNSET,
> >  >     		.radio_addr     = ADDR_UNSET,
> >  >   -		.tuner_config   = 1,
> >  >   +		.tuner_config   = 0,
> >  >     		.mpeg           = SAA7134_MPEG_DVB,
> >  >     		.gpiomask       = 0x000200000,
> >  >     		.inputs         = {{
> >  >     			.name = name_tv,
> >  >     			.vmux = 4,
> >  >     			.amux = TV,
> >  >
> >  >
> >  >   Please test if the above patch fixes the issue you're suffering[1]. If so, then
> >  >   we'll need to add a modprobe parameter to allow disabling LNA for saa7134 devices
> >  >   with LNA.
> >  >
> >  >   [1] Note: the above is not the fix, as some users of this board may be using the
> >  >   original antenna, and changing tuner_config will break things for them; the right
> >  >   fix is likely to allow controlling the LNA via userspace.
> >  Tried that patch on 3.5.3. No improvement, unfortunately.
> I have to retract that. It turns out that there is some strange interaction
> between the cabletv box and the card. When I rebooted into 'my' patch
> I still got the noisy signal. I then power cycled the cabletv box, and
> voila,
> I got a good signal on my own patch.
Awfully sorry about this. After having had the familty sit in and check 
the differences,
I must say that the patch does not fix the issue. This time around I 
have x11grabs with
ffmpeg to show if you want.

I'll be away from the card until the end of the coming week. Then, I'll 
bring out the multimeter...

Best regards,
/Anders
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c
index bc08f1d..98b482e 100644
--- a/drivers/media/pci/saa7134/saa7134-cards.c
+++ b/drivers/media/pci/saa7134/saa7134-cards.c
@@ -3288,13 +3288,13 @@  struct saa7134_board saa7134_boards[] = {
 		.name           = "Pinnacle PCTV 310i",
 		.audio_clock    = 0x00187de7,
 		.tuner_type     = TUNER_PHILIPS_TDA8290,
 		.radio_type     = UNSET,
 		.tuner_addr     = ADDR_UNSET,
 		.radio_addr     = ADDR_UNSET,
-		.tuner_config   = 1,
+		.tuner_config   = 0,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.gpiomask       = 0x000200000,
 		.inputs         = {{
 			.name = name_tv,
 			.vmux = 4,
 			.amux = TV,