
SCAN_TIPS - supplemental information for scanfw, a CCI scanner for mythbuntu/MythTV
Document Version 1.0
Developed by: majoridiot
(C)2008 by the mythbuntu Development Team

Distributed as part of the mythbuntu distribution of MythTV under GPL v2 and later.

***************************************************************************
License:

This Package is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public
License along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

****************************************************************************

GENERAL
=======

Using a firewire connection to a cable set-top box (STB) as a MythTV tuner can be
troublesome and an ongoing battle, due to channels being encrypted.  scanfw was developed
as a tool for MythTV users, to help identify and troubleshoot the encryption status of 
channels in their cable lineup.

It is very important to note that scanfw is only a tool and will likely require regular
use to ensure a stable line-up.  It is *not* a one-time magic bullet to solve all of your
MythtTV firewire woes and using it as such may cheat you you out of channels you could be
using.


ENCRYPTION PITFALLS
===================

Encryption of cable channels and the ability or inability to record them varies widely by
cable system and region.  Depending on your cable provider, you may have full, conditional
or no encryption applied to your channels- and this may change from day to day or vary by
show.

It is important to always keep in mind that scanfw produces only a *snapshot* of your channels
for that particular moment in time.  There is no guarantee that the encryption status will
remain that way.  To get an accurate overview of the encryption status of your channels, you
will need to spend the time and effort to make multiple scans initially and then make a regular
practice of re-scanning periodically- especially if your recordings and/or LiveTV are failing.

The following encryption issues were encountered during the development of scanfw and are 
important to keep in mind, as they may apply to your cable system/STB as well:

 * Some channels assert encryption conditionally and/or by time of day- e.g. only during 
   prime-time.  It is also fairly common for a "normally clear" channel to assert encryption
   for certain programs only.  This can be especially true for "original" or "exclusive"
   broadcasts.

 * It is possible that a "normally encrypted" channel will report as clear if the channel
   is scanned during a commercial that does not have encryption asserted.  This reinforces
   the need for more than one scan and for closely monitoring the program material being
   viewed by the scanner on the tv.

 * When tuning a new channel, it is not uncommon for the CCI to cycle the encryption status
   back and forth for a few moments before stabilizing.  Some channels are reliably worse
   than others and can take a number of seconds to stabilize the CCI.  These channels may 
   yield a false-positive for encryption if not given sufficient time to stabilize before
   scanning.

 * It is possible for a channel to have bogus (malformed?) CCI information.  Scanning these
   channels yields 50/50 reliability- depending entirely on the data or lack thereof.  
   Testing has shown that these channels will usually display empty CCI, DRM, etc. when 
   checked manually via the STB diagnostic screens but seem to be OK for recording.  It is 
   unknown at this time what causes this issue, other than it stems from the cable head.
   

SCANNING STRATEGIES
===================

*** REMEMBER THAT THE MYTHTV BACKEND SERVER MUST BE STOPPED WHEN SCANNING ***

scanfw may need to recover itself from unstable situations by re-priming the STB.  It is 
critically important that the priming channel you provide with the -p option be a known-
reliable channel to prime with.  For cable systems with analog channels, it is usually a 
good bet to pick one of these, as they are normally unencrypted and stable.  You can use
mythprime combined with manual channel changes to help determine a reliable priming channel.

Before scanning, you need to determine how much time it takes for your STB to acquire and
display a channel after a channel change.  You should do this for both SD and HD channels,
looking for the *longest* average time- and then add at least two seconds to it.  This is a
reasonable number to use for the -s option for a "quick scan", which is set at 4 seconds by 
default. Although it is not recommended, you can set -s as low as 3 seconds.

When performing your scans, you should (if possible) watch the output of the scan, the stb
display and the tv, to be sure the scanner and stb are in synch and that the tv is acquiring
the channel properly.  Some STBS do not like rapid channel changes and will skip or ignore 
channel changes or become unstable.  Increasing -s will usually fix these issues.

For the best results, you should scan the channels you want to record during the time of day
you would normally be recording.  e.g. Late-night scans can have little relevance if you record
a lot of prime-time, etc.

A quick-scan, using the default of -s 4, will give you a fairly accurate snapshot of your
channels.  However, due to the cycling CCI issue previously mentioned, quick scans can also 
yield false-positives for encryption on clear channels- and vice-versa.  Quick scans are good
for getting an overall picture of things, to help you narrow your focus to possible problem
channels, but should not be solely relied upon for configuring your final line-up.

The most accurate results are obtained by giving the stb plenty of time to stabilize after a
channel change, before scanfw reads the CCI.  A value of -s 8 or more has been found reliable
at helping weed out problem channels that may report falsely.


SCAN RESULTS: WHAT DO I DO WITH THEM?
=====================================

So you've invested the time and effort to do all of these scans, re-scans, etc. and now have
a fairly good idea of which channels are always or conditionally encrypted... but what do you
do with this information?  The answer is totally up to you.

The "safest" thing to is to disable any channel that is encrypted, regardless of whether it is
conditional or not.  This is your best bet for never missing recordings due to encryption- but
possibly at the expense of losing access to a channel that is clear the majority of the time.

Conditionally-encrypted channels can still be used by setting up recoding rules, etc. to handle
known conditionally-encrypted programs via an alternate method; e.g. pvr capture via coax.
MythTV is a highly-configurable environment and there are many rules and settings that can be
employed or developed to help you get the most out of your firewire connection.  Given correct
setting and rules, the only problem with enabling channels with conditional encryption is when
tuning LiveTV to an encrypted program.  Worst case, you will have occasional failed recordings
that you can develop rules to handle in the future.

You are encouraged to share your results and any rules, configs or work-arounds in the forum
or mailing lists.  Your solution may be a lifesaver for a lot of other MythTV users.


V1.0
May 2008
majoridiot
