Jump to content

About dvb-t tuning space!


fxwwdh

Recommended Posts

Hi all,

 

I create a dvb-t tuning space and use it to tune signals, but i get a problem when i tune to frequency 473143KHz. I cant find the frequency 473143KHz in the current frequency table.

How to add frequency to the current frequency table? Where is the current frequency table? Is it stored in the regedit? Thanks in advance!

MSDN said:

A tuning space object performs several functions:

 

It stores information about the network, such as the range of physical channels.

It is a factory for tune requests.

It is persistable, so it can be stored in the system registry.

DVB-T tuning space i store in my regedit:

 

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Tuning Spaces\7]

@="{C6B14B32-76AA-4A86-A7AC-5C79AAF58DA7}"

"Name"="DVB-T"

"Description"="Local DVB-T Digital Antenna"

"Network Type"="{216C62DF-6D7F-4e9a-8571-05F14EDB766A}"

"System Type"=dword:00000001

"Network ID"=dword:00000000

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Tuning Spaces\7\Default Locator]

@="{9CD64701-BDF3-4D14-8E03-F12983D86664}"

"Frequency"=dword:ffffffff

"InnerFECMethod"=dword:ffffffff

"InnerFECRate"=dword:ffffffff

"OuterFECMethod"=dword:ffffffff

"OuterFECRate"=dword:ffffffff

"ModulationType"=dword:ffffffff

"SymbolRate"=dword:ffffffff

"Bandwidth"=dword:ffffffff

"LPInnerFECMethod"=dword:ffffffff

"LPInnerFECRate"=dword:ffffffff

"HierarchyAlpha"=dword:ffffffff

"GuardInterval"=dword:ffffffff

"TransmissionMode"=dword:ffffffff

"OtherFrequencyInUse"=dword:ffffffff

 

Can anybody help me? Thanks a lot!

Link to comment

Hi Griga,

 

Thanks for your reply! I tried what you said in my programme, but it still cannt get the signal.

 

ULONG ISDB_JAP[] = {473143,479143,485143,491143,497143,503143,509143,515143,521143,527143,
	533143,539143,545143,551143,557143,563143,569143,575143,581143,587143,
	593143,599143,605143,611143,617143,623143,629143,635143,641143,647143,
	653143,659143,665143,671143,677143,683143,689143,695143,701143,707143,
	713143,719143,725143,731143,737143,743143,749143,755143,761143,767143,
	773143,779143,785143,791143,797143,803143};

CComPtr<IFrequencyMap> pIFrequencyMap = NULL;
hr = m_pNetworkProvider->QueryInterface(IID_IFrequencyMap, (void**)&pIFrequencyMap);
if (SUCCEEDED(hr))
{
	 hr = pIFrequencyMap->put_FrequencyMapping(56, ISDB_JAP);
}

for (ULONG ulFreq=ISDB_JAP[0]; ulFreq<=ISDB_JAP[55]; ulFreq+=6000)
{
	 m_ulCarrierFrequency = ulFreq;
	 CComPtr <IDVBTuneRequest> pTuneRequest;
	 hr = CreateDVBTTuneRequest(&pTuneRequest);
	 if (FAILED(hr))
	 {
		   return hr;
	 }

	 hr = m_pITuner->put_TuneRequest (pTuneRequest);
	 if (FAILED(hr))
	 {
		   return hr;
	 }

	 Sleep(300);
	 LONG lStrength = 0;
	 if ( GetSignalStrength(&lStrength) )
	 {
		  if (lStrength != 0)
		 {
			  // save frequency!
		 }
	 }
	 else
	 {
		 return E_FAIL;
	 }
}


