Project

General

Profile

Help! Can't get muxes or channels to detect "properly"

Added by Mike Stecker about 9 years ago

I have been having the hardest time getting TVHeadend setup and working properly with my system. I am running TVHeadend 4.2 on a QNAP NAS with a HDHomeRun and Verizon FiOS TV service. Please bear with me as I don't really understand all the terms, what works in/out of the USA, etc.

Here's my setup:

I live about 2 hours east of Los Angeles and this is where I get my main locals from. I'm not sure if that information matters, but maybe it does for the sake of the muxes.

The actual HDHomeRun works great. I'm on the latest firmware, I can use their official KODI app and see all the channels, proper guide and everything. The actual HDHomeRun device says that I have exactly 300 channels and everything I've tried so far works great using their official app or browsing using the web interface.

I have even run the command on the QNAP to get a list of all the channels, etc and tried building a custom dvb list file as well. The log ran fine, I was able to see hundreds of channels in the list, many of which were encrypted.

I have tried setting TVHeadend up in two different ways: ATSC and DVB-C (changing HDHR driver settings to "force" one or the other). I spent more time on the DVB-C side but I could never get anything to work as DVB-C.

As for setting it up as ATSC, I was able to get a list of services after having to MANUALLY type in all the muxes one by one. There are 163 in the log file that I generated using the command tvheadend option hdc 131F0BFD scan /tuner0 /share/CACHEDEV1_DATA/tuner0.log, however I only added the ones that the log file showed had actual channels. There are 116 that I have added and this resulted in finding 707 services.

So the areas I am having trouble are:
  • DVB-C - shouldn't I be using this instead of ATSC? I don't know why all the muxes I manually add under DVB-C fail the scan. The errors I get when scanning muxes set up as DVB-C are: linuxdvb: HDHomeRun DVB-C 131F0BFD-1 : DVB-C #0 - failed to tune [e=Invalid argument]
    • In getting as far as I did setting up as ATSC, I can only seem to map 105 channels because the rest are encrypted. Yet, using the actual HDHomeRun, I can access many of the channels that were marked as encrypted. How can I get these channels?
  • When mapping services to channels, no proper data seems to be mapping. Everything maps with names such as "549MHz/{PMT:1080}", and in the log file that I ran to get my list of muxes, the closes match I can find says "PROGRAM 3108: 511 KTTV-65-DTV"
  • Since the actual HDHomeRun app can get guide data, channel data, icons, etc, shouldn't I be able to get that here?

I attached the log file I generated as well as the "custom" mux list that I made from the log.

Here is more information, not sure if it's relevant or not:

# dmesg | grep -i dvb
[50595.938479] hdhomerun: creating dvb device for 131F0BFD-0
[50595.938619] DVB: registering new adapter (HDHomeRun)
[50595.940039] DVB: registering adapter 0 frontend 0 (HDHomeRun ATSC 131F0BFD-0)...
[50595.940333] HDHomeRun0: DVB Frontend registered
[50595.940341] HDHomeRun0: Registered DVB adapter0
[50595.941086] hdhomerun: creating dvb device for 131F0BFD-1
[50595.941732] DVB: registering new adapter (HDHomeRun)
[50595.943362] DVB: registering adapter 1 frontend 0 (HDHomeRun ATSC 131F0BFD-1)...
[50595.943930] HDHomeRun1: DVB Frontend registered
[50595.943938] HDHomeRun1: Registered DVB adapter1
[50595.944828] hdhomerun: creating dvb device for 131F0BFD-2
[50595.945398] DVB: registering new adapter (HDHomeRun)
[50595.948015] DVB: registering adapter 2 frontend 0 (HDHomeRun ATSC 131F0BFD-2)...
[50595.948614] HDHomeRun2: DVB Frontend registered
[50595.948622] HDHomeRun2: Registered DVB adapter2

