intro.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _dvb_introdution:
  3. ************
  4. Introduction
  5. ************
  6. .. _requisites:
  7. What you need to know
  8. =====================
  9. The reader of this document is required to have some knowledge in the
  10. area of digital video broadcasting (DVB) and should be familiar with
  11. part I of the MPEG2 specification ISO/IEC 13818 (aka ITU-T H.222), i.e
  12. you should know what a program/transport stream (PS/TS) is and what is
  13. meant by a packetized elementary stream (PES) or an I-frame.
  14. Various DVB standards documents are available from http://www.dvb.org
  15. and/or http://www.etsi.org.
  16. It is also necessary to know how to access unix/linux devices and how to
  17. use ioctl calls. This also includes the knowledge of C or C++.
  18. .. _history:
  19. History
  20. =======
  21. The first API for DVB cards we used at Convergence in late 1999 was an
  22. extension of the Video4Linux API which was primarily developed for frame
  23. grabber cards. As such it was not really well suited to be used for DVB
  24. cards and their new features like recording MPEG streams and filtering
  25. several section and PES data streams at the same time.
  26. In early 2000, we were approached by Nokia with a proposal for a new
  27. standard Linux DVB API. As a commitment to the development of terminals
  28. based on open standards, Nokia and Convergence made it available to all
  29. Linux developers and published it on https://linuxtv.org in September
  30. 2000. Convergence is the maintainer of the Linux DVB API. Together with
  31. the LinuxTV community (i.e. you, the reader of this document), the Linux
  32. DVB API will be constantly reviewed and improved. With the Linux driver
  33. for the Siemens/Hauppauge DVB PCI card Convergence provides a first
  34. implementation of the Linux DVB API.
  35. .. _overview:
  36. Overview
  37. ========
  38. .. _stb_components:
  39. .. figure:: intro_files/dvbstb.*
  40. :alt: dvbstb.pdf / dvbstb.png
  41. :align: center
  42. Components of a DVB card/STB
  43. A DVB PCI card or DVB set-top-box (STB) usually consists of the
  44. following main hardware components:
  45. - Frontend consisting of tuner and DVB demodulator
  46. Here the raw signal reaches the DVB hardware from a satellite dish or
  47. antenna or directly from cable. The frontend down-converts and
  48. demodulates this signal into an MPEG transport stream (TS). In case
  49. of a satellite frontend, this includes a facility for satellite
  50. equipment control (SEC), which allows control of LNB polarization,
  51. multi feed switches or dish rotors.
  52. - Conditional Access (CA) hardware like CI adapters and smartcard slots
  53. The complete TS is passed through the CA hardware. Programs to which
  54. the user has access (controlled by the smart card) are decoded in
  55. real time and re-inserted into the TS.
  56. - Demultiplexer which filters the incoming DVB stream
  57. The demultiplexer splits the TS into its components like audio and
  58. video streams. Besides usually several of such audio and video
  59. streams it also contains data streams with information about the
  60. programs offered in this or other streams of the same provider.
  61. - MPEG2 audio and video decoder
  62. The main targets of the demultiplexer are the MPEG2 audio and video
  63. decoders. After decoding they pass on the uncompressed audio and
  64. video to the computer screen or (through a PAL/NTSC encoder) to a TV
  65. set.
  66. :ref:`stb_components` shows a crude schematic of the control and data
  67. flow between those components.
  68. On a DVB PCI card not all of these have to be present since some
  69. functionality can be provided by the main CPU of the PC (e.g. MPEG
  70. picture and sound decoding) or is not needed (e.g. for data-only uses
  71. like “internet over satellite”). Also not every card or STB provides
  72. conditional access hardware.
  73. .. _dvb_devices:
  74. Linux DVB Devices
  75. =================
  76. The Linux DVB API lets you control these hardware components through
  77. currently six Unix-style character devices for video, audio, frontend,
  78. demux, CA and IP-over-DVB networking. The video and audio devices
  79. control the MPEG2 decoder hardware, the frontend device the tuner and
  80. the DVB demodulator. The demux device gives you control over the PES and
  81. section filters of the hardware. If the hardware does not support
  82. filtering these filters can be implemented in software. Finally, the CA
  83. device controls all the conditional access capabilities of the hardware.
  84. It can depend on the individual security requirements of the platform,
  85. if and how many of the CA functions are made available to the
  86. application through this device.
  87. All devices can be found in the ``/dev`` tree under ``/dev/dvb``. The
  88. individual devices are called:
  89. - ``/dev/dvb/adapterN/audioM``,
  90. - ``/dev/dvb/adapterN/videoM``,
  91. - ``/dev/dvb/adapterN/frontendM``,
  92. - ``/dev/dvb/adapterN/netM``,
  93. - ``/dev/dvb/adapterN/demuxM``,
  94. - ``/dev/dvb/adapterN/dvrM``,
  95. - ``/dev/dvb/adapterN/caM``,
  96. where N enumerates the DVB PCI cards in a system starting from 0, and M
  97. enumerates the devices of each type within each adapter, starting
  98. from 0, too. We will omit the “ ``/dev/dvb/adapterN/``\ ” in the further
  99. discussion of these devices.
  100. More details about the data structures and function calls of all the
  101. devices are described in the following chapters.
  102. .. _include_files:
  103. API include files
  104. =================
  105. For each of the DVB devices a corresponding include file exists. The DVB
  106. API include files should be included in application sources with a
  107. partial path like:
  108. .. code-block:: c
  109. #include <linux/dvb/ca.h>
  110. #include <linux/dvb/dmx.h>
  111. #include <linux/dvb/frontend.h>
  112. #include <linux/dvb/net.h>
  113. To enable applications to support different API version, an additional
  114. include file ``linux/dvb/version.h`` exists, which defines the constant
  115. ``DVB_API_VERSION``. This document describes ``DVB_API_VERSION 5.10``.