Linux TvHeadend Mux flip flopping
#1
The issue is one mux is continually switching its muxID from 89 to 11 and back repeatedly about twice a second.

TVHeadend Log

Should i log a bug?

The hardware in question is Sundtek DVB S/S2 on Haswell Platform

Linux 3.13.0-031300rc8-generic (im planning to replace the kernel with latest stable linux-image-3.13.3-031303-generic)

TVHeadend 3.4.27
Reply
#2
You should try the tvheadend bug tracker (or join #hts on Freenode) since this is clearly not an XBMC issue.
Reply
#3
(2014-02-26, 23:57)negge Wrote: You should try the tvheadend bug tracker (or join #hts on Freenode) since this is clearly not an XBMC issue.

hence why its posted in the tvheadend thead and not in XBMC general...

I did have a chat to the dev on IRC but did not get it resolved.
Reply
#4
You should create a bug report anyway if you haven't done so already, people tend to forget bugs "reported" on IRC.
Reply
#5
This bug is caused by the TVHeadEnd getting confused between two different satellites. In this particular case it's Optus D1 at 160E at Optus C1 at 156E. Both have a transponder at frequency 12707, one with a MuxID of 89, the other with 11. TVHeadEnd is updating the mux table incorrectly based only on the frequency, without considering the satellite position. I added a new field to the satconfig to hold an integer that represents ten times the longitude (e.g. 1600 for 160E) and I added code check in tdmi_compare_key() in dvb_multiplex.c
Reply
#6
@djaggar: it would be very nice if you could push your patch as a pull request to https://github.com/tvheadend/tvheadend. I don't have satellite but I imagine there are lots of other people who would appreciate a fix for this.
Reply
#7
@negge I'm happy to do that, but as the TVHeadEnd DVB stuff has (or is) been all be rewritten this is a bit of a dead end ... I had a quick look at the later sources and it did appear to be considering the sat position before updating muxes. A new user should start from that.

But, if anyone really wants this change, here is (the short) list of diffs against version 3.5.247

Code:
diff -urBN tvheadend/src/dvb/dvb.h mytvheadend/src/dvb/dvb.h
--- tvheadend/src/dvb/dvb.h     2014-03-25 13:42:13.061401084 +1300
+++ mytvheadend/src/dvb/dvb.h   2014-03-25 13:39:52.101395736 +1300
@@ -59,6 +59,7 @@
   char *sc_name;
   char *sc_comment;
   char *sc_lnb;
+  int  sc_position;

   struct th_dvb_mux_instance_list sc_tdmis;

@@ -83,6 +84,7 @@
typedef struct dvb_mux_conf {
   dvb_frontend_parameters_t dmc_fe_params;
   int dmc_polarisation;
+  int dmc_position;
   dvb_satconf_t *dmc_satconf;
#if DVB_API_VERSION >= 5
   fe_modulation_t dmc_fe_modulation;


diff -urBN tvheadend/src/dvb/dvb_multiplex.c mytvheadend/src/dvb/dvb_multiplex.c
--- tvheadend/src/dvb/dvb_multiplex.c   2014-03-25 13:42:13.061401084 +1300
+++ mytvheadend/src/dvb/dvb_multiplex.c 2014-03-25 13:47:54.369414033 +1300
@@ -109,7 +109,8 @@
   fd = labs(fd);
   return fd < 2000 &&
     a->dmc_polarisation             == b->dmc_polarisation &&
-    a->dmc_satconf                  == satconf;
+    a->dmc_satconf                  == satconf &&
+    a->dmc_satconf->sc_position     == b->dmc_position;
}


diff -urBN tvheadend/src/dvb/dvb_satconf.c mytvheadend/src/dvb/dvb_satconf.c
--- tvheadend/src/dvb/dvb_satconf.c     2014-03-25 13:42:13.061401084 +1300
+++ mytvheadend/src/dvb/dvb_satconf.c   2014-03-24 15:37:25.126385215 +1300
@@ -75,6 +75,7 @@
   sc = calloc(1, sizeof(dvb_satconf_t));
   sc->sc_id = strdup(id);
   sc->sc_lnb = strdup("Universal");
+  sc->sc_position = 1600;
   TAILQ_INSERT_TAIL(&tda->tda_satconfs, sc, sc_adapter_link);

   return sc;
@@ -115,6 +116,7 @@
   htsmsg_add_str(m, "name", sc->sc_name ?: "");
   htsmsg_add_str(m, "comment", sc->sc_comment ?: "");
   htsmsg_add_str(m, "lnb", sc->sc_lnb);
+  htsmsg_add_u32(m, "position", sc->sc_position);
   return m;
}

@@ -139,5 +141,8 @@
   tvh_str_update(&sc->sc_comment, htsmsg_get_str(values, "comment"));
   tvh_str_update(&sc->sc_lnb, htsmsg_get_str(values, "lnb"));

+  if(!htsmsg_get_u32(values, "position", &u32))
+    sc->sc_position = u32;
+
   if(!htsmsg_get_u32(values, "port", &u32))
     sc->sc_port = u32;


diff -urBN tvheadend/src/dvb/dvb_tables.c mytvheadend/src/dvb/dvb_tables.c
--- tvheadend/src/dvb/dvb_tables.c      2014-03-25 13:42:13.065401084 +1300
+++ mytvheadend/src/dvb/dvb_tables.c    2014-03-25 13:53:37.033427034 +1300
@@ -712,9 +712,7 @@
{
   int freq, symrate;
   struct dvb_mux_conf dmc;
-#if ENABLE_TRACE
   uint16_t orbital_pos;
-#endif

   if(len < 11)
     return -1;
@@ -733,11 +731,11 @@
     return -1;
   }

-#if ENABLE_TRACE
   orbital_pos = bcdtoint(ptr[4]) * 100 + bcdtoint(ptr[5]);
-#endif
+#if ENABLE_TRACE
   tvhtrace("nit", "    orbital pos %d", orbital_pos);
-
+#endif
+  dmc.dmc_position = orbital_pos;
   symrate =
     bcdtoint(ptr[7]) * 100000 + bcdtoint(ptr[8]) * 1000 +
     bcdtoint(ptr[9]) * 10     + (ptr[10] >> 4);


diff -urBN tvheadend/src/webui/static/app/dvb.js mytvheadend/src/webui/static/app/dvb.js
--- tvheadend/src/webui/static/app/dvb.js       2014-03-25 13:42:13.089401085 +1300
+++ mytvheadend/src/webui/static/app/dvb.js     2014-03-24 15:08:44.242319922 +1300
@@ -1429,6 +1429,13 @@
                        maxValue : 63
                })
        }, {
+               header : "Orbital Position",
+               dataIndex : 'position',
+               editor : new fm.NumberField({
+                       minValue : 0,
+                       maxValue : 1800
+               })
+       }, {
                header : "LNB type",
                dataIndex : 'lnb',
                width : 200,
@@ -1449,7 +1456,7 @@
                editor : new fm.TextField()
        } ]});

-       var rec = Ext.data.Record.create([ 'name', 'port', 'comment', 'lnb' ]);
+    var rec = Ext.data.Record.create([ 'name', 'port', 'comment', 'lnb', 'position' ]);

        return new tvheadend.tableEditor('Satellite config', 'dvbsatconf/'
                + adapterId, cm, rec, null, null, null);
Reply
#8
Thanks Djaggar, mystery solved as to what was going on.

I have been waiting for version 4. but might pull the patch and build 3.5 to get around this.
Reply

Logout Mark Read Team Forum Stats Members Help
TvHeadend Mux flip flopping0