# tvheadend showlog
TVHeadend QPKG log created: Wed Aug 19 10:06:17 PDT 2015
Transferring control to TVH_Dev_HDHomerun...
Adding HDHomerun support...
   Loaded dvb-core.ko
   Loaded dvb_hdhomerun_core.ko
   Loaded dvb_hdhomerun_fe.ko
   Loaded dvb_hdhomerun.ko
   Existing device node -> Misc device(#10):hdhomerun_control(#55)
   Loaded userhdhomerun
   Waiting 10s for userhdhomerun to detect tuners and create devices
   Found 3 tuners created by userhdhomerun
   Existing device node -> hdhomerun_data(#251):Num(#0)
   Existing device node -> hdhomerun_data(#251):Num(#1)
   Existing device node -> hdhomerun_data(#251):Num(#2)
   Existing device node -> DVB(#212)
   Existing device node -> DVB(#212)
   Existing device node -> DVB(#212)
HDHomerun drivers loaded successfully.
Checking dvb-scan files... 1 file(s) found.
TVHeadend started.

Anyway, if someone could help me figure out how to get everything to work properly that would be great! Thanks!


Replies (13)

RE: Help! Can't get muxes or channels to detect "properly" - Added by Gary Brown about 9 years ago

in the USA the system used is ATSC only.

For encrypted channels when you map the channels tick the include encrypted channels.

Cannot answer the final question but if you have time to get yourself on the irc channel and ask on there as a few people have this sort of setup.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Eric Bookbinder about 8 years ago

Mike,

Did you ever get this working? I am going to be setting up tvheadend with a FIOS cable card whenever it comes in.
Thanks!

RE: Help! Can't get muxes or channels to detect "properly" - Added by Robert Cameron about 8 years ago

The Prime (and other CableCARD devices) do not use the Channel(frequency) and Program selection tuning that DVB systems use. Therefore, you cannot use this method with Tvheadend.

While US encrypted cable does use frequencies as channels (muxes), and those frequencies do carry multiple Programs (Services), that is not how a CableCARD tuner actually tunes the channel. Instead, the CableCARD, or optionally its Tuning Adapter, maintains a separate channel mapping that is used. To access this, a "virtual channel" is used for tuning. (For example, in my particular situation, the HD stream of CBS is on frequency/mux 145.75MHz, and the Program ID for its stream is 412; that particular mux also carries programs 411, 413 and 414. However, to tune to that channel, I have to tell the Prime to tune to the "virtual channel" 702, because otherwise it will not decrypt the stream.)

Unfortunately, Tvheadend presently has no capability for use virtual channels for tuning, so you cannot the Prime as your would other devices in Tvheadend.

However, there is a workaround: The Prime will give you stream over HTTP, and you use that address as an IPTV input into Tvheadend. This is the method I use, and it works well for me. I presently have 2 Primes set up this way, and soon will be adding a third. (I figure with 9 tuners, I should be able to mimic the Dish/DirecTV feature that records all primetime broadcasts on the main networks.)

If you want further details on how a setup like this might work—using the Primes as IPTV inputs—let me know and I will share how to set it up, including the best ways to manage/map service and channel names for easier management.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Eric Bookbinder about 8 years ago

A guide would be great. There really aren't many guides for FiOS or services like they.

Thanks!

RE: Help! Can't get muxes or channels to detect "properly" - Added by Robert Cameron about 8 years ago

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.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Mark Moroni about 8 years ago

To easily generate the m3u file, I stumbled across the following python script: https://gist.github.com/JoshKastang/88d5081dfdbaaf04092c

The main change you need to make in the script is to provide your Prime's IP (which I have set as as a DHCP reservation in my router so the Prime's IP doesn't change).

@Robert - A question for you...

I currently only have one prime set up with TVH. In order to add a 2nd (or 3rd) prime, I assume you need to go thru he same steps as above except having a new M3U created for the 2nd Prime's IP. However, if you set up separate muxes/services for the 2nd prime, does it show duplicate channel listings? (i.e. you'll have a channel "2" for Prime "A" and a channel "2" for Prime "B?" or are they merged into one channel?

Glad to see we have some users out there like ourselves trying to solve the TVH + HDHR Prime challenge :)

RE: Help! Can't get muxes or channels to detect "properly" - Added by Robert Cameron about 8 years ago

Yes, each Prime has its own M3U, since the IP addresses are different. And because they are separate M3Us, they are separate "Networks" in Tvheadend. However, if they all share the same Service names, they will then map to the same Channel names. There will only be one Channel, but it will link to multiple Services in different Networks, depending upon what is available and how you have set your priorities.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Eric Bookbinder about 8 years ago

Do you have to do anything special to get the local HD channels to show up (505 vs 5)? For some reason it isn't finding them.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Robert Cameron about 8 years ago

Could you access them before? There should be nothing needed to tune the channels, but your provider may have them as SDV channels, which means you need a Tuning Adapter to tune them.

My local CBS is 2, so I can access that with http://$prime_ipaddress:5004/auto/v2 . Similarly, the HD version of that channel is 702, so it is streamed with http://$prime_ipaddress:5004/auto/v702 . I don't do anything special or different. To make things easier when setting up Tvheadend, what I did is only include the channels I'm interested in on my M3Us, so I don't have any of the SD versions of my channels listed if I also have access to the HD version.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Matt P almost 8 years ago

Hi, I on see IPTV as a network setup option, not "Automatic IPTV." I also can seem to get the m3u playlist to work..the scan fails. Is there a difference in the network or am I missing something?

Thanks

RE: Help! Can't get muxes or channels to detect "properly" - Added by Robert Cameron almost 8 years ago

If you do not see Automatic IPTV as a network type, then you are most likely not using the current 4.1 branch of Tvheadend.

I do not know if the 4.0 branch handles M3U files for IPTV definitions, and if it does, how the process is different from the current versions of Tvheadend.

Therefore, I think your only option for getting those channels into Tvheadend is to manually add each channel you want to access as a separate mux, then scan the muxes and add the resulting services to a channel.

One side note, though: if your broadcaster/provider changes the program ID of a channel, you will have to rescan the mux. One wouldn't normally think this would be a problem, but the service is added as MPEG-TS type, which has an associated program ID, and if the program ID differs when the channel plays from what was originally scanned, Tvheadend thinks there is no input. I have to rescan my muxes about twice a month because of this.

RE: Help! Can't get muxes or channels to detect "properly" - Added by Matt P almost 8 years ago

So I upgraded to the unstable release of Tvheadend and got it to work. Thanks for the help!

RE: Help! Can't get muxes or channels to detect "properly" - Added by Ed M over 7 years ago

nevermind, i deleted my post. I think i found my answer

    (1-13/13)