I'm trying to understand how most applications perform ATSC tuning. Assume that I already have an ATSC tune request that I've acquired via
ITuneRequest *pITuneRequest = NULL;
pATSCTuningSpace->CreateTuneRequest(&pTuneRequest)`
It seems that there are three prevalent methods:
1) Build a list of all major.minor channels and map them to a physical channel, then tune to that physical channel whenever a major.minor is requested. This map is built via code like this:
for i = 2 to 69
tune_to_physical_channel(i)
if (tuner_has_lock())
add_to_known_list(i, major_of(i), minor_of(i));
next
The UI only presents list of major.minor channels to the user.
The problem that I'm seeing here is that I seem to get duplicate mappings; there are times when I tune physical channel 30 and see 43.1, and other times when I tune it, but instead see 43.2! Why would this be happening?
2) Tune to major.minor directly. Allow direct input of both the major and minor channels, and do not use physical channels at all. I've tried this using several local channels: 8.1, 8.2, 43.1, 43.2, 43.3, 49.1, 49.2.
8.1 and 8.2 tune perfectly if a build a tune request and set parameters like this:
IATSCChannelTuneRequest* pIATSCChannelTuneRequest = NULL;
IATSCLocator *pIATSCLocator = NULL;
hr = pITuneRequest->QueryInterface( IID_IATSCChannelTuneRequest,
(void**)&pIATSCChannelTuneRequest);
pIATSCChannelTuneRequest->put_Channel(lMajorChannel);
pIATSCChannelTuneRequest->put_MinorChannel(lMinorChannel);
::CoCreateInstance( CLSID_ATSCLocator, 0, CLSCTX_INPROC, IID_IATSCLocator,
(void**)&pIATSCLocator);
pIATSCLocator->put_CarrierFrequency(-1);
pIATSCLocator->put_SymbolRate(-1);
pIATSCLocator->put_PhysicalChannel(-1);
pIATSCChannelTuneRequest->put_Locator(pIATSCLocator);
The other channels never tune. Why? Other applications (such as WinTV) tune everything correctly.
3) Build a list of major.minor channels by scanning a list of known frequencies for a given geographic area. Some applications seed themselves with location-based known frequencies, such as this one, this one, and this one. Note that all of those are US Specific.
I haven't actually tried it yet, but my plan would be to supply a list, and build a mapping of major.minor -> frequency, similar to #1:
foreach (frequency f in frequency_array)
tune_to_frequency (f)
if (tuner_has_lock())
add_to_known_list(f, major_of(f), minor_of(f));
next
So again the question is: How do applications implement scanning/tuning for ATSC channels?