The SA MCE Community

The South African Windows Media Center Edition Community

Syndication

Go ahead! Subscribe to our feeds and keep up to date with what's going on.

Adverts

Articles

This blog is used to publish articles and other content for the community.

Finding analogue TV broadcast frequencies for MCE 2005

For those of you need to setup MCE 2005 using an antenna, this is for you.

We are going to step through the options you have to get the all important frequency data and registry keys that MCE requires to view the TV signal for your area.

Remember, no matter what you do, if you have a bad signal coming into your MCE or TV, there is not much either can do about it.  Have a look at this article, Analogue TV signal issues here on this site regarding a bad TV picture and what you can do about it.

First, some background with regards to how MCE, and most other PVR software, works all this out.  DirectX handles all the internal frequency setup for most applications that need a TV signal.  Your video card driver will interact with DirectX to find the frequency for your area using pre-defined tables.  These DirectX tables have frequency data for a number of countries. The correct country code, the same as the international dialling code prefix, is determined via the country settings you PC is set to.  This can be setup in the Control Panel under the Regional Settings icon.  South Africa uses the same frequency table as the United Kingdom.  You can find the table here on the MSDN site.

When scanning for channels, the TV tuner filter in DirectX will use this frequency table to look for channels instead of scanning the whole frequency spectrum as this is a lot quicker.  When the TV Tuner filter tunes to a channel, it scans for the most precise signal.  In other words, once a channel is found, it auto tunes by itself to get the correct lock.

Although these frequencies are generally expected to be exact, broadcast frequencies may be adjusted up or down several Hz (Hertz) by the broadcast station to reduce potential interference with neighbouring channels.

DirectX supports that if no channels are found, you can specify frequency overrides yourself, which take precedent over those stored internally within DirectX. A significant amount of effort was spent to ensure that the broadcast frequencies and colour standard assignments are correct for each country or region. Even so, there will be situations when the frequency tables are not sufficient, contain errors, or become obsolete. To address this problem, the frequencies listed in the TV Tuner filter's frequency tables may be selectively overridden by using the registry.  These are known as frequency overrides and are grouped into application-defined "tuning spaces," which are identified by number.

You specify these overrides in a registry key.  The key can be found at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TV System Services\TVAutoTune. Within this registry key, you will see that there are a number of sub keys with the following format:  TSXX-0 or TSXX-1.  TS stands for Tuning Space.  XX is the country code based on the international dialling code prefix.  0 or 1 indicates the signal type, 0 is for analogue antenna and 1 cable or satellite.

Within those keys there are a number of DWORD sub keys and values.  The DWORD key name is the channel number and the value is a hexadecimal number equating to the frequency in Hz that you require.  You are looking at an 8 digit number, e.g. 243250000 equates to 243.25MHz.

The following example shows an example override, the one I use for my MCE setup:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TV System Services\TVAutoTune\TS27-0]
"1"=dword:0aec2c50
"2"=dword:0c5a6250
"3"=dword:2fa39650
"4"=dword:21557a50
"5"=dword:2dbb4e50


Note the "TS27-0" key name. 27 for South Africa and 0 for analogue antenna.

In the above example the DWORD sub key named 5 overrides the frequency value for the frequency at index 5 in the internal frequency table.

Although overriding the base frequencies is supported the TV Tuner filter will still auto tune the last bit to get the best picture.  You cannot manually do an adjustment up and down the frequency spectrum to try improve things.  It will either lock onto the signal and therefore have the best possible picture or it won't be able to and you will have a snowy image.  In other words, if you have a snowy picture now, and do an override to move up or down .25mhz, you will have the same snowy picture, as the TV tuner will still find the signal and still auto tune to the horizontal lock that it had found before.

There is a chance the local frequencies differ from that given by the DirectX table, hence no amount of tuning or scanning will find any stations. As mentioned above, it doesn't scan every part of the frequency spectrum looking for a signal as that will take too long.  It only scans where it expects to find a signal so, you can do a scan and miss everything if your local broadcast frequencies differ to those that Windows knows about.  By putting in the registry overrides the TV Tuner will find channels, but you haven’t achieved an auto tune, what you have done is told the card where to expect to find channels, the card has then auto tuned given those base frequencies to start with.

OK, so now we have got that sometimes confusing lot out of the way, we can discuss ways to scan for frequencies.  Both of the steps outlined below only ever need to be performed once for your MCE.  Once you have this data store it somewhere safe or just save the registry key and if you ever rebuild the machine, you can just import it again.  You only need to perform 1 of the 2 options listed below.

The output of this exercise will give you the information that you need when using this article to get EPG data in Media Center using SmartGuide 2005 or this article using QuickGuide as well as a registry file that you can use in any way that you want.  

Option 1: Use MCE

Before we begin, I have read a number of reports that MCE machines running MCE Rollup 2 or later have issues finding channels whilst performing a scan.  I have tested this and from what I saw, it appears those reports are partially correct.  After Rollup 2 was installed, I found that MCE defiantly picked up less channels but it did pick up all the channels that it did before MCE Rollup 2 was installed.  I might just be lucky that it did find all my channels though. Just bear this in mind, if you are struggling to get this to work.  You may need to do this process on a machine that does not have Rollup 2 installed.
  1. Build your media center PC as per usual.  Run MCE for the first time. 
  2. Click through the first couple of screens, choosing the options you want until you get to the screen called Optional Setup. 
  3. Select Configure tuners, TV signal, and Guide and click Next.
  4. On the confirm your region page, ensure the current region is set to South Africa or whatever country you live in.  If it isn't, close MCE and chnage this under regional settings and start again.  If everything is correct, select Yes, use this region to configure TV services and click Next.
  5. Choose Antenna as your input and click Next.
  6. On the Guide Privacy screen, click No under Do you want to use the Guide? and click Next.
  7. On the Scan for Services screen ,click Start Scan.  Once the scan is complete, click Next.
  8. Run through the rest of the setup until it is finished, configuring any relevant options along the way.
