linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* LGDT3305 configuration questions
@ 2012-12-02 11:53 Frank Schäfer
  2012-12-02 16:10 ` Devin Heitmueller
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Schäfer @ 2012-12-02 11:53 UTC (permalink / raw)
  To: mkrufky, linux-media

Hi Michael,

I'm currently working on adding support for the "MSI Digivox ATSC"
(EM2874B + TDA18271HDC2 + LGDT3305) to the em28xx driver and I'm trying
to find the right setup for the LGDT3305.
Maybe you can answer some questions about the LGDT3305 configuration:

1) When should deny_i2c_rptr in struct lgdt3305_config be set ?
I can see what the code does, but I'm unsure which value to use.
What's the i2c repeater / i2c gate ctrl and how does it work ?

2) User defined IF frequencies (fields vsb_if_khz and qam_if_khz in
struct lgdt3305_config):
What happens if no user defined values are selected ? The corresponding
registers seem to be 0x00000000 in this case (for the LGDT3305).
Which IF is used in this case ?
The USB log of the stick shows that the registers are set to 4a 3d 70 a3
(for QAM; don't have a log for VSB).
According to the code in lgdt3305_set_if() this corresponds to a value
of .qam_if_khz = 4000.
In the em28xx driver we have another device with the LGDT3304 which sets
this value to 4000, too.
OTOH, these fields claim to hold the value in kHz, so this would be 4MHz
only. But AFAIK intermediate frequencies are usually about 10 times
higher !? ATSC seems to use 44MHz.

Thanks for your help ! :)

Regards,
Frank

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: LGDT3305 configuration questions
  2012-12-02 11:53 LGDT3305 configuration questions Frank Schäfer
@ 2012-12-02 16:10 ` Devin Heitmueller
  2012-12-02 17:39   ` Frank Schäfer
  0 siblings, 1 reply; 3+ messages in thread
From: Devin Heitmueller @ 2012-12-02 16:10 UTC (permalink / raw)
  To: Frank Schäfer; +Cc: mkrufky, linux-media

Hi Frank,

I might be able to help out here a bit.

On Sun, Dec 2, 2012 at 6:53 AM, Frank Schäfer
<fschaefer.oss@googlemail.com> wrote:
> 1) When should deny_i2c_rptr in struct lgdt3305_config be set ?
> I can see what the code does, but I'm unsure which value to use.
> What's the i2c repeater / i2c gate ctrl and how does it work ?

Basically an i2c gate is a construct where i2c traffic from the bridge
to the tuner goes *through* the demodulator, and the demodulator has
the ability to open/close the gate to block traffic.  This is very
typical in tuners since in many cases servicing i2c traffic can
reducing tuning quality (hence you want it to only receive traffic if
it's actually intended for the tuner).  It's sometimes referred to as
an I2C repeater, but it's the same thing.

I discuss some more of the details here:

How Tuners Work
http://www.kernellabs.com/blog/?p=1045

> 2) User defined IF frequencies (fields vsb_if_khz and qam_if_khz in
> struct lgdt3305_config):
> What happens if no user defined values are selected ? The corresponding
> registers seem to be 0x00000000 in this case (for the LGDT3305).

You won't get a signal lock.  This value must be set, and it must
match the value configured in the tuner.

> Which IF is used in this case ?
> The USB log of the stick shows that the registers are set to 4a 3d 70 a3
> (for QAM; don't have a log for VSB).
> According to the code in lgdt3305_set_if() this corresponds to a value
> of .qam_if_khz = 4000.
> In the em28xx driver we have another device with the LGDT3304 which sets
> this value to 4000, too.
> OTOH, these fields claim to hold the value in kHz, so this would be 4MHz
> only. But AFAIK intermediate frequencies are usually about 10 times
> higher !? ATSC seems to use 44MHz.

4000 MHz is a very common intermediate frequency for Both QAM and
ATSC.  The value is user definable but in reality the value chosen
will directly impact the quality of tuning reception (the manufacturer
typically determines the ideal IF by putting a spectrum analyzer on
the output and evaluating performance at different IF levels).  Hence
if you got 4000 from the em28xx trace, that is probably the correct
value (make sure the same value is specified in both the demodulator
and tuner configuration blocks - in this case the tda18271_cfg block
passed at dvb_attach).

It's also not impossible (although uncommon) to have different IF
settings for ATSC versus ClearQAM, so you should indeed get a second
trace to see if it's 4MHz in both cases.

Cheers,

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: LGDT3305 configuration questions
  2012-12-02 16:10 ` Devin Heitmueller
