Linux pages by ndrix
>Andrix Home <
 
Linux projects

Drivers
Applications
Downloads
Links

dvbd

Revision History
Documentation
Known Bugs
Download

 

DVB daemon
Documentation

  • dvbd2 (dvbd.c v0.03, v0.03c, v0.03s2)
  • dvbd3 (dvbd.c v0.03.2, v0.03.2a, v0.03.2b, v0.03.3)

dvbd2 is a daemon used for tuning the DVB card to a transponder and install the necessary filters to be able to receive IP data embedded in MPEG2 streams used by one-way satellite internet access services such as Europe Online, OpenSKY, etc.

REQUIREMENTS :

  • a DVB card
  • the Siemens DVB drivers version 0.7 until 0.8.2 installed and working
  • the device /dev/video must exist.
    • if it does not exist, create it with /dev/MAKEDEV video
    • ln -s /dev/video0 /dev/video
    • or with :
    • mknod /dev/video0 c 80 0
    • mknod /dev/video1 c 81 0
    • ln -s /dev/video0 /dev/video
  • make sure the reverse path filter (rp_filter) is OFF in your linux kernel, otherwise you won't receive anything. Remember this kind of satellite link is asymetrical with data going out on a path (your modem most likely) and returning on another path (your sat dish and DVB card). Do this by :
    • echo 0 > /proc/sys/net/ipv4/conf/dvb0/rp_filter
  • dvbd NEEDS ROOT PRIVILEGES to run (it set network interfaces up/down, changes MAC address, etc)
  • expects configuration file /etc/dvbd.conf
  • dvbd in dvbds package expects /etc/dvbds.conf

RUNNING dvbd :

dvbd will :

  • set the tuner to the transponder selected by command line parameters or config file.
  • set IP and/or MAC filters for Sat-IP services
  • listen on UDP port 1060 for filter configuration requests by a patched version of mrouted for use with EON's FAZZT service which uses multicast transmission. Filters are set on the fly as needed. The patched version of mrouted is in package dvbrouter
  • unless given the -q flag, dvbd will remain in foreground and will periodically display statistics information like frequency tuned to, signal strength, bit error rate (vber), noise level, etc. Usefull for checking how it works. You can stop it with Ctrl-C.
  • DO NOT start and stop dvbd multiple times without reloading the drivers!!! If you do, you will receive duplicate packets (one packet received multiplied with how many times you started dvbd).
  • unless you are using FAZZT services on EON, or plan to watch their video feeds, and you also run mrouted, you can start dvbd -q, wait a few seconds to allow it to tune and then you can safely kill it, the settings running on the card won't be lost.
  • you CAN'T use a Sat-IP service and watch Sat Digital TV both at once with a single DVB card.

TESTING and DEBUGGING :

  • in dvbd2 the interface that is connected to the internet is hardcoded in dvbd.h as :
    • #define network_device "eth0"
    • change this to whatever is appropriate for you (usually ppp0)
    • dvbd.h in dvbds package does not need this parameter.
  • When you run dvbd whithout -q flag, it will fork into a daemon, but remain on the console and display statistics
  • Statistics will display the following parameters :
    Fsync Not sure what this is. PLEASE FILL
    Freq

    Frequency set on the tuner. WARNING, this is not the same as you specified in dvbd.conf, but the tuning frequency after the LNB has made a down-convertion.
    Freq = transponder_freq - LOF
    where LOF = 9.75GHz or 10.6GHz depending on which part of the Ku band you are using.
    WARNING!!! original dvbd can only use the high Ku band (transponder frequency above 11.8GHz). See revision history on which versions can use correctly the entire Ku band, or a patch for your version

    Sync

    Indicates lock on transponder. Possible values: 0, 31, 63, 95, 127.
    127 - signal level is good, you should always have Sync=127.
    95 - signal level is low, packet loss will occur, Sat-IP service will still work most of the time. Streaming applications like FAZZT won't work reliably.
    63 - signal level is too low, packet loss will be high, Sat-IP service may work with reduced speed, or not work at all. Streaming services won't work (packet loss too high).
    31 - some signal level exists, but is totally inadequate for data reception
    0 - no signal
    dvbd running as daemon will log every 5 minutes Sync level to SYSLOG.
    You should always have Sync=127

    Afc Tuner's Automatic Frequency Control. PLEASE FILL
    Agc Tuner's Automatic Gain Control.
    The lower the signal, the higher the value. When signal is too low, AGC will be high and too much noise will also be amplified, to no avail.
    Nest Noise level Estimation. PLEASE FILL
    Vber

    Bit Error Rate discovered by error detection codes.
    Vber should be 0
    When Sync=95 or Sync=63, and Vber < 5000 Sat-IP will mostly work with some 20% packet loss.
    When Sync=127 and Vber < 5000 Sat-IP will work with some 10-15% packet loss. Streaming services won't be 10% reliable (Very large files downloaded via FAZZT may fail CRC).

  • If things don't work, look into SYSLOG and run dvbd without daemon mode.
  • If you see the message "invalid ioctl VIDIOCSFRONTEND" in SYSLOG :
    • (assuming drivers work otherwise and are loaded)
    • check that /dev/video exists
    • if you are using dvbd from dvbrouter package, try to get dvbd2 package and try again. Personally, I was never able to use dvbd from dvbrouter pkg.
  • If Sync=0 :
    • Check cables, dish alignment (try to receive a Digital TV on the same satellite), parameters in dvbd.conf
  • If Sync<127 (inadeqate, low, or too low/unsuable) :
    • Is your dish adequately sized for the signal level from that satellite and transponder on your geographical location ? See http://www.lyngsat.com for more information and coverage maps.
    • Is there anything obstructing your dish's view of the satellite ?(building, trees)
    • Is your dish correctly aligned ? Try minute adjustments to the dish positioning.
    • Is your cable good quality (low attenuation) and not too long ? (recommended less then 20m)
  • FAZZT services from EON only work with the patched mrouted running (from dvbrouter package)
  • pinging the Sat-IP ISP server returns duplicate packets
    • you stopped and restarted dvbd without reloading the drivers. Unload the drivers and start over
  • ping response times very large (response time should be <= aprox 350ms)
    • your local ISP (used to send requests) is slow, has only a satellite uplink thet adds a lot to response time or the route to your Sat-IP ISP is way too long.
    • change your local ISP
  • More and performance issues you can find in the Sat-HOWTO
  • Comments and suggestions are welcome.

SECURITY CONSIDERATIONS :

While running, dvbd will open UDP port 1060 which will be used by the modified mrouted to dynamically set and release filters required for multicast routing, multicast group join/part.

  • NO SECURITY options exist for granting/denying access to clients to this port.
  • As dvbd must be run as root, this might be a potential SECURITY RISC as yet unknown bugs in dvbd might give an attacker a remote root shell.
  • Use ipchains/iptables to restrict access to UDP port 1060.

COMMAND LINE OPTIONS :

-a 1 or 0 AFC on=1/off=0
-t 1 or 0 22 kHz signal on=1/off=0
Unless dvbd2 is patched, this should always be on
-v 1 or 0 polarisation H=1/V=0
-d 1 or 0 diseqc on=1/off=0
-p 1 or 0 LNB power on=1/off=0
-s

integer
> 1500000
< 46000000

Symbol Rate
-f integer
> 10600000
< 14500000
Transponder frequency (Ku band)
Unless dvbd2 is patched, frequencies < 11800000 are not usable.
Usually, transponders go up to 12750000
-q   Detach from console and become a daemon
-w   Watchdog Timer support
-c path/to/file Use custom configuration file instead of default /etc/dvbd.conf

SAMPLE CONFIGURATION FILE

Copy the sample config file below and paste it into /etc/dvbd.conf


# DVB receiver configuration file, (c) 2000 data planet international
#
# standard location is /etc/dvbd.conf
#
# LNB power on=1/off=0
#
power 1
#
# symbol rate [symbol/sec]
#
# ASTRA 1E/1F
#
# symbolrate 27500000
#
# ASTRA 1G/1H
#
symbolrate 22000000
#
# frequency [kHz]
#
# ASTRA TR 103
#
# frequency 12461000
#
# ASTRA TR 115
#
frequency 12662750
#
# ASTRA TR 114
#
# frequency 12640000
#
# ASTRA TR 113
#
# frequency 12632250
#
# 22 kHz signal on=1/off=0
#
ttk 1
#
# diseqc on=1/off=0
#
diseqc 0
#
# AFC on=1/off=0
#
AFC 1
#
# polarisation H=1/V=0
#
polarisation 1
#
# settings for MPE filter, PID and MAC filtering, valid MAC bytes(?)
# filter_name PID [MAC addr] [valid MAC bits]
# Only 10 filters can be configured.
#
filter_0 512
#
# filter_1 785
#
# filter_2 786 01:00:5E:01:0A:01 31
#
# filter_3 xxx
#
# filter_4 xxx
#
# filter_5 xxx
#
# filter_6 xxx
#
# filter_7 xxx
#
# filter_8 xxx
#
# filter_9 xxx
#

