+*TVHeadEnd Configuration Instructions*+
Ubuntu 10.04.4 Server
Silicon Dust HDHomeRun Tuner
North American Guide Listings
XBMC 12 (Frodo) as a Front End
Note: This is a Work in Progress. If I have time, I may add more to this, but this should be enough for most U.S. based users to get TVHeadEnd fully functional. Note that you CANNOT use Ubuntu 12.04 until someone tells me how to re-compile the Linux Kernel with the DVB Headers. You'll have to use 10.04.4.
------
. Install Ubuntu 10.04.4 Server. Use all default options, except select to install the SSH Server for remote access to the console.
. Install HDHomeRun Drivers:
sudo apt-get install hdhomerun-config hdhomerun-config-gui
Note: These are the drivers provided by Silicon Dust to allow use of the HDHomeRun on Linux.
. Install HDHomeRun Add-Ons
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:tfylliv/dvbhdhomerun
sudo apt-get update
sudo apt-get install dvbhdhomerun-dkms dvbhdhomerun-utils
Note: These are add-ons developed by others to allow HdHomeRun to work with TVHeadEnd. They do not work with newer versions of Linux, and do not work with Ubuntu 12.04.3. Apparently, newer versions of Ubunut have Kernels that do not include DVB Headers, and so the Kernel must be recompiled with them, or something. If anyone knows how to do that, please post here!
Some guides have indicated that you need to configure /etc/dvbhdhomerun, but I left it alone and it worked. Here are the instructions from another guide:
hdhomerun_config discover
Make a note of your Device ID.
sudo nano /etc/dvbhdhomerun
You'll see something like this:
[1210E3DC-0]
tuner_type=ATSC
use_full_name=true
Make sure that the information in brackets "[]" matches your device ID. If you are using an off-air antenna, verify that tuner_type is ATSC. Include one entry for each tuner on your network.
To restart the drivers:
sudo service dvbhdhomerun-utils restart
. Install TV HeadEnd:
sudo apt-add-repository http://apt.tvheadend.org/stable
sudo apt-get update
sudo apt-get install tvheadend
(Note that currently the repo does not work for Ubuntu 10.04.4, so do this instead):
sudo nano /etc/apt/sources.list
Add to the end of the file:
deb http://apt.tvheadend.org/stable lucid main
Ctrl-X, Y, ENTER to save and exit.
sudo apt-get update
sudo apt-get install tvheadend
Answer all prompts "Yes".
During the install, you will be prompted for a admin username and password. Remember this, as you'll need it to login to the web interface and to configure XBMC to connect.
Note: TVHeadEnd is the program that records TV. It runs as user: hts
It stores its config files in /home/hts/.hts/tvheadend
If you later want to change the username/password, use this command:
sudo dpkg-reconfigure tvheadend
. Download mc2xml
Visit web-site (mc2xml.hosterbox.net) and locate download link for Linux
cd /home/hts
sudo mkdir mc2xml
sudo cd mc2xml
sudo wget http:(Download Link obtained above)
sudo mv index* mc2xml
sudo chmod +x mc2xml
sudo ./mc2xml -c us -g 90024
You'll be prompted to select a lineup and then the program will download the channels to xmltv.xml in the same folder.
Note: This is a third party program that will download Program Guide listings to an XML File. Replace 90024 with your ZIP Code. Change 90024 to your zip/postal code. If you're in Canada, change -c from us to ca.
The download link changes frequently, so always go to the web-site to get the latest link immediately before you download. If you use an old link, you'll be downloading a web-page instead of the mc2xml app.
In the future:
sudo home/hts/mc2xml/mc2xml
by itself will cause it to update the file in the future.
To reset the program,
sudo rm /home/hts/mc2xml/mc2xml.dat /home/hts/mc2xml/xmltv.xml
. Set up Cron Job to download updated guide data daily
sudo nano /etc/cron.daily/mc2xml
type the following:
#!/bin/sh
# Update Program Guide Information Daily
cd /home/hts/mc2xml
/home/hts/mc2xml/mc2xml
CTRL-X, Y to save and exit
sudo chmod +x /etc/cron.daily/mc2xml
. Download TV Grab File
cd /usr/bin
sudo wget
https://tv-grab-file.googlecode.com/files/tv_grab_file
sudo chmod 777 tv_grab_file
sudo nano tv_grab_file
and change line that begins with cat to:
cat /home/hts/mc2xml/xmltv.xml
CTRL-x, Y to save and exit.
Note: This file is needed to allow TVHeadEnd to interface with the XML files that are downloaded by MC2XML.
. Restart TVHeadEnd:
sudo service tvheadend restart
Note: Necessary so that TVHeadEnd finds tv_grab_file.
. Configure TVHeadEnd:
Using a computer that has a web browser on it, enter the following URL:
http://IPADDRESS:9981
Note: Replace IPADDRESS with the IP address of your Ubuntu machine. If you don't know what it is, type:
ifconfig eth0
at the command prompt.
Click chevrons in bottom right hand corner to bring up log and watch as TVHeadEnd does the configuration. click the gear to the right after the log is open to enable debugging (more detailed log information).
. Have TVHeadEnd Scan for channels
click "Configuration", click "DVB Inputs," click "TV Adapters"
Select Click on "Select TV Adapter" to pull down a list of recognized TV Sources;
Check Enable, Autodetect muxes, Skip Initial Scan, and Uncheck Idle scanning;
optionally change the adapter name;
click save at the bottom;
Click Add DVB Network by Location, select US, select "US_ATSC....", click Add DVB Network.
Repeat the above for the second TV Adapter in the dropdown list.
Over on the right hand side of the screen, take note of the following:
Services: 0
Muxes: ??
Muxes awaiting initial scan: ""
The system will scan each Mux (a potential channel) to see if there is a service (an actual channel). When Muxes awaiting initial scan reaches 0, all potential
channels have been scanned and the number shown in "Services" is how many channels were actually found.
You can watch the scan by opening the log (chevron in bottom right hander corner of screen) and enabling debugging by pressing the gear next to the chevrons after the
log window is open.
. Set-up Program Guide in TVHeadEnd:
Configuration/Channel/EGP/EPG Grabber:
Check all three options in general config
Internal Grabber
Module: XMLTV: tv_grag_file
Over the Air Grabbers: Uncheck All
Save
Note: This tells TVHeadEnd to use the tv_grab file to get the XML data that you downloaded previously. It will force TVHeadEnd to download the choices for Guide Data. The actual guide data will not be downloaded because you haven't set-up any channels yet.
. Give a Temporary Channel Number to Each Service so you can watch each channel in XBMC:
NOTE: Wait here until "Muxes awaiting initial scan:" reaches 0 in the "Configuration/DVB Inputs/Select TV Tuner" area. You can also tell that this is done because
the "Map DVB Services to Channels" button will become active. Note that due to a bug in TVHeadEnd, the "Map DVB Services to Channels" button does not currently work.
Instead, you'll have to manually map the DVB Services to Channels using the following procedure:
Configuration/DVB Inputs/Services
Close the log window (chevrons in the bottom right hand corner) or you may not see all the Services!
Click the spot under Channel Name to the right of the first service.
Type a number in the "Channel Name" field, starting with 100.
Hit enter after each one to move to the next cell and increase the number by 1, i.e. 101, 102, 103, and so on.
When done, click "Save Changes"
Note: This will also create Channels in Configuration/Channel/EGP/Channels for each channel that you name.
. Go to a device that runs XBMC
Install XBMC PVR App for TVHeadEnd and configure.
System -> Settings -> Addons -> Installed Addons -> PVR Clients -> Tvheadend HTSP Client -> Configure;
Give it the IP address and username and password for TVHeadEnd.
System -> Settings -> Live TV -> Enabled: Check
Escape to XBMC main screen; select Live TV and verify it works.
. Watch each channel.
As you watch, go back to your TVHeadEnd interface:
Configuration/Channel/EPG/Channels
Once you determine what the channel is,
A. click EPG Grab Source for that channel and select the channel description that matches.
B. Type in the Channel Number in the "Number" field. These channel numbers are used by XBMC to Order the channels, and are shown if you select the option in XBMC to show original channel numbers.
When You're done, click save changes at the top.
. Update the program guide data in TVHeadEnd now that you've set-up your channels.
TVHeadend: Configuration/Channel/EGP/EPG Grabber:
Change the number of hours to anything other than what it is now (I recommend 24 - you can change it back later) to force a guide update now. Click Save.
Now the Program Guide in TVHeadEnd should populate. If it doesn't, hit the refresh button in the middle left hand-side of the screen.
. Update the program guide data in XBMC:
Settings/Live TV/General/Reset the PVR Database- to force XBMC to download the latest guide settings.
. Go to the Program Guide in TVHeadEnd and start setting up your timers to record shows.
-------
-------
If you prefer to use Schedules Direct for Guide Data, then skip the instructions above relating to mc2xml and TV Grab File, you can try these instructions. I haven't tested them, but they should work.
Go to:
http://www.schedulesdirect.org/ and register for an account;
Log in, click "Add a new lineup" and follow the prompts;
Sign out;
sudo /usr/bin/tv_grab_na_dd --configure
follow the prompts
sudo cp ~/.xmltv /home/hts/
(Note: The line above may not be necessary.)
click the "XML TV tab" (in TVHeadEnd?)
Click "Enable debug output" (the little gear at the bottom right);
Select "North America (Data Direct)";
set desired grab interval;
check "Enable grabbing";
hit save;