Help - Search - Members - Calendar
Full Version: Bda Channel Scanning App
DVB Owners Discussion Forum - dvbowners.com > Technical & Development Forums > BDA Driver Development
afan
Hi,

I am currently developping an application with DirectShow using BDA driver. I succeed to mount the graph, create a tune request and get a channel program displayed on my screen. But now i would like to know how to have an exhaustive channel scan.
So is there anyone who develops or can explain how can I scan all channel available on the frequency MAP from my country??
I heard about IScanningTuner and AutoProgram but i dont undersand how does it work ...
I have tried with the TIF filter and getservices :

CODE
HRESULT GetChannel()
{
    IGuideData *pGuideData = NULL;
    HRESULT theHr;
    if(!m_pTIF)
    {
        theHr = mBDAGraph->FindFilterByName(L"BDA MPEG2 Transport Information Filter", &m_pTIF);
        if(theHr != S_OK)
        {
            
            return theHr;
        }
    }

    theHr = m_pTIF->QueryInterface(__uuidof(IGuideData),(void **)&pGuideData);
    if(theHr!=S_OK)
    {
        
        return theHr;
    }
    IEnumTuneRequests *pEnumTuneRequests = NULL;
    if (SUCCEEDED(theHr))
    {
        theHr = pGuideData->GetServices(&pEnumTuneRequests);
        ITuneRequest* theTR;
        unsigned long theNbReturn;
        
        while (SUCCEEDED(pEnumTuneRequests->Next(1, &theTR, &theNbReturn)))
        {
            if (theNbReturn == 0)
                break;
            IEnumGuideDataProperties* theEnumProp;
            pGuideData->GetServiceProperties(theTR, &theEnumProp);
            IGuideDataProperty* theProp;
            
            while (SUCCEEDED(theEnumProp->Next(1, &theProp, &theNbReturn)))
            {
                
                
                if (theNbReturn == 0)
                    break;
                BSTR theSTR;
                VARIANT varValue;
                VariantInit(&varValue);
                long lLang;
                BSTR szValue;
                theHr = theProp->get_Name(&theSTR);
                theHr = theProp->get_Value(&varValue);
                szValue = varValue.bstrVal;
                switch (varValue.vt)
                {
                    case VT_BSTR: { szValue =                 varValue.bstrVal; break; }
                    case VT_I4:  
                    {  
                        lLang = varValue.lVal;  
                        break;
                    }

                    default:      {  break; }

                }
                
                        
                theProp->Release();
            }
            theEnumProp->Release();
            theTR->Release();
        }
        pEnumTuneRequests->Release();
    }
    else
    {
        
        return theHr;
    }
return S_OK;
}


but this one do not give all channel for every frequency.
Thx a lot !!
JoeyBloggs
I suggest you look at the source code to ScanChannelsBDA 2.0 although it does not use the TIF more than absolutely necessary. http://forums.dvbowners.com/index.php?showforum=25

QUOTE
So is there anyone who develops or can explain how can I scan all channel available on the frequency MAP from my country??
Which is <rolls eyes> ??? We are not mind readers you know.

QUOTE
I heard about IScanningTuner
never seen it actually implemented... Forget about it.
bear
You could take a look at WS's captureengine scan channel function, from memory it uses some of the TIF functions.
JoeyBloggs
The critical line is

// Fill in the Components lists for the tune request
hr = piTuneRequestInfo->CreateComponentList(piTuneRequest);
afan
QUOTE (JoeyBloggs @ Sep 29 2005, 12:45 PM) *
I suggest you look at the source code to ScanChannelsBDA 2.0 although it does not use the TIF more than absolutely necessary. http://forums.dvbowners.com/index.php?showforum=25

QUOTE
So is there anyone who develops or can explain how can I scan all channel available on the frequency MAP from my country??
Which is <rolls eyes> ??? We are not mind readers you know.

QUOTE
I heard about IScanningTuner
never seen it actually implemented... Forget about it.


Thx for your answer....
I would like to scan french channels ... But I would like to be country independant and to be sure that my scan is really exhaustive... When I say exhaustive, i want to know when my channel has a "good" signal.
With BdaScanChannel app, i have found channels that I can not watch ...
Example
CODE
Please Select Menu(1,2,4,5,6,9,10):5
# locked 506166, 7 signal locked = Y present = Y stength = 25 quality = 60

Network_1("rΘseau numΘrique terrestre franτais", 0, 1243840, 1)
    ONID=8442 ,NETWORKID=8442, TSID=4
  Program_ 1("M6"                  , 1025,  120,   130,  110)    # LCN=6 Teletex
t=140
  Program_ 2("M6 AC3"              , 1025,  120,  A131,  110)    #
  Program_ 3("W9"                  , 1026,  220,   230,  210)    # LCN=9
  Program_ 4("NT1"                 , 1027,  320,   330,  310)    # LCN=11

# Nothing found on 514166kHz, trying +125, trying -125, Nothing found
# Nothing found on 522166kHz, trying +125, trying -125, Nothing found
# locked 530166, 7 signal locked = Y present = Y stength = 24 quality = 60

Network_2("rΘseau numΘrique terrestre franτais", 0, 1243840, 1)
    ONID=8442 ,NETWORKID=8442, TSID=3
  Program_ 1("CANAL+"              ,  769,  170,   120, 1280)    # LCN=4
  Program_ 2("CANAL+ TEST"         ,  773,    0,    96, 1284)    # LCN=83 Telete
