Project

General

Profile

Feature #4243

multiple SAT>IP DVB-T frequency (Hz)

Added by Mono Polimorph almost 8 years ago. Updated about 7 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
SAT>IP
Target version:
Start date:
2017-02-19
Due date:
% Done:

100%

Estimated time:

Description

Hi,

I'm using TVH with two SAT>IP clients: one supports DVB-T2 and the other DVB-C. Now I like to map some IPTV muxes for both devices. If I use a freq. in the DVB-C space with the parameter "SAT>IP DVB-T frequency (Hz)" it works (i feel it isn't limited to DVB-T only). So, I suggest to support more than one frequency (a list separated by ",") for not repeat all IPTV muxes (at time I need to repeat all twice).

In short words, I suggest to support for IPTV: "SAT>IP DVB frequency (Hz)" = "474000,170000"

Please, can you add this?
Thank you!


Files

History

#1

Updated by Jaroslav Kysela over 7 years ago

  • Target version set to 4.4
#2

Updated by Mono Polimorph about 7 years ago

Hi,

I created one implementation of this functionality (head of the future 4.4 version!).

Comments:

  1. As I don't know how to support "multiple comma separated integers" in the configuration parameters (I don't see any example in the sources), I implemented three equal frequencies.
  2. All three frequencies are irrelevant of DVB-S/T/C, as only the number is used. However, to be more clear for the user are identified as DVB-T, DVB-C and DVB-S. You can put any value on it.
  3. For DVB-T/C you can use values as "658000000", and for DVB-S you can use "12610500". Take note of this when you assign your frequencies!
  4. In addition, the code now checks the number of announced tuners. If the number has more than one digit then is rounded to '9' (the maximum as the specification of the standard).
  5. As a bonus I added two new SAT>IP client manual configurations: 4 DVB-S tuners and 2 DVB-T/C. I use this configuration and I miss it in the current sources.

Here the patch:

diff --git a/src/input/mpegts/iptv/iptv_mux.c b/src/input/mpegts/iptv/iptv_mux.c
index fba69fe..857418b 100644
--- a/src/input/mpegts/iptv/iptv_mux.c
+++ b/src/input/mpegts/iptv/iptv_mux.c
@@ -259,6 +259,20 @@ const idclass_t iptv_mux_class =
     },
     {
       .type     = PT_U32,
+      .id       = "iptv_satip_dvbc_freq",
+      .name     = N_("SAT>IP DVB-C frequency (Hz)"),
+      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbc_freq),
+      .opts     = PO_ADVANCED
+    },
+    {
+      .type     = PT_U32,
+      .id       = "iptv_satip_dvbs_freq",
+      .name     = N_("SAT>IP DVB-S frequency (Hz)"),
+      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbs_freq),
+      .opts     = PO_ADVANCED
+    },
+    {
+      .type     = PT_U32,
       .id       = "iptv_buffer_limit",
       .name     = N_("Buffering limit (ms)"),
       .desc     = N_("Specifies the incoming buffering limit in " 
diff --git a/src/input/mpegts/iptv/iptv_private.h b/src/input/mpegts/iptv/iptv_private.h
index 851eef7..9fa6029 100644
--- a/src/input/mpegts/iptv/iptv_private.h
+++ b/src/input/mpegts/iptv/iptv_private.h
@@ -132,6 +132,8 @@ struct iptv_mux
   char                 *mm_iptv_hdr;
   char                 *mm_iptv_tags;
   uint32_t              mm_iptv_satip_dvbt_freq;
+  uint32_t              mm_iptv_satip_dvbc_freq;
+  uint32_t              mm_iptv_satip_dvbs_freq;

   uint32_t              mm_iptv_rtp_seq;

diff --git a/src/input/mpegts/satip/satip.c b/src/input/mpegts/satip/satip.c
index c326233..605c728 100644
--- a/src/input/mpegts/satip/satip.c
+++ b/src/input/mpegts/satip/satip.c
@@ -202,6 +202,8 @@ static const char *satip_tunercfg_tab[] = {
   "DVBS2-2,DVB-C2",
   "DVBC-1,DVBS2-1",
   "DVBC-2,DVBS2-2",
+  "DVBS2-4,DVBT-2",
+  "DVBS2-4,DVBC-2",
   NULL
 };

diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c
index 31fa433..9fcc185 100644
--- a/src/satip/rtsp.c
+++ b/src/satip/rtsp.c
@@ -553,9 +553,14 @@ rtsp_start
       }
 #if ENABLE_IPTV
       if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
-        LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link)
+        LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) {
           if (deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbt_freq) < 2000)
             break;
