Comprehensive Tvheadend, XBMC, HDHomerun How To
The purpose of this post is to document how after much trail and error I was able to get XBMC to play live TV from my HdHomerun via Tvheadend. I hope it is useful for someone else. I make no claims that it is the only or even the best way to go about accomplishing the goal, only that it worked for me. Please note that this is a complete summary according to the best of my recollection. With this in mind further note that it is not beyond me to possibly have omitted some steps that I either forgot or consider so obvious that they do not need mentioned. Please provide feedback if you feel some added steps ought to be included and I will do my best to update the OP accordingly.
Install XBMC with TV/DVR Support:
sudo apt-add-repository ppa:alexandr-surkov/dharma-pvr
sudo apt-get update
sudo apt-get install xbmc
Install Hdhomerun software:
sudo apt-get install hdhomerun-config hdhomerun-config-gui
Make sure the HDHomerun is found:
Output should read something like:
hdhomerun device 103194EA found at x.y.z.a
If it doesn't check your firewall(s).
sudo apt-get install tvheadend
Make sure tvheadend web UI works and set up users:
open browser go to: http://tvheadendserver:9981/
click "Configuration" tab, click "Access Control" tab;
set up 1 admin user (all rights);
set up 1 xbmc user (all rights except admin);
optionally limit access to local host by setting both prefixes to 127.0.0.1/32.
sudo service tvheadend stop
Install other needed stuff (dvbhdhomerun driver):
sudo add-apt-repository ppa:tfylliv/dvbhdhomerun
sudo apt-get update
sudo apt-get install dvbhdhomerun-dkms dvbhdhomerun-utils
sudo service dvbhdhomerun-utils start
Set kernel module to load on boot:
sudo echo dvb_hdhomerun >> /etc/modules
sudo nano /etc/dvbhdhomerun
change settings to fit your config as described in file.
Start all the little helpers:
sudo userhdhomerun -f
sudo service dvbhdhomerun-utils start
sudo service tvheadend restart
Finish tvheadend config:
open browser, go to: http://tvheadendserver:9981/
click "Configuration", click "TV Adapters"
Select an adapter in dropdown list;
Check Autodetect muxes and Idle scanning;
optionally change the adapter name;
Click Add DVB Network by Location and select yours;
The Status display will now change to show how many Muxes there are and how many more need scanned;
Set up XML Grabbing:
While the muxes scan go to: http://www.schedulesdirect.org/ and register for an account;
Log in, click "Add a new lineup" and follow the prompts;
sudo /usr/bin/tv_grab_na_dd --configure
follow the prompts
sudo cp ~/.xmltv /home/hts/
click the "XML TV tab";
Click "Enable debug output" (the little gear at the bottom right);
Select "North America (Data Direct)";
set desired grab interval;
check "Enable grabbing";
wait for the XML Grabber to do its thing (about 2 minutes), you will be notified it is done in the debug window;
go back to "TV Adapters", with any luck your muxes awaiting initial scan will now be down to 0;
if so, continue below, if not have a cup of coffee or something and wait till theyre done;
Map DVB Services:
Click Map DVB services to channels
Click the "Channels" tab;
for each channel double click in the XMLTV source column and match the channel to the corresponding source;
Save your changes and close the browser.
go to System -> Settings -> Addons -> Installed Addons -> PVR Clients -> Tvheadend HTSP Client -> Configure;
Make changes to suit your setup;
escape to main settings screen;
select Live TV;
escape to XBMC main screen;
select Live TV and verify it works;
you are done.
I have to repeat the "Start all the little helpers:" step after each reboot. Yes, they could be included into some sort of startup script but no, I could not be arsed to find out how. If anyone cares to share, please enlighten me
For reference, I am running the following specs:
Acer Revo 1600 stock, except upgraded to 2gb ram
HTS Tvheadend 2.13
The first post (and some subsequent posts) in this thread makes this sound quite complicated, probably because much of the information was applicable to older versions of the operating system and software that are all fairly outdated by now, but I have found that in Ubuntu 14.04 Server Edition most of the above steps are totally unnecessary. I recently installed Ubuntu 14.04 Server and this is all I really had to do:
1. Download and install Ubuntu Server - http://www.ubuntu.com/download/server
2. Do any necessary configuration on the server (mainly, give it a static IP address so Kodi can find it on the network).
3. Install the HDHomeRun drivers: sudo apt-get install hdhomerun-config hdhomerun-config-gui (note this will automatically bring in a bunch of Linux dependencies, many of which are probably not needed in a server environment but they don't hurt anything).
4. Install TVHeadend: I installed Tvheadend - Master branch - 'unstable' releases using the instructions at https://tvheadend.org/projects/tvheadend/wiki/AptRepository - I have read that the "unstable" release is actually fairly stable, and I have found that to be true. I've also read that it will contain the latest bug fixes long before they get put into the "stable" branch.
And that was all I needed to do to get TVHeadend working - my HDHomeRun adapters showed up in THVheaded's configuration, and everything works normally. I did not need to start any "little helpers" and I did not need to install anything else, other than tv_grab_file (https://github.com/Rigolo/tv-grab-file) so that I could use zap2xml (http://zap2xml.awardspace.info/) to get schedule information (mc2xml no longer works to get free schedule information). tv_grab_file goes in the /usr/bin directory along with the other grabbers and must have the same ownership and permissions as the other grabbers (root:root and executable). I also installed Webmin (http://www.webmin.com/), which makes system administration tasks a bit easier (especially if you aren't a Linux guru) but that's totally optional, and most experienced Linux users won't need it. Just one caution, don't ever use Webmin to stop TVHeadend (from Webmin's Bootup and Shutdown menu) or you will never be able to get TVHeadend to restart automatically after a system reboot until the next update to TVHeadend is installed.
Thank you for updating the instructions. I wrote a set of instructions quite some time ago, after doing so, I decided not to use TVHeadEnd for a variety of reasons. I'm glad to see that the process has become easier.
Nowadays, I might attempt to install on Debian rather than Ubuntu...
No, you do NOT want to use Debian, unless you feel confident in your ability to compile TVHeadend from scratch or it doesn't bother you that at some point you may not be able to upgrade TVHeadend without first upgrading Debian. I made the mistake of using Debian on my first install of TVHeadend and have regretted it ever since, in part because I'm now stuck on the 3.9 branch on that system (not the same one I use with the HDHomeRuns). Admittedly if I were to install Debian Jessie (rather than Wheezy, which is what I have) then I could use a newer version, but it seems TVHeadend primarily supports Ubuntu, not Debian.