Linux DVB: An Introduction

Written September 2003 by Dr. Jürgen Pfennig © 2004-2005 (GNU Free Documentation License)

Intended Audience

Maybe you just want to watch TV with linux but your linux installer did not find or configure your TV card. And let us also assume that you are neither a hardware nor a Linux guru. In other words: you became confused by lots of nasty details!

In the following chapters we will not discuss mpegtools or any other software with the exception of MPlayerzapdvb integrates all the software you need to convert the Transport Stream (see below) read from the driver to MPEG2 output data. There is also a video conversion and edit program called zapcvt.

What you can read on this Page

The 1st section will give a rough overview about DVB and explain the major technical terms. Reading this will help you to understand what the gurus are talking about.

The 2nd important thing is hardware. Here you will learn a little bit about TV cards in general and how they function. Maybe we have to divert you to another Linux project here, if your hardware doesn't match the requirements.

When you arrive at the 3rd section you most likely have a suitable DVB card and want some software for it (again you risk being diverted to another project). This can be Linux DVR if you spent enough money for the card. But maybe you were a bit costive and still want to watch DVB TV - this is were we are going to help you!

DVB Basics and Terminology

DVB stands for "Digital Video Broadcast" and it comes in three flavours:

DVB-S  distributed via satellites, this is the most common version
DVB-Cdistributed via a cable-tv connection (usually some sort of pay-tv)
DVB-Tterrestrial broadcast (in Germany this has started replacing the classic analog TV)

All three standards have two things in common: (1) instead of traditional PAL/SECAM or NTSC the signal is encoded as MPEG2, e.g. it is digital and (2) approximately eight multiplexed DVB channels fit into the place (or bandwidth) taken by a single analog channel. On the other hand the three standards a quite different as far as encoding and error correction are concerned. The different transport media (microwave, cable and radio) cause different distortions like noise, echoes or multiple reception paths that must be corrected in an appropriate way.

A satellite can serve multiple analog channels at a time (about 20) - each channel has its own receiver (for upstream data) connected to a transmitter (to send data back to earth). These sets of hardware are called the transponders of a satellite. The hardware makes no difference between analog or digital TV (but the transponder bandwidth was originally chosen to fit one analog channel).

So in DVB case the transponder multiplexes multiple digital channels, just to fill the available bandwidth. Technically this happens by chopping the digital inputs into small pieces, prefixing them with some control information so that they can be reassembled and feeding the mixed pieces to the transponder. This signal is called a Transport Stream (TS).

If your DVB card is tuned to a digital channel it receives such a TS. The TS consists of packages of 188 bytes length. The Audio and Video Data are encoded in the form of Packetized Elementary Streams (PES) and the PES packets themselves get packed into the TS. Many different PES can be transported in a single TS (depending on bandwidth) and to each PES a 13Bit PID value is assigned so that the TS can be filtered for the PES packets belonging to a given stream.

The Linux DVB driver can filter multiple PES streams from the input TS data and deliver them to a user space program that extracts the audio or video data. In our case (a single simple DVB card) this involves three Linux devices:

  • /dev/dvb/adapter0/frontend0 (this controls the tuner of the card and the data flow inside the driver)
  • /dev/dvb/adapter0/demux0 (from where the filter part of the driver reads the TS data)
  • /dev/dvb/adapter0/dvr0 (a destination to which the driver sends the sub-stream for which a filter was set up)

Simple cards have no further hardware - some (user space) program reads from /dev/dvb/adapter0/dvr0 and does all the decoding in software. MPlayer is a good example for such work. The more expensive cards contain an internal MPEG decoder (SAA7110) and can do all the work internally. You can even connect a TV set for viewing. We take a closer look to that in the next two sections.

Types of TV cards

Traditional TV cards were analog and contained a tuner plus a so called frame buffer chip. The chips decoded the TV signal (PAL, NTSC ...), digitised it and stored the result in a buffer (as a rectangular array of pixels). The software for such a frame-grabber card just reads the buffer content, scales it to the required resolution and displays the data on the computer screen. The sound signal was often handled by another analog chip, so that such a card needed a cable connection to the computer's sound card.

The v4l (video for Linux) software handles such cards. Typical chips are bttv and SAA7134. The (user space) TV application typically reads the frame buffer data from the /dev/video0 device. A problem with such cards is video recording - the data must be encoded as MPEG2 to deliver an acceptable quality at a given data rate.

DVB cards contain at least a tuner and the logic to handle the TS stream (the SAA7146 chip). In our case (a single simple DVB card) the data flow touches at least the three Linux devices introduced in the previous section (/dev/dvb/adapter0/ with frontend0demux0 and dvr0).

There is no connection to the sound card because the audio data is already digital and is contained in the PES that a user space application can read from dvr0. Video recording is made easy as the video and audio data come as a Packetized MPEG2 stream (the PES) almost ready to be written to disk.

A simple DVB card has no further hardware - the decoding of the Transport Stream (TS) and the filtering for a given TV Program ID (PID) are done by a Linux Kernel driver. Some (user space) software reads from /dev/dvr/adapter0/dvr0 and feeds this Packetized Elementary Stream (PES - an MPEG container format) into a viewer like MPlayer. The software MPEG decoding (with Deinterlacing turned on) needs a 1 Hz Pentium III or something better.

Special types of DVB cards

Until now we have discussed simple DVB cards. The more expensive cards contain an internal MPEG decoder (SAA7110) and most likely a video output to connect a TV set. Such cards can be programmed to do all the work internally so that a connected TV set can be used for viewing. The SAA7110 also works as a frame buffer chip. Classical DVB drivers did rely on the presence of a SAA7110 chip to feed the /dev/video0 device (or on /dev/adapter0/videowhich is just an alias). This was nice for expensive cards (like the famous Siemens DVB card) but caused problems with simple cards like the KNC-S.

The more expensive cards can even display On-Screen data over the /dev/adapter0/osd device. The Linux DVR project extensively uses these features. As an advantage you can play back videos over a connected TV set having nice On-Screen-Display menus without demanding too much CPU power.

A Side Remark concerning current PC Hardware

The autumn 2003 the producers of home entertainment equipment showed lots of products that are more or less PC based and provide digital TV recording. The PC manufacturers are aware of this trend and offer little bare-bones that provide TV output with reasonable quality. Just an example: an Asus Pundit with a 2.4 GHz Celeron, 256 MByte, DVD drive, Hard-disk and a DVB card costs less than 550 Euro (including all taxes). The quality of the TV image comes very close to what you get out of an analog Sat-receiver. You can even do simple work with KDE (GTK works too). In other words: DVB cards containing their own, separate TV output and an MPEG hardware decoder have become obsolete.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值