Merge pull request #177 from vpeter4/dvb

xbmc-addon: start userspace DVB drivers before Tvheadend/VDR
This commit is contained in:
Stephan Raue 2012-02-21 17:15:40 -08:00
commit f5eabb1529
19 changed files with 201 additions and 28 deletions

View File

@ -1,2 +1,4 @@
2.0.1
- starting userspace DVB drivers from Tvheadend/VDR
2.0.0
- initial version of HDHomeRun driver

View File

@ -20,7 +20,7 @@
PKG_NAME="hdhomerun"
PKG_VERSION="2.0"
PKG_REV="0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.silicondust.com/products/hdhomerun/dvbt/"
@ -32,5 +32,5 @@ PKG_SECTION="driver/dvb"
PKG_SHORTDESC="A linux DVB driver for the HDHomeRun (http://www.silicondust.com)."
PKG_LONGDESC="A linux DVB driver for the HDHomeRun (http://www.silicondust.com)."
PKG_IS_ADDON="yes"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_TYPE="xbmc.python.script"
PKG_AUTORECONF="no"

View File

@ -0,0 +1,65 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2011 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, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.hdhomerun"
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/driver.dvb.hdhomerun"
mkdir -p $ADDON_HOME
if [ ! -f "$ADDON_HOME/dvbhdhomerun.sample" ]; then
cp $ADDON_DIR/config/* $ADDON_HOME/
fi
if [ -z "$(pidof userhdhomerun)" ]; then
rm -f /tmp/dvbhdhomerun
if [ -f $ADDON_HOME/dvbhdhomerun.conf ]; then
ln -s $ADDON_HOME/dvbhdhomerun.conf /tmp/dvbhdhomerun
fi
# if not already added
modprobe dvb_hdhomerun
modprobe dvb_hdhomerun_fe
mkdir -p /var/log/
rm -f /var/log/dvbhdhomerun.log
export LD_LIBRARY_PATH=$ADDON_DIR/lib:$LD_LIBRARY_PATH
userhdhomerun -f
# how much time should we wait?
usleep 1000000
if [ -f $ADDON_HOME/extra-wait.sh ]; then
sh $ADDON_HOME/extra-wait.sh
fi
# save adapter names in background
(
sleep 4
sn_old=$(cat $ADDON_HOME/adapters.txt 2>/dev/null)
sn_new=$(grep "Name of device: " /var/log/dvbhdhomerun.log)
if [ "$sn_old" != "$sn_new" ]; then
echo -n $sn_new >$ADDON_HOME/adapters.txt
fi
)&
fi

9
packages/addons/driver/hdhomerun/source/default.py Executable file → Normal file
View File

@ -21,12 +21,3 @@
import os
import sys
import xbmcaddon
__scriptname__ = "Driver for the HDHomeRun TV tuner"
__author__ = "OpenELEC"
__url__ = "http://www.openelec.tv"
__settings__ = xbmcaddon.Addon(id='driver.dvb.hdhomerun')
__cwd__ = __settings__.getAddonInfo('path')
__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "hdhomerun.service") )
os.system(__path__)

View File

@ -37,8 +37,7 @@ case "$1" in
thaw|resume)
if [ -f "$LOCKDIR/$LOCKFILE" ]; then
progress "Restarting HDHomeRun driver for wakeup..."
hdhomerun.service
# driver started within Tvheadend/VDR
rm -rf "$LOCKDIR/$LOCKFILE"
fi
;;

View File

@ -1,2 +1,4 @@
2.0.5
- starting userspace DVB drivers from Tvheadend/VDR
1.90.0
- initial version of Sundtek MediaTV DVB driver

View File

@ -2,8 +2,8 @@
# sundtek.conf
#
# Call attach/detach script when new device appears/disappears
device_attach=/storage/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv/device_attach_detach.sh attach DEVID
device_detach=/storage/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv/device_attach_detach.sh detach DEVID
# Do not change this line!
device_attach=/storage/.xbmc/addons/driver.dvb.sundtek-mediatv/bin/device-attached.sh
# Infrared Control Support is disabled/enabled
ir_disabled=1

6
packages/addons/driver/sundtek-mediatv/meta Executable file → Normal file
View File

@ -19,8 +19,8 @@
################################################################################
PKG_NAME="sundtek-mediatv"
PKG_VERSION="1.90"
PKG_REV="4"
PKG_VERSION="2.0"
PKG_REV="5"
PKG_ARCH="any"
PKG_LICENSE="nonfree"
PKG_SITE="http://support.sundtek.com/"
@ -32,5 +32,5 @@ PKG_SECTION="driver/dvb"
PKG_SHORTDESC="Sundtek USB Stick DVB userspace driver"
PKG_LONGDESC="Driver for Sundtek MediaTV Pro (DVB-C, DVB-T, AnalogTV, Composite, S-Video, FM-Radio USB Stick) and Sundtek SkyTV Ultimate (DVB-S/S2 USB)."
PKG_IS_ADDON="yes"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_TYPE="xbmc.python.script"
PKG_AUTORECONF="no"

View File

@ -0,0 +1,25 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2011 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, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
SUNDTEK_READY="/var/run/sundtek.ready"
touch $SUNDTEK_READY

View File

@ -0,0 +1,70 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2011 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, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
ADDON_DIR="$HOME/.xbmc/addons/driver.dvb.sundtek-mediatv"
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/driver.dvb.sundtek-mediatv"
SUNDTEK_READY="/var/run/sundtek.ready"
mkdir -p $ADDON_HOME
if [ ! -f "$ADDON_HOME/sundtek.conf" ]; then
cp $ADDON_DIR/config/* $ADDON_HOME/
fi
SUNDTEK_ARG="--pluginpath=$ADDON_DIR/bin --daemon"
if [ -z "$(pidof mediasrv)" ]; then
rm -f $SUNDTEK_READY
rm -f /tmp/sundtek.conf
ln -sf $ADDON_HOME/sundtek.conf /tmp/sundtek.conf
mediasrv $SUNDTEK_ARG
# wait for device to attach
cnt=0
while [ 1 ]; do
if [ -f $SUNDTEK_READY ]; then
rm -f $SUNDTEK_READY
break
else if [ "$cnt" = "120" ]; then
logger -t Tvheadend "### No Sundtek device attached in 60 sec ###"
return
fi
fi
let cnt=cnt+1
usleep 500000
done
export LD_LIBRARY_PATH=$ADDON_DIR/lib:$LD_LIBRARY_PATH
export LD_PRELOAD=$ADDON_DIR/lib/libmediaclient.so:$LD_PRELOAD
(
# save adapter serial number in background
sleep 4
serial_number_old=$(cat $ADDON_HOME/adapters.txt 2>/dev/null)
serial_number_new=$(mediaclient -e | awk '/ID:/ {print $2}')
if [ "$serial_number_old" != "$serial_number_new" ]; then
echo "$serial_number_new" >$ADDON_HOME/adapters.txt
fi
)&
fi

View File

@ -18,6 +18,6 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
import xbmc, time, os, subprocess
os.system("sundtek-mediatv.service")
import os
import sys
import xbmcaddon

View File

@ -37,8 +37,7 @@ case "$1" in
thaw|resume)
if [ -f "$LOCKDIR/$LOCKFILE" ]; then
progress "Restarting Sundtek MediaTV DVB driver for wakeup..."
sundtek-mediatv.service
# driver started within Tvheadend/VDR
rm -rf "$LOCKDIR/$LOCKFILE"
fi
;;

View File

@ -28,3 +28,4 @@ mkdir -p $ADDON_BUILD/$PKG_ADDON_ID
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
cp -P $PKG_BUILD/build.Linux/tvheadend $ADDON_BUILD/$PKG_ADDON_ID/bin
cp -P $BUILD/w_scan-[0-9]*/w_scan $ADDON_BUILD/$PKG_ADDON_ID/bin

View File

@ -1,3 +1,6 @@
2.0.5
- start userspace DVB drivers before Tvheadend
2.0.4
- update to hts-tvheadend-fdf89b2

View File

@ -20,7 +20,7 @@
PKG_NAME="hts-tvheadend"
PKG_VERSION="fdf89b2"
PKG_REV="4"
PKG_REV="5"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.lonelycoder.com/hts/tvheadend_overview.html"
@ -32,8 +32,6 @@ PKG_PRIORITY="optional"
PKG_SECTION="service/multimedia"
PKG_SHORTDESC="hts-tvheadend: a TV streaming server for Linux supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources."
PKG_LONGDESC="HTS-Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources. It also comes with a powerful and easy to use web interface both used for configuration and day-to-day operations, such as searching the EPG and scheduling recordings. Even so, the most notable feature of Tvheadend is how easy it is to set up: Install it, navigate to the web user interface, drill into the TV adapters tab, select your current location and Tvheadend will start scanning channels and present them to you in just a few minutes. If installing as an Addon a reboot is needed"
PKG_IS_ADDON="yes"
PKG_ADDON_TYPE="xbmc.service"
PKG_AUTORECONF="no"

View File

@ -47,5 +47,13 @@ TVHEADEND_ARG="-f -C -s -u root -g root -c $ADDON_HOME"
mkdir -p $ADDON_HOME
if [ ! $(pidof tvheadend) ];then
# start userspace DVB driver/addon
for driver_dvb in $(find /storage/.xbmc/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do
driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}')
logger -t Tvheadend "### Loading userspace DVB driver: $driver_dvb_name ###"
# use ". " because of variable export
. $driver_dvb
done
tvheadend $TVHEADEND_ARG &>$LOG_FILE
fi

View File

@ -1,3 +1,6 @@
2.0.4
- start userspace DVB drivers before VDR
2.0.3
- update to vdr-plugin-xvdr-0ac808a
- rebuild for libiconv changes

3
packages/addons/service/multimedia/vdr-addon/meta Normal file → Executable file
View File

@ -21,7 +21,7 @@
PKG_NAME="vdr-addon"
PKG_VERSION="2.0"
PKG_REV="3"
PKG_REV="4"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.openelec.tv"
@ -33,6 +33,5 @@ PKG_SECTION="service.multimedia"
PKG_SHORTDESC="vdr: A powerful DVB TV application"
PKG_LONGDESC="This project describes how to build your own digital satellite receiver and video disk recorder. It is based mainly on the DVB-S digital satellite receiver card, which used to be available from Fujitsu Siemens and the driver software developed by the LinuxTV project."
PKG_AUTORECONF="no"
PKG_IS_ADDON="yes"
PKG_ADDON_TYPE="xbmc.service"

View File

@ -58,5 +58,13 @@ fi
)
if [ ! $(pidof vdr.bin) ];then
# start userspace DVB driver/addon
for driver_dvb in $(find /storage/.xbmc/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do
driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}')
logger -t VDR "### Loading userspace DVB driver: $driver_dvb_name ###"
# use ". " because of variable export
. $driver_dvb
done
LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" vdr.bin $VDR_ARG &>$LOG_FILE
fi