Merge remote-tracking branch 'upstream/master' into openelec-settings

This commit is contained in:
Stefan Saraev 2013-02-21 21:36:22 +02:00
commit 91f5b77abe
21 changed files with 398 additions and 277 deletions

View File

@ -1,25 +1,22 @@
3.0.1 3.0.2
addon renamed to just sundtek
added addon settings added addon settings
enable HW PID filter (enabled for RPi by default)
enable IR receiver
allow sharing local tuner over network
use network tuners
sundtek's binaries are downloaded on first run sundtek's binaries are downloaded on first run
automatically download new version of the binaries if available automatically download new version of the binaries if available
added preload library to .profile (to run mediaclient, w_scan, ... from console) added preload library to .profile (to run mediaclient, w_scan, ... from console)
2.1.4 2.1.4
support for Raspberry Pi support for Raspberry Pi
2.1.3 2.1.3
support for network tuner support for network tuner
2.1.2 2.1.2
support for multiple Sundtek tuners support for multiple Sundtek tuners
support for working with other tuners (kernel drivers) support for working with other tuners (kernel drivers)
2.1.1 2.1.1
- update to addon version 2.1 update to addon version 2.1
2.0.5 2.0.5
- starting userspace DVB drivers from Tvheadend/VDR starting userspace DVB drivers from Tvheadend/VDR
1.90.0 1.90.0
- initial version of Sundtek MediaTV DVB driver initial version of Sundtek MediaTV DVB driver

View File

@ -1,9 +1,15 @@
# #
# sundtek.conf # sundtek.conf
# #
# Call attach/detach script when new device appears/disappears
# Do not change this line (OpenElec addon require this) ! # enable HW PID filter (default on for RPi)
device_attach=/storage/.xbmc/addons/driver.dvb.sundtek/bin/device-attached.sh use_hwpidfilter=off
# enable listening on network
enablenetwork=off
# Lowest adapter number to start with, e.g. /dev/dvb/adapter5/frontend0
first_adapter=0
# Infrared Control Support is disabled/enabled # Infrared Control Support is disabled/enabled
ir_disabled=1 ir_disabled=1
@ -11,9 +17,6 @@ ir_disabled=1
# trigger device_attach only once if more devices is used # trigger device_attach only once if more devices is used
bulk_notification=on bulk_notification=on
# Lowest adapter number to start with, e.g. /dev/dvb/adapter5/frontend0
#first_adapter=5
# Get adapter serial number with mediaclient -e # Get adapter serial number with mediaclient -e
# or look into file adapter_serial_number.txt # or look into file adapter_serial_number.txt
#[SERIALNUMBER] #[SERIALNUMBER]
@ -24,3 +27,7 @@ bulk_notification=on
#[U123456789012] #[U123456789012]
#initial_dvb_mode=DVBT #initial_dvb_mode=DVBT
#[NETWORK]
#device=192.168.1.1:0
#device=192.168.1.1:1

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -18,9 +18,9 @@
# http://www.gnu.org/copyleft/gpl.html # http://www.gnu.org/copyleft/gpl.html
################################################################################ ################################################################################
PKG_NAME="sundtek" PKG_NAME="sundtek-mediatv"
PKG_VERSION="3.0" PKG_VERSION="3.0"
PKG_REV="1" PKG_REV="2"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="nonfree" PKG_LICENSE="nonfree"
PKG_SITE="http://support.sundtek.com/" PKG_SITE="http://support.sundtek.com/"

View File

@ -0,0 +1,21 @@
<settings>
<setting id="AUTO_UPDATE" value="false" />
<setting id="ANALOG_TV" value="false" />
<setting id="SETTLE_TIME" value="0" />
<setting id="RUN_USER_SCRIPT" value="false" />
<setting id="ENABLE_HW_PID_FILTER" value="false" />
<setting id="ENABLE_IR_RECEIVER" value="false" />
<setting id="LOWEST_ADAPTER_NUM" value="0" />
<setting id="ALLOW_NET_USE" value="false" />
<setting id="USE_NET_TUNERS" value="false" />
<setting id="DEVICE1_IP" value="" />
<setting id="DEVICE1_NUM" value="1" />
<setting id="DEVICE2_IP" value="" />
<setting id="DEVICE2_NUM" value="1" />
<setting id="DEVICE3_IP" value="" />
<setting id="DEVICE3_NUM" value="1" />
<setting id="DEVICE4_IP" value="" />
<setting id="DEVICE4_NUM" value="1" />
<setting id="DEVICE5_IP" value="" />
<setting id="DEVICE5_NUM" value="1" />
</settings>

View File

@ -22,7 +22,7 @@
. /etc/profile . /etc/profile
ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek" ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek-mediatv"
logger -t Sundtek "### Sundtek manual start ###" logger -t Sundtek "### Sundtek manual start ###"
. $ADDON_DIR/bin/userspace-driver.sh . $ADDON_DIR/bin/userspace-driver.sh

View File

@ -22,7 +22,7 @@
. /etc/profile . /etc/profile
ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek" ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek-mediatv"
export LD_PRELOAD=$ADDON_DIR/lib/libmediaclient.so export LD_PRELOAD=$ADDON_DIR/lib/libmediaclient.so

View File

@ -0,0 +1,289 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
net_tuner_num_fix() {
local num=$1
[ -z "$num" ] && num=1
num=$(( $num *1 ))
[ $num -lt 1 ] && num=1
num=$(( $num -1 ))
echo $num
}
ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek-mediatv"
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv"
ADDON_SETTINGS="$ADDON_HOME/settings.xml"
mkdir -p $ADDON_HOME
if [ ! -f "$ADDON_HOME/sundtek.conf" ]; then
cp $ADDON_DIR/config/* $ADDON_HOME/
else
# in case of missing entries in addon home's sundtek.conf
entry_set="$(grep use_hwpidfilter $ADDON_HOME/sundtek.conf 2>/dev/null)"
if [ -z "$entry_set" ]; then
sed -i 's|^device_attach=.*|# device_attach not used anymore\n\n# enable HW PID filter\nuse_hwpidfilter=off\n\n# enable listening on network\nenablenetwork=off|g' $ADDON_HOME/sundtek.conf
sed -i 's|^#first_adapter=.*|first_adapter=0|g' $ADDON_HOME/sundtek.conf
sed -i 's|.*network tuner IP address (OpenELEC specific).*||g' $ADDON_HOME/sundtek.conf
sed -i 's|.*network_tuner_ip=.*||g' $ADDON_HOME/sundtek.conf
fi
fi
if [ ! -f "$ADDON_SETTINGS" ]; then
cp $ADDON_DIR/settings-default.xml $ADDON_SETTINGS
fi
mkdir -p /var/config
cat "$ADDON_SETTINGS" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d' > /var/config/sundtek-addon.conf
. /var/config/sundtek-addon.conf
if [ "$AUTO_UPDATE" = "true" -a -f $ADDON_DIR/bin/mediasrv ]; then
logger -t Sundtek "### Checking for new Sundtek binary installer ###"
touch $ADDON_HOME/driver-version.txt
wget -O /tmp/sundtek-driver-version.txt http://sundtek.de/media/latest.phtml
md5_1=$(md5sum -b /tmp/sundtek-driver-version.txt | awk '{print $1}')
md5_2=$(md5sum -b $ADDON_HOME/driver-version.txt | awk '{print $1}')
if [ "$md5_1" != "$md5_2" ]; then
logger -t Sundtek "### Updating Sundtek binary installer ###"
rm -f $ADDON_DIR/bin/mediasrv
fi
rm -f /tmp/sundtek-driver-version.txt
fi
if [ ! -f $ADDON_DIR/bin/mediasrv ]; then
# remove renamed addon if exist
rm -fr "$HOME/.xbmc/addons/driver.dvb.sundtek"
rm -fr "$HOME/userdata/addon_data/driver.dvb.sundtek"
logger -t Sundtek "### Downloading installer ###"
cd $ADDON_DIR
mkdir -p bin lib tmp
cd tmp/
ARCH=$(sed -n 's|.*\.\([^-]*\)-.*|\1|p' /etc/release | tr -d '\n')
if [ "$ARCH" = "x86_64" ]; then
INSTALLER_URL="http://sundtek.de/media/netinst/64bit/installer.tar.gz"
elif [ "$ARCH" = "i386" ]; then
INSTALLER_URL="http://sundtek.de/media/netinst/32bit/installer.tar.gz"
elif [ "$ARCH" = "arm" ]; then
INSTALLER_URL="http://sundtek.de/media/netinst/armsysvhf/installer.tar.gz"
# enable HW PID filter on RPi by default
sed -i 's|^use_hwpidfilter=.*|use_hwpidfilter=on|g' $ADDON_DIR/config/sundtek.conf
sed -i 's|^use_hwpidfilter=.*|use_hwpidfilter=on|g' $ADDON_HOME/sundtek.conf
sed -i 's|.*id="ENABLE_HW_PID_FILTER".*|<setting id="ENABLE_HW_PID_FILTER" value="true" />|' $ADDON_SETTINGS
else
logger -t Sundtek "### Unsupported architecture ###"
cd ..
rm -fr tmp/
exit 1
fi
wget -O installer.tar.gz $INSTALLER_URL
wget -O ../driver-version.txt http://sundtek.de/media/latest.phtml
logger -t Sundtek "### Extracting installer ###"
tar -xzf installer.tar.gz
if [ $? -ne 0 ]; then
logger -t Sundtek "### Installer damaged ###"
cd ..
rm -fr tmp/
exit 2
fi
cp -Pa opt/bin/* ../bin/
cp -Pa opt/lib/* ../lib/
cp ../driver-version.txt $ADDON_HOME/
cd ..
rm -fr tmp/
logger -t Sundtek "### Installer finished ###"
cat "$ADDON_SETTINGS" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d' > /var/config/sundtek-addon.conf
. /var/config/sundtek-addon.conf
fi
if [ ! -f $ADDON_HOME/driver-version.txt ]; then
cp $ADDON_DIR/driver-version.txt $ADDON_HOME/
fi
# enable to install same addon package version again
rm -f /storage/.xbmc/addons/packages/driver.dvb.sundtek*
# add alias for /opt/bin/mediaclient
alias_set="$(grep libmediaclient.so /storage/.profile 2>/dev/null)"
if [ -z "$alias_set" ]; then
echo "" >>/storage/.profile
echo "[ -f /storage/.xbmc/addons/driver.dvb.sundtek-mediatv/lib/libmediaclient.so ] && export LD_PRELOAD=/storage/.xbmc/addons/driver.dvb.sundtek-mediatv/lib/libmediaclient.so" >>/storage/.profile
echo "" >>/storage/.profile
else
# fix name
sed -i 's|/driver.dvb.sundtek/|/driver.dvb.sundtek-mediatv/|g' /storage/.profile
fi
export LD_PRELOAD=$ADDON_DIR/lib/libmediaclient.so
if [ "$ANALOG_TV" = "true" -a ! -f "$ADDON_DIR/bin/plugins/lib/libavcodec.so.54.12.100" ]; then
logger -t Sundtek "### Downloading missing ffmpeg libraries ###"
cd $ADDON_DIR/bin
mkdir -p plugins/
cd plugins/
ARCH=$(sed -n 's|.*\.\([^-]*\)-.*|\1|p' /etc/release | tr -d '\n')
wget -O sundtek-ffmpeg-analog_tv-lib.tgz http://dl.dropbox.com/u/8224157/public/sundtek/sundtek-ffmpeg-analog_tv-lib-$ARCH.tgz
logger -t Sundtek "### Extracting ffmpeg libraries ###"
tar -xzf sundtek-ffmpeg-analog_tv-lib.tgz
if [ $? -ne 0 ]; then
logger -t Sundtek "### Ffmpeg library archive damaged ###"
rm -f sundtek-ffmpeg-analog_tv-lib.tgz
exit 2
fi
rm -f sundtek-ffmpeg-analog_tv-lib.tgz
fi
if [ -z "$(pidof mediasrv)" ]; then
rm -f /var/log/mediasrv.log
rm -f /var/log/mediaclient.log
SUNDTEK_CONF_TMP=/tmp/sundtek.conf
cp $ADDON_HOME/sundtek.conf $SUNDTEK_CONF_TMP
[ -z "$LOWEST_ADAPTER_NUM" ] && LOWEST_ADAPTER_NUM=0
sed -i "s|^first_adapter=.*|first_adapter=$LOWEST_ADAPTER_NUM|g" $SUNDTEK_CONF_TMP
# enable HW PID filter
if [ "$ENABLE_HW_PID_FILTER" = "true" ]; then
sed -i 's|^use_hwpidfilter=.*|use_hwpidfilter=on|g' $SUNDTEK_CONF_TMP
else
sed -i 's|^use_hwpidfilter=.*|use_hwpidfilter=off|g' $SUNDTEK_CONF_TMP
fi
# enable IR receiver
if [ "$ENABLE_IR_RECEIVER" = "true" ]; then
sed -i 's|^ir_disabled=.*|ir_disabled=0|g' $SUNDTEK_CONF_TMP
else
sed -i 's|^ir_disabled=.*|ir_disabled=1|g' $SUNDTEK_CONF_TMP
fi
if [ "$ALLOW_NET_USE" = "true" ]; then
sed -i 's|^enablenetwork=.*|enablenetwork=on|g' $SUNDTEK_CONF_TMP
else
sed -i 's|^enablenetwork=.*|enablenetwork=off|g' $SUNDTEK_CONF_TMP
fi
[ "$DEVICE1_IP" = "0.0.0.0" ] && DEVICE1_IP=""
[ "$DEVICE2_IP" = "0.0.0.0" ] && DEVICE2_IP=""
[ "$DEVICE3_IP" = "0.0.0.0" ] && DEVICE3_IP=""
[ "$DEVICE4_IP" = "0.0.0.0" ] && DEVICE4_IP=""
[ "$DEVICE5_IP" = "0.0.0.0" ] && DEVICE5_IP=""
DEVICE1_NUM=$(net_tuner_num_fix $DEVICE1_NUM)
DEVICE2_NUM=$(net_tuner_num_fix $DEVICE2_NUM)
DEVICE3_NUM=$(net_tuner_num_fix $DEVICE3_NUM)
DEVICE4_NUM=$(net_tuner_num_fix $DEVICE4_NUM)
DEVICE5_NUM=$(net_tuner_num_fix $DEVICE5_NUM)
if [ "$USE_NET_TUNERS" = "true" -a -n "$DEVICE1_IP" ]; then
# delete all network tuner entries
awk '/^\[NETWORK\]/{flag=1; next} /^device=|^#|^$/{if (flag==1) next} /.*/{flag=0; print}' $SUNDTEK_CONF_TMP >${SUNDTEK_CONF_TMP}-net
mv ${SUNDTEK_CONF_TMP}-net $SUNDTEK_CONF_TMP
echo "" >>$SUNDTEK_CONF_TMP
# remove empty lines at the end of file
sed -i '${/^$/d;}' $SUNDTEK_CONF_TMP
# add entries
echo "[NETWORK]" >>$SUNDTEK_CONF_TMP
for dev in $(seq 0 $DEVICE1_NUM); do
echo "device=$DEVICE1_IP:$dev" >>$SUNDTEK_CONF_TMP
done
if [ -n "$DEVICE2_IP" ]; then
for dev in $(seq 0 $DEVICE2_NUM); do
echo "device=$DEVICE2_IP:$dev" >>$SUNDTEK_CONF_TMP
done
if [ -n "$DEVICE3_IP" ]; then
for dev in $(seq 0 $DEVICE3_NUM); do
echo "device=$DEVICE3_IP:$dev" >>$SUNDTEK_CONF_TMP
done
if [ -n "$DEVICE4_IP" ]; then
for dev in $(seq 0 $DEVICE4_NUM); do
echo "device=$DEVICE4_IP:$dev" >>$SUNDTEK_CONF_TMP
done
if [ -n "$DEVICE5_IP" ]; then
for dev in $(seq 0 $DEVICE5_NUM); do
echo "device=$DEVICE5_IP:$dev" >>$SUNDTEK_CONF_TMP
done
fi
fi
fi
fi
else
# delete all network tuner entries
awk '/^\[NETWORK\]/{flag=1; next} /^device=|^#|^$/{if (flag==1) next} /.*/{flag=0; print}' $SUNDTEK_CONF_TMP >${SUNDTEK_CONF_TMP}-net
mv ${SUNDTEK_CONF_TMP}-net $SUNDTEK_CONF_TMP
echo "" >>$SUNDTEK_CONF_TMP
# remove empty lines at the end of file
sed -i '${/^$/d;}' $SUNDTEK_CONF_TMP
fi
md5_1=$(md5sum -b $SUNDTEK_CONF_TMP | awk '{print $1}')
md5_2=$(md5sum -b $ADDON_HOME/sundtek.conf | awk '{print $1}')
if [ "$md5_1" != "$md5_2" ]; then
# file changed - copy to addon home
cp $SUNDTEK_CONF_TMP $ADDON_HOME/sundtek.conf
fi
mediasrv --wait-for-devices -p $ADDON_DIR/bin -c $ADDON_HOME/sundtek.conf -d
# wait few seconds
[ -z "$SETTLE_TIME" ] && SETTLE_TIME=0
SETTLE_TIME=$(( $SETTLE_TIME *1 ))
if [ $SETTLE_TIME -gt 0 ]; then
logger -t Sundtek "### Settle for $SETTLE_TIME sec ###"
sleep $SETTLE_TIME
fi
if [ "$ANALOG_TV" = "true" ]; then
logger -t Sundtek "### Switching to analog TV mode ###"
#rm -fr /dev/dvb/
mediaclient --disable-dvb=/dev/dvb/adapter0
fi
if [ "$RUN_USER_SCRIPT" = "true" -a -f "$ADDON_HOME/userscript.sh" ]; then
logger -t Sundtek "### Running user script $ADDON_HOME/userscript.sh ###"
cat $ADDON_HOME/userscript.sh | dos2unix >/var/run/sundtek-userscript.sh
sh /var/run/sundtek-userscript.sh
fi
(
# save adapter serial number in background
sleep 5
serial_number_old=$(cat $ADDON_HOME/adapters.txt 2>/dev/null)
serial_number_new=$(mediaclient -e | awk '/device / {print $0} /ID:/ {print $2}')
if [ "$serial_number_old" != "$serial_number_new" ]; then
echo "$serial_number_new" >$ADDON_HOME/adapters.txt
fi
)&
fi
logger -t Sundtek "### Sundtek ready ###"

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="1000">General</string>
<string id="1011">Auto update binary driver</string>
<string id="1012">Enable analog TV</string>
<string id="1014">Extra settle time</string>
<string id="1015">Run user script</string>
<string id="1030">Enable hardware PID filter</string>
<string id="1035">Enable IR receiver</string>
<string id="1040">Lowest adapter number (/dev/dvb/adapterX/)</string>
<string id="2000">Networking</string>
<string id="2005">Share local tuner over network</string>
<string id="2010">Use network shared tuners</string>
<string id="2020">Server 1 IP address</string>
<string id="2021"> # of tuners</string>
<string id="2030">Server 2 IP address</string>
<string id="2031"> # of tuners</string>
<string id="2040">Server 3 IP address</string>
<string id="2041"> # of tuners</string>
<string id="2050">Server 4 IP address</string>
<string id="2051"> # of tuners</string>
<string id="2060">Server 5 IP address</string>
<string id="2061"> # of tuners</string>
</strings>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="1000" >
<setting label="" type="lsep" />
<setting type="sep" />
<setting id="AUTO_UPDATE" type="bool" label="1011" default="false" />
<setting id="ANALOG_TV" type="bool" label="1012" default="false" enable="false" />
<setting id="SETTLE_TIME" type="number" label="1014" default="0" />
<setting id="RUN_USER_SCRIPT" type="bool" label="1015" default="false" />
<setting id="ENABLE_HW_PID_FILTER" type="bool" label="1030" default="false" />
<setting id="ENABLE_IR_RECEIVER" type="bool" label="1035" default="false" />
<setting id="LOWEST_ADAPTER_NUM" type="number" label="1040" default="0" />
</category>
<category label="2000" >
<setting label="" type="lsep" />
<setting type="sep" />
<setting id="ALLOW_NET_USE" type="bool" label="2005" default="false" />
<setting id="USE_NET_TUNERS" type="bool" label="2010" default="false" />
<setting id="DEVICE1_IP" type="ipaddress" label="2020" default="" visible="eq(-1,true)" />
<setting id="DEVICE1_NUM" type="labelenum" label="2021" default="1" values="1|5|4|3|2" visible="eq(-2,true)" />
<setting id="DEVICE2_IP" type="ipaddress" label="2030" default="" visible="eq(-3,true)" />
<setting id="DEVICE2_NUM" type="labelenum" label="2031" default="1" values="1|5|4|3|2" visible="eq(-4,true)" />
<setting id="DEVICE3_IP" type="ipaddress" label="2040" default="" visible="eq(-5,true)" />
<setting id="DEVICE3_NUM" type="labelenum" label="2041" default="1" values="1|5|4|3|2" visible="eq(-6,true)" />
<setting id="DEVICE4_IP" type="ipaddress" label="2050" default="" visible="eq(-7,true)" />
<setting id="DEVICE4_NUM" type="labelenum" label="2051" default="1" values="1|5|4|3|2" visible="eq(-8,true)" />
<setting id="DEVICE5_IP" type="ipaddress" label="2060" default="" visible="eq(-9,true)" />
<setting id="DEVICE5_NUM" type="labelenum" label="2061" default="1" values="1|5|4|3|2" visible="eq(-10,true)" />
</category>
</settings>

View File

@ -23,22 +23,22 @@
. /etc/profile . /etc/profile
LOCKDIR="/var/lock/" LOCKDIR="/var/lock/"
LOCKFILE="sundtek" LOCKFILE="$LOCKDIR/sundtek-mediatv"
case "$1" in case "$1" in
hibernate|suspend) hibernate|suspend)
if [ -n "$(pidof mediasrv)" ]; then if [ -n "$(pidof mediasrv)" ]; then
progress "Shutting down Sundtek DVB driver for suspending..." progress "Shutting down Sundtek DVB driver for suspending..."
mkdir -p "$LOCKDIR" mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE" touch "$LOCKFILE"
mediaclient --shutdown mediaclient --shutdown
fi fi
;; ;;
thaw|resume) thaw|resume)
if [ -f "$LOCKDIR/$LOCKFILE" ]; then if [ -f "$LOCKFILE" ]; then
# driver started within Tvheadend/VDR # driver started within Tvheadend/VDR
rm -rf "$LOCKDIR/$LOCKFILE" rm -f "$LOCKFILE"
fi fi
;; ;;

View File

@ -1,7 +0,0 @@
<settings>
<setting id="AUTO_UPDATE" value="false" />
<setting id="ANALOG_TV" value="false" />
<setting id="NETWORK_TUNER_IP" value="0.0.0.0" />
<setting id="SETTLE_TIME" value="0" />
<setting id="RUN_USER_SCRIPT" value="false" />
</settings>

View File

@ -1,25 +0,0 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
SUNDTEK_READY="/var/run/sundtek.ready"
touch $SUNDTEK_READY

View File

@ -1,197 +0,0 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek"
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/driver.dvb.sundtek"
ADDON_SETTINGS="$ADDON_HOME/settings.xml"
SUNDTEK_READY="/var/run/sundtek.ready"
mkdir -p $ADDON_HOME
if [ ! -f "$ADDON_HOME/sundtek.conf" ]; then
cp $ADDON_DIR/config/* $ADDON_HOME/
fi
if [ ! -f "$ADDON_SETTINGS" ]; then
cp $ADDON_DIR/settings-default.xml $ADDON_SETTINGS
fi
mkdir -p /var/config
cat "$ADDON_SETTINGS" | awk -F\" '{print $2"=\""$4"\""}' | sed '/^=/d' > /var/config/sundtek-addon.conf
. /var/config/sundtek-addon.conf
if [ "$AUTO_UPDATE" = "true" -a -f $ADDON_DIR/bin/mediasrv ]; then
logger -t Sundtek "### Checking for new Sundtek binary installer ###"
touch $ADDON_HOME/driver-version.txt
wget -O /tmp/sundtek-driver-version.txt http://sundtek.de/media/latest.phtml
md5_1=$(md5sum -b /tmp/sundtek-driver-version.txt | awk '{print $1}')
md5_2=$(md5sum -b $ADDON_HOME/driver-version.txt | awk '{print $1}')
if [ "$md5_1" != "$md5_2" ]; then
logger -t Sundtek "### Updating Sundtek binary installer ###"
rm -f $ADDON_DIR/bin/mediasrv
fi
rm -f /tmp/sundtek-driver-version.txt
fi
if [ ! -f $ADDON_DIR/bin/mediasrv ]; then
logger -t Sundtek "### Downloading installer ###"
cd $ADDON_DIR
mkdir -p bin lib tmp
cd tmp/
ARCH=$(sed -n 's|.*\.\([^-]*\)-.*|\1|p' /etc/release | tr -d '\n')
if [ "$ARCH" = "x86_64" ]; then
INSTALLER_URL="http://sundtek.de/media/netinst/64bit/installer.tar.gz"
elif [ "$ARCH" = "i386" ]; then
INSTALLER_URL="http://sundtek.de/media/netinst/32bit/installer.tar.gz"
elif [ "$ARCH" = "arm" ]; then
INSTALLER_URL="http://sundtek.de/media/netinst/armsysvhf/installer.tar.gz"
else
logger -t Sundtek "### Unsupported architecture ###"
cd ..
rm -fr tmp/
exit 1
fi
# test only !!!
#INSTALLER_URL="http://sundtek.de/support/installer.tar.gz"
wget -O installer.tar.gz $INSTALLER_URL
wget -O ../driver-version.txt http://sundtek.de/media/latest.phtml
logger -t Sundtek "### Extracting installer ###"
tar -xzf installer.tar.gz
if [ $? -ne 0 ]; then
logger -t Sundtek "### Installer damaged ###"
cd ..
rm -fr tmp/
exit 2
fi
cp -Pa opt/bin/* ../bin/
cp -Pa opt/lib/* ../lib/
cp ../driver-version.txt $ADDON_HOME/
cd ..
rm -fr tmp/
logger -t Sundtek "### Installer finished ###"
fi
if [ ! -f $ADDON_HOME/driver-version.txt ]; then
cp $ADDON_DIR/driver-version.txt $ADDON_HOME/
fi
# enable to install same version again
rm -f /storage/.xbmc/addons/packages/driver.dvb.sundtek-*
# add alias for /opt/bin/mediaclient
#alias_set="$(grep /opt/bin/mediaclient /storage/.profile 2>/dev/null)"
alias_set="$(grep libmediaclient.so /storage/.profile 2>/dev/null)"
if [ -z "$alias_set" ]; then
echo "" >>/storage/.profile
#echo "alias /opt/bin/mediaclient=/storage/.xbmc/addons/driver.dvb.sundtek/bin/mediaclient" >>/storage/.profile
echo "[ -f /storage/.xbmc/addons/driver.dvb.sundtek/lib/libmediaclient.so ] && export LD_PRELOAD=/storage/.xbmc/addons/driver.dvb.sundtek/lib/libmediaclient.so" >>/storage/.profile
echo "" >>/storage/.profile
fi
export LD_PRELOAD=$ADDON_DIR/lib/libmediaclient.so
if [ "$ANALOG_TV" = "true" -a ! -f "$ADDON_DIR/bin/plugins/lib/libavcodec.so.54.12.100" ]; then
logger -t Sundtek "### Downloading missing ffmpeg libraries ###"
cd $ADDON_DIR/bin
mkdir -p plugins/
cd plugins/
ARCH=$(sed -n 's|.*\.\([^-]*\)-.*|\1|p' /etc/release | tr -d '\n')
wget -O sundtek-ffmpeg-analog_tv-lib.tgz http://dl.dropbox.com/u/8224157/public/sundtek/sundtek-ffmpeg-analog_tv-lib-$ARCH.tgz
logger -t Sundtek "### Extracting ffmpeg libraries ###"
tar -xzf sundtek-ffmpeg-analog_tv-lib.tgz
if [ $? -ne 0 ]; then
logger -t Sundtek "### Ffmpeg library archive damaged ###"
rm -f sundtek-ffmpeg-analog_tv-lib.tgz
exit 2
fi
rm -f sundtek-ffmpeg-analog_tv-lib.tgz
fi
if [ -z "$(pidof mediasrv)" ]; then
rm -f /var/log/mediasrv.log
rm -f /var/log/mediaclient.log
rm -f $SUNDTEK_READY
mediasrv --wait-for-devices -p $ADDON_DIR/bin -c $ADDON_HOME/sundtek.conf -d
if [ -n "$NETWORK_TUNER_IP" -a "$NETWORK_TUNER_IP" != "0.0.0.0" ]; then
logger -t Sundtek "### Trying to connect to Sundtek network device IP $NETWORK_TUNER_IP ###"
mediaclient --mount=$NETWORK_TUNER_IP
else
logger -t Sundtek "### Trying to attach Sundtek device ###"
fi
# wait for device to get attached or connected
for i in $(seq 1 240); do
if [ -n "$NETWORK_TUNER_IP" -a -e /dev/dvb/adapter*/frontend* ]; then
sh $ADDON_DIR/bin/device-attached.sh
fi
if [ -f $SUNDTEK_READY ]; then
rm -f $SUNDTEK_READY
logger -t Sundtek "### Sundtek ready ###"
if [ -n $SETTLE_TIME -a $SETTLE_TIME -gt 0 ]; then
logger -t Sundtek "### Settle for $SETTLE_TIME sec ###"
sleep $SETTLE_TIME
fi
break
elif [ "$i" = "240" ]; then
logger -t Sundtek "### No Sundtek device attached or connected ###"
return
else
usleep 500000
fi
done
if [ "$ANALOG_TV" = "true" ]; then
logger -t Sundtek "### Switching to analog TV mode ###"
#rm -fr /dev/dvb/
mediaclient --disable-dvb=/dev/dvb/adapter0
fi
if [ "$RUN_USER_SCRIPT" = "true" -a -f "$ADDON_HOME/userscript.sh" ]; then
logger -t Sundtek "### Running user script $ADDON_HOME/userscript.sh ###"
cat $ADDON_HOME/userscript.sh | dos2unix >/var/run/sundtek-userscript.sh
sh /var/run/sundtek-userscript.sh
fi
(
# save adapter serial number in background
sleep 5
serial_number_old=$(cat $ADDON_HOME/adapters.txt 2>/dev/null)
serial_number_new=$(mediaclient -e | awk '/device / {print $0} /ID:/ {print $2}')
if [ "$serial_number_old" != "$serial_number_new" ]; then
echo "$serial_number_new" >$ADDON_HOME/adapters.txt
fi
)&
fi

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="1000">General</string>
<string id="1011">Auto update binary driver</string>
<string id="1012">Analog TV</string>
<string id="1013">Network tuner IP</string>
<string id="1014">Extra settle time</string>
<string id="1015">Run user script</string>
</strings>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="1000">
<setting label="1010" type="lsep" />
<setting type="sep" />
<setting id="AUTO_UPDATE" type="bool" label="1011" default="false" />
<setting id="ANALOG_TV" type="bool" label="1012" default="false" enable="false" />
<setting id="NETWORK_TUNER_IP" type="ipaddress" label="1013" default="0.0.0.0" />
<setting id="SETTLE_TIME" type="number" label="1014" default="0" />
<setting id="RUN_USER_SCRIPT" type="bool" label="1015" default="false" />
</category>
</settings>

View File

@ -1,3 +1,6 @@
3.0.5
- update to TVHeadend 3.3.485
3.0.4 3.0.4
- update to TVHeadend 3.3.403 - update to TVHeadend 3.3.403

View File

@ -19,8 +19,8 @@
################################################################################ ################################################################################
PKG_NAME="tvheadend" PKG_NAME="tvheadend"
PKG_VERSION="3.3.403" PKG_VERSION="3.3.485"
PKG_REV="4" PKG_REV="5"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="http://www.lonelycoder.com/hts/tvheadend_overview.html" PKG_SITE="http://www.lonelycoder.com/hts/tvheadend_overview.html"