3/24/2016
Goal: set up a DVR for the over-the air TV available in Chicago, Illinois USA
I didn't ever find any documentation that explained completely what I need to do to get it all working, so I am documenting it here. I'm experienced with Linux and Windows but a NOOB with KODI / XBMC. After spending several days trying to figure out how to configure it, I finally have a completely working environment with my local stations showing up in Kodi and their associated show schedules.
Video source: HDHomerun Extend.
PVR hardware: Raspberry Pi 3 with 32GB SD memory
Media Center: Kodi / OSMC
Flirc remote receiver
WD 314GB PiDrive (still waiting for it)
Location: Chicago
The first thing to do was choose a flavor of Kodi / XBMC. First I tried OpenElec, which was easy to install. Next I had to decide on a PVR (DVR) back server. Both a PVR server and client are required. I decided on tvheadend.
I had to install tvheadend server from the OpenElec unofficial add-ins repository. After spending many hours searching the web I could not get tvheadend to detect any MUXes. It seems a major issue is that both OpenElec and tvheadend are very Euro-centric, and I am in the United States for which no documentation exists. Also the tvheadend configuration seems to change rapidly, so there are lots of instructions that are no longer valid.
I decided to install OSMC instead of OpenElec. The installation was well documented on their site. One caveat is that when the installer asks where you want to install OSMC, it means on the Raspberry Pi, not the computer you are installing on. If you are using a USB adapter for the micro SD card, you choose SD card, not USB. I like the OSMC skin better than the Kodi skin.
Tvheadend server is very easy to install from the "My OSMC" App Store. Restart the Raspberry Pi after installing tvheadend.
Next Configure tvheadend 4.0.7
- Determine Raspberry Pi IP
- Launch tvheadend web based config:
http://Raspberry-Pi-IP:9981/
- log in (osmc, osmc)
- Click conguration
- Click DVB inputs
- Click Networks. Add a new network. Choose Type: ATSC. Give it any name, I am using "osmc8".
- Click TV adaptors - you should see the HDHomerun tuners (or other tuners you may have) displayed.
- Open the system log by clicking the double ^ symbol in the lower right corner.
- Click HDHomeRun folder icon, change the network type to ATSC. ATSC is used for over the air broadcasts in the USA. Click Save.
- Click TV adaptors.
- Click each HDHomeRun tuner. Enable it. Change the network to "osmc8". Turn off idle scan. Save.
- Click Networks.
- Click Pre-defined Muxes:
- Choose "United States: us-ATSC-center-frequencies-8VSB". Save.
- Click Look for errors in the log. You may have to reboot the HDHomeRun if you see "locked" messages and the click force scan again.
- Click Muxes. You should see a bunch of muxes. These are the potential base channels. You should see "Pending" in scan results until it detects channels.
- The channel that exist will say "OK", the others will say "FAIL".
- Click Services, you should see all of the channels you can receive with your TV.
- Click Map All, click the "check availability" checkbox.
- Click "Channel / EPG", Channels, Uncheck the channels you don't want to see, then save.
Here's another good tutorial: https://discourse.osmc.tv/t/howto-tvheadend-setup-of-ip-tv-with-osmc-and-the-avm-fritz-wlan-repeater-dvb-c/8471
In retrospect, tvheadend would have worked on OpenElec too, but I had to flail around for a while before I discovered that.
There are two ways to get OTA scheduling, one in zap2xml, the other is
http://www.schedulesdirect.org/ ($25 per year). I chose schedulesdirect because NOOB.
After you sign up, click "Add a new lineup". Choose the lineup for your area.
This was the most difficult part to figure out.
- Install Putty to get you terminal access to your OSMC / tvheadend server.
- Log into the server (osmc, osmc)
- To install xmltv, run:
sudo apt-get install xmltv-util
sudo apt-get update
Here's the xmltv config according to http://wiki.xmltv.org/index.php/HowtoUseGrabbers
From the command line, run: "tv_find_grabbers baseline manualconfig" to list the available grabbers
"tv_grab_na_dd" is the grabber to use for schedulesdirect.org.
This file references docs.tms.tribune.com, which is no longer valid.
Edit /usr/bin/tv_grab_na_dd and replace all references of docs.tms.tribune.com to dd.schedulesdirect.org. The rest of the URL remains the same.
run: "sudo vi /usr/bin/tv_grab_na_dd" to edit the file
run: mkdir /home/osmc/.xmltv
run: "tv_grab_na_dd --config-file /home/osmc/.xmltv/tv_grab_na_dd.conf" to build the config file.
Log in to www.schedulesdirect.org with your schedulesdirect userID and password, choose the lineup, etc.
run: tv_grab_na_dd --output /home/osmc/.xmltv/tv_grab_file.xmltv --quiet to generate a test xml file
run: sudo reboot now
Log into the tvheadend web page
Go to Configuration -> Channel / EPG -> <>EPG Grabber
In General Config, uncheck all.
In Internal Grabber, chose the "XMLTV: North America (Data Direct) grabber.
Uncheck all items in Over-the-air grabbers
Uncheck all items in External Interfaces.
Click the tiny double ^ icon in the lower right to open the system log window.
Click save configuration. If everything worked right you should see it download schedules and channels.
Wait until it finishes, then reboot
Go to Configuration -> Channel / EPG -> <>EPG Grabber -> Channels
Uncheck the channels you don't want to see.
Click on each channel, click the edit button and choose the EPG source for each channel. Save.
Reboot and close your browser
Log into the tvheadend web page
Wait a few minutes then click refresh on the Electronic Program Guide. Schedules should show up.
Installing the client side of tvheadend on OSMC is confusing but not as bad.
From the OSMC interface, go to System, Add-Ons, My Add-ons, PVR Clients, and choose Tvheadend HTSP Client.
Configure Tvheadend userID and password (osmc / osmc).
Enable Tvheadend HTSP Client.
Go to Settings, TV, General and enable it.
Now you will see the "Live TV" menu option, and be able to browse TV channels.
I'll update this if things change and I have to fix anything or if there are more configurations that I don't know about yet...
3/29 update
Testing OSMC interface via HDMI on the HDTV.
You can view the TV schedule.
You can schedule a show to be recorded.
You can play back a recorded show, and it looks great!
Due to an versioning issue between the Tvheadend client and Tvheadend server included with OSMC, you cannot view live TV from Tvheadend client.
HD Recording works fine via WiFi because HDHomeRun Extend "Converts video to H.264 AVC for more efficient streaming and better playback support on portable devices".
Still to test:
Test HDHomeRun client to see if it co-exists with the TvHeadend client / server.
-W