[usbtunerhelper] add patch for usbtuners which take longer for loading during init. master mirror/master
authorhschang <chang@dev3>
Wed, 8 Jul 2020 01:46:43 +0000 (10:46 +0900)
committerhschang <chang@dev3>
Wed, 8 Jul 2020 01:46:43 +0000 (10:46 +0900)
meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper.bb
meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/fix_delayed_loading.patch [new file with mode: 0755]
meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/usbtunerhelper.sh

index 38d0e32..23de067 100644 (file)
@@ -4,7 +4,7 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
 PV = "1.0+git${SRCPV}"
-PR = "r8"
+PR = "r9"
 SRC_REV = ""
 
 SRC_URI = " \
@@ -15,6 +15,7 @@ SRC_URI = " \
        file://get_avail_vtuner.patch \
        file://setfrontend_ofdm_fecauto.patch \
        file://pump_proc_checksize.patch \
+       file://fix_delayed_loading.patch \
        file://${PN}.sh \
        "
 
diff --git a/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/fix_delayed_loading.patch b/meta-openvuplus/recipes-vuplus/usbtunerhelper/usbtunerhelper/fix_delayed_loading.patch
new file mode 100755 (executable)
index 0000000..d03bc6a
--- /dev/null
@@ -0,0 +1,34 @@
+diff -Naur git.orig/usbtunerhelper.c git/usbtunerhelper.c\r
+--- git.orig/usbtunerhelper.c  2015-11-04 20:03:46.000000000 +0100\r
++++ git/usbtunerhelper.c       2015-11-04 20:04:16.200476304 +0100\r
+@@ -665,6 +665,7 @@\r
+       int debug = 0;\r
+       int scan_inverval = 1;\r
+       int scan_count = 60;\r
++      char filename[] = "/tmp/.vtuner_available";\r
\r
+       int option;\r
+       while ((option = getopt(argc, argv, "dh")) >= 0)\r
+@@ -680,6 +681,12 @@\r
+               }\r
+       }\r
\r
++      if ( (scan_adapters() > 0) && (!debug) ){\r
++              FILE *fp;\r
++              fp=fopen(filename, "w+");\r
++              fclose(fp);\r
++      }\r
++\r
+       if (!debug) daemon_init();\r
\r
+       signal(SIGTERM, sigint_handler);\r
+@@ -700,6 +707,9 @@\r
\r
+       available_vtuner = get_avail_vtuner();\r
\r
++      int ret;\r
++      ret = remove(filename);\r
++      \r
+       for (i = 0; i < adaptercount; i++)\r
+       {\r
+               init_adapter(i);\r
index 424cf3d..3d3e620 100644 (file)
@@ -1,24 +1,34 @@
-#!/bin/sh
-
-if ! [ -x /usr/bin/usbtunerhelper ]; then
-       exit 0
-fi
-
-case "$1" in
-       start)
-               start-stop-daemon -S -x /usr/bin/usbtunerhelper
-               ;;
-       stop)
-               start-stop-daemon -K -x /usr/bin/usbtunerhelper
-               ;;
-       restart|reload)
-               $0 stop
-               $0 start
-               ;;
-       *)
-               echo "Usage: $0 {start|stop|restart}"
-               exit 1
-               ;;
-esac
-
-exit 0
+#!/bin/sh\r
+\r
+if ! [ -x /usr/bin/usbtunerhelper ]; then\r
+       exit 0\r
+fi\r
+\r
+VTUNER_FILE="/tmp/.vtuner_available"\r
+\r
+case "$1" in\r
+       start)\r
+               start-stop-daemon -S -x /usr/bin/usbtunerhelper\r
+               if [ -f $VTUNER_FILE ]\r
+               then\r
+                       echo "[USBTUNERHELPER] wait for initializing vtuner"\r
+                       while [ ! -f $VTUNER_FILE ]; do\r
+                               usleep 100000\r
+                       done\r
+                       sleep 2\r
+               fi\r
+               ;;\r
+       stop)\r
+               start-stop-daemon -K -x /usr/bin/usbtunerhelper\r
+               ;;\r
+       restart|reload)\r
+               $0 stop\r
+               $0 start\r
+               ;;\r
+       *)\r
+               echo "Usage: $0 {start|stop|restart}"\r
+               exit 1\r
+               ;;\r
+esac\r
+\r
+exit 0\r