xt=44
  Program_ 3("CANAL+ TEST"         ,  773,    0,    97, 1284)    #
  Program_ 4("PLANETE"             ,  772,    0,    92, 1283)    # LCN=82
  Program_ 5("CANAL+ SPORT"        ,  771,    0,    88, 1282)    # LCN=81 Telete
xt=38
  Program_ 6("CANAL+ SPORT"        ,  771,    0,    89, 1282)    #
  Program_ 7("CANAL+ CINEMA"       ,  770,    0,    84, 1281)    # LCN=80 Telete
xt=35
  Program_ 8("CANAL+ CINEMA"       ,  770,    0,    85, 1281)    #

# Nothing found on 538166kHz, trying +125, trying -125, Nothing found
# locked 546166, 7 signal locked = Y present = Y stength = 32 quality = 60

Network_3("TNT France", 0, 1243840, 1)
    ONID=8442 ,NETWORKID=8442, TSID=6
  Program_ 1("TF1"                 , 1537,  120,   130,  100)    # LCN=1 Teletex
t=140
  Program_ 2("NRJ12"               , 1538,  220,   230,  200)    # LCN=12
  Program_ 3("NRJ12 AC3"           , 1538,  220,  A231,  200)    #
  Program_ 4("TPS Star"            , 1541,    0,   530,  500)    # LCN=30

# Nothing found on 0kHz, trying +125, trying -125, Nothing found
# Nothing found on 0kHz, trying +125, trying -125, Nothing found
# Nothing found on 0kHz, trying +125, trying -125, Nothing found
# Nothing found on 0kHz, trying +125, trying -125, Nothing found


TF1, NRJ12, CANAL+ is ok
but M6,W9,NT1 not...
How can I know without watching it...
JoeyBloggs
You will need to go deeper and look at the stream descriptors for Condition Access (CA). Even that's not going to be 100% as it appears that some channels in France are being tranmitted unscrambled but with CA descriptors. I suggest you get a copy of TSReader for a start. So that you can see what information is available in the TransportStream.
afan
Ok thanks a lot for your help!!
Unfortunately I can not use the TSReader beacause it doesnt handle my BDA card...
So I look at your code
http://forums.dvbowners.com/index.php?showtopic=1051&st=1
I would like to be sure:
Is it possible to scan ALL channels with TIF filter for all frequency???
About scrambled channels, is the TIF mentionning it? Or do i have to decode the TS ?
JoeyBloggs
QUOTE
Unfortunately I can not use the TSReader beacause it doesnt handle my BDA card...
So just record some TS and load it from file. Doesn't need to be live.

QUOTE
About scrambled channels, is the TIF mentionning it? Or do i have to decode the TS ?
You are eventually going to have to do at least some of the decoding yourself, the TIF won't do it all. It's possible to use a hybrid half TIF, half own table decoding. Or like ScanChannelsBDA primarily own decoding, with minimal TIF involvement.
afan
QUOTE (JoeyBloggs @ Oct 5 2005, 12:59 PM) *
So just record some TS and load it from file. Doesn't need to be live.

How can I record some TS from Live???
I try with graphedit but my filter(TSReader dump) is buggy, i think...

QUOTE
You are eventually going to have to do at least some of the decoding yourself, the TIF won't do it all. It's possible to use a hybrid half TIF, half own table decoding. Or like ScanChannelsBDA primarily own decoding, with minimal TIF involvement.

What is an hybrid half TIF? Where can I find it ? wink.gif
I m currently writing a Channel scan with tune request and TIF reader. But i'm wondering if it 's the right way, cause of scrambled channel ???
JoeyBloggs
You can use any DTV software that supports TS recording. You could also construct a graph manually I guess, but you will need a standard dump filter. I've got no idea what TSReader Dump is ~

As for code you could either start from ScanChannelsBDA or write your own.
afan
QUOTE (JoeyBloggs @ Oct 5 2005, 03:28 PM) *
You can use any DTV software that supports TS recording. You could also construct a graph manually I guess, but you will need a standard dump filter. I've got no idea what TSReader Dump is ~

As for code you could either start from ScanChannelsBDA or write your own.

Ok i'm trying it ...
I would to write my own but I need more information about the hybrid TIF filter which can obtain some valid information ...
Why is ScanChannelBda finding an ONID, a TSID and a SID for a channel that I cant watch on my screen when i put a tune request with this values ???
Tanks a lot !!!
I'm learning with you....
bear
afan,

QUOTE
I would to write my own but I need more information about the hybrid TIF filter which can obtain some valid information ...
I think what JoeyBloggs's was meaning when he says "hybrid TIF" was that you can use the TIF filter for the higher level functions and then use the MPEG-2 Sections & Tables filter to parse the lower level information.

I think a good example is the WebScheduler capture engine, where all the tuning & service information is aquired via the TIF Interface and the lower level parsing of the pid information etc is done by reading sections data via the MPEG-2 Sections & Tables filter.

QUOTE
Why is ScanChannelBda finding an ONID, a TSID and a SID for a channel that I cant watch on my screen when i put a tune request with this values ???


At a guess the service may not be running or it has encryption maybe. If you are using graphedit with BDA drivers then check the MS Demultiplexer for what pids are mapped to its A/V Pins. If there are no pids mapped then check what pids are mapped to the TIF, this info may give us a clue.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.