After some playing around trying to get my mpegts_cablecard_ additions, I decided to look back at why my quick and dirty hack didn't work, and I found the root problem. When making my changes I thought the only relevant parts I needed to modify was in the tvhdhomerun_frontend_tune function, but tvhdhomerun_frontend_start_mux is actually the calling function, and after it tunes a mux, it then applies a filter to the programs. This causes problems with the Prime, because when you tune a virtual channel it sets the frequency and the program both; the resetting of the program filter in tvhdhomerun_frontend_start_mux wipes that out, and Prime can no longer get the proper program set.
So, while working on getting CableCARD support properly in Tvheadend, I have created a (rather quite hacky) workaround that allows one to tune the Prime using the hdhomerun_client support in Tvheadend. This also means that it is streaming over UDP rather than TCP, which should result in less continuity errors because of resent packets.
In short, it works like this: The Prime is created as an ATSC-C network. Muxes must be manually created; the mux frequency is the virtual channel number * 1000000—so virtual channel 702 is saved in Tvheadend as a mux with frequency 702MHz. After the mux is scanned, you must select the proper Service/Program: you can find this by using the command line tool
hdhomerun_config
to first set the proper channel (@hdhomerun_config FFFFFFFF set /tuner#/vchannel ###@, where FFFFFFFF is the Device ID of your Prime,
tuner#
is the tuner number you wish you set—either 0, 1 or 2—and the ### is the cable channel you wish to tune—702 in the example from above), and then you can use it to find the proper program number: @hdhomerun_config FFFFFFFF get /tuner#/program@. The Service that matches the mux and program number will be the one that you assign a Channel to.
The advantage to this is streaming over UDP, as well as getting the signal strength and quality information for the feed. While it is a bit more work getting the muxes/services mapped to Channels, I feel that the benefits it gives outweigh the negatives from using TCP/IPTV as the workaround.
If anyone is interested, I have created a patch (only about 7 lines) that can be applied to the current master's tvheadend_frontend.c to enable this hack.
I am still working on getting proper CableCARD support working, but I thought I might share this information in case there are others who are interested ....