+          if (deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbc_freq) < 2000)
+            break;
+          if (deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbs_freq) < 2000)
+            break;
+          }
         if (mux) {
           dmc = rs->dmc;
           rs->perm_lock = 1;
diff --git a/src/satip/server.c b/src/satip/server.c
index 1b6a341..b43aaa7 100644
--- a/src/satip/server.c
+++ b/src/satip/server.c
@@ -152,14 +152,25 @@ satip_server_http_xml(http_connection_t *hc)
 #if ENABLE_IPTV
     else if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
       mpegts_mux_t *mm;
-      LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link)
+      LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link) {
         if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbt_freq) {
           dvbt++;
-          break;
         }
+        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbc_freq) {
+          dvbc++;
+        }
+        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbs_freq) {
+          dvbs++;
+        }
+      }
     }
 #endif
   }
+  // The SAT>IP specification only supports 1-9 tuners (1 digit)!
+  if (dvbt > 9) dvbt = 9;
+  if (dvbc > 9) dvbc = 9;
+  if (dvbs > 9) dvbs = 9;
+  if (atsc > 9) atsc = 9;
   for (p = xtab; p->id; p++) {
     i = *p->cptr;
     if (i > 0) {

I hope you want to commit it, or modify/improve it.
Regards.

#3

Updated by Mono Polimorph about 7 years ago

Hi,

No comments about it? :)

#4

Updated by Mono Polimorph about 7 years ago

Hi,

Why is this patch not approved?

#5

Updated by Mono Polimorph about 7 years ago

Hi,

What's wrong with this patch?
I'm using it and it works. Perhaps a best implementation can be done. However, I like to discuss it if I can improve it.

Regards.

#6

Updated by Jaroslav Kysela about 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|c0c43d4d944798a6b52d0345983d1a2c505e135d.

#7

Updated by Jaroslav Kysela about 7 years ago

Added to v4.3-480-gc0c43d4d9 except the client update with few fixes and additions (added frequency examples and added filter code matching the tuner types).

And I would like to ask you to create PR (pull request) on github next time, so I can comment directly your code. This way (handling patches) is more time costly on my side.

#8

Updated by Mono Polimorph about 7 years ago

Jaroslav Kysela wrote:

Added to v4.3-480-gc0c43d4d9 except the client update with few fixes and additions (added frequency examples and added filter code matching the tuner types).

Thank you!
However, the idea behaind not adding the maching of the tuner type is to enable the option of use more than one frequency with the same type. For example, for simulate two different orbital positions. In fact, without it you have 3 different frequencies of any type for your IPTV.

In any case, your implementation checking the tuner type is the correct one.
However, any idea of how to use "," separated values in the config?
For example, for type DVB-S will be interesting to support values like "12610500,11244000"

Regards.

#9

Updated by Jaroslav Kysela about 7 years ago

It's more difficult, because the field should be handled as string type and custom parsers (get/set callbacks) should be added to the code with a management of integer arrays with frequencies.

#10

Updated by Mono Polimorph about 7 years ago

Jaroslav Kysela wrote:

It's more difficult, because the field should be handled as string type and custom parsers (get/set callbacks) should be added to the code with a management of integer arrays with frequencies.

Sure! For this reason I implemented in this way. ;)

Also available in: Atom PDF