diff --git a/packages/addons/service/tvheadend42/changelog.txt b/packages/addons/service/tvheadend42/changelog.txt
index 4009d676d7..b845f1511e 100644
--- a/packages/addons/service/tvheadend42/changelog.txt
+++ b/packages/addons/service/tvheadend42/changelog.txt
@@ -1,3 +1,9 @@
+109
+- added custom start options to addon
+- added FRITZ!Box Sat>IP server support to addon
+- update to Tvheadend 4.1.2415
+- fix debug if activated but nothing selected
+
108
- added CA (libdvben50221) support
- update to Tvheadend 4.1.2401
diff --git a/packages/addons/service/tvheadend42/package.mk b/packages/addons/service/tvheadend42/package.mk
index b66763a683..9e9d1bc6c3 100644
--- a/packages/addons/service/tvheadend42/package.mk
+++ b/packages/addons/service/tvheadend42/package.mk
@@ -1,6 +1,6 @@
################################################################################
# This file is part of LibreELEC - https://LibreELEC.tv
-# Copyright (C) 2016 Team LibreELEC
+# Copyright (C) 2016-2017 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,9 +17,9 @@
################################################################################
PKG_NAME="tvheadend42"
-PKG_VERSION="1f894a6"
-PKG_VERSION_NUMBER="4.1.2401"
-PKG_REV="108"
+PKG_VERSION="e5f5a42"
+PKG_VERSION_NUMBER="4.1.2415"
+PKG_REV="109"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.tvheadend.org"
diff --git a/packages/addons/service/tvheadend42/source/bin/tvheadend42.start b/packages/addons/service/tvheadend42/source/bin/tvheadend42.start
index 6484302389..89a999f157 100755
--- a/packages/addons/service/tvheadend42/source/bin/tvheadend42.start
+++ b/packages/addons/service/tvheadend42/source/bin/tvheadend42.start
@@ -2,7 +2,7 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
-# Copyright (C) 2016 Team LibreELEC
+# Copyright (C) 2016-2017 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,6 +44,19 @@ XMLTV_FILE="$ADDON_DIR/bin/tv_grab_file"
chmod a+x $ADDON_DIR/bin/*
+# workaround to support old 4.1.x version upgrade for Tvh after 4.1.2369
+if [ -f "$ADDON_HOME/dvr/config/dvr-config" ]; then
+ rm $ADDON_HOME/dvr/config/dvr-config
+fi
+
+if [ -f "$ADDON_HOME/channel/config/config.tmp" ]; then
+ rm $ADDON_HOME/channel/config/config.tmp
+fi
+
+if [ -f "$ADDON_HOME/channel/config/tag.tmp" ]; then
+ rm $ADDON_HOME/channel/config/tag.tmp
+fi
+
# copy config files to userdata
if [ ! -f "$DVR_SETTINGS_FILE" ]; then
mkdir -p $DVR_SETTINGS_DIR
@@ -71,11 +84,26 @@ if [ ! -f "$XMLTV_SETTINGS_FILE" ]; then
cp $ADDON_DIR/defaults/xmltv/config $XMLTV_SETTINGS_FILE
fi
-# options
+# delayed Tvh startup
if [ "$WORKAROUND_SLEEP" == "true" ]; then
sleep $WORKAROUND_SLEEP_TIME
fi
+# support FritzBox Sat>IP Server detection workaround
+if [ "$AVM_SATIP_SERVER" == "true" ]; then
+ AVM_SATIP=""
+ for i in $(seq 1 $AVM_SATIP_SERVER_NUM); do
+ ref_ip=AVM_IP_${i}
+ eval "AVM_IP=\${$ref_ip}"
+ AVM_SATIP="$AVM_SATIP --satip_xml http://${AVM_IP}:${AVM_PORT}/satipdesc.xml"
+ done
+fi
+
+# custom startup parameters
+if [ "$CUSTOM_START" != "true" ]; then
+ CUSTOM_ARGS=""
+fi
+
# debug value generation
if [ "$DEBUG_LOG_TRACE_1" != "NONE" ]; then
DEBUG_LOG_ARG="$DEBUG_LOG_TRACE_1"
@@ -84,7 +112,7 @@ fi
if [ "$DEBUG_LOG_TRACE_2" != "NONE" ]; then
DEBUG_LOG_ARG="$DEBUG_LOG_ARG,$DEBUG_LOG_TRACE_2"
fi
-
+
if [ "$DEBUG_LOG_TRACE_3" != "NONE" ]; then
DEBUG_LOG_ARG="$DEBUG_LOG_ARG,$DEBUG_LOG_TRACE_3"
fi
@@ -97,6 +125,11 @@ if [ "$DEBUG_LOG_TRACE_5" != "NONE" ]; then
DEBUG_LOG_ARG="$DEBUG_LOG_ARG,$DEBUG_LOG_TRACE_5"
fi
+# if debuglog is activated and nothing selected to trace
+if [ -z "$DEBUG_LOG_ARG" ];then
+ DEBUG_LOG_ARG="all"
+fi
+
# rename debuglog if already exist to prevent overwriting after crash
if [ -f "${DEBUG_LOG_PATH}" ]; then
cp ${DEBUG_LOG_PATH} ${DEBUG_LOG_PATH}_$(date '+%Y-%m-%d_%H.%M.%S').txt
@@ -104,9 +137,9 @@ fi
# debug commandline
if [ "$DEBUG_LOG" = "true" ]; then
- TVHEADEND_ARG="-B -C -u root -g video -c $ADDON_HOME -l ${DEBUG_LOG_PATH} --trace $DEBUG_LOG_ARG"
+ TVHEADEND_ARG="-B -C -u root -g video -c $ADDON_HOME $AVM_SATIP $CUSTOM_ARGS -l ${DEBUG_LOG_PATH} --trace $DEBUG_LOG_ARG"
else
- TVHEADEND_ARG="-B -C -u root -g video -c $ADDON_HOME"
+ TVHEADEND_ARG="-B -C -u root -g video -c $ADDON_HOME $AVM_SATIP $CUSTOM_ARGS"
fi
# start userspace DVB driver/addon
diff --git a/packages/addons/service/tvheadend42/source/resources/language/English/strings.xml b/packages/addons/service/tvheadend42/source/resources/language/English/strings.xml
index b036835769..02b78e7e35 100644
--- a/packages/addons/service/tvheadend42/source/resources/language/English/strings.xml
+++ b/packages/addons/service/tvheadend42/source/resources/language/English/strings.xml
@@ -1,27 +1,39 @@
-
- XMLTV
- DVB
- DEBUG
- XMLTV Configuration
- XMLTV source type
- XMLTV File location
- XMLTV Web location
- XMLTV Script location
- DVB Configuration
- Unload DVB mudules before suspend
- Wait for frontend initialization
- Number of adapters to wait for
- Preload capmt_ca.so library
- Delay the start of Tvheadend
- Seconds delay
- TRACE Configuration
- Path
- Activate TRACE Debug
- Debug Value #1
- Debug Value #2
- Debug Value #3
- Debug Value #4
- Debug Value #5
+
+ XMLTV
+ DVB
+ DEBUG
+ FRITZ!Box Sat>IP
+ XMLTV Configuration
+ XMLTV source type
+ XMLTV File location
+ XMLTV Web location
+ XMLTV Script location
+ DVB Configuration
+ Unload DVB mudules before suspend
+ Wait for frontend initialization
+ Number of adapters to wait for
+ Preload capmt_ca.so library
+ Delay the start of Tvheadend
+ Seconds delay
+ Custom start parameter
+ Parameter
+ FRITZ!Box Sat>IP server
+ # of tuners
+ Tuner #1 address
+ Tuner #2 address
+ Tuner #3 address
+ Tuner #4 address
+ AVM SAT>IP Port
+ Port
+ FRITZ!Box Sat>IP server connection
+ TRACE Configuration
+ Path
+ Activate TRACE Debug
+ Debug Value #1
+ Debug Value #2
+ Debug Value #3
+ Debug Value #4
+ Debug Value #5
diff --git a/packages/addons/service/tvheadend42/source/resources/settings.xml b/packages/addons/service/tvheadend42/source/resources/settings.xml
index 185a5a27f8..06883e8c41 100644
--- a/packages/addons/service/tvheadend42/source/resources/settings.xml
+++ b/packages/addons/service/tvheadend42/source/resources/settings.xml
@@ -1,34 +1,48 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+