View Full Version : TVHeadend 4.2 with NA-EIT
giggle_goose
03-21-2019, 07:30 PM
This thread is for the purpose of testing your DVB adapters. I take no responsibility for any damage you do to your computer or any additional hardware you may be using. I also assume that you have some basic Ubuntu / Debian knowledge, and that you hardware is functioning correctly. For simplicity, I will assume that you are using a CLEAN Ubuntu 16.04 x64 or greater install. Currently, I have not created any 32 bit / ARM packages.
On a side-note: I have tested and run this DEB from an LXC container for over a year now. You just need to enable passthrough unix-char devices, and point to each device in /dev/dvb/adapter0/xxx0. If you don't know what LXC/LXD/containers are, then ignore this paragraph.
UPDATES
I added support for the SW42, but it still requires testing from the community
KNOWN ISSUES
Only the Legacy SW21 is supported. If anyone owns a SW42/SW44 and wants to test, please PM me.
Only 91 EPG works. The current workaround is to map similar tv channels from 91 to 82 to have guide on HD channels.
Some EPG information such as the original episode air date, and episode title show up in the description, rather than the corresponding field.
INSTALLATION
# Refresh the package repos
sudo apt update
# There are several dependencies required. Install these from official repos.
# This packaged version requires libdvbcsa because it has it's own CSA client.
sudo apt install libavahi-client3 liburiparser1 dvb-apps libdvbcsa1
# Install the file attached to this message.
unzip tvheadend_4.2.6-5_amd64.zip
sudo dpkg -i tvheadend_4.2.6-5_amd64.deb
INITIAL CONFIGURATION
Log in to your server via http://x.x.x.x:9981/ If you don't know your IP, type ifconfig from the command line to figure it out.
Click the Configuration tab, then DVB Inputs, then Networks. Click the Add button to create your network (ie: 91/82). I change the Character set so to ISO-8859-1 so the EPG shows french characters correctly. Make sure "User service IDs as channel numbers" is checked. (If you don't see it, you may have to change the View level to Expert at the bottom of the window). Repeat this step for each other satellite you plan on adding.
Click the TV Addapters tab. Highlight your device on the left, so you see Basic Settings on the right. Make sure to change your Satellite config to Advanced (non-universal LNBs, rotors, etc.)
Click Advanced (non-universal LNBs, rotors, etc.) on the left side. On the right, update Orbital Positions to match the number of LNBs and networks you are using. Click the Save button at the bottom. You should now have new entries on the left for Position #1, Position #2, etc..
Click Position #1 on the left. On the right, click Enabled, and choose the correct network you created in step 2. Update your LNB and switch type as necessary.
If you are using a switch, select them under each Position on the left side, and update them on the right. For legacy switches, each port starts at zero, and you need to change the Uncommitted value. So if 91 is in port 1, choose Uncommitted = 0. Repeat for each other position you configured in step 5.
Click the Muxes tab, and click the Add button. Choose your network that you configured in step 1. If necessary, use Lyngsat to find the details. (Don't add them all.... just start with the first transponder, ie: (12224000 Khz, 20000000 Sym/s, Right Polarization, QPSK modulation, FEC 7/8). Some cards require that you specify these details, ie: auto modulation and auto FEC might not work with Genpix skywalker-1. Repeat this step for any additional networks you want to add.
Click the Networks tab, and highlight each item and click Force Scan.
Click the Muxes tab. Once everything is done scanning you should have 32 transponders for each network source.
At this point, you can click the Service tab, and click the Map Services button, and choose map all services from the dropdown that appeared. The only items I check off are "Map encrypted services", and "Create type-based tags". Click the Map services button.
ADVANCED CONFIGURATION
Under the Configuration tab, find CAs. Click the Add button. From the dropdown box, choose "Code Word Client (newcamd)". Click Enabled. Sorry, at this point I will not specify any additional details here, or endorse any particular vendors. This part you have to figure out on your own.
By disabling EPG scanning on transponders that don't support it, you can improve scan times and data. 91/82 only use transponder #1 for both networks. Under the Muxes tab, change each transponder's EPG scan column so it says "Disabled", and choose Only Bell, or Only Dish for transponder #1.
Click the Channels / EPG tab, then click the EPG Grabber Modules tab. If you don't see it, you may have to change your View Mode to Expert on the Configuration->General tab.
I disable every module except for the Over-the-air: NA Bell, or NA Dish.
If you use RPi's to watch TV, you can keep the CPU and network load down by using channel tags. Instead of loading every channel, and the EPG behind them, I keep groups for Favorites. Click the Channel / EPG tab, then the Channel Tags tab. Add whatever group you would like to see. Once done, click the Channels tab, and find any channels you want to add. You click the Tags column and type your new name, then click the checkbox. This takes a while and it's tedious, but it pays off when you don't have to page through 1500+ channels to find the 50-60 channels you regularly watch.
WORKAROUNDS
next step is associating 91EPG channels to their counterparts on 82. This is a known issue, but we can get around it for the time being. (TVHeadend wrote part of the EPG scan to prevent networks from overwriting other networks EPGs. Unfortunately, this is exactly what NA dishes do between 91/82). I hope to have this resolved soon, but in the meantime, here's the fix.
Click Configuration->Channel / EPG->Channels tabs. Find the HD channels that match up with an SD channel from 91 in the "Reuse EPG from" column. ie: MUCHH is the same as MUCH. CW11H is the same as WPIX. A&EHD = A&E, and so on...
Again, this is unfortunate, but it is better than not having a 9 day guide.
Pigbait
03-23-2019, 04:17 AM
no dice, got your build up but nothing scanning
giggle_goose
03-25-2019, 01:49 PM
Try using the Legacy SW42 option, and see if that helps.
If it doesn't, please let me know if you can scan vertical/rights transponders, or horizontal/left transponders.
I don't have access to the same type of LNBs you are using and I can't test it from here, but I found a post saying that those types of LNBs have a built in SW42.
If BandStacked LNB type does not work, try using the plain old DBS LNB type.
Pigbait
04-02-2019, 07:24 PM
Tried this word for word.. still nothing.. sent you some logs. Hopefully the logs worked
giggle_goose
11-28-2019, 02:00 PM
It might be a little late to reply, but another user on this forum tested the DPP LNBs and said:
Originally Posted by th3magpi3
Again, sorry to spam, but I got everything figured out with the DPP hardware using it's built in switch. No need for legacy equipment or switches. Fully tested using the bell version of the Dish 500+ using a DPP Twin LNB setup.
I can let you know how it's done if you're interested?
Now let's work on upgrading your build to parse the proper EPG data and we're golden Got that github link? I want to see what you did in terms of epg fetching. Wondering if the newest build has that old issue of the EPG overwrite patched and if we can add your NA-EPG grab to the new version if it's patched.
Amazing what 6 hours of pulling your hair learning a new system can do
giggle_goose
11-28-2019, 02:13 PM
I am going to post a few of my diff files, so anyone call pull tvheadend 4.2.x from github and apply some patches.
src/epggrab/module/eit.c is the file that needs a few tweaks to improve the EPG data. Currently, all the details are in a single string. It only needs a delimiter to separate the episode, air date, and series name. Genre is already figured out, so it can simply be removed from the description.
The same file needs a little work around line 650 to include multiple dishes.
If anyone is willing to contribute, go ahead and reply to this thread so we can improve the existing packages.
src/config.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/config.c
+++ b/src/config.c
@@ -611,6 +611,8 @@
htsmsg_add_u32(m, "opentv-skyuk", 1);
htsmsg_add_u32(m, "opentv-skyit", 1);
htsmsg_add_u32(m, "opentv-ausat", 1);
+ htsmsg_add_u32(m, "na_dish", 1);
+ htsmsg_add_u32(m, "na_bell", 1);
}
hts_settings_save(c, "epggrab/config");
src/epggrab/module/eit.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/epggrab/module/eit.c
+++ b/src/epggrab/module/eit.c
@@ -313,6 +313,37 @@
static int _eit_desc_content
( epggrab_module_t *mod, const uint8_t *ptr, int len, eit_event_t *ev )
{
+ // Disnetwork / Bell Expressvu
+ const unsigned char *data = ptr;
+ if ( !ev->genre && data[0] >= 0xF0 && data[0] <= 0xF8 )
+ {
+ ev->genre = calloc(1, sizeof(epg_genre_list_t));
+ if ( data[0] == 0xF0 ) epg_genre_list_add_by_eit(ev->genre, 0xA0); // Paid programming
+ if ( data[0] == 0xF1 ) epg_genre_list_add_by_eit(ev->genre, 0x10); // Movies
+ if ( data[0] == 0xF2 ) epg_genre_list_add_by_eit(ev->genre, 0x40); // Sports
+ if ( data[0] == 0xF3 ) epg_genre_list_add_by_eit(ev->genre, 0x20); // News
+ if ( data[0] == 0xF4 ) epg_genre_list_add_by_eit(ev->genre, 0x50); // Children
+ if ( data[0] == 0xF5 ) epg_genre_list_add_by_eit(ev->genre, 0x90); // Education
+ if ( data[0] == 0xF6 ) epg_genre_list_add_by_eit(ev->genre, 0x30); // Series
+ if ( data[0] == 0xF7 ) epg_genre_list_add_by_eit(ev->genre, 0x60); // Music
+ if ( data[0] == 0xF8 ) epg_genre_list_add_by_eit(ev->genre, 0x70); // Religous
+
+ // This allows us to split a string by a delimter
+ // https://stackoverflow.com/questions/14265581/parse-split-a-string-in-c-using-string-delimiter-standard-c
+ //
+ // Dishnetwork descriptors
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/eitfixup.cpp
+ //
+ // Dishdescriptors.h
+ // https://code.mythtv.org/doxygen/eitfixup_8cpp_source.html#l00431
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/mpeg/dishdescriptors.cpp
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/mpeg/dishdescriptors.h
+
+
+
+ return 0;
+ }
+
while (len > 1) {
if (*ptr == 0xb1)
ev->bw = 1;
@@ -490,11 +521,15 @@
r = _eit_desc_component(mod, ptr, dlen, &ev);
break;
case DVB_DESC_PARENTAL_RAT:
+ case DVB_DESC_DISHNET_MPAA:
r = _eit_desc_parental(mod, ptr, dlen, &ev);
break;
case DVB_DESC_CRID:
r = _eit_desc_crid(mod, ptr, dlen, &ev, svc);
break;
+ //case DVB_DESC_DISHNET_PROGID:
+ // r = _eit_dishnet_desc_crid(mod, ptr, dlen, &ev, svc);
+ // break;
default:
r = 0;
_eit_dtag_dump(mod, dtag, dlen, ptr);
@@ -649,7 +684,7 @@
}
/* Validate */
- if(tableid < 0x4e || tableid > 0x6f || len < 11) {
+ if((tableid < 0x4e || tableid > 0x6f || len < 11) && (tableid < 0x81 || tableid > 0xa4 || len < 11)) {
if (ths)
atomic_add(&ths->ths_total_err, 1);
return -1;
@@ -887,6 +922,8 @@
EIT_OPS(ops_nz_freeview, 0, EIT_CONV_HUFFMAN, EIT_SPEC_NZ_FREEVIEW);
EIT_OPS(ops_baltic, 0x39, 0, 0);
EIT_OPS(ops_bulsat, 0x12b, 0, 0);
+ EIT_OPS(ops_na_dish, 0x300, EIT_CONV_HUFFMAN, 0);
+ EIT_OPS(ops_na_bell, 0x441, EIT_CONV_HUFFMAN, 0);
EIT_CREATE("eit", "EIT: DVB Grabber", 1, &ops);
EIT_CREATE("uk_freesat", "UK: Freesat", 5, &ops_uk_freesat);
@@ -894,6 +931,8 @@
EIT_CREATE("nz_freeview", "New Zealand: Freeview", 5, &ops_nz_freeview);
EIT_CREATE("viasat_baltic", "VIASAT: Baltic", 5, &ops_baltic);
EIT_CREATE("Bulsatcom_39E", "Bulsatcom: Bula 39E", 5, &ops_bulsat);
+ EIT_CREATE("na_dish", "NA Dish", 5, &ops_na_dish);
+ EIT_CREATE("na_bell", "NA Bell", 5, &ops_na_bell);
}
void eit_done ( void )
src/epggrab/otamux.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/epggrab/otamux.c
+++ b/src/epggrab/otamux.c
@@ -496,6 +496,8 @@
[MM_EPG_ONLY_OPENTV_SKY_UK] = "opentv-skyuk",
[MM_EPG_ONLY_OPENTV_SKY_ITALIA] = "opentv-skyit",
[MM_EPG_ONLY_OPENTV_SKY_AUSAT] = "opentv-ausat",
+ [MM_EPG_ONLY_DISHNET_DISH] = "na_dish",
+ [MM_EPG_ONLY_DISHNET_BELL] = "na_bell",
};
lock_assert(&global_lock);
src/epggrab/support/freesat_huffman.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/epggrab/support/freesat_huffman.c
+++ b/src/epggrab/support/freesat_huffman.c
@@ -5777,7 +5777,7 @@
unsigned short kk;
unsigned int b;
- if (src[0] != 0x1f) return -1;
+ if (src[0] != 0x1f && src[0] != 0xff) return -1;
p = 0;
if (src[1] == 1 || src[1] == 2) {
src/input/mpegts.h
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts.h
+++ b/src/input/mpegts.h
@@ -400,6 +400,8 @@
MM_EPG_ONLY_OPENTV_SKY_AUSAT,
MM_EPG_ONLY_BULSATCOM_39E,
MM_EPG_ONLY_PSIP,
+ MM_EPG_ONLY_DISHNET_DISH,
+ MM_EPG_ONLY_DISHNET_BELL,
};
#define MM_EPG_LAST MM_EPG_ONLY_PSIP
src/input/mpegts/dvb.h
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/dvb.h
+++ b/src/input/mpegts/dvb.h
@@ -188,6 +188,9 @@
#define ATSC_DESC_GENRE 0xAB
#define ATSC_DESC_PRIVATE_INFO 0xAD
+#define DVB_DESC_DISHNET_MPAA 0x89 // Stars and MPAA ratings
+#define DVB_DESC_DISHNET_PROGID 0x96 // Series ID, Program ID, and Original air date
+
/* Service type lookup */
int dvb_servicetype_lookup ( int t );
src/input/mpegts/dvb_support.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/dvb_support.c
+++ b/src/input/mpegts/dvb_support.c
@@ -266,7 +266,7 @@
/* Check custom conversion */
while (conv && conv->func) {
- if (conv->type == src[0])
+ if ((conv->type == src[0]) || (conv->type == 0xff ))
return conv->func(dst, &dstlen, src, srclen);
conv++;
}
@@ -382,7 +382,7 @@
{
int l = buf[0];
- if(l + 1 > buflen)
+ if(l + 1 > buflen && conv->type != 0xff)
return -1;
if(dvb_get_string(dst, dstlen, buf + 1, l, dvb_charset, conv))
src/input/mpegts/linuxdvb/linuxdvb_switch.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c
+++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c
@@ -174,9 +174,47 @@
linuxdvb_satconf_ele_t *sc, int vol, int pol, int band, int freq )
{
int i, com, r1 = 0, r2 = 0, slp;
+ unsigned char cmd = 0;
int fd = linuxdvb_satconf_fe_fd(lsp);
linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld;
+ if (!strcmp(ld->ld_type ?: "", "Legacy SW21")) {
+ if ( ls->ls_uncommitted % 2 == 0 )
+ cmd = 0x34;
+ else
+ cmd = 0x65;
+
+ if ( pol == 1 )
+ cmd |= 0x80;
+
+ if (ioctl(fd, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd)){
+ tvherror(LS_DISEQC, "failed to issue legacy switch command (e=%s)", strerror(errno));
+ return -1;
+ }
+
+ /* sleep for 240 milliseconds */
+ usleep(240 * 1000);
+
+ return 0;
+ }
+
+ if (!strcmp(ld->ld_type ?: "", "Legacy SW42")) {
+ if ( ls->ls_uncommitted % 2 == 0 )
+ cmd = 0x46;
+ else
+ cmd = 0x17;
+
+ if (ioctl(fd, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd)){
+ tvherror(LS_DISEQC, "failed to issue legacy switch command (e=%s)", strerror(errno));
+ return -1;
+ }
+
+ /* sleep for 240 milliseconds */
+ usleep(240 * 1000);
+
+ return 0;
+ }
+
if (lsp->ls_diseqc_full || lsp->ls_last_switch != sc ||
(ls->ls_committed >= 0 &&
(pol + 1 != lsp->ls_last_switch_pol ||
@@ -261,6 +299,8 @@
htsmsg_t *m = htsmsg_create_list();
htsmsg_add_msg(m, NULL, htsmsg_create_key_val("", tvh_gettext_lang(lang, N_("None"))));
htsmsg_add_msg(m, NULL, htsmsg_create_key_val("Generic", tvh_gettext_lang(lang, N_("Generic"))));
+ htsmsg_add_msg(m, NULL, htsmsg_create_key_val("Legacy SW21", tvh_gettext_lang(lang, N_("Legacy SW21"))));
+ htsmsg_add_msg(m, NULL, htsmsg_create_key_val("Legacy SW42", tvh_gettext_lang(lang, N_("Legacy SW42"))));
return m;
}
@@ -269,8 +309,8 @@
( const char *name, htsmsg_t *conf, linuxdvb_satconf_ele_t *ls, int c, int u )
{
linuxdvb_switch_t *ld = NULL;
- if (!strcmp(name ?: "", "Generic")) {
- ld = (linuxdvb_switch_t*)linuxdvb_diseqc_create(linuxdv b_switch, NULL, conf, "Generic", ls);
+ if (!strcmp(name ?: "", "Generic") || !strcmp(name ?: "", "Legacy SW21") || !strcmp(name ?: "", "Legacy SW42")) {
+ ld = (linuxdvb_switch_t*)linuxdvb_diseqc_create(linuxdv b_switch, NULL, conf, name, ls);
if (ld) {
ld->ld_tune = linuxdvb_switch_tune;
if (!conf) {
src/input/mpegts/mpegts_mux.c
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/src/input/mpegts/mpegts_mux.c
+++ b/src/input/mpegts/mpegts_mux.c
@@ -490,6 +490,8 @@
{ N_("Only OpenTV Sky UK"), MM_EPG_ONLY_OPENTV_SKY_UK },
{ N_("Only OpenTV Sky Italia"), MM_EPG_ONLY_OPENTV_SKY_ITALIA },
{ N_("Only OpenTV Sky Ausat"), MM_EPG_ONLY_OPENTV_SKY_AUSAT },
+ { N_("Only Dish Network"), MM_EPG_ONLY_DISHNET_DISH },
+ { N_("Only Bell Expressvu"), MM_EPG_ONLY_DISHNET_BELL },
};
return strtab2htsmsg(tab, 1, lang);
}
asdfgasdfg
05-07-2020, 03:55 PM
The following diff will provide emm support:
src/descrambler/emm_reass.c
--- a/src/descrambler/emm_reass.c 2019-11-15 11:52:07.000000000 -0600
+++ b/src/descrambler/emm_reass.c 2020-05-06 08:05:56.323987758 -0500
@@ -389,9 +389,11 @@
hexserial[3] = data[6];
if (memcmp(hexserial, &ra->ua[4], (data[7] == 0x10) ? 3 : 4) == 0)
match = 1;
- } else if (data[0] == 0x82) { // global
+ } else if ((data[0] == 0x82) ||
+ (data[0]==0x84 && data[1]==0x70 && data[2]==0x96) ||
+ (data[0]==0x83 && !memcmp(&data[3],&ra->ua[4],(data[7]==0x10)?3:4))) // global
match = 1;
- }
+ //}
if (match)
send(aux, data, len, mux);
asdfgasdfg
05-07-2020, 05:26 PM
Try using the Legacy SW42 option, and see if that helps.
If it doesn't, please let me know if you can scan vertical/rights transponders, or horizontal/left transponders.
I don't have access to the same type of LNBs you are using and I can't test it from here, but I found a post saying that those types of LNBs have a built in SW42.
If BandStacked LNB type does not work, try using the plain old DBS LNB type.
If you are using standard diseqc and LNB's then you will need this patch which creates a new entry for LNB Type: "NA DVB" Note the required lnb_high value.
src/input/mpegts/linuxdvb/linuxdvb_lnb.c
--- a/src/input/mpegts/linuxdvb/linuxdvb_lnb.c 2019-11-15 11:52:07.000000000 -0600
+++ b/src/input/mpegts/linuxdvb/linuxdvb_lnb.c 2020-05-07 12:16:13.213364907 -0500
@@ -405,6 +405,20 @@
.lnb_high = 10700000,
.lnb_switch = 11800000,
},
+ {
+ { {
+ .ld_type = "NA DVB",
+ .ld_tune = linuxdvb_lnb_standard_tune,
+ },
+ .lnb_freq = linuxdvb_lnb_standard_freq,
+ .lnb_match = linuxdvb_lnb_standard_match,
+ .lnb_band = linuxdvb_lnb_standard_band,
+ .lnb_pol = linuxdvb_lnb_standard_pol,
+ },
+ .lnb_low = 11250000,
+ .lnb_high = 99999999,
+ .lnb_switch = 0,
+ },
};
/* ************************************************** ************************
asdfgasdfg
06-04-2020, 12:07 AM
The HD channels that match up with an SD channel from 91 in the "Reuse EPG from" column. ie: MUCHH is the same as MUCH. CW11H is the same as WPIX. A&EHD = A&E, and so on...
Again, this is unfortunate, but it is better than not having a 9 day guide.
Did you play with the multi transponder guide data?
th3magpi3
07-12-2020, 03:33 PM
Here's a 64 bit deb file patched with all above diff patches applied. Can use legacy switches, proper voltages, N3 emm pushes, NA EPG.
Unzip to your HOME directory.
unzip tvh_4.2.6_NA_Patched_amd64.zip
sudo dpkg -i tvh_4.2.6_NA_EPG-N3_EMM-patched_amd64.deb
DPP LNB's us diseqc commands, 91 port 1, 82 port 2. 119 port 1, 110 port2, extra LNB port 3.
th3magpi3
07-12-2020, 04:58 PM
DPP LNB's us diseqc commands, 91 port 1, 82 port 2. 119 port 1, 110 port2, extra LNB port 3.
yes and TVH even has a built in "Bandstacked" option for things like DPP however I believe when you go over 2 LNBs you can push something like a skywalker past it's limit in terms of amperage draw.
asdfgasdfg
07-23-2020, 04:43 PM
Patch for EIT on S82 (may also work for Dish but I can not test!)
file: src/epggrab/module/eit.c
if ((mm->mm_tsid != tsid || mm->mm_onid != onid) &&
!mm->mm_eit_tsid_nocheck) {
if (mm->mm_onid != MPEGTS_ONID_NONE &&
mm->mm_tsid != MPEGTS_TSID_NONE)
tvhtrace(LS_TBL_EIT,
"%s: invalid tsid found tid 0x%02X, onid:tsid %d:%d != %d:%d",
mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
mm->mm_onid = onid;
mm->mm_tsid = tsid;
// mm = NULL;
}
}
the two extra lines and a comment of mm = NULL;
Edit: jumped the gun, I do have now and next data but not 9 day guide... still needs more work I think
Edit2 this does not work... the eit database is updated by the mux used to search... need to find the channel using the onid... need to dig into the code more
asdfgasdfg
07-24-2020, 03:33 PM
Ok the problem is when tvheadend looks for the channel the eit is on, it only searches the MUX running the EIT scan. The fix is to always search for the channel based on the onid and tsid.... and here is the code changes:
src/epggrab/module/eit.c: (don't worry about the tableid, just search for the mux)
st->sections[sa/32] &= ~mask;
}
tvhtrace(LS_TBL_EIT,
"%s: before find mux tid 0x%02X, onid:tsid %d:%d != %d:%d ",
mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
mm = mpegts_network_find_mux(mm->mm_network, onid, tsid, 1);
/* Get transport stream */
// Note: tableid=0x4f,0x60-0x6f is other TS
// so must find the tdmi
//if (tableid == 0x4f || tableid >= 0x60) {
// mm = mpegts_network_find_mux(mm->mm_network, onid, tsid, 1);
//} else {
//if ((mm->mm_tsid != tsid || mm->mm_onid != onid) &&
// !mm->mm_eit_tsid_nocheck) {
// if (mm->mm_onid != MPEGTS_ONID_NONE &&
// mm->mm_tsid != MPEGTS_TSID_NONE)
// tvhtrace(LS_TBL_EIT,
// "%s: invalid tsid found tid 0x%02X, onid:tsid %d:%d != %d:%d ",
// mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
// mm = NULL;
// goto done;
// }
//}
if(!mm) {
goto done;
}
tvhtrace(LS_TBL_EIT,
"%s: after find mux tid 0x%02X, onid:tsid %d:%d != %d:%d ",
mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
src/input/mpegts/mpegts_network.c: (change code for mpegts_network_find_mux)
/************************************************** ****************************
* Search
************************************************** ***************************/
mpegts_mux_t *
mpegts_network_find_mux
( mpegts_network_t *mn, uint32_t onid, uint32_t tsid, int check )
{
tvhtrace(LS_MPEGTS, "Started Network search tsid: %d onid: %d", tsid,onid );
mpegts_mux_t *mm;
mpegts_mux_t *mm2;
mpegts_network_t *mn1;
mm2= NULL;
LIST_FOREACH(mn1,&mpegts_network_all, mn_global_link) {
LIST_FOREACH(mm, &mn1->mn_muxes, mm_network_link) {
if (mm->mm_onid == onid && mm->mm_tsid == tsid){
mm2=mm;
break;
}
}
if (mm2) break;
}
tvhtrace(LS_MPEGTS, "Finished Network search tsid: %d onid: %d", tsid,onid );
return mm2;
}
Now we have the data for 82.... and this should work for Dish as well. You only need to specify the first MUX on 91.
th3magpi3
07-28-2020, 07:29 AM
Here are asdfgasdfg's recent edits as well as giggle goose's code in diff files to easily be patched to fresh 4.2.6 source code before building.
*EDIT* - Fixed the mpegts_network.c patch for the official 4.2.6 build from TVH's Github. Link HERE (https://github.com/tvheadend/tvheadend/releases/tag/v4.2.6)
Remember - only apply these patches to CLEAN source code. eit.c contains both the aforementioned users' edits in the single patch file.
src/epggrab/module/eit.c
--- eit.c 2018-03-26 01:19:37.000000000 -0700
+++ eit_patched.c 2020-07-25 17:50:57.000000000 -0700
@@ -313,6 +313,37 @@
static int _eit_desc_content
( epggrab_module_t *mod, const uint8_t *ptr, int len, eit_event_t *ev )
{
+ // Disnetwork / Bell Expressvu
+ const unsigned char *data = ptr;
+ if ( !ev->genre && data[0] >= 0xF0 && data[0] <= 0xF8 )
+ {
+ ev->genre = calloc(1, sizeof(epg_genre_list_t));
+ if ( data[0] == 0xF0 ) epg_genre_list_add_by_eit(ev->genre, 0xA0); // Paid programming
+ if ( data[0] == 0xF1 ) epg_genre_list_add_by_eit(ev->genre, 0x10); // Movies
+ if ( data[0] == 0xF2 ) epg_genre_list_add_by_eit(ev->genre, 0x40); // Sports
+ if ( data[0] == 0xF3 ) epg_genre_list_add_by_eit(ev->genre, 0x20); // News
+ if ( data[0] == 0xF4 ) epg_genre_list_add_by_eit(ev->genre, 0x50); // Children
+ if ( data[0] == 0xF5 ) epg_genre_list_add_by_eit(ev->genre, 0x90); // Education
+ if ( data[0] == 0xF6 ) epg_genre_list_add_by_eit(ev->genre, 0x30); // Series
+ if ( data[0] == 0xF7 ) epg_genre_list_add_by_eit(ev->genre, 0x60); // Music
+ if ( data[0] == 0xF8 ) epg_genre_list_add_by_eit(ev->genre, 0x70); // Religous
+
+ // This allows us to split a string by a delimter
+ // https://stackoverflow.com/questions/14265581/parse-split-a-string-in-c-using-string-delimiter-standard-c
+ //
+ // Dishnetwork descriptors
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/eitfixup.cpp
+ //
+ // Dishdescriptors.h
+ // https://code.mythtv.org/doxygen/eitfixup_8cpp_source.html#l00431
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/mpeg/dishdescriptors.cpp
+ // https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/mpeg/dishdescriptors.h
+
+
+
+ return 0;
+ }
+
while (len > 1) {
if (*ptr == 0xb1)
ev->bw = 1;
@@ -490,11 +521,15 @@
r = _eit_desc_component(mod, ptr, dlen, &ev);
break;
case DVB_DESC_PARENTAL_RAT:
+ case DVB_DESC_DISHNET_MPAA:
r = _eit_desc_parental(mod, ptr, dlen, &ev);
break;
case DVB_DESC_CRID:
r = _eit_desc_crid(mod, ptr, dlen, &ev, svc);
break;
+ //case DVB_DESC_DISHNET_PROGID:
+ // r = _eit_dishnet_desc_crid(mod, ptr, dlen, &ev, svc);
+ // break;
default:
r = 0;
_eit_dtag_dump(mod, dtag, dlen, ptr);
@@ -649,7 +684,7 @@
}
/* Validate */
- if(tableid < 0x4e || tableid > 0x6f || len < 11) {
+ if((tableid < 0x4e || tableid > 0x6f || len < 11) && (tableid < 0x81 || tableid > 0xa4 || len < 11)) {
if (ths)
atomic_add(&ths->ths_total_err, 1);
return -1;
@@ -691,26 +726,32 @@
mask <<= (24 - (sa % 32));
st->sections[sa/32] &= ~mask;
}
-
+ tvhtrace(LS_TBL_EIT,
+ "%s: before find mux tid 0x%02X, onid:tsid %d:%d != %d:%d ",
+ mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
+ mm = mpegts_network_find_mux(mm->mm_network, onid, tsid, 1);
/* Get transport stream */
// Note: tableid=0x4f,0x60-0x6f is other TS
// so must find the tdmi
- if (tableid == 0x4f || tableid >= 0x60) {
- mm = mpegts_network_find_mux(mm->mm_network, onid, tsid, 1);
- } else {
- if ((mm->mm_tsid != tsid || mm->mm_onid != onid) &&
- !mm->mm_eit_tsid_nocheck) {
- if (mm->mm_onid != MPEGTS_ONID_NONE &&
- mm->mm_tsid != MPEGTS_TSID_NONE)
- tvhtrace(LS_TBL_EIT,
- "%s: invalid tsid found tid 0x%02X, onid:tsid %d:%d != %d:%d",
- mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
- mm = NULL;
- }
- }
+ // if (tableid == 0x4f || tableid >= 0x60) {
+ // mm = mpegts_network_find_mux(mm->mm_network, onid, tsid, 1);
+ //} else {
+ // if ((mm->mm_tsid != tsid || mm->mm_onid != onid) &&
+ // !mm->mm_eit_tsid_nocheck) {
+ // if (mm->mm_onid != MPEGTS_ONID_NONE &&
+ // mm->mm_tsid != MPEGTS_TSID_NONE)
+ // tvhtrace(LS_TBL_EIT,
+ // "%s: invalid tsid found tid 0x%02X, onid:tsid %d:%d != %d:%d",
+ // mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
+ // mm = NULL;
+ // }
+ // }
if(!mm)
goto done;
+ tvhtrace(LS_TBL_EIT,
+ "%s: after find mux tid 0x%02X, onid:tsid %d:%d != %d:%d ",
+ mt->mt_name, tableid, mm->mm_onid, mm->mm_tsid, onid, tsid);
/* Get service */
svc = mpegts_mux_find_service(mm, sid);
if (!svc) {
@@ -887,6 +928,8 @@
EIT_OPS(ops_nz_freeview, 0, EIT_CONV_HUFFMAN, EIT_SPEC_NZ_FREEVIEW);
EIT_OPS(ops_baltic, 0x39, 0, 0);
EIT_OPS(ops_bulsat, 0x12b, 0, 0);
+ EIT_OPS(ops_na_dish, 0x300, EIT_CONV_HUFFMAN, 0);
+ EIT_OPS(ops_na_bell, 0x441, EIT_CONV_HUFFMAN, 0);
EIT_CREATE("eit", "EIT: DVB Grabber", 1, &ops);
EIT_CREATE("uk_freesat", "UK: Freesat", 5, &ops_uk_freesat);
@@ -894,6 +937,8 @@
EIT_CREATE("nz_freeview", "New Zealand: Freeview", 5, &ops_nz_freeview);
EIT_CREATE("viasat_baltic", "VIASAT: Baltic", 5, &ops_baltic);
EIT_CREATE("Bulsatcom_39E", "Bulsatcom: Bula 39E", 5, &ops_bulsat);
+ EIT_CREATE("na_dish", "NA Dish", 5, &ops_na_dish);
+ EIT_CREATE("na_bell", "NA Bell", 5, &ops_na_bell);
}
void eit_done ( void )
src/input/mpegts/mpegts_network.c
--- mpegts_network.c 2018-03-26 01:19:37.000000000 -0700
+++ mpegts_network_patched.c 2020-07-29 13:54:26.000000000 -0700
@@ -647,16 +647,23 @@
mpegts_network_find_mux
( mpegts_network_t *mn, uint16_t onid, uint16_t tsid, int check )
{
- mpegts_mux_t *mm;
- LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link) {
- if (mm->mm_onid && onid && mm->mm_onid != onid) continue;
- if (mm->mm_tsid == tsid) {
- if (!check || mm->mm_enabled == MM_ENABLE)
- break;
+ tvhtrace(LS_MPEGTS, "Started Network search tsid: %d onid: %d", tsid,onid );
+ mpegts_mux_t *mm;
+ mpegts_mux_t *mm2;
+ mpegts_network_t *mn1;
+ mm2= NULL;
+ LIST_FOREACH(mn1,&mpegts_network_all, mn_global_link) {
+ LIST_FOREACH(mm, &mn1->mn_muxes, mm_network_link) {
+ if (mm->mm_onid == onid && mm->mm_tsid == tsid){
+ mm2=mm;
+ break;
+ }
}
+ if (mm2) break;
}
- return mm;
+ tvhtrace(LS_MPEGTS, "Finished Network search tsid: %d onid: %d", tsid,onid );
+ return mm2;
}
mpegts_service_t *
asdfgasdfg
07-29-2020, 04:41 AM
Depending on the version, you may get a compile issue with this edit
- ( mpegts_network_t *mn, uint16_t onid, uint16_t tsid, int check )
+ ( mpegts_network_t *mn, uint32_t onid, uint32_t tsid, int check )
My version has onid and tsid defined as uint32_t but yours has them defined as uint16_t
You need to keep the line the same as in your current code. The last version of 4.2 from git master branch uses uinit32_t.
th3magpi3
07-29-2020, 09:00 PM
I was pulling my source from the 4.2.6 link on their github:
https://github.com/tvheadend/tvheadend/releases/tag/v4.2.6
I'll update the diff on my earlier post for anyone compiling with this version :)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.