@ 2012-12-02 17:39   ` Frank Schäfer
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Schäfer @ 2012-12-02 17:39 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: mkrufky, linux-media

Hi Devin,

Am 02.12.2012 17:10, schrieb Devin Heitmueller:
> Hi Frank,
>
> I might be able to help out here a bit.
>
> On Sun, Dec 2, 2012 at 6:53 AM, Frank Schäfer
> <fschaefer.oss@googlemail.com> wrote:
>> 1) When should deny_i2c_rptr in struct lgdt3305_config be set ?
>> I can see what the code does, but I'm unsure which value to use.
>> What's the i2c repeater / i2c gate ctrl and how does it work ?
> Basically an i2c gate is a construct where i2c traffic from the bridge
> to the tuner goes *through* the demodulator, and the demodulator has
> the ability to open/close the gate to block traffic.

 Yeah, thats what the name suggests. But I didn't understand the
purpose/benefit...

> This is very
> typical in tuners since in many cases servicing i2c traffic can
> reducing tuning quality (hence you want it to only receive traffic if
> it's actually intended for the tuner).

... and that explains it. Thanks !

>   It's sometimes referred to as
> an I2C repeater, but it's the same thing.
>
> I discuss some more of the details here:
>
> How Tuners Work
> http://www.kernellabs.com/blog/?p=1045

Thank you for the link, I will definitely read it !

>
>> 2) User defined IF frequencies (fields vsb_if_khz and qam_if_khz in
>> struct lgdt3305_config):
>> What happens if no user defined values are selected ? The corresponding
>> registers seem to be 0x00000000 in this case (for the LGDT3305).
> You won't get a signal lock.  This value must be set, and it must
> match the value configured in the tuner.

Yes, that's what Antti explained, too.
The tda18271 driver also lets me understand things better...

>> Which IF is used in this case ?
>> The USB log of the stick shows that the registers are set to 4a 3d 70 a3
>> (for QAM; don't have a log for VSB).
>> According to the code in lgdt3305_set_if() this corresponds to a value
>> of .qam_if_khz = 4000.
>> In the em28xx driver we have another device with the LGDT3304 which sets
>> this value to 4000, too.
>> OTOH, these fields claim to hold the value in kHz, so this would be 4MHz
>> only. But AFAIK intermediate frequencies are usually about 10 times
>> higher !? ATSC seems to use 44MHz.
> 4000 MHz is a very common intermediate frequency for Both QAM and
> ATSC.  The value is user definable but in reality the value chosen
> will directly impact the quality of tuning reception (the manufacturer
> typically determines the ideal IF by putting a spectrum analyzer on
> the output and evaluating performance at different IF levels).  Hence
> if you got 4000 from the em28xx trace, that is probably the correct
> value (make sure the same value is specified in both the demodulator
> and tuner configuration blocks - in this case the tda18271_cfg block
> passed at dvb_attach).
>
> It's also not impossible (although uncommon) to have different IF
> settings for ATSC versus ClearQAM, so you should indeed get a second
> trace to see if it's 4MHz in both cases.

Ok, so it seems the 44000 KHz for ATSC I've read were wrong and 4000KHz
is right.

The LGDT3305 driver handles only 1 IF setting for QAM, but looking into
the tda18271 driver it seems that different intermediate frequencies for
QAM are possible.
Looks like this is configured with the tda18271_std_map entry in
tda18271_config...
I have to stop for today now, will continue tomorrow evening.

Thanks for your explanations !

Regards,
Frank



>
> Cheers,
>
> Devin
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-02 17:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 11:53 LGDT3305 configuration questions Frank Schäfer
2012-12-02 16:10 ` Devin Heitmueller
2012-12-02 17:39   ` Frank Schäfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).