dvbd3 is a revised version of dvbd2 with some additional features added.

Most of what has been said about dvbd above is still valid for dvbd3.
However, command line options and configuration file have changed.
These are described settings below are valid for dvbd3a version 0.03.2a,b by Rolf Siebrecht as it is the implementation that has the most features to date.
dvbd3a runs only on the patched 0.8.2 driver. See notes on the new dvbd3a

COMMAND LINE OPTIONS :

Command line options are handled by the GNU getopt_long() function. That means, you may write a cmdline option as :
-d1
or
-d 1
or
--ducktales=1

-a
--afc
1 or 0 AFC on=1/off=0
-b
--dvb_ifname
ifname Name of DVB device to use (network interface created for DVB device).
default = dvb0
-c
--config
path/to/file Use custom configuration file.
Default = /etc/dvbd.conf
-d
--diseqc
1 or 0 diseqc on=1/off=0

-i
--net_ifname

ifname Set network iface name resp. IP address for filter_0 (unicast)
Example = ppp0
-f
--frequency
integer
10700..12750
[MHz]
for DVB-S
110000..870000 [kHz]
for DVB-C, DVB-T)

Transponder frequency (Ku band) for DVB-S, cable or terrestrial transmitter frequency for
DVB-T, DVB-C
For older variants of dvbd3, see notes
-h
--help
  Show help overview
