2 ###############################################################################
4 ###############################################################################
5 # Copyright (C) 2010 VideoLAN
8 # Authors: Christophe Massiot <massiot@via.ecp.fr>
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 ###############################################################################
25 CONF_BASE
="/usr/local/share/dvblast/dvbiscovery-"
32 echo "Usage: $0 [-a <adapter #>] [-S <diseqc sat num>] [-c <conf file>]" >&2
40 TEMP
=`getopt -o a:S:c: -n "$0" -- "$@"`
42 if test $?
-ne 0; then
72 type=`$DVBLAST $diseqc $adapter -f 0 2>&1 | grep '^debug: Frontend' | sed 's/^debug: Frontend ".*" type "\(.*\)" supports:$/\1/'`
78 conf_file
="${CONF_BASE}_dvb-s.conf"
82 conf_file
="${CONF_BASE}_dvb-c.conf"
86 conf_file
="${CONF_BASE}_dvb-t.conf"
90 conf_file
="${CONF_BASE}_atsc.conf"
94 echo "unknown frontend type $type" >&2
98 if test -n "$conf_file_passed"; then
99 conf_file
=$conf_file_passed
102 if ! test -r "$conf_file"; then
103 echo "unable to open $conf_file" >&2
108 if test $childpid -ne 0; then
117 $DVBLAST $diseqc $adapter -O $LOCK_TIMEOUT -Q $QUIT_TIMEOUT $opts 2>|
$tmp_file &
120 if test $?
-eq 0; then
132 "NONE") opts
="$opts $2 0" ;;
133 "1/2") opts
="$opts $2 12" ;;
134 "2/3") opts
="$opts $2 23" ;;
135 "3/4") opts
="$opts $2 34" ;;
136 "4/5") opts
="$opts $2 45" ;;
137 "5/6") opts
="$opts $2 56" ;;
138 "6/7") opts
="$opts $2 67" ;;
139 "7/8") opts
="$opts $2 78" ;;
140 "8/9") opts
="$opts $2 89" ;;
147 "QPSK") opts
="$opts -m qpsk" ;;
148 "QAM16") opts
="$opts -m qam_16" ;;
149 "QAM32") opts
="$opts -m qam_32" ;;
150 "QAM64") opts
="$opts -m qam_64" ;;
151 "QAM128") opts
="$opts -m qam_128" ;;
152 "8VSB") opts
="$opts -m vsb_8" ;;
153 "16VSB") opts
="$opts -m vsb_16" ;;
160 trap signal_catch
1 2 3 15
162 while read sys freq pol srate fec what mod
; do
163 opts
="-f $freq -s $srate"
169 "QPSK") opts
="$opts -m qpsk" ;;
170 "8PSK") opts
="$opts -m psk_8" ;;
172 echo "invalid modulation $mod" >&2
177 echo "incompatible file" >&2
185 "V") opts
="$opts -v 13" ;;
186 "H") opts
="$opts -v 18" ;;
196 trap signal_catch
1 2 3 15
198 while read sys freq srate fec mod
; do
199 opts
="-f $freq -s $srate"
204 echo "incompatible file" >&2
218 trap signal_catch
1 2 3 15
220 while read sys freq bw fec fec2 mod mode guard hier
; do
226 echo "incompatible file" >&2
232 "8MHz") opts
="$opts -b 8" ;;
233 "7MHz") opts
="$opts -b 7" ;;
234 "6MHz") opts
="$opts -b 6" ;;
243 "2k") opts
="$opts -X 2" ;;
244 "8k") opts
="$opts -X 8" ;;
249 "1/32") opts
="$opts -G 32" ;;
250 "1/16") opts
="$opts -G 16" ;;
251 "1/8") opts
="$opts -G 8" ;;
252 "1/4") opts
="$opts -G 4" ;;
257 "NONE") opts
="$opts -H 0" ;;
258 "1") opts
="$opts -H 1" ;;
259 "2") opts
="$opts -H 2" ;;
260 "4") opts
="$opts -H 4" ;;
270 trap signal_catch
1 2 3 15
272 while read sys freq mod
; do
278 echo "incompatible file" >&2
290 trap signal_catch
1 2 3 15
292 grep -v "^#" < "$conf_file" 2>/dev
/null |
$tune &