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>
33 <section id="query-dvb-frontend-info">
34 <title>Querying frontend information</title>
36 <para>Information about the frontend can be queried with
37 <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
40 &sub-frontend_get_info;
42 <section id="dvb-fe-read-status">
43 <title>Querying frontend status</title>
45 <para>Information about the frontend tuner locking status can be queried with
46 <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>.</para>
49 &sub-frontend_read_status;
53 <section id="dvb-diseqc-master-cmd">
54 <title>diseqc master command</title>
56 <para>A message sent from the frontend to DiSEqC capable equipment.</para>
58 struct dvb_diseqc_master_cmd {
59 uint8_t msg [6]; /⋆ { framing, address, command, data[3] } ⋆/
60 uint8_t msg_len; /⋆ valid values are 3...6 ⋆/
65 <section role="subsection" id="dvb-diseqc-slave-reply">
66 <title>diseqc slave reply</title>
68 <para>A reply to the frontend from DiSEqC 2.0 capable equipment.</para>
70 struct dvb_diseqc_slave_reply {
71 uint8_t msg [4]; /⋆ { framing, data [3] } ⋆/
72 uint8_t msg_len; /⋆ valid values are 0...4, 0 means no msg ⋆/
73 int timeout; /⋆ return from ioctl after timeout ms with ⋆/
74 }; /⋆ errorcode when no message was received ⋆/
78 <section id="fe-sec-voltage-t">
79 <title>diseqc slave reply</title>
80 <para>The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation
81 (horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched
82 consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
84 typedef enum fe_sec_voltage {
91 <section id="fe-sec-tone-mode-t">
92 <title>SEC continuous tone</title>
94 <para>The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
95 high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
96 be switched consistently to the DiSEqC commands as described in the DiSEqC
99 typedef enum fe_sec_tone_mode {
102 } fe_sec_tone_mode_t;
106 <section id="fe-sec-mini-cmd-t">
107 <title>SEC tone burst</title>
109 <para>The 22KHz tone burst is usually used with non-DiSEqC capable switches to select
110 between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to
111 be switched consistently to the DiSEqC commands as described in the DiSEqC
114 typedef enum fe_sec_mini_cmd {
123 <section id="fe-spectral-inversion-t">
124 <title>frontend spectral inversion</title>
125 <para>The Inversion field can take one of these values:
128 typedef enum fe_spectral_inversion {
132 } fe_spectral_inversion_t;
134 <para>It indicates if spectral inversion should be presumed or not. In the automatic setting
135 (<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
140 <section id="fe-code-rate-t">
141 <title>frontend code rate</title>
142 <para>The possible values for the <constant>fec_inner</constant> field used on
143 <link linkend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and
144 <link linkend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are:
147 typedef enum fe_code_rate {
162 <para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
167 <section id="fe-modulation-t">
168 <title>frontend modulation type for QAM, OFDM and VSB</title>
169 <para>For cable and terrestrial frontends, e. g. for
170 <link linkend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>,
171 <link linkend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and
172 <link linkend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>,
173 it needs to specify the quadrature modulation mode which can be one of the following:
176 typedef enum fe_modulation {
195 <title>More OFDM parameters</title>
197 <section id="fe-transmit-mode-t">
198 <title>Number of carriers per channel</title>
200 typedef enum fe_transmit_mode {
201 TRANSMISSION_MODE_2K,
202 TRANSMISSION_MODE_8K,
203 TRANSMISSION_MODE_AUTO,
204 TRANSMISSION_MODE_4K,
205 TRANSMISSION_MODE_1K,
206 TRANSMISSION_MODE_16K,
207 TRANSMISSION_MODE_32K,
208 } fe_transmit_mode_t;
212 <section id="fe-bandwidth-t">
213 <title>frontend bandwidth</title>
215 typedef enum fe_bandwidth {
227 <section id="fe-guard-interval-t">
228 <title>frontend guard inverval</title>
230 typedef enum fe_guard_interval {
236 GUARD_INTERVAL_1_128,
237 GUARD_INTERVAL_19_128,
238 GUARD_INTERVAL_19_256,
239 } fe_guard_interval_t;
243 <section id="fe-hierarchy-t">
244 <title>frontend hierarchy</title>
246 typedef enum fe_hierarchy {
258 <section id="frontend_fcalls">
259 <title>Frontend Function Calls</title>
261 <section id="frontend_f_open">
262 <title>open()</title>
263 <para>DESCRIPTION</para>
264 <informaltable><tgroup cols="1"><tbody><row>
266 <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
267 for subsequent use. Usually the first thing to do after a successful open is to
268 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
269 <para>The device can be opened in read-only mode, which only allows monitoring of
270 device status and statistics, or read/write mode, which allows any kind of use
271 (e.g. performing tuning operations.)
273 <para>In a system with multiple front-ends, it is usually the case that multiple devices
274 cannot be open in read/write mode simultaneously. As long as a front-end
275 device is opened in read/write mode, other open() calls in read/write mode will
276 either fail or block, depending on whether non-blocking or blocking mode was
277 specified. A front-end device opened in blocking mode can later be put into
278 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
279 system call. This is a standard system call, documented in the Linux manual
280 page for fcntl. When an open() call has succeeded, the device will be ready
281 for use in the specified mode. This implies that the corresponding hardware is
282 powered up, and that other front-ends may have been powered down to make
283 that possible.</para>
285 </row></tbody></tgroup></informaltable>
287 <para>SYNOPSIS</para>
288 <informaltable><tgroup cols="1"><tbody><row><entry
290 <para>int open(const char ⋆deviceName, int flags);</para>
292 </row></tbody></tgroup></informaltable>
295 <informaltable><tgroup cols="2"><tbody><row><entry
301 <para>Name of specific video device.</para>
305 <para>int flags</para>
308 <para>A bit-wise OR of the following flags:</para>
314 <para>O_RDONLY read-only access</para>
320 <para>O_RDWR read/write access</para>
326 <para>O_NONBLOCK open in non-blocking mode</para>
332 <para>(blocking mode is the default)</para>
334 </row></tbody></tgroup></informaltable>
335 <para>RETURN VALUE</para>
336 <informaltable><tgroup cols="2"><tbody><row><entry
341 <para>Device driver not loaded/available.</para>
345 <para>EINTERNAL</para>
348 <para>Internal error.</para>
355 <para>Device or resource busy.</para>
362 <para>Invalid argument.</para>
364 </row></tbody></tgroup></informaltable>
367 <section id="frontend_f_close">
368 <title>close()</title>
371 <informaltable><tgroup cols="1"><tbody><row><entry
373 <para>This system call closes a previously opened front-end device. After closing
374 a front-end device, its corresponding hardware might be powered down
375 automatically.</para>
377 </row></tbody></tgroup></informaltable>
380 <informaltable><tgroup cols="1"><tbody><row><entry
382 <para>int close(int fd);</para>
384 </row></tbody></tgroup></informaltable>
387 <informaltable><tgroup cols="2"><tbody><row><entry
392 <para>File descriptor returned by a previous call to open().</para>
394 </row></tbody></tgroup></informaltable>
395 <para>RETURN VALUE</para>
396 <informaltable><tgroup cols="2"><tbody><row><entry
401 <para>fd is not a valid open file descriptor.</para>
403 </row></tbody></tgroup></informaltable>
407 <section id="FE_DISEQC_RESET_OVERLOAD">
408 <title>FE_DISEQC_RESET_OVERLOAD</title>
411 <informaltable><tgroup cols="1"><tbody><row><entry
413 <para>If the bus has been automatically powered off due to power overload, this ioctl
414 call restores the power to the bus. The call requires read/write access to the
415 device. This call has no effect if the device is manually powered off. Not all
416 DVB adapters support this ioctl.</para>
418 </row></tbody></tgroup></informaltable>
422 <informaltable><tgroup cols="1"><tbody><row><entry
424 <para>int ioctl(int fd, int request =
425 <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para>
427 </row></tbody></tgroup></informaltable>
430 <informaltable><tgroup cols="2"><tbody><row><entry
435 <para>File descriptor returned by a previous call to open().</para>
439 <para>int request</para>
442 <para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this
445 </row></tbody></tgroup></informaltable>
450 <section id="FE_DISEQC_SEND_MASTER_CMD">
451 <title>FE_DISEQC_SEND_MASTER_CMD</title>
454 <informaltable><tgroup cols="1"><tbody><row><entry
456 <para>This ioctl call is used to send a a DiSEqC command.</para>
458 </row></tbody></tgroup></informaltable>
461 <informaltable><tgroup cols="1"><tbody><row><entry
463 <para>int ioctl(int fd, int request =
464 <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct
465 dvb_diseqc_master_cmd ⋆cmd);</para>
467 </row></tbody></tgroup></informaltable>
471 <informaltable><tgroup cols="2"><tbody><row><entry
476 <para>File descriptor returned by a previous call to open().</para>
480 <para>int request</para>
483 <para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this
489 dvb_diseqc_master_cmd
493 <para>Pointer to the command to be transmitted.</para>
495 </row></tbody></tgroup></informaltable>
500 <section id="FE_DISEQC_RECV_SLAVE_REPLY">
501 <title>FE_DISEQC_RECV_SLAVE_REPLY</title>
504 <informaltable><tgroup cols="1"><tbody><row><entry
506 <para>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</para>
508 </row></tbody></tgroup></informaltable>
512 <informaltable><tgroup cols="1"><tbody><row><entry
514 <para>int ioctl(int fd, int request =
515 <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct
516 dvb_diseqc_slave_reply ⋆reply);</para>
518 </row></tbody></tgroup></informaltable>
522 <informaltable><tgroup cols="2"><tbody><row><entry
527 <para>File descriptor returned by a previous call to open().</para>
531 <para>int request</para>
534 <para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this
540 dvb_diseqc_slave_reply
544 <para>Pointer to the command to be received.</para>
546 </row></tbody></tgroup></informaltable>
550 <section id="FE_DISEQC_SEND_BURST">
551 <title>FE_DISEQC_SEND_BURST</title>
554 <informaltable><tgroup cols="1"><tbody><row><entry
556 <para>This ioctl call is used to send a 22KHz tone burst.</para>
558 </row></tbody></tgroup></informaltable>
562 <informaltable><tgroup cols="1"><tbody><row><entry
564 <para>int ioctl(int fd, int request =
565 <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para>
567 </row></tbody></tgroup></informaltable>
571 <informaltable><tgroup cols="2"><tbody><row><entry
576 <para>File descriptor returned by a previous call to open().</para>
580 <para>int request</para>
583 <para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para>
587 <para>fe_sec_mini_cmd_t
591 <para>burst A or B.</para>
593 </row></tbody></tgroup></informaltable>
598 <section id="FE_SET_TONE">
599 <title>FE_SET_TONE</title>
602 <informaltable><tgroup cols="1"><tbody><row><entry
604 <para>This call is used to set the generation of the continuous 22kHz tone. This call
605 requires read/write permissions.</para>
607 </row></tbody></tgroup></informaltable>
610 <informaltable><tgroup cols="1"><tbody><row><entry
612 <para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>,
613 fe_sec_tone_mode_t tone);</para>
615 </row></tbody></tgroup></informaltable>
618 <informaltable><tgroup cols="2"><tbody><row><entry
623 <para>File descriptor returned by a previous call to open().</para>
627 <para>int request</para>
630 <para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para>
634 <para>fe_sec_tone_mode_t
638 <para>The requested tone generation mode (on/off).</para>
640 </row></tbody></tgroup></informaltable>
644 <section id="FE_SET_VOLTAGE">
645 <title>FE_SET_VOLTAGE</title>
648 <informaltable><tgroup cols="1"><tbody><row><entry
650 <para>This call is used to set the bus voltage. This call requires read/write
653 </row></tbody></tgroup></informaltable>
656 <informaltable><tgroup cols="1"><tbody><row><entry
658 <para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>,
659 fe_sec_voltage_t voltage);</para>
661 </row></tbody></tgroup></informaltable>
665 <informaltable><tgroup cols="2"><tbody><row><entry
670 <para>File descriptor returned by a previous call to open().</para>
674 <para>int request</para>
677 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
681 <para>fe_sec_voltage_t
685 <para>The requested bus voltage.</para>
687 </row></tbody></tgroup></informaltable>
692 <section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
693 <title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
696 <informaltable><tgroup cols="1"><tbody><row><entry
698 <para>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate
699 for long cables). This call requires read/write permissions. Not all DVB
700 adapters support this ioctl.</para>
702 </row></tbody></tgroup></informaltable>
706 <informaltable><tgroup cols="1"><tbody><row><entry
708 <para>int ioctl(int fd, int request =
709 <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para>
711 </row></tbody></tgroup></informaltable>
715 <informaltable><tgroup cols="2"><tbody><row><entry
720 <para>File descriptor returned by a previous call to open().</para>
724 <para>int request</para>
727 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
731 <para>int high</para>
734 <para>The requested bus voltage.</para>
736 </row></tbody></tgroup></informaltable>
741 <section id="FE_SET_FRONTEND_TUNE_MODE">
742 <title>FE_SET_FRONTEND_TUNE_MODE</title>
743 <para>DESCRIPTION</para>
744 <informaltable><tgroup cols="1"><tbody><row>
746 <para>Allow setting tuner mode flags to the frontend.</para>
748 </row></tbody></tgroup></informaltable>
750 <para>SYNOPSIS</para>
751 <informaltable><tgroup cols="1"><tbody><row>
753 <para>int ioctl(int fd, int request =
754 <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para>
756 </row></tbody></tgroup></informaltable>
758 <para>PARAMETERS</para>
759 <informaltable><tgroup cols="2"><tbody><row>
761 <para>unsigned int flags</para>
765 FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "normal" tuning behaviour. Additionally, there will be no automatic monitoring of the lock status, and hence no frontend events will be generated. If a frontend device is closed, this flag will be automatically turned off when the device is reopened read-write.
768 </row></tbody></tgroup></informaltable>
775 <section id="frontend_legacy_dvbv3_api">
776 <title>DVB Frontend legacy API (a. k. a. DVBv3)</title>
777 <para>The usage of this API is deprecated, as it doesn't support all digital
778 TV standards, doesn't provide good statistics measurements and provides
779 incomplete information. This is kept only to support legacy applications.</para>
781 &sub-frontend_legacy_api;