1 .. -*- coding: utf-8; mode: rst -*-
3 .. _frontend-properties:
5 DVB Frontend properties
6 =======================
8 Tuning into a Digital TV physical channel and starting decoding it
9 requires changing a set of parameters, in order to control the tuner,
10 the demodulator, the Linear Low-noise Amplifier (LNA) and to set the
11 antenna subsystem via Satellite Equipment Control (SEC), on satellite
12 systems. The actual parameters are specific to each particular digital
13 TV standards, and may change as the digital TV specs evolves.
15 In the past, the strategy used was to have a union with the parameters
16 needed to tune for DVB-S, DVB-C, DVB-T and ATSC delivery systems grouped
17 there. The problem is that, as the second generation standards appeared,
18 those structs were not big enough to contain the additional parameters.
19 Also, the union didn't have any space left to be expanded without
20 breaking userspace. So, the decision was to deprecate the legacy
21 union/struct based approach, in favor of a properties set approach.
25 On Linux DVB API version 3, setting a frontend were done via
26 struct :c:type:`dvb_frontend_parameters`.
27 This got replaced on version 5 (also called "S2API", as this API were
28 added originally_enabled to provide support for DVB-S2), because the
29 old API has a very limited support to new standards and new hardware.
30 This section describes the new and recommended way to set the frontend,
31 with suppports all digital TV delivery systems.
33 Example: with the properties based approach, in order to set the tuner
34 to a DVB-C channel at 651 kHz, modulated with 256-QAM, FEC 3/4 and
35 symbol rate of 5.217 Mbauds, those properties should be sent to
36 :ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` ioctl:
38 - :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` =
41 - :ref:`DTV_FREQUENCY <DTV-FREQUENCY>` = 651000000
43 - :ref:`DTV_MODULATION <DTV-MODULATION>` = QAM_256
45 - :ref:`DTV_INVERSION <DTV-INVERSION>` = INVERSION_AUTO
47 - :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>` = 5217000
49 - :ref:`DTV_INNER_FEC <DTV-INNER-FEC>` = FEC_3_4
51 - :ref:`DTV_TUNE <DTV-TUNE>`
53 The code that would that would do the above is show in
54 :ref:`dtv-prop-example`.
58 Example: Setting digital TV frontend properties
59 ===============================================
65 #include <sys/ioctl.h>
66 #include <linux/dvb/frontend.h>
68 static struct dtv_property props[] = {
69 { .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_DVBC_ANNEX_A },
70 { .cmd = DTV_FREQUENCY, .u.data = 651000000 },
71 { .cmd = DTV_MODULATION, .u.data = QAM_256 },
72 { .cmd = DTV_INVERSION, .u.data = INVERSION_AUTO },
73 { .cmd = DTV_SYMBOL_RATE, .u.data = 5217000 },
74 { .cmd = DTV_INNER_FEC, .u.data = FEC_3_4 },
78 static struct dtv_properties dtv_prop = {
79 .num = 6, .props = props
84 int fd = open("/dev/dvb/adapter0/frontend0", O_RDWR);
90 if (ioctl(fd, FE_SET_PROPERTY, &dtv_prop) == -1) {
94 printf("Frontend set\\n");
98 .. attention:: While it is possible to directly call the Kernel code like the
99 above example, it is strongly recommended to use
100 `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it
101 provides abstraction to work with the supported digital TV standards and
102 provides methods for usual operations like program scanning and to
103 read/write channel descriptor files.
114 fe_property_parameters
115 frontend-stat-properties
116 frontend-property-terrestrial-systems
117 frontend-property-cable-systems
118 frontend-property-satellite-systems