intro.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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 (Digital TV) 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 Digital TV standards documents are available for download at:
  15. - European standards (DVB): http://www.dvb.org and/or http://www.etsi.org.
  16. - American standards (ATSC): https://www.atsc.org/standards/
  17. - Japanese standards (ISDB): http://www.dibeg.org/
  18. It is also necessary to know how to access Linux devices and how to
  19. use ioctl calls. This also includes the knowledge of C or C++.
  20. .. _history:
  21. History
  22. =======
  23. The first API for Digital TV cards we used at Convergence in late 1999 was an
  24. extension of the Video4Linux API which was primarily developed for frame
  25. grabber cards. As such it was not really well suited to be used for Digital
  26. TV cards and their new features like recording MPEG streams and filtering
  27. several section and PES data streams at the same time.
  28. In early 2000, Convergence was approached by Nokia with a proposal for a new
  29. standard Linux Digital TV API. As a commitment to the development of terminals
  30. based on open standards, Nokia and Convergence made it available to all
  31. Linux developers and published it on https://linuxtv.org in September
  32. 2000. With the Linux driver for the Siemens/Hauppauge DVB PCI card,
  33. Convergence provided a first implementation of the Linux Digital TV API.
  34. Convergence was the maintainer of the Linux Digital TV API in the early
  35. days.
  36. Now, the API is maintained by the LinuxTV community (i.e. you, the reader
  37. of this document). The Linux Digital TV API is constantly reviewed and
  38. improved together with the improvements at the subsystem's core at the
  39. Kernel.
  40. .. _overview:
  41. Overview
  42. ========
  43. .. _stb_components:
  44. .. kernel-figure:: dvbstb.svg
  45. :alt: dvbstb.svg
  46. :align: center
  47. Components of a Digital TV card/STB
  48. A Digital TV card or set-top-box (STB) usually consists of the
  49. following main hardware components:
  50. Frontend consisting of tuner and digital TV demodulator
  51. Here the raw signal reaches the digital TV hardware from a satellite dish or
  52. antenna or directly from cable. The frontend down-converts and
  53. demodulates this signal into an MPEG transport stream (TS). In case
  54. of a satellite frontend, this includes a facility for satellite
  55. equipment control (SEC), which allows control of LNB polarization,
  56. multi feed switches or dish rotors.
  57. Conditional Access (CA) hardware like CI adapters and smartcard slots
  58. The complete TS is passed through the CA hardware. Programs to which
  59. the user has access (controlled by the smart card) are decoded in
  60. real time and re-inserted into the TS.
  61. .. note::
  62. Not every digital TV hardware provides conditional access hardware.
  63. Demultiplexer which filters the incoming Digital TV MPEG-TS stream
  64. The demultiplexer splits the TS into its components like audio and
  65. video streams. Besides usually several of such audio and video
  66. streams it also contains data streams with information about the
  67. programs offered in this or other streams of the same provider.
  68. Audio and video decoder
  69. The main targets of the demultiplexer are audio and video
  70. decoders. After decoding, they pass on the uncompressed audio and
  71. video to the computer screen or to a TV set.
  72. .. note::
  73. Modern hardware usually doesn't have a separate decoder hardware, as
  74. such functionality can be provided by the main CPU, by the graphics
  75. adapter of the system or by a signal processing hardware embedded on
  76. a Systems on a Chip (SoC) integrated circuit.
  77. It may also not be needed for certain usages (e.g. for data-only
  78. uses like “internet over satellite”).
  79. :ref:`stb_components` shows a crude schematic of the control and data
  80. flow between those components.
  81. .. _dvb_devices:
  82. Linux Digital TV Devices
  83. ========================
  84. The Linux Digital TV API lets you control these hardware components through
  85. currently six Unix-style character devices for video, audio, frontend,
  86. demux, CA and IP-over-DVB networking. The video and audio devices
  87. control the MPEG2 decoder hardware, the frontend device the tuner and
  88. the Digital TV demodulator. The demux device gives you control over the PES
  89. and section filters of the hardware. If the hardware does not support
  90. filtering these filters can be implemented in software. Finally, the CA
  91. device controls all the conditional access capabilities of the hardware.
  92. It can depend on the individual security requirements of the platform,
  93. if and how many of the CA functions are made available to the
  94. application through this device.
  95. All devices can be found in the ``/dev`` tree under ``/dev/dvb``. The
  96. individual devices are called:
  97. - ``/dev/dvb/adapterN/audioM``,
  98. - ``/dev/dvb/adapterN/videoM``,
  99. - ``/dev/dvb/adapterN/frontendM``,
  100. - ``/dev/dvb/adapterN/netM``,
  101. - ``/dev/dvb/adapterN/demuxM``,
  102. - ``/dev/dvb/adapterN/dvrM``,
  103. - ``/dev/dvb/adapterN/caM``,
  104. where ``N`` enumerates the Digital TV cards in a system starting from 0, and
  105. ``M`` enumerates the devices of each type within each adapter, starting
  106. from 0, too. We will omit the “``/dev/dvb/adapterN/``\ ” in the further
  107. discussion of these devices.
  108. More details about the data structures and function calls of all the
  109. devices are described in the following chapters.
  110. .. _include_files:
  111. API include files
  112. =================
  113. For each of the Digital TV devices a corresponding include file exists. The
  114. Digital TV API include files should be included in application sources with a
  115. partial path like:
  116. .. code-block:: c
  117. #include <linux/dvb/ca.h>
  118. #include <linux/dvb/dmx.h>
  119. #include <linux/dvb/frontend.h>
  120. #include <linux/dvb/net.h>
  121. To enable applications to support different API version, an additional
  122. include file ``linux/dvb/version.h`` exists, which defines the constant
  123. ``DVB_API_VERSION``. This document describes ``DVB_API_VERSION 5.10``.