1 <title>DVB Frontend API</title>
3 <para>The DVB frontend API was designed to support three types of delivery systems:</para>
5 <listitem>Terrestrial systems: DVB-T, DVB-T2, ATSC, ATSC M/H, ISDB-T, DVB-H, DTMB, CMMB</listitem>
6 <listitem>Cable systems: DVB-C Annex A/C, ClearQAM (DVB-C Annex B), ISDB-C</listitem>
7 <listitem>Satellital systems: DVB-S, DVB-S2, DVB Turbo, ISDB-S, DSS</listitem>
9 <para>The DVB frontend controls several sub-devices including:</para>
11 <listitem>Tuner</listitem>,
12 <listitem>Digital TV demodulator</listitem>
13 <listitem>Low noise amplifier (LNA)</listitem>
14 <listitem>Satellite Equipment Control (SEC) hardware (only for Satellite).</listitem>
16 <para>The frontend can be accessed through
17 <emphasis role="bold">/dev/dvb/adapter?/frontend?</emphasis>. Data types and
18 ioctl definitions can be accessed by including
19 <emphasis role="bold">linux/dvb/frontend.h</emphasis> in your application.
22 <para>NOTE: Transmission via the internet (DVB-IP)
23 is not yet handled by this API but a future extension is possible.</para>
24 <para>On Satellital systems, the API support for the Satellite Equipment Control
25 (SEC) allows to power control and to send/receive signals to control the
26 antenna subsystem, selecting the polarization and choosing the Intermediate
27 Frequency IF) of the Low Noise Block Converter Feed Horn (LNBf). It
28 supports the DiSEqC and V-SEC protocols. The DiSEqC (digital SEC)
29 specification is available at
30 <ulink url="http://www.eutelsat.com/satellites/4_5_5.html">Eutelsat</ulink>.</para>
32 <section id="query-dvb-frontend-info">
33 <title>Querying frontend information</title>
35 <para>Usually, the first thing to do when the frontend is opened is to
36 check the frontend capabilities. This is done using <link linkend="FE_GET_INFO">FE_GET_INFO</link>. This ioctl will enumerate
37 the DVB API version and other characteristics about the frontend, and
38 can be opened either in read only or read/write mode.</para>
41 <section id="dvb-fe-read-status">
42 <title>Querying frontend status and statistics</title>
44 <para>Once <link linkend="FE_GET_PROPERTY"><constant>FE_SET_PROPERTY</constant></link>
45 is called, the frontend will run a kernel thread that will periodically
46 check for the tuner lock status and provide statistics about the quality
48 <para>The information about the frontend tuner locking status can be queried
49 using <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>.</para>
50 <para>Signal statistics are provided via <link linkend="FE_GET_PROPERTY"><constant>FE_GET_PROPERTY</constant></link>.
51 Please notice that several statistics require the demodulator to be fully
52 locked (e. g. with FE_HAS_LOCK bit set). See
53 <xref linkend="frontend-stat-properties">Frontend statistics indicators</xref>
54 for more details.</para>
59 <section id="fe-spectral-inversion-t">
60 <title>frontend spectral inversion</title>
61 <para>The Inversion field can take one of these values:
64 typedef enum fe_spectral_inversion {
68 } fe_spectral_inversion_t;
70 <para>It indicates if spectral inversion should be presumed or not. In the automatic setting
71 (<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
76 <section id="fe-code-rate-t">
77 <title>frontend code rate</title>
78 <para>The possible values for the <constant>fec_inner</constant> field used on
79 <link linkend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and
80 <link linkend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are:
83 typedef enum fe_code_rate {
98 <para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
103 <section id="fe-modulation-t">
104 <title>frontend modulation type for QAM, OFDM and VSB</title>
105 <para>For cable and terrestrial frontends, e. g. for
106 <link linkend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>,
107 <link linkend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and
108 <link linkend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>,
109 it needs to specify the quadrature modulation mode which can be one of the following:
112 typedef enum fe_modulation {
131 <title>More OFDM parameters</title>
133 <section id="fe-transmit-mode-t">
134 <title>Number of carriers per channel</title>
136 typedef enum fe_transmit_mode {
137 TRANSMISSION_MODE_2K,
138 TRANSMISSION_MODE_8K,
139 TRANSMISSION_MODE_AUTO,
140 TRANSMISSION_MODE_4K,
141 TRANSMISSION_MODE_1K,
142 TRANSMISSION_MODE_16K,
143 TRANSMISSION_MODE_32K,
144 } fe_transmit_mode_t;
148 <section id="fe-bandwidth-t">
149 <title>frontend bandwidth</title>
151 typedef enum fe_bandwidth {
163 <section id="fe-guard-interval-t">
164 <title>frontend guard inverval</title>
166 typedef enum fe_guard_interval {
172 GUARD_INTERVAL_1_128,
173 GUARD_INTERVAL_19_128,
174 GUARD_INTERVAL_19_256,
175 } fe_guard_interval_t;
179 <section id="fe-hierarchy-t">
180 <title>frontend hierarchy</title>
182 typedef enum fe_hierarchy {
194 <section id="frontend_fcalls">
195 <title>Frontend Function Calls</title>
197 <section id="frontend_f_open">
198 <title>open()</title>
199 <para>DESCRIPTION</para>
200 <informaltable><tgroup cols="1"><tbody><row>
202 <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
203 for subsequent use. Usually the first thing to do after a successful open is to
204 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
205 <para>The device can be opened in read-only mode, which only allows monitoring of
206 device status and statistics, or read/write mode, which allows any kind of use
207 (e.g. performing tuning operations.)
209 <para>In a system with multiple front-ends, it is usually the case that multiple devices
210 cannot be open in read/write mode simultaneously. As long as a front-end
211 device is opened in read/write mode, other open() calls in read/write mode will
212 either fail or block, depending on whether non-blocking or blocking mode was
213 specified. A front-end device opened in blocking mode can later be put into
214 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
215 system call. This is a standard system call, documented in the Linux manual
216 page for fcntl. When an open() call has succeeded, the device will be ready
217 for use in the specified mode. This implies that the corresponding hardware is
218 powered up, and that other front-ends may have been powered down to make
219 that possible.</para>
221 </row></tbody></tgroup></informaltable>
223 <para>SYNOPSIS</para>
224 <informaltable><tgroup cols="1"><tbody><row><entry
226 <para>int open(const char ⋆deviceName, int flags);</para>
228 </row></tbody></tgroup></informaltable>
231 <informaltable><tgroup cols="2"><tbody><row><entry
237 <para>Name of specific video device.</para>
241 <para>int flags</para>
244 <para>A bit-wise OR of the following flags:</para>
250 <para>O_RDONLY read-only access</para>
256 <para>O_RDWR read/write access</para>
262 <para>O_NONBLOCK open in non-blocking mode</para>
268 <para>(blocking mode is the default)</para>
270 </row></tbody></tgroup></informaltable>
271 <para>RETURN VALUE</para>
272 <informaltable><tgroup cols="2"><tbody><row><entry
277 <para>Device driver not loaded/available.</para>
281 <para>EINTERNAL</para>
284 <para>Internal error.</para>
291 <para>Device or resource busy.</para>
298 <para>Invalid argument.</para>
300 </row></tbody></tgroup></informaltable>
303 <section id="frontend_f_close">
304 <title>close()</title>
307 <informaltable><tgroup cols="1"><tbody><row><entry
309 <para>This system call closes a previously opened front-end device. After closing
310 a front-end device, its corresponding hardware might be powered down
311 automatically.</para>
313 </row></tbody></tgroup></informaltable>
316 <informaltable><tgroup cols="1"><tbody><row><entry
318 <para>int close(int fd);</para>
320 </row></tbody></tgroup></informaltable>
323 <informaltable><tgroup cols="2"><tbody><row><entry
328 <para>File descriptor returned by a previous call to open().</para>
330 </row></tbody></tgroup></informaltable>
331 <para>RETURN VALUE</para>
332 <informaltable><tgroup cols="2"><tbody><row><entry
337 <para>fd is not a valid open file descriptor.</para>
339 </row></tbody></tgroup></informaltable>
344 &sub-fe-get-property;
345 &sub-fe-diseqc-reset-overload;
346 &sub-fe-diseqc-send-master-cmd;
347 &sub-fe-diseqc-recv-slave-reply;
348 &sub-fe-diseqc-send-burst;
351 &sub-fe-enable-high-lnb-voltage;
352 &sub-fe-set-frontend-tune-mode;
356 <section id="frontend_legacy_dvbv3_api">
357 <title>DVB Frontend legacy API (a. k. a. DVBv3)</title>
358 <para>The usage of this API is deprecated, as it doesn't support all digital
359 TV standards, doesn't provide good statistics measurements and provides
360 incomplete information. This is kept only to support legacy applications.</para>
362 &sub-frontend_legacy_api;