Some TV tuners have 3 AFC (automatic frequency control) bits which indicate
how close the tuner is to a TV carrier.  These are (in my experience) bits
0-2 of the "status" byte of the tuner (the only byte you can read from the
tuner).

The values of the 3 bits (again, from my experience with certain Temic,
Philips, and Samsung tuners) are:

0 -- carrier sensed, try lowering tuner freq by 100 KHz or so

1 -- carrier sensed, try lowering tuner freq by 50 KHz or so

2 -- carrier sensed, tuner is centered on carrier frequency

3 -- carrier sensed, try raising tuner freq by 50 KHz or so

4 -- carrier not sensed, try scanning for a signal

5-7 -- not used


Make sure you allow the tuner's PLL to settle before checking the AFC bits.
Settling time can be anywhere from 10-200 msec, depending upon how large the
frequency jump is from the old frequency.

If you need to scan, you can try a linear scan from, say, 3 MHz below to 3
MHz above the normal expected frequency.  However, I prefer a zig-zag scan
or table-driven scan, alternating just above and below the normal expected
frequency, and working your way out from there.

If you experiment with your tuner, and always see "0" value in the AFC bits,
even when you know you are exactly centered on the TV signal, then your
tuner does not support these AFC status bits.

I don't know whether V4L supports the right status read-back for an app to
accomplish auto-tune, but you can build it in at the driver level if you can
set up a timing mechanism so the driver can check the AFC status bits, reset
the tuner freq (if necessary), and then get called back after the PLL has
been given time to settle.  I've done it successfully inside an X driver.

Auto-tuning can work quite well, and is especially useful in situations such
as United States cable systems, in which the carrier frequency can vary by
+/- 2 MHz or so, depending upon the cable supplier's choice of frequency
standard.  In this case, a table driven scan should try the standard
frequencies first, then resort to zig-zag.

-- Ben --

"Ben Cahill, Intel SW Engineering.  Opinions expressed are
those of the author and do not represent Intel Corporation".


-----Original Message-----
From: I�aki Garc�a Etxebarria [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 22, 2000 5:36 PM
To: [EMAIL PROTECTED]
Subject: Autotuning


        Hi everybody,

I am trying to add autotuning capabilities to my program, but i am a bit
confused.
Can it be done with V4L1?
And with V4L2?
If yes to any of this questions, can anybody show me a good algorithm
for doing that?

I am trying to use the signal field of the video_tuner struct as an
indicator, but it is 0 OR 65535, so it isn't very useful for doing
autotuning.
I know for sure that it is possible to do it with my card (a Miro PCTV),
because the Windows program supplied with the card does it.

        Thanks for your answers,
I�aki


-- 
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.



--
         To unsubscribe: mail [EMAIL PROTECTED] with
                       "unsubscribe" as the Subject.

  • Autotuning I�aki Garc�a Etxebarria
    • Cahill, Ben M

Reply via email to