Path: blob/master/Documentation/DocBook/dvb/intro.xml
10823 views
<title>Introduction</title>12<section id="requisites">3<title>What you need to know</title>45<para>The reader of this document is required to have some knowledge in6the area of digital video broadcasting (DVB) and should be familiar with7part I of the MPEG2 specification ISO/IEC 13818 (aka ITU-T H.222), i.e8you should know what a program/transport stream (PS/TS) is and what is9meant by a packetized elementary stream (PES) or an I-frame.</para>1011<para>Various DVB standards documents are available from12<ulink url="http://www.dvb.org" /> and/or13<ulink url="http://www.etsi.org" />.</para>1415<para>It is also necessary to know how to access unix/linux devices and16how to use ioctl calls. This also includes the knowledge of C or C++.17</para>18</section>1920<section id="history">21<title>History</title>2223<para>The first API for DVB cards we used at Convergence in late 199924was an extension of the Video4Linux API which was primarily developed25for frame grabber cards. As such it was not really well suited to be26used for DVB cards and their new features like recording MPEG streams27and filtering several section and PES data streams at the same time.28</para>2930<para>In early 2000, we were approached by Nokia with a proposal for a31new standard Linux DVB API. As a commitment to the development of32terminals based on open standards, Nokia and Convergence made it33available to all Linux developers and published it on34<ulink url="http://www.linuxtv.org/" /> in September 2000.35Convergence is the maintainer of the Linux DVB API. Together with the36LinuxTV community (i.e. you, the reader of this document), the Linux DVB37API will be constantly reviewed and improved. With the Linux driver for38the Siemens/Hauppauge DVB PCI card Convergence provides a first39implementation of the Linux DVB API.</para>40</section>4142<section id="overview">43<title>Overview</title>4445<figure id="stb_components">46<title>Components of a DVB card/STB</title>47<mediaobject>48<imageobject>49<imagedata fileref="dvbstb.pdf" format="PS" />50</imageobject>51<imageobject>52<imagedata fileref="dvbstb.png" format="PNG" />53</imageobject>54</mediaobject>55</figure>5657<para>A DVB PCI card or DVB set-top-box (STB) usually consists of the58following main hardware components: </para>5960<itemizedlist>61<listitem>6263<para>Frontend consisting of tuner and DVB demodulator</para>6465<para>Here the raw signal reaches the DVB hardware from a satellite dish66or antenna or directly from cable. The frontend down-converts and67demodulates this signal into an MPEG transport stream (TS). In case of a68satellite frontend, this includes a facility for satellite equipment69control (SEC), which allows control of LNB polarization, multi feed70switches or dish rotors.</para>7172</listitem>73<listitem>7475<para>Conditional Access (CA) hardware like CI adapters and smartcard slots76</para>7778<para>The complete TS is passed through the CA hardware. Programs to79which the user has access (controlled by the smart card) are decoded in80real time and re-inserted into the TS.</para>8182</listitem>83<listitem>84<para>Demultiplexer which filters the incoming DVB stream</para>8586<para>The demultiplexer splits the TS into its components like audio and87video streams. Besides usually several of such audio and video streams88it also contains data streams with information about the programs89offered in this or other streams of the same provider.</para>9091</listitem>92<listitem>9394<para>MPEG2 audio and video decoder</para>9596<para>The main targets of the demultiplexer are the MPEG2 audio and97video decoders. After decoding they pass on the uncompressed audio and98video to the computer screen or (through a PAL/NTSC encoder) to a TV99set.</para>100101102</listitem>103</itemizedlist>104105<para><xref linkend="stb_components" /> shows a crude schematic of the control and data flow106between those components.</para>107108<para>On a DVB PCI card not all of these have to be present since some109functionality can be provided by the main CPU of the PC (e.g. MPEG110picture and sound decoding) or is not needed (e.g. for data-only uses111like “internet over satellite”). Also not every card or STB112provides conditional access hardware.</para>113114</section>115116<section id="dvb_devices">117<title>Linux DVB Devices</title>118119<para>The Linux DVB API lets you control these hardware components120through currently six Unix-style character devices for video, audio,121frontend, demux, CA and IP-over-DVB networking. The video and audio122devices control the MPEG2 decoder hardware, the frontend device the123tuner and the DVB demodulator. The demux device gives you control over124the PES and section filters of the hardware. If the hardware does not125support filtering these filters can be implemented in software. Finally,126the CA device controls all the conditional access capabilities of the127hardware. It can depend on the individual security requirements of the128platform, if and how many of the CA functions are made available to the129application through this device.</para>130131<para>All devices can be found in the <emphasis role="tt">/dev</emphasis>132tree under <emphasis role="tt">/dev/dvb</emphasis>. The individual devices133are called:</para>134135<itemizedlist>136<listitem>137138<para><emphasis role="tt">/dev/dvb/adapterN/audioM</emphasis>,</para>139</listitem>140<listitem>141<para><emphasis role="tt">/dev/dvb/adapterN/videoM</emphasis>,</para>142</listitem>143<listitem>144<para><emphasis role="tt">/dev/dvb/adapterN/frontendM</emphasis>,</para>145</listitem>146<listitem>147148<para><emphasis role="tt">/dev/dvb/adapterN/netM</emphasis>,</para>149</listitem>150<listitem>151152<para><emphasis role="tt">/dev/dvb/adapterN/demuxM</emphasis>,</para>153</listitem>154<listitem>155156<para><emphasis role="tt">/dev/dvb/adapterN/caM</emphasis>,</para></listitem></itemizedlist>157158<para>where N enumerates the DVB PCI cards in a system starting159from 0, and M enumerates the devices of each type within each160adapter, starting from 0, too. We will omit the “<emphasis161role="tt">/dev/dvb/adapterN/</emphasis>” in the further dicussion162of these devices. The naming scheme for the devices is the same wheter163devfs is used or not.</para>164165<para>More details about the data structures and function calls of all166the devices are described in the following chapters.</para>167168</section>169170<section id="include_files">171<title>API include files</title>172173<para>For each of the DVB devices a corresponding include file exists.174The DVB API include files should be included in application sources with175a partial path like:</para>176177178<programlisting>179#include <linux/dvb/frontend.h>180</programlisting>181182<para>To enable applications to support different API version, an183additional include file <emphasis184role="tt">linux/dvb/version.h</emphasis> exists, which defines the185constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document186describes <emphasis role="tt">DVB_API_VERSION 3</emphasis>.187</para>188189</section>190191192193