Getting the Prime set up on Tvheadend took quite a bit of trial and error, but this is the setup that I am using, and has been working well for me. This method uses the Automatic IPTV Network type that is only present in the current 4.1 development builds, so you need to upgrade if you haven’t done so yet. (Also, I recommend using a build from within the last 2 weeks as there were several fixes to the TS handling that I noticed have greatly improved the quality of the recordings and minimized the number of transport/continuity errors I was previously experiencing.)
1. Network setup
This is the most time consuming part. The first thing you need to do is create a M3U playlist file that contains all of the channels you wish to have available in Tvheadend. The format is really quite simple: the first line in the file is:
#EXTM3U
This just indicates what kind of file this is. The rest of the file is comprised of pairs of lines: the first is an info line which indicates the name you want the Service to be in Tvheadend, and the other is the URI to the stream itself:
#EXTINF:-1,CBS
http://192.168.1.5:5004/auto/v702
Everything after the comma (,) in the info line is used as the Service name. (This is helpful when creating your Channels later, as having Channel and Service names being the same makes mapping them MUCH easier.) The URI is specific to your Prime. The general format is:
http://[ip_address_of_prime]:5004/auto/v[cable_channel_number]
So in my example above, my Prime would have an IP address of 192.168.1.1, and CBS would be the name of the channel found on channel 702 in my cable lineup. The beginning of my M3U looks like this:
#EXTM3U
#EXTINF:-1,CBS
http://1321DC95:5004/auto/v702
#EXTINF:-1,NBC
http://1321DC95:5004/auto/v704
#EXTINF:-1,The CW
http://1321DC95:5004/auto/v705
#EXTINF:-1,ABC
http://1321DC95:5004/auto/v707
#EXTINF:-1,KCAL
http://1321DC95:5004/auto/v709
#EXTINF:-1,Fox
http://1321DC95:5004/auto/v711
#EXTINF:-1,MyTV
http://1321DC95:5004/auto/v713
#EXTINF:-1,KCET
http://1321DC95:5004/auto/v728
#EXTINF:-1,Ion
http://1321DC95:5004/auto/v730
#EXTINF:-1,PBS SoCal
http://1321DC95:5004/auto/v700
#EXTINF:-1,KDOC
http://1321DC95:5004/auto/v710
#EXTINF:-1,PBS
http://1321DC95:5004/auto/v25
(You may have noticed that my listing has my Prime’s Device ID instead of its IP address. This is because there is a bug/problem with some network configurations in the Prime’s network start that causes it to drop off the network. As a workaround, my Primes are connect directly to the computer running Tvheadend over a link local connection via USB ethernet adapter. Because of this, I cannot give them IP addresses—the combination of DHCP and gigabit ethernet seems to be the root of the problem with the Primes—so I have script that modifies my hosts file to allow me to address each Prime attached by its ID.
In your situation, it is probably sufficient to merely setup an IP reservation in your router’s DHCP server settings. This will keep addressing consistent, and make dealing with Tvheadend easier: if Tvheadend sees that there was a change in the M3U, it needs to rescan the muxes.)
After you have your M3U file created, save it somewhere that Tvheadend can see it. (I have mine in the same directory that I store channel icons, but you can use your Tvheadend user’s home directory if you like. Then, in the Tvheadend WebUI, create a new Automatic IPTV network, and for the source, set it to:
file:///home/hts/prime.m3u
or whatever the full path to the file you just created is. Then, before you select create, change to option for the Maximum number of inputs to 3. This will allow Tvheadend to use all of the tuners in your Prime.
Once you have your network created, you need to scan your muxes for services. This step basically attempts to open each URI listed in the M3U file, and if it can open a stream, it will create a Service matching the name you put in the EXTINF line above the URI.
Since each URI is directed to a specific Prime device based upon its IP address, if you have multiple Primes you need to have multiple M3Us, each one as a separate Automatic IPTV network. (For my setup, I have 3 Primes, so I have 3 Automatic IPTV networks, one for each device. The M3U files for each Prime is identical, except for the IP address in the URI, which is specific to each device. You can easily do a find & replace on the IP address in the M3U file if you need to address multiple Primes.
That should get you setup with access to your Primes in Tvheadend. The next step is getting your channels created, and mapped to both Services and EPG Channels.