Re: [PATCH v3 04/14] si2157: Add analog tuning related functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 12/19/19 3:13 PM, Mauro Carvalho Chehab wrote:
Em Sun, 24 Nov 2019 07:09:07 +0200
Antti Palosaari <crope@xxxxxx> escreveu:

On 11/14/19 10:03 PM, Brad Love wrote:
Include set_analog_params, get_frequency, and get_bandwidth.

Tested with NTSC and PAL standards via ch3/4 generator. Other standards
are included, but are untested due to lack of generator.

Signed-off-by: Brad Love <brad@xxxxxxxxxxxxxxxx>
---
Changes since v1:
- remove __func__ from dev_dbg macros

After all it looks pretty simply, but implementation is not done that
simply. Crazy RF/IF offsets, impossible values and so.

I think you need to study some tuner basics:
* what IF frequency is, why, and so
* IF vs. BW, what is relation, what are possible values
* Down conversion RF to IF. OK, *on that case* firmware covers PLL, but
it is fundamental. So basics of integer-N and fractional-N PLL is always
you must to know.
* Filtering. Especially IF filtering, which is generally low-pass
filtering. Think possible filters when selecting IF.

For me, the implementation seems to make sense. I mean, for analog TV, both
channel bandwidth and chroma/audio sub-carrier IF depends on the TV standard
only.

So, for NTSC and PAL/M/N/N', bandwidth is always 6MHz. For other standards, it
may be either 6MHz, 7MHz or 8MHz. the actual bandwidth depends if it is
a channel at VHF or at UHF range.

So, this part of the patch sounds OK to me.

The IF is actually a little trickier. Yet, if you take a lok on other
tuners, like drivers/media/tuners/tda827x.c, it is up tot he tuner to
automatically set the IF that will work for each video standard:

static void tda827x_set_std(struct dvb_frontend *fe,
			    struct analog_parameters *params)
{
	struct tda827x_priv *priv = fe->tuner_priv;
	char *mode;

	priv->lpsel = 0;
	if (params->std & V4L2_STD_MN) {
		priv->sgIF = 92;
		priv->lpsel = 1;
		mode = "MN";
	} else if (params->std & V4L2_STD_B) {
		priv->sgIF = 108;
		mode = "B";
...

static int tda827xo_set_analog_params(struct dvb_frontend *fe,
				      struct analog_parameters *params)
{

...

	N = freq + priv->sgIF;

In other words, for analog TV, the tuner will always receive the
channel central frequency, with may vary depending on the video
standard, and will adjust it to tune at the right channel, using the
per-standard IF (if needed), as, on most tuner drivers, the tunning
frequency should be either initial frequency or the main carrier
frequency, and not the center frequency.

How the carrier central frequency can be vary tings like video standard?
If you tune to some channel like 654.321MHz then that is central frequency no matter what kind of bandwidth is used.

And as I pointed those strange offset, please tell me what is that 1250000 Hz offset? It simply looks nonsense. You first add 1250000 to RF frequency, then you compensate same from IF value - the carrier at IF will be just same.

Also, there was something like 6/7/8MHz wide channel dropped to IF only 1.25MHz. How that wide channel could fit that small space?

regards
Antti




--
http://palosaari.fi/



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux