2 ###############################################################################
4 ###############################################################################
5 # Copyright (C) 2010 VideoLAN
7 # Authors: Christophe Massiot <massiot@via.ecp.fr>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 ###############################################################################
24 CONF_BASE
="/usr/local/share/dvblast/dvbiscovery"
31 echo "Usage: $0 [-a <adapter #>] [-n <frontend #>] [-S <diseqc sat num>] [-c <conf file>]" >&2
40 TEMP
=`getopt -o a:n:S:c: -n "$0" -- "$@"`
42 if test $?
-ne 0; then
76 type=`$DVBLAST $diseqc $adapter $frontend -f 0 2>&1 | grep '^debug: Frontend' | sed 's/^debug: Frontend ".*" type "\(.*\)" supports:$/\1/'`
82 conf_file
="${CONF_BASE}_dvb-s.conf"
86 conf_file
="${CONF_BASE}_dvb-c.conf"
90 conf_file
="${CONF_BASE}_dvb-t.conf"
94 conf_file
="${CONF_BASE}_atsc.conf"
98 echo "unknown frontend type $type" >&2
102 if test -n "$conf_file_passed"; then
103 conf_file
=$conf_file_passed
106 if ! test -r "$conf_file"; then
107 echo "unable to open $conf_file" >&2
112 if test $childpid -ne 0; then
122 $DVBLAST $diseqc $adapter $frontend -O $LOCK_TIMEOUT -Q $QUIT_TIMEOUT -q4 -x xml
$opts >|
$tmp_file &
125 if test $?
-eq 0; then
138 "NONE") opts
="$opts $2 0" ;;
139 "1/2") opts
="$opts $2 12" ;;
140 "2/3") opts
="$opts $2 23" ;;
141 "3/4") opts
="$opts $2 34" ;;
142 "4/5") opts
="$opts $2 45" ;;
143 "5/6") opts
="$opts $2 56" ;;
144 "6/7") opts
="$opts $2 67" ;;
145 "7/8") opts
="$opts $2 78" ;;
146 "8/9") opts
="$opts $2 89" ;;
153 "QPSK") opts
="$opts -m qpsk" ;;
154 "QAM16") opts
="$opts -m qam_16" ;;
155 "QAM32") opts
="$opts -m qam_32" ;;
156 "QAM64") opts
="$opts -m qam_64" ;;
157 "QAM128") opts
="$opts -m qam_128" ;;
158 "8VSB") opts
="$opts -m vsb_8" ;;
159 "16VSB") opts
="$opts -m vsb_16" ;;
166 trap signal_catch
1 2 3 15
168 while read sys freq pol srate fec what mod
; do
169 opts
="-f $freq -s $srate"
175 "QPSK") opts
="$opts -m qpsk" ;;
176 "8PSK") opts
="$opts -m psk_8" ;;
178 echo "invalid modulation $mod" >&2
183 echo "incompatible file" >&2
191 "V") opts
="$opts -v 13" ;;
192 "H") opts
="$opts -v 18" ;;
202 trap signal_catch
1 2 3 15
204 while read sys freq srate fec mod
; do
205 opts
="-f $freq -s $srate"
210 echo "incompatible file" >&2
224 trap signal_catch
1 2 3 15
226 while read sys freq bw fec fec2 mod mode guard hier
; do
232 echo "incompatible file" >&2
238 "8MHz") opts
="$opts -b 8" ;;
239 "7MHz") opts
="$opts -b 7" ;;
240 "6MHz") opts
="$opts -b 6" ;;
249 "2k") opts
="$opts -X 2" ;;
250 "8k") opts
="$opts -X 8" ;;
255 "1/32") opts
="$opts -G 32" ;;
256 "1/16") opts
="$opts -G 16" ;;
257 "1/8") opts
="$opts -G 8" ;;
258 "1/4") opts
="$opts -G 4" ;;
263 "NONE") opts
="$opts -H 0" ;;
264 "1") opts
="$opts -H 1" ;;
265 "2") opts
="$opts -H 2" ;;
266 "4") opts
="$opts -H 4" ;;
276 trap signal_catch
1 2 3 15
278 while read sys freq mod
; do
284 echo "incompatible file" >&2
296 trap signal_catch
1 2 3 15
298 grep -v "^#" < "$conf_file" 2>/dev
/null |
$tune &