To get the actual frequency in Hz for each channel, navigate your way to Settings > TV > Guide > Edit Channels from within the MCE UI.

You should then be presented with a list of channel numbers and frequencies. 



Unfortunately, this list can get compromised by the fact that if MCE detects teletext on a channel, it will not display that channels frequency in the list.  Also, for some reason does not like some frequencies and won't display them at all.  All you have to do is write down the frequency for each TV channel.  In the case of there being 2 channels listed for the same TV channel, just choose the one with the best picture.  If you are happy with your results, move on down to the section of this artcle that explains how to use the frequencies.

If all your channels are not present or you are not happy with the image quality you can always run scan again.  To do this navigate your way to Settings > TV > Scan for More Services and click the Start Scan button.  This will run the scan again and it might find more to append to your list.

If for some reason you don't have any luck gathering your frequency data using MCE, try it using the other method below.

Option 2: Use MediaPortal

MediaPortal is an awesome open source HTPC application that is an alternative to MCE 2005.  It has some great features and some really talented and dedicated developers work on it.  You can read more about it on their website.

One of the great features of this product is the nice configuration tools that they have written.  We will use these tools to get the information that we need.
  1. Download and install MediaPortal.
  2. Run the Setup MediaPortal icon on the Desktop or in the Start Menu.
  3. Once the window opens select Television and then Capture Cards in the left tree.
  4. Your TV capture card should be listed in the right pane of the window.  Select your card and click the Edit button.  If it is not in the list, click the Add button.
  5. Once the window opens, select the Auto tune tab.
  6. Ensure the country is set to South Africa or whatever country you are looking for and that your input source is set to Antenna.  Once you are happy click the Scan button.
Once the scan is complete, you should see a window similar to this one:



If all your channels are not present or you are not happy with the image quality you can always click the Scan button again.

Once all the channels have been found go to this page on MSDN and map the channel numbers in the Ch column to the ones in the table to find the frequency.  In the case of there being 2 channels listed for the same TV channel, just choose the one with the best picture.  For example, in the screenshot you'll see that the scan picked up channel 8.  I identified this as SABC 2 using the preview window.  Going to the page on the MSDN site, I can now see that the frequency for SABC 2 in my area is 207250000 Hz or 207.25 MHz.  

Perform this method for each channel you want to use.  The table below, lists all the relevant frequencies I found.

1 - SABC 1 = 183250000 Hz
2 - SABC 2 = 207250000 Hz
3 - SABC 3 = 799250000 Hz
4 - MNET = 559250000 Hz
5 - E-TV = 767250000 Hz

Use the frequencies

So what do you do with these frequencies now that you have them?  Well, both SmartGuide 2005 and QuickGuide need these frequencies when a guide update is run.  SmartGuide allows you to enter these channels into the application and will apply them automatically if the correct switches are used.  Have a look at this article on this site for more information regarding setting up SmartGuide or this one regarding setting up QuickGuide.

QuickGuide does not support this feature and you need to import registry key manually after each guide update to accomplish the same thing SmartGuide does.  See steps 19 and 20 in this article for more information regarding this.

To create a registry key based on the above data that can be used to import the frequencies after a guide update perform the following steps:
  1. Open regedit.exe and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TV System Services\TVAutoTune.
  2. Delete all the keys with the name TS27-0.
  3. Create a new key called TS27-0 by right clicking the TVAutoTune key and selecting New > Key.
  4. Create a new DWORD value by right clicking the TS27-0 key and selecting New > DWORD value.  Name the value 1.
  5. Set the value data for the newly created key by double clicking on it.  When the box opens, select Decimal and type 183250000 in the Value data field.  Click OK.  The value should then be converted to the Hexadecimal value when you do so.
  6. Repeat steps 4 and 5 for each of the channels in the order that you want the channels to be listed.

Once you have done this all your channels will be listed in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TV System Services\TVAutoTune key.  Simply export this key by right clicking the TS27-0 key or the relevant key for your country, choosing Export, save the file and you are done.

In the end, you should have something that looks along the lines of this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TV System Services\TVAutoTune\TS27-0]
"1"=dword:0aec2c50
"2"=dword:0c5a6250
"3"=dword:2fa39650
"4"=dword:21557a50
"5"=dword:2dbb4e50


One final option:

If you have a Hauppauge TV card, have a look at FreqCopy which is a tool that takes channel and frequency information from tables constructed by Hauppauge's WinTV software and automatically builds the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TV System Services\TVAutoTune\ for you.  I have had varying degrees of success with this little application, mainly due to the WinTV application not being the best around.  

Last resort:

If all of this fails and you simply cannot get an antenna input to work with MCE, you can get around using an antenna as a TV source in MCE by using a video machine to capture the TV signal.  You then output from the video machine to the MCE TV card using RCA or S-Video cables and setup MCE to use satellite as a TV signal source and configure it to use the IR blaster to change channels on the video machine.  By setting MCE up in this way, you basically fool MCE into thinking you have a set top box like a DSTV decoder.

Good luck!

Published May 04 2006, 04:48 PM by Chris
Filed under:

This is the Articles blog where we will publish articles covering various topics related to configuring and using media center and other technologies in your home.

Remember, you can use the forums to ask specific questions or the Questions and Suggestions forum to suggest an article you think should be here.


Theme design is Corona 2007 by Chris Lotter.

© Copyright SA MCE Community, 2006-2007. All rights reserved.
Microsoft©, Windows Vista© & Windows XP© are registered trademarks of Microsoft Corporation.

Powered by Community Server (Commercial Edition), by Telligent Systems