|
Contents [hide]
|
Why DVB-T?
DVB-T, for Digital Video Broadcasting Television, is a major evolution in broadcast history, in the same way that colour TV in its days was a revolution.
Using radio waves for terrestrial broadcasting as well as digital technology, it gives maximum quality of image and sound without cost or membership registration of any kind : Dolby Digital 5.1 sound and high resolution images, equivalent to DVD image quality.
Supported devices
here is a list of the supported USB devices:
http://www.linuxtv.org/wiki/index.php/DVB-T_USB_Devices
Compiling the kernel with the correct DVB-T driver
Please follow these instructions to compile 2.6.30-rc5 fresh kernel. before building the kernel edit the configuration with the following command: <pre> make menuconfig ARCH=arm </pre>
Browse to Device Drivers->Multimedia Devices make sure the following are selected:
* DVB For Linux
* DVB/ATSC Adapters
Support for various USB DVB devices (Select your appropriate camera driver)
* Customize the frondend modules to build
Save the configuration and continue building the kernel.
Installing firmware files
In order to get latest firmware files for DVB-T devices, firmware files need to be installed: <pre> apt-get install linux-firmware </pre>
Checking your device
Now you can connect your dongle to the USB socket, typing dmesg will help you to monitor the kernel probe. if successfully you should be able to see adapter under /dev/dvbt. now we are ready to install some utilities.
Install Stuff
We use the Debian packages dvb-utils, mplayer, and vlc.
Scanning for channels
You need a channels.conf file, which tells various apps what frequencies and tuning parameters to use for all the different logical channels. This is generated thusly:
<pre> $ scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/au-sydney_north_shore | tee > channels.conf </pre>
or scan manually:
<pre> $ cat wollongong.scan
- T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 711625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE $ scan wollongong.scan | tee >> channels.conf
</pre>
Now put channels.conf in the right place for different apps:
<pre> $ mkdir -p ~/.tzap ~/.mplayer $ mv channels.conf ~/.tzap $ ln -s ~/.tzap/channels.conf ~/.mplayer/channels.conf.ter </pre>
Testing reception
<pre> $ mplayer "dvb://SBS HD" </pre>
you can also try:
<pre> $ mplayer /dev/dvb/adapter0/dvr0 </pre>
Streaming
dvbstream
The dvbstream package contains a simple app that can dump a stream to the network.
unicast
On the host you want to view the stream do something like:
<pre> nc -u -l -p <portnum> | mplayer -cache 8000 -vo xv - </pre>
And then on the TV box, we first used tzap to tune the channel in, and then ran dvbstream:
<pre> $ tzap "SBS HD" ^C to interrupt it once it acquires a signal (FE_HAS_LOCK) $ dvbstream -v 102 -a 103 -o | nc -u <target> <portnum> </pre>
more information about the zap utility: zap
multicast
dvbstream can multicast an RTP stream to your local network <pre> $ dvbstream -f <frequency> <pid_audio> <pid_video>
- example
$ dvbstream -f 602000000 101 102 </pre> Each dvb-t frequencies has multiple video and audio streams on different pids. You can find them from your channels.conf.
to receive the stream <pre> $ mplayer rtp://224.0.1.2:5004/ -cache 2048 </pre>
The rtp stream will flood your network. If you have wifi it can be easily be congested. It has advantages if you have multiple receivers in the network.
With VLC
vlc is an all-singing all-dancing media streamer, but in the end we don't use it to do much more than dvbstream does (the only real advantage it offers for multicast is generation of the SAP announcements). See the VLC streaming HOWTO for more detailed docs.
Here is a script to invoke vlc with all the right arguments, you will probably want to edit it to suit your setup:
<pre>
- !/bin/bash
- machines to stream to (unicast)
- each additional client multiplies the bandwidth required
- leave unset to use multicast
- clients="zarquon"
- channels.conf file to use
conf="$HOME/.tzap/channels.conf"
- work out frequency/program ID
- default to SBS, it has the soccer :)
[ $# == "0" ] && ch='SBS HD' || ch=$1 if grep -q ^"$ch" $conf; then
chan=$(grep -i ^"$ch" $conf | head -1 | cut -d: -f1)
freq=$(grep -i ^"$ch" $conf | head -1 | cut -d: -f2)
prog=$(grep -i ^"$ch" $conf | head -1 | cut -d: -f13)
echo "$chan, frequency $freq, program ID $prog"
else
echo "Unknown channel $ch" > /dev/stderr
exit 1
fi
- construct arguments to vlc
if [ ! -z "$clients" ]; then # unicast
dsts=""
for host in $clients; do
dsts="${dsts}dst=standard{access=udp,mux=ts,url=${host}},"
done
sout="#duplicate{${dsts}}"
else # multicast
dst="access=udp,mux=ts,url=239.255.42.42,sap,name=\"KEG TV: $chan\""
sout="#standard{$dst}"
fi
- run the damn thing!
exec vlc -I dummy --ttl 1 --program=$prog dvb: \ --dvb-frequency=$freq --dvb-bandwidth=7 --sout "$sout"
</pre>
Notes:
$prog is the program ID from channels.conf
a TTL of 1 prevents the stream from crossing any routers; increase this only if you need to
239.255.x.x is in the "private space" for multicast IPs, the .42.42 is arbitrary
To view this stream on a client, you could do:
<pre> $ vlc udp:@239.255.42.42 </pre>
Where to get help?
here are some good references:
