Friday, July 23, 2010

Finding missing ClearQAM streams


Often, after installing a new Digital TV Tuner into your system Media Center will not detect any channels on it. You run 100's of  'Scan for more Channels' and just end up with 'No Channels Found. To add insult to injury you attempt to add the channels manually but you have absolutely no luck as guessing the channel numbers and sub numbers is just that - a guess.

Figure 1 The Dreaded - No channels found - screen
Well I had enough of that and I decided to write a small utility to scan every channel that media center scans and display the information in the hopes that someone else can find it useful - I know I did.
To understand why your channels are not detected you need to understand how Media Center 'detects' a unique channel. The first step is of course scanning for channels usually this starts by setting the digital tuner to channel 55.25 MHz (if you live in the USA) Media Center uses frequencies for BDA tuners to set the channel. It then jumps in increments of roughly 6 Mhz searching for a digital signal - there are some places where it jumps a different amount but this is outside the scope of this discussion.
Every time the tuner locks onto a signal the transport stream is scanned for a Program Association Table (PAT) table - the PAT table contains each program number and the PID associated with that program. After the PAT table is detected the Program Map Table (PMT) needs to be found. The PMT contains the information (PID and type) of each elementary stream i.e. video, audio, etc.
Now you are wondering what is he talking about what's all this talk about programs when we are talking transport streams…well a transport stream can carry many different streams that are multiplexed, each stream is identified by a PID which is contained in the PAT.

Now Media Center has determined that this is a digital stream and it wants to get 'Digital' information. The stream is now scanned for PSIP (Program and System Information Protocol) information. This starts off with the Master Guide Table (MGT) – this table, similar to how PAT contains information about the streams, contains information about PSIP tables. Most PSIP packets have a PID of 0x1ffb (8187) so detecting the correct table is just a matter of detecting the table field. The MGT will define if a stream contains a Terrestrial Virtual Channel Table (TVCT) used by ATSC transmissions or a Cable VCT (CVCT) which is obviously used by Cable transmissions. These two VCT tables along with the MGT are all that is used for channel detection. There are other tables – the Event Information Table (EIT) is used for guide information if a channel match cannot be found, the Extended Text Table (ETT), etc.
If everything panned out MCE would have detected your channels and you would not be reading this postJ. However there is one caveat occasionally program with duplicate program numbers may be overwritten. I have tested and verified this in a couple of times.

Figure 2 Channel information returned
As you can see in Figure 2 channel 72 two channels with PSIP information were detected and 3 without – the Call Signs are displayed along with the channel numbers that Media Center will present the channel as on the guide the other may be displayed as C72.97, C72.20 and of course C72.235. This of just depends of course on no other channels show up with the same program number and overwrite them.

Figure 3 Media Center Channel edit
As you can see in Figure 3 the information detected on the utility is reflected in Media Center. The pad-lock on the right shows that the channels are encrypted if there is no padlock you can check the box and the channel will show up on your guide without any information. You can then watch it for a while to determine what channel it is and change the listing manually.
If you do not see your program and you know more or less what channel it is you will be able to add it manually. Select Add a QAM channel enter the missing channel number which is either the PSIP number or the "channe .program number". You can select QAM256 by default it does not really make a difference as he tuner handles the demodulation not Media Center.

Figure 4 Adding Channel manually
Unfortunately Media Center will never map a xx.yy channel that it detected via a scan to a xx channel that you will see if you are using a cable card or a STB. This is because Media Center is treating every program as if is a ATSC program – scanning the internals of Media Center also reflects this.
The utility I wrote just scans the channels for now – I am busy porting some of this code to C# so that I can combine it with the code in my previous article to allow editing of the Media Center Guide listings directly. This will also give the ability to select a full channel number as opposed to a x.y number.

Here are the links to the files:
32bit ClearQAM Scanner.
64bit ClearQAM Scanner.

This files are offered without warranty, however they are not public domain please leave any comments re bugs etc. here.

To install run the registerdll.bat file then run the exe file - it will grab the first QAM capable tuner that Media Center is aware of i.e. you must have set up Media Center to use the Digital Cable Tuner before running this utility.