HRESULT
CBDAFilterGraph::CreateDVBTTuneRequest(
IDVBTuneRequest** pTuneRequest)
{
HRESULT hr = S_OK;

if (pTuneRequest == NULL)
{
		return E_POINTER;
}

// Making sure we have a valid tuning space
if (m_pITuningSpace == NULL)
{
	   return E_FAIL;
}

//  Create an instance of the DVBT tuning space
CComQIPtr <IDVBTuningSpace> pDVBTTuningSpace (m_pITuningSpace);
if (!pDVBTTuningSpace)
{
		return E_FAIL;
}

//  Create an empty tune request.
CComPtr <ITuneRequest> pNewTuneRequest;
hr = pDVBTTuningSpace->CreateTuneRequest(&pNewTuneRequest);
if (FAILED (hr))
{
		return hr;
}

//query for an IDVBTuneRequest interface pointer
CComQIPtr <IDVBTuneRequest> pDVBTTuneRequest (pNewTuneRequest);
if (!pDVBTTuneRequest)
{
	   return E_FAIL;
}

CComPtr <IDVBTLocator> pDVBTLocator;
hr = pDVBTLocator.CoCreateInstance (CLSID_DVBTLocator);
if (FAILED( hr))
{
	   return hr;
}

hr = pDVBTLocator->put_CarrierFrequency( m_ulCarrierFrequency );
if (FAILED(hr))
{
	  return hr;
}

hr = pDVBTTuneRequest->put_Locator (pDVBTLocator);
if (FAILED (hr))
{
	  return hr;
}

hr = pDVBTTuneRequest.QueryInterface (pTuneRequest);
return hr;
}

BOOL
CBDAFilterGraph::GetSignalStrength(LONG* pSignalStrength)
{
LONG lSignalStrength = 0;
HRESULT hr;

OutputDebugString(TEXT("BDASample: CBDAFilterGraph::GetSignalStrength\n"));

if(m_pITuner == NULL)
	return FALSE;
hr = m_pITuner->get_SignalStrength(&lSignalStrength);
if (FAILED(hr))
{
	return FALSE;
}

*pSignalStrength = lSignalStrength;

return TRUE;
}

Link to comment