-o
--power
1 or 0 LNB power on=1/off=0
-q   Detach from console and become a daemon
(don't output status messages )
-s
--symbolrate

integer
> 1500000
< 46000000

Symbol Rate
-p
--polarization
1 or 0 Select transponder polarization H=1/V=0
-w
--watchdog
  Use /dev/watchdog as time schedule
-e
--fec
0, 1, 2, 3, 4, 5, 6, 7 or 8 FEC (forward error correction) code.
0=1/2, 1=2/3, 2=3/4, 3=4/5, 4=5/6, 5=6/7, 6=7/8, 7=8/9, 8=auto
Default: 4 (=5/6)
-m
--simple
  Just execute frontend and filter settings - and exit
-n
--do_nothing
  Don't execute any control action, but just display all settings that would be effective if started really and exit
-v
--v4l_ifname
/path/to/dev select V4L device (/dev/video0, /dev/video1, ...)

Specifying following pairs of cmdline options at the same time is
obviously nonsense:
--quiet plus --simple
--quiet plus --do_nothing
--simple plus --do_nothing

Notes on dvbd3 (original) command line options :

  • GNU style options do not exist
  • new option was old option's equivalent
  • -i options was -e
  • -o options was -p
  • -p options was -v
  • -e, -m, -n, -v options are new in dvbd3a and have no equivalent
  • -t options exists only in original dvbd3 and is defined as for dvbd2

SECURITY CONSIDERATIONS :

While running, dvbd will open UDP port 1060 which will be used by the modified mrouted to dynamically set and release filters required for multicast routing, multicast group join/part.

  • NO SECURITY options exist for granting/denying access to clients to this port.
  • As dvbd must be run as root, this might be a potential SECURITY RISC as yet unknown bugs in dvbd might give an attacker a remote root shell.
  • Use ipchains/iptables to restrict access to UDP port 1060.

SAMPLE CONFIGURATION FILE

Copy the sample config file below and paste it into /etc/dvbd.conf


# DVB receiver configuration file, (c) 2000 data planet international
# Please see README + README.1st for further informations.
# This file is looked up in /etc # (unless you invoke dvbd with -c flag).
#
# Uncomment those lines where you need other settings than the # default.
# The default settings are realized by the main program itself and # are chosen for Astra 1G (19.2E) transponder 115 "EON,
# Internet-via-the-Sky".
# The alternative settings shown here are suited for Eutelsat W3 (7E)
# transponder C3 "Open Sky".
#
#
# name of existing dvb net interface to use
# (default: dvb0)
#
#dvb_ifname dvb0
#
#
# name of Video4Linux device assigned to DVB driver
# (default: /dev/video)
#
#v4l_ifname /dev/video
#
#
# power to LNB. on=1/off=0
# (default: on)
#
#power 1
#
#
# symbol rate [symbols/sec]
# (default: 22000000)
#
#symbolrate 27500000
#
#
# frequency [MHz] (DVB-S) resp. [kHz] (DVB-C, DVB-T)
# (default: 12663)
#
#frequency 11262
#
#
# FEC (forward error correction) code.
# 0=1/2, 1=2/3, 2=3/4, 3=4/5, 4=5/6, 5=6/7, 6=7/8, 7=8/9, 8=auto
# (default: 4 (=5/6))
#
#fec 1
#
#
# DiSEqC control. on=1/off=0
# (default: off)
#
#diseqc 0
#
#
# AFC. on=1/off=0
# (default: on)
#
#afc 1
#
#
# transponder polarization. H=1/V=0
# (default: H)
#
#polarization 1
#
#
# filter_0 is intended as unicast IP filter. Its first argument is
# PID (for example EON uses 512 to carry unicast traffic). The # second argument here is either the IP address (or IP network with # /bitmask in CIDR notation), that will be set as pass-through # filter for the packets that are only to be received, or a name # of existing network interface - in such case, the corresponding # filter value will be calculated from the IP of that interface # (useful for use with Europe OnLine, for example). The second # argument can be also completely omitted - in this case, the # filter will correspond to the real MAC address of your DVB # card => only packets with this MAC address will be received.
# BUT PLEASE, NEVER EVER SET THIS TO ANY IP ADDRESS OR IP-NET, # UNLESS YOU KNOW PERFECTLY WHAT YOU ARE DOING. THE NAME OF THE # NETWORK INTERFACE OR COMPLETELY OMITTING THE SECOND FIELD IS # THE SAFE BET.
#
# syntax: filter_0 <PID> [<netdevice | IP[/bitmask]>]
#
filter_0 512 eth0
#
# other MPE filters (these are intended to filter multicast # traffic).
#
# syntax: filter_x <PID> <MAC> [valid_MAC_bytes]
#
#filter_1 785
#
#filter_2 786 01:00:5E:01:0A:01 31
#
#filter_3 xxx
#
#filter_4 xxx
#
#filter_5 xxx
#
#filter_6 xxx
#
#filter_7 xxx
#
#filter_8 xxx
#
#filter_9 xxx
#

Notes on dvbd3 (original) configuration file options :

  • new option was old option's equivalent
  • afc options was AFC (case senzitive)
  • polarization options was polarisation
  • ttk option is only in original dvbd3, same as for dvbd2
  • fec, v4l_ifname are only in dvbd3a

Notes on dvbd3a features :

  • dvbd3a runs only on the patched 0.8.2 driver.
  • Create an entry
    alias dvb0 dvb
    in your /etc/modules.conf. This way the driver gets automatically loaded when you start dvbd - if it shouldn't be already loaded at that time. Provided you configured the driver for automatic loading by modprobe etc.
  • General rule is:
    --> There are default values for all settings,
    --> which may be overridden by config file options,
    --> which may be overridden by command line options.
    I.e., command line options have most priority.
  • The -t command line option resp. the ttk config file option were
    removed because the 22 kHz signal generation is now controlled dependent
    on the transponder frequency. If the frequency value is above 11700000 kHz
    (Hi Ku-band) the 22 kHz signal is turned on; else (Lo Ku-band) it is turned
    off. I.e., the 22 kHz signal is expected to have the fixed purpose of a
    band-switch; it can't be selected arbitrarily any more. (As a side effect
    the actual frequency of the card's tuner is computed by consideration of a
    LNB LOF of 10600000 kHz for Hi-band - and 9750000 kHz for Lo-band.)
  • Older versions used for DVB-S setup frequency units in kHz. Latest dvbd3a changed to frequency units in MHz.
    • Older versions: frequency 11262000
    • Latest version: frequency 11262
    • If not sure, check the README file.

For additional information check the README file and the source.


© Andrei Boros 2000 - 2002
E-mail :  andrix@fx.ro