13 comments:

  1. I tried to run the 64 bit after registerdll and it crashed immediately.

    After seeing "detecting" in the cmd window I get the Windows error message that it stopped working.

    ReplyDelete
  2. I have a C# version of the app that will give output to a window but it is part of my streaming tuner server code - which has not been posted yet. I am currently working on an iOS client for the server and will post a complete solution when I am done.
    post a screen cap of your crash and I will see what I can do for you. I assume you were running it on Vista or Win7.

    ReplyDelete
  3. I assume this porogram does't work with XP without media center? I was hoping your program would tell me if my cable provider is doing something different since a month ago that would cause my QAM recordings using BeyondTV no to have any PAT information.

    ReplyDelete
  4. No, I am using calls that are only available on Vista and Win 7.

    ReplyDelete
  5. I ran the channel scan and this is what it returned. I have Time Warner metro NY cable.
    I know I have clear QAM channels. What am I doing wrong?
    Thanks,
    Will

    Copyright GEAR Software Inc. 2010
    Go to http://netcodeman.blogspot.com for more i

    AVerMedia 23888 BDA Tuner/Demod (ClearQAM)
    AVerMedia 23888 Tuner (|Cable)
    Digital Signal detected on Channel 28
    0 Programs found
    Digital Signal detected on Channel 49
    0 Programs found
    Digital Signal detected on Channel 56
    0 Programs found
    Digital Signal detected on Channel 57
    0 Programs found
    Digital Signal detected on Channel 77
    0 Programs found
    Digital Signal detected on Channel 78
    0 Programs found
    Digital Signal detected on Channel 79
    0 Programs found
    Digital Signal detected on Channel 80
    0 Programs found
    Digital Signal detected on Channel 82
    0 Programs found
    Digital Signal detected on Channel 83
    0 Programs found
    Digital Signal detected on Channel 84
    0 Programs found
    Digital Signal detected on Channel 86
    0 Programs found
    Digital Signal detected on Channel 91
    0 Programs found
    Digital Signal detected on Channel 94
    0 Programs found
    Digital Signal detected on Channel 100
    0 Programs found
    Digital Signal detected on Channel 101
    0 Programs found
    Digital Signal detected on Channel 103
    0 Programs found
    Digital Signal detected on Channel 104
    0 Programs found
    Digital Signal detected on Channel 105
    0 Programs found
    Digital Signal detected on Channel 106
    0 Programs found
    Digital Signal detected on Channel 107
    0 Programs found
    Digital Signal detected on Channel 108
    0 Programs found
    Digital Signal detected on Channel 109
    0 Programs found
    Digital Signal detected on Channel 110
    0 Programs found
    Digital Signal detected on Channel 112
    0 Programs found
    Digital Signal detected on Channel 116
    0 Programs found
    Digital Signal detected on Channel 121
    0 Programs found
    Digital Signal detected on Channel 125
    0 Programs found
    Digital Signal detected on Channel 126
    0 Programs found
    Digital Signal detected on Channel 129
    0 Programs found
    Digital Signal detected on Channel 132
    0 Programs found
    Digital Signal detected on Channel 133
    0 Programs found
    Digital Signal detected on Channel 134
    0 Programs found
    Digital Signal detected on Channel 135
    0 Programs found
    Scanning Complete on Channel 157
    Press any key to exit...

    ReplyDelete
  6. You are not doing anything wrong. The utility is detecting a digital signal lock on the specified channel however there does not seem to be any PSIP information or a PAT to identify the streams/programs. You will notice it spends a few seconds on each channel - this is to detect the presence of these packets. If no info is found then it cannot show any channels.

    It may be that there are either no clear QAM channels (on these channels the provider only sends a management packet approximately every 60 seconds - in this case the scanning of each channel would take an excruciatingly long time) or the provider has stripped these packets, for some unknown reason.

    ReplyDelete
  7. Rats! All I get back is the name of the tuner card and "channel scan complete". Could it be because I have a combo tuner that does both analog & digital?

    ReplyDelete
  8. It may be - it will only scan QAM channels if it finds a digital tuner capable of QAM.

    ReplyDelete
  9. Is it still possible to D/L the 64 bit software? It looks like what I'm looking for. Thanks

    ReplyDelete
  10. Can you email me the 64 bit Program? The links are not active anymore.

    ReplyDelete
  11. can anyone email me this app 64 bit? biggy_5757@yahoo.com thank you

    ReplyDelete