IMO you don't have to set up a frequency list for what you're doing (DVBViewer doesn't either). AFAIK it's only required if you want to use IScanningTuner.

 

So there must be some other reason why that frequency doesn't work. Have you already tried pDVBTLocator->put_Bandwidth? Looks like 6 MHz is the correct value in your case... however, most drivers don't care.

 

Is there any other application that is able to receive a signal on 473143KHz with your device? You may want to try one of the (restricted) TransEdit test versions that I've attached in the forum (Download, Manual). Use File -> New List -> Terrestrial to create a transponder list, enter the frequency in question and scan.

 

BTW: Which country requires a 143 khz frequency offset? Usually I'd expect +/- 167 khz.

Link to comment

Hi Griga,

 

Thanks for your reply!

 

So there must be some other reason why that frequency doesn't work. Have you already tried pDVBTLocator->put_Bandwidth? Looks like 6 MHz is the correct value in your case... however, most drivers don't care.

yes, i already tried it.

 

Is there any other application that is able to receive a signal on 473143KHz with your device?

yes, newsoft's pvr can get the signal. I test it with graphedit and with one system it can tune the signal, but

on the second system, it doesn't work! I think it has something to do with the dvb-t tuning space, because the two graphs

that i built on the two systems were the same.

 

BTW: Which country requires a 143 khz frequency offset? Usually I'd expect +/- 167 khz.

there are Japan's isdb-t frequencies.

 

Thanks again!

Link to comment

Hi Griga,

 

"You may want to try one of the (restricted) TransEdit test versions that I've attached in the forum (Download, Manual). Use File -> New List -> Terrestrial to create a transponder list, enter the frequency in question and scan."

I test my signal with TransEdit and it cannt scan the frequency too!

Link to comment

Have you checked if it's just the first tuned frequency that won't work? What happens if you tune them in descending order?

 

In our experience after creating the NP and before connecting it to the tuner filter we must call put_TuneRequest with a kind of dummy tune request (no frequency set), otherwise things may not work, particularly with DVB-S (the tuner filter doesn't connect).

 

I think it has something to do with the dvb-t tuning space

Where do you get the tuning space from? There are two possibilities:

 

- Retrieve all DVB-T tuning spaces that are available in your system (the ones from the registry) by calling ITuner.EnumTuningSpaces and use one of them

 

or

 

- Create your own DVB-T tuning space with CoCreateInstance and set its properties.

 

IMO there is not much that can be wrong with DVB-T tuning spaces. They are not that sophisticated... there are several DVB-T tuning spaces in my registry, and they all look like the one that you've posted above, except OtherFrequencyInUse is set to 0 in some of the default locators.

Link to comment
I test my signal with TransEdit and it cannt scan the frequency too!

Is it able to scan other frequencies?

 

Go to Settings -> Hardware and change the options, particularly "Stop stream while tuning", "Use standard interface" and "Retune attempts".

 

Japan's isdb-t frequencies

Dunno if the TransEdit Scanner can cope with it. However, if there is a PAT and PMT some results should show up.

Link to comment

;)

 

Hi,

 

Have you checked if it's just the first tuned frequency that won't work? What happens if you tune them in descending order?

I have only one frequency! :oops:

 

In our experience after creating the NP and before connecting it to the tuner filter we must call put_TuneRequest with a kind of dummy tune request (no frequeny set), otherwise things may not work, particularly with DVB-S (the tuner filter doesn't connect).

yes, in my programme i create a tune request to initialize the network provider before connecting other filters.

 

IMO there is not much that can be wrong with DVB-T tuning spaces. They are not that sophisticated... there are several DVB-T tuning spaces in my registry, and they all look like the one that you've posted above, except OtherFrequencyInUse is set to 0 in some of the default locators.

as you said, maybe i was wrong and the guess was too careless.

 

I have reversed a little part of the PVR and find that my programme is almost the same as it.

we both do the following:

 

CBDAFilterGraph::BuildGraph(
CComBSTR pNetworkType)   // the registered Tuning Space name
{
HRESULT hr = S_OK;

// STEP 1: load network provider first so that it can configure other
// filters, such as configuring the demux to sprout output pins.
// We also need to submit a tune request to the Network Provider so it will
// tune to a channel
if(FAILED (hr = LoadNetworkProvider(pNetworkType)))
{
	  return hr;
}

hr = m_pNetworkProvider->QueryInterface(__uuidof (ITuner), reinterpret_cast <void**> (&m_pITuner));
if(FAILED (hr))
{
	  return hr;
}

// create a tune request to initialize the network provider
// before connecting other filters
CComPtr <IDVBTuneRequest> pDVBTTuneRequest;
if(FAILED (hr = CreateDVBTTuneRequest(&pDVBTTuneRequest)))
{
	  return hr;
}

//submit the tune request to the network provider
hr = m_pITuner->put_TuneRequest(pDVBTTuneRequest);
if(FAILED(hr))
{
	  return hr;
}

// connect other filters!!!
}

HRESULT
CBDAFilterGraph::LoadNetworkProvider(
CComBSTR pNetworkType)
{
HRESULT  hr = S_OK;
CComBSTR bstrNetworkType;
CLSID	CLSIDNetworkType;	

// obtain tuning space then load network provider
if(m_pITuningSpace == NULL)
{		
		hr = CreateTuningSpace(pNetworkType);
		if (FAILED(hr))
		{			   
			return E_FAIL;
		}
}

if (!m_pITuningSpace)
{	 
	return E_FAIL;
}

// Get the current Network Type clsid
hr = m_pITuningSpace->get_NetworkType(&bstrNetworkType);
if (FAILED (hr))
{	 
	return hr;
}

hr = CLSIDFromString(bstrNetworkType, &CLSIDNetworkType);
if (FAILED (hr))
{
	return hr;
}

// create the network provider based on the clsid obtained from the tuning space
hr = CoCreateInstance(CLSIDNetworkType, NULL, CLSCTX_INPROC_SERVER,
					  IID_IBaseFilter, 
					  reinterpret_cast<void**>(&m_pNetworkProvider));
if (FAILED (hr))
{
	return hr;
}

//add the Network Provider filter to the graph
hr = m_pFilterGraph->AddFilter(m_pNetworkProvider, L"Network Provider");

return hr;
}

HRESULT
CBDAFilterGraph::CreateTuningSpace(
CComBSTR pNetworkType)
{
HRESULT hr = S_OK;	
CComPtr <IDVBTuningSpace> pIDVBTuningSpace;

hr = pIDVBTuningSpace.CoCreateInstance(CLSID_DVBTuningSpace);
if (FAILED(hr) || !pIDVBTuningSpace)
{		
	return FALSE;
}

// set the Frequency mapping
WCHAR szFreqMapping[ 3 ]=L"-1";
BSTR bstrFreqMapping = SysAllocString(szFreqMapping);
if (bstrFreqMapping)
{
	hr = pIDVBTuningSpace->put_FrequencyMapping(bstrFreqMapping); // not used
	SysFreeString(bstrFreqMapping);
}

// set the Friendly Name of the network type, shown as Name in the registry
hr = pIDVBTuningSpace->put_UniqueName(pNetworkType);
if (FAILED(hr))
{		
	return hr;
}

// set the System type to terrestrial
hr = pIDVBTuningSpace->put_SystemType(DVB_Terrestrial);
if (FAILED(hr))
{		
	return hr;
}

// set the Network Type to DVBT
CComBSTR clsid_dvbt = ("{216C62DF-6D7F-4e9a-8571-05F14EDB766A}");
hr = pIDVBTuningSpace->put_NetworkType(clsid_dvbt);
if (FAILED(hr))
{	  
	return hr;
}

// set the Friendly Name, shown as Description in the registry
WCHAR szFriendlyName[ 64 ]=L"Local DVB-T Digital Antenna";
BSTR bstrFriendlyName = SysAllocString(szFriendlyName);
if (bstrFriendlyName)
{
	hr = pIDVBTuningSpace->put_FriendlyName(bstrFriendlyName);
	SysFreeString(bstrFriendlyName);
}

// create DVBT Locator
hr = CoCreateInstance(CLSID_DVBTLocator,
					  NULL,
					  CLSCTX_INPROC_SERVER,
					  IID_IDVBTLocator,
					  reinterpret_cast<void**>(&pIDVBTLocator));
if (FAILED(hr) || !pIDVBTLocator)
{		
	return hr;
}

// NOTE: The below parameter with the exception of
//	   setting the carrier frequency don't need to set.
//	   Thus they are set to -1.  The demodulator can
//	   handle these parameters without having to specifically
//	   set them in the hardware.

// set the Bandwidth
hr = pIDVBTLocator->put_Bandwidth(m_Band);							// not used 

// set the Carrier Frequency
hr = pIDVBTLocator->put_CarrierFrequency(m_ulCarrierFrequency);

// set the Low Priority FEC type
hr = pIDVBTLocator->put_LPInnerFEC(BDA_FEC_METHOD_NOT_SET);	   // not used

// set the Low Priority code rate
hr = pIDVBTLocator->put_LPInnerFECRate(BDA_BCC_RATE_NOT_SET);	 // not used

// set the hieriarcy alpha
hr = pIDVBTLocator->put_HAlpha(BDA_HALPHA_NOT_SET);			   // not used 

// set the guard interval
hr = pIDVBTLocator->put_Guard(BDA_GUARD_NOT_SET);				 // not used 

// set the transmission mode/FFT
hr = pIDVBTLocator->put_Mode(BDA_XMIT_MODE_NOT_SET);			  // not used 

// set whether the frequency is being used by another DVB-T broadcaster
hr = pIDVBTLocator->put_OtherFrequencyInUse(VARIANT_BOOL(FALSE)); // not used

// set the inner FEC type
hr = pIDVBTLocator->put_InnerFEC(BDA_FEC_METHOD_NOT_SET);		 // not used

// set the inner code rate
hr = pIDVBTLocator->put_InnerFECRate(BDA_BCC_RATE_NOT_SET);	   // not used 

// set the outer FEC type
hr = pIDVBTLocator->put_OuterFEC(BDA_FEC_METHOD_NOT_SET);		 // not used 

// set the outer code rate
hr = pIDVBTLocator->put_OuterFECRate(BDA_BCC_RATE_NOT_SET);	   // not used 

// set the modulation type
hr = pIDVBTLocator->put_Modulation(BDA_MOD_NOT_SET);			  // not used 

// set the symbol rate
hr = pIDVBTLocator->put_SymbolRate(-1);						   // not used

// set this a default locator
hr = pIDVBTuningSpace->put_DefaultLocator(pIDVBTLocator);

// create a copy of this tuning space for the 
// class member variable.
hr = pIDVBTuningSpace->Clone(&m_pITuningSpace);
if (FAILED(hr))
{		
	m_pITuningSpace = NULL;
	return hr;
}

pIDVBTuningSpace	 = NULL;
pIDVBTLocator		= NULL;

return hr;
}

HRESULT
CBDAFilterGraph::CreateDVBTTuneRequest(
IDVBTuneRequest** pTuneRequest)
{
HRESULT hr = S_OK;

if (pTuneRequest == NULL)
{
	return E_POINTER;
}

// Making sure we have a valid tuning space
if (m_pITuningSpace == NULL)
{
	return E_FAIL;
}

//  Create an instance of the DVBS tuning space
CComQIPtr <IDVBTuningSpace> pDVBTTuningSpace (m_pITuningSpace);
if (!pDVBTTuningSpace)
{		
	return E_FAIL;
}

//  Create an empty tune request.
CComPtr <ITuneRequest> pNewTuneRequest;
hr = pDVBTTuningSpace->CreateTuneRequest(&pNewTuneRequest);
if (FAILED (hr))
{
	return hr;
}

//query for an IDVBTuneRequest interface pointer
CComQIPtr <IDVBTuneRequest> pDVBTTuneRequest (pNewTuneRequest);
if (!pDVBTTuneRequest)
{
	return E_FAIL;
}

CComPtr <IDVBTLocator> pDVBTLocator;
hr = pDVBTLocator.CoCreateInstance (CLSID_DVBTLocator);
if (FAILED( hr))
{
	return hr;
}

hr = pDVBTLocator->put_CarrierFrequency( m_ulCarrierFrequency );
if (FAILED(hr))
{
	return hr;
}

hr = pDVBTTuneRequest->put_Locator (pDVBTLocator);
if (FAILED (hr))
{
	return hr;
}

hr = pDVBTTuneRequest.QueryInterface (pTuneRequest);
return hr;
}

 

Thanks!

Link to comment
I have only one frequency!

Well, that's the global crisis... ;)

 

Ok, let's summarize: On system 1 everything is fine. On system 2 the PVR software works, but your code (though it is very similar) and TransEdit don't. Right?

 

BTW: With the default hardware settings (Use standard interface off) TransEdit doesn't use tuning spaces at all, but communicates directly with the tuner filter via the IBDA_XXX interfaces. So you can drop this assumption, I think. Must be something different.

 

I would check the TransEdit options mentioned above. Just to make sure: The frequency has to be entered as 473.143 (MHz), did you do it this way?

Link to comment

Hi,

 

Ok, let's summarize: On system 1 everything is fine. On system 2 the PVR software works, but your code (though it is very similar) and TransEdit don't. Right?

yes, PVR works, my code and TransEdit dont.

 

BTW: With the default hardware settings (Use standard interface off) TransEdit doesn't use tuning spaces at all, but communicates directly with the tuner filter via the IBDA_XXX interfaces. So you can drop this assumption, I think. Must be something different.

I think there is sth different too, but the main parts(the code that i showed) are the same, so i cannt find anything else that

would affect the scan process.

 

I would check the TransEdit options mentioned above. Just to make sure: The frequency has to be entered as 473.143 (MHz), did you do it this way?

yes, i entered 473.143 in the frequency frame and selected 6M in the bandwidth frame.

 

Thanks a lot!

Link to comment

Hi,

 

Is it able to scan other frequencies?

I have tested it with another dvb-t device and it can scan the 722000 freq.

 

Go to Settings -> Hardware and change the options, particularly "Stop stream while tuning", "Use standard interface" and "Retune attempts".

yes, i checked all these settings, but no effect.

 

Dunno if the TransEdit Scanner can cope with it.

isdb-t and dvb-t both use the dvb-t network provider, but maybe there is some difference when scanning frequency.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...