Project

General

Profile

Bug #4553

Can't find Sat>IP server at startup

Added by C vH about 4 years ago. Updated about 4 years ago.

Status:
Fixed
Priority:
Normal
Category:
SAT>IP
Target version:
-
Start date:
2017-08-24
Due date:
% Done:

100%

Estimated time:
Found in version:
4.x
Affected Versions:

Description

This was already discussed earlier, but currently it looks like to evolve into a general problem, so I tagged it bug instead of a feature.

Multible ppl at multible systems (OpenMediaVault, Synology, Debian/Ubuntu ...) are reporting the same issue over and over again.

At the moment their system starts Tvh (start, reboot, suspend), there is still no network connection and Tvh won't discover their Sat>IP servers.
So ppl have to edit their start files (sleep 5-10) or restart their Tvh servers to get their Sat>IP Servers detected (also the discover Sat>IP server button is too hidden).
Both is not too practical and this problem is only seen at Tvh. VDR/DVBviewer etc didn't suffer from this problem - at least not at startup.

I think there is absolutely no need to do this workarounds at all - Tvh should be able to detect this at an plain normal/standard system.
Its common these days (ssd, systemd ...) that services are faster up then networks - Tvh should be able to handle this.

What could be done (some ideas):
- if no Sat>IP server was found at startup scan after ~10sec a second time and maybe after ~30sec a third time
- scan periodical after a Sat>IP server (1x ever 15min or so)
- don't scan for network devices if no network is ready -> wait till network is up

personally the first proposal looks save and shouldn't have any drawbacks + no user interaction and no addition settings are needed, for 2 + 3 I can see at least drawbacks or additional settings/user interaction needed

would be great to get this fixed
best regards

Associated revisions

Revision 8b2fe7a3 (diff)
Added by Jaroslav Kysela about 4 years ago

satip client: issue discovery packets 1,10,30,3600+ seconds after boot, fixes #4553

Revision 699c827b (diff)
Added by Jaroslav Kysela about 4 years ago

satip client: issue discovery packets 1,10,30,3600+ seconds after boot, fixes #4553

History

#1

Updated by Jaroslav Kysela about 4 years ago

- scan periodical after a Sat>IP server (1x ever 15min or so)

TVH already does scan for new servers, once per hour.

This patch adds code to send the UPnP MSEARCH after 1,10,30,3600... seconds after boot:

diff --git a/src/input/mpegts/satip/satip.c b/src/input/mpegts/satip/satip.c
index 92d6562be..62234dabe 100644
--- a/src/input/mpegts/satip/satip.c
+++ b/src/input/mpegts/satip/satip.c
@@ -1251,18 +1251,24 @@ ST: urn:ses-com:device:SatIPServer:1\r\n" 
 static void
 satip_discovery_static_timer_cb(void *aux)
 {
+  static int next_timeout = 10;
   int i;

   if (!tvheadend_is_running())
     return;
   for (i = 0; i < satip_static_clients->num; i++)
     satip_discovery_static(satip_static_clients->str[i]);
-  mtimer_arm_rel(&satip_discovery_static_timer, satip_discovery_static_timer_cb, NULL, sec2mono(3600));
+  mtimer_arm_rel(&satip_discovery_static_timer, satip_discovery_static_timer_cb,
+                 NULL, sec2mono(next_timeout));
+  if (next_timeout < 3600)
+    next_timeout = next_timeout >= 30 ? 3600 : 30;
 }

 static void
 satip_discovery_timer_cb(void *aux)
 {
+  static int next_timeout = 10;
+
   if (!tvheadend_is_running())
     return;
   if (!atomic_get(&upnp_running)) {
@@ -1280,7 +1286,9 @@ satip_discovery_timer_cb(void *aux)
   if (satip_discovery_service)
     satip_discovery_send_msearch((void *)1);
   mtimer_arm_rel(&satip_discovery_timer, satip_discovery_timer_cb,
-                 NULL, sec2mono(3600));
+                 NULL, sec2mono(next_timeout));
+  if (next_timeout < 3600)
+    next_timeout = next_timeout >= 30 ? 3600 : 30;
 }

 void
#2

Updated by Jaroslav Kysela about 4 years ago

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

Applied in changeset commit:tvheadend|6549dc80e741d19763ce3f75c474b3e6529fe79a.

#3

Updated by Mono Polimorph about 4 years ago

Jaroslav Kysela wrote:

- scan periodical after a Sat>IP server (1x ever 15min or so)

TVH already does scan for new servers, once per hour.

This patch adds code to send the UPnP MSEARCH after 1,10,30,3600... seconds after boot:

[...]

Great!

However, Why after the three initial searches wait for 1 hour?
I suggest this list: 2,15,60,900+... seconds.
Or leave the user the option for configure (in the expert zone) the list of seconds.

Search every hour it's a lot of time! I prefer every 15 minutes.

Regards.

#4

Updated by Jaroslav Kysela about 4 years ago

The server should advertise itself when booted (for UPnP config). Yes, the period might be configurable. Create another feature request.

Also available in: Atom PDF