Doug Lung / RF Technology
04.01.2013 11:01 AM
Installing the FCC’s ‘TVStudy’ in 24 Easy Steps
A step-by-step guide to get the FCC’s ‘TV Study’ running under Linux.
Doug Lung
In early February, the FCC released “TVStudy” as a compiled program for Mac OS-X and as source code for other operating systems to illustrate how coverage and interference could be calculated for TV stations before and after Incentive Auction repacking.  I've provided a step-by-step how-to get it running under Linux.

An easy way to run Linux on an existing OS like Windows is set to up a virtual machine by downloading and installing Oracle Virtual- Box from http://www.virtualbox.org. Allow at least 60 GB for Linux and the TVStudy program. I recommend using the Xfce version of Manjaro, a pre-configured version of Arch Linux from http://manjaro.org/. See the VirtualBox and Manjaro web sites and the wiki at https://wiki.archlinux.org/ for details on installation and configuration.

After booting Manjaro in VirtualBox you should see a screen like the one in Fig. 1. The TVStudy installation uses the terminal program in Manjaro. Information you need to input at the command prompt in the terminal window is in bold.

These steps should work with other Linux distributions if you verify and change the file locations in the Makefile and tvstudy.h if necessary and the package installation command. See the instructions the FCC link in step 8 for a description of the output files and more program options.

Next month I’ll provide more details on the settings and show how to display cell by cell results in Google Earth.

E-mail me at dlung@transmitter.com with any questions or comments.

After booting Manjaro in VirtualBox you should see a screen like the one in Fig. 1. The TVStudy installation uses the terminal program in Manjaro. Information you need to input at the command prompt in the terminal window is in bold.

1) Install MySQL using: sudo pacman -S mysql libmysqlclient mysql-clients

Fig. 1: Screenshot after booting Manjaro in VirtualBox
2) Install Java: sudo pacman -S jdk7-openjdk

3) Install the Fortran compiler: sudio pacman -S gcc-fortran

4) Install the core bsd libraries: sudo pacman -S libbsd

5) Install git, needed to download the libnostd library: sudo pacman –S git

6) Download libnostd (http://25thandclement.com/~william/projects/libnostd.html) using git: git clone http://25thandClement.com/~william/projects/libnostd.git

7) From the downloaded libnostd/ directory, copy the files in libnostd/bsd to /usr/include/bsd – sudo cp -R bsd/ /usr/include/

8) Download the FCC TVStudy files from http://data.fcc.gov/download/ incentive-auctions/OET-69/ and put them in your home directory. The files total over 16 GB so it may take days to download depending on your Internet connection. The tar archive is broken into 2 GB files that can be downloaded individually.

8) Install the par2 library and program to test and repair the FCC files (optional): sudo pacman -S libpar2 par2cmdline

Fig. 2: Longley Rice error flags
9) Verify the files: par2 v 2013Jan_tvstudy_files.par2 
This will also take a long time. Be patient.
If errors are found repeat using “r” to repair instead of “v”.

11) Concatenate the tgz (gzip compressed tar files). All eight files must be listed in the correct order! Due to page formatting it shows here as multiple lines, but everything must be entered on one line. It will take a long time to complete.

cat 2013Jan_tvstudy_files.tgz.001 2013Jan_tvstudy_files.tgz.002
2013Jan_tvstudy_files.tgz.003 2013Jan_tvstudy_files.tgz.004
2013Jan_tvstudy_files.tgz.005 2013Jan_tvstudy_files.tgz.006
2013Jan_tvstudy_files.tgz.007 2013Jan_tvstudy_files.tgz.008 >
2013Jan_tvstudy_files.tgz

12) Extract the files: tar zxvf 2013Jan_tvstudy_files.tgz This will also take a long time

13) Download modified Makefile and tvstudy.h files from: http://xmtr.com/tvstudy/Arch/Makefile and http://xmtr.com/tvstudy/Arch/tvstudy.h

14) Copy Makefile to 2013Jan_tvstudy_files/dev/Makefile

15) Copy tvstudy.h to 2013Jan_tvstudy_files/dev/src/tvstudy.h

16) Change to the 2013Jan_tvstudy_files/dev directory. Clean out any old compiled programs (just to be sure...) and then compile the program. Although warnings may appear it should complete without errors:
make clean
make all

17) If there are no errors, install: make install

18) Configure systemd to start MySQL automatically when Linux starts then start MySQL:
sudo systemctl enable mysqld
sudo systemctl start mysqld

19) Start a MySQL shell. You should see the greeting and a mysql> prompt if all goes well: mysql -u root

20) Set the MySQL password. I used “tv”. Don’t forget the “;” at the end! update mysql.user set password = password(‘tv’) where user = ‘root’;

21) Exit MySQL by typing exit without the “;”

22) Change to the 2013Jan_tvstudy_files/sql directory. Build the database for TVStudy. Like some of other steps, this will take a long time. Go do something else for a while! This command MUST be run from the 2013Jan_tvstudy_files/sql directory!
mysql -u root -p

enter the password from step 20 at the password prompt. At the mysql> prompt enter: source build_root.sql When the mysql>prompt returns, type exit

23) Change to the 2013Jan_tvstudy_files/ directory and start your first study: java -jar tvstudy.jar

The password is the one set in step 20. Under the “Study” menu select “New”. Before clicking “Create”, click “Browse” to select the CDBS file location, normally at 2013Jan_tvstudy_files/cdbs/22Feb2012 then after a while a dialog will appear to change the default parameters. Ignore it for now.

Create a Scenario by selecting “New” in the Scenario window that opens after the study is created. Give the Scenario a name and hit “Create”. Do not bother with the other options on the screen for now.

On the next screen, click the “Add” button at the bottom of the window. You can now search CDBS for a specific station by facility ID, Call Sign, File Number or channel and city.

If you want to analyze interference check the “Add undesired stations” box. A list of matching records will be displayed in a box below. Click “Use” to select the one to study.

Once all the stations are loaded the list will be displayed and stations can be added or removed. DO NOT USE THE [X] on the frame to close any TVStudy Java windows! Only use the “Close” menu item under “Window”!

In the window for the study you have created there will be three tabs— Scenarios, Rules, and Study. “Rules” allows you to modify OET-69 interference rules and “Study” changes the Longley-Rice parameters, including treatment of Longley Rice error flags.

To replicate the current OET-69 defaults, change “Longley-Rice Error Handling” to “Assume Service” and the “Depression angle method” to “Effective Height” rather than “True Geometry.” The 2010 population data is the default, but to match existing OET-69 studies 2000 population will have to be selected.

Click the “Save Study” button in the lower right. It can also be saved under the “Scenario” menu. Close the windows using the “Window” menus’ “Close” function.

24) The study has to be run from the command line. For example, if the study created in step 23 was called “KNBC”, the scenario was called “KNBC_default” and the output file name is to be “knbc_default” the command would be:
./tvstudy localhost root tv “KNBC” “KNBC_default” knbc_default



Comments
Post New Comment
If you are already a member, or would like to receive email alerts as new comments are
made, please login or register.

Enter the code shown above:

(Note: If you cannot read the numbers in the above
image, reload the page to generate a new one.)

1.
Posted by: Anonymous
Thu, 06-20-2013 - 4:24PM Report Comment
Doug, Love your article... as usual. It would be great if you could follow up on this with some practical operating tips. And perhaps some suggestions on ways to make use of the shape files... preferably without having to spend money on expensive GIS software. Thanks Dave




Thursday 2:01PM
IBC APP Now Available
I downloaded the app and found it useful for my main IBC pitfall


 
Featured Articles
Discover TV Technology