1 <title>DVB Frontend API</title>
3 <para>The DVB frontend device controls the tuner and DVB demodulator
4 hardware. It can be accessed through <emphasis
5 role="tt">/dev/dvb/adapter0/frontend0</emphasis>. Data types and and
6 ioctl definitions can be accessed by including <emphasis
7 role="tt">linux/dvb/frontend.h</emphasis> in your application.</para>
9 <para>DVB frontends come in three varieties: DVB-S (satellite), DVB-C
10 (cable) and DVB-T (terrestrial). Transmission via the internet (DVB-IP)
11 is not yet handled by this API but a future extension is possible. For
12 DVB-S the frontend device also supports satellite equipment control
13 (SEC) via DiSEqC and V-SEC protocols. The DiSEqC (digital SEC)
14 specification is available from
15 <ulink url="http://www.eutelsat.com/satellites/4_5_5.html">Eutelsat</ulink>.</para>
17 <para>Note that the DVB API may also be used for MPEG decoder-only PCI
18 cards, in which case there exists no frontend device.</para>
20 <section id="frontend_types">
21 <title>Frontend Data Types</title>
23 <section id="fe-type-t">
24 <title>Frontend type</title>
26 <para>For historical reasons, frontend types are named by the type of modulation used in
27 transmission. The fontend types are given by fe_type_t type, defined as:</para>
29 <table pgwide="1" frame="none" id="fe-type">
30 <title>Frontend types</title>
35 <entry>fe_type</entry>
36 <entry>Description</entry>
37 <entry><link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> equivalent type</entry>
42 <entry id="FE_QPSK"><constant>FE_QPSK</constant></entry>
43 <entry>For DVB-S standard</entry>
44 <entry><constant>SYS_DVBS</constant></entry>
47 <entry id="FE_QAM"><constant>FE_QAM</constant></entry>
48 <entry>For DVB-C annex A/C standard</entry>
49 <entry><constant>SYS_DVBC_ANNEX_AC</constant></entry>
52 <entry id="FE_OFDM"><constant>FE_OFDM</constant></entry>
53 <entry>For DVB-T standard</entry>
54 <entry><constant>SYS_DVBT</constant></entry>
57 <entry id="FE_ATSC"><constant>FE_ATSC</constant></entry>
58 <entry>For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used in US.</entry>
59 <entry><constant>SYS_ATSC</constant> (terrestrial) or <constant>SYS_DVBC_ANNEX_B</constant> (cable)</entry>
61 </tbody></tgroup></table>
63 <para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're
64 supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter.
68 <section id="fe-caps-t">
69 <title>frontend capabilities</title>
71 <para>Capabilities describe what a frontend can do. Some capabilities can only be supported for
72 a specific frontend type.</para>
74 typedef enum fe_caps {
76 FE_CAN_INVERSION_AUTO = 0x1,
80 FE_CAN_FEC_4_5 = 0x10,
81 FE_CAN_FEC_5_6 = 0x20,
82 FE_CAN_FEC_6_7 = 0x40,
83 FE_CAN_FEC_7_8 = 0x80,
84 FE_CAN_FEC_8_9 = 0x100,
85 FE_CAN_FEC_AUTO = 0x200,
87 FE_CAN_QAM_16 = 0x800,
88 FE_CAN_QAM_32 = 0x1000,
89 FE_CAN_QAM_64 = 0x2000,
90 FE_CAN_QAM_128 = 0x4000,
91 FE_CAN_QAM_256 = 0x8000,
92 FE_CAN_QAM_AUTO = 0x10000,
93 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
94 FE_CAN_BANDWIDTH_AUTO = 0x40000,
95 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
96 FE_CAN_HIERARCHY_AUTO = 0x100000,
97 FE_CAN_8VSB = 0x200000,
98 FE_CAN_16VSB = 0x400000,
99 FE_HAS_EXTENDED_CAPS = 0x800000,
100 FE_CAN_TURBO_FEC = 0x8000000,
101 FE_CAN_2G_MODULATION = 0x10000000,
102 FE_NEEDS_BENDING = 0x20000000,
103 FE_CAN_RECOVER = 0x40000000,
104 FE_CAN_MUTE_TS = 0x80000000
109 <section id="dvb-frontend-info">
110 <title>frontend information</title>
112 <para>Information about the frontend ca be queried with
113 <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
116 struct dvb_frontend_info {
119 uint32_t frequency_min;
120 uint32_t frequency_max;
121 uint32_t frequency_stepsize;
122 uint32_t frequency_tolerance;
123 uint32_t symbol_rate_min;
124 uint32_t symbol_rate_max;
125 uint32_t symbol_rate_tolerance; /⋆ ppm ⋆/
126 uint32_t notifier_delay; /⋆ ms ⋆/
132 <section id="dvb-diseqc-master-cmd">
133 <title>diseqc master command</title>
135 <para>A message sent from the frontend to DiSEqC capable equipment.</para>
137 struct dvb_diseqc_master_cmd {
138 uint8_t msg [6]; /⋆ { framing, address, command, data[3] } ⋆/
139 uint8_t msg_len; /⋆ valid values are 3...6 ⋆/
143 <section role="subsection" id="dvb-diseqc-slave-reply">
144 <title>diseqc slave reply</title>
146 <para>A reply to the frontend from DiSEqC 2.0 capable equipment.</para>
148 struct dvb_diseqc_slave_reply {
149 uint8_t msg [4]; /⋆ { framing, data [3] } ⋆/
150 uint8_t msg_len; /⋆ valid values are 0...4, 0 means no msg ⋆/
151 int timeout; /⋆ return from ioctl after timeout ms with ⋆/
152 }; /⋆ errorcode when no message was received ⋆/
156 <section id="fe-sec-voltage-t">
157 <title>diseqc slave reply</title>
158 <para>The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation
159 (horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched
160 consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
162 typedef enum fe_sec_voltage {
169 <section id="fe-sec-tone-mode-t">
170 <title>SEC continuous tone</title>
172 <para>The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
173 high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
174 be switched consistently to the DiSEqC commands as described in the DiSEqC
177 typedef enum fe_sec_tone_mode {
180 } fe_sec_tone_mode_t;
184 <section id="fe-sec-mini-cmd-t">
185 <title>SEC tone burst</title>
187 <para>The 22KHz tone burst is usually used with non-DiSEqC capable switches to select
188 between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to
189 be switched consistently to the DiSEqC commands as described in the DiSEqC
192 typedef enum fe_sec_mini_cmd {
201 <section id="fe-status-t">
202 <title>frontend status</title>
203 <para>Several functions of the frontend device use the fe_status data type defined
206 typedef enum fe_status {
207 FE_HAS_SIGNAL = 0x01, /⋆ found something above the noise level ⋆/
208 FE_HAS_CARRIER = 0x02, /⋆ found a DVB signal ⋆/
209 FE_HAS_VITERBI = 0x04, /⋆ FEC is stable ⋆/
210 FE_HAS_SYNC = 0x08, /⋆ found sync bytes ⋆/
211 FE_HAS_LOCK = 0x10, /⋆ everything's working... ⋆/
212 FE_TIMEDOUT = 0x20, /⋆ no lock within the last ~2 seconds ⋆/
213 FE_REINIT = 0x40 /⋆ frontend was reinitialized, ⋆/
214 } fe_status_t; /⋆ application is recommned to reset ⋆/
216 <para>to indicate the current state and/or state changes of the frontend hardware.
221 <section id="dvb-frontend-parameters">
222 <title>frontend parameters</title>
223 <para>The kind of parameters passed to the frontend device for tuning depend on
224 the kind of hardware you are using.</para>
225 <para>The struct <constant>dvb_frontend_parameters</constant> uses an
226 union with specific per-system parameters. However, as newer delivery systems
227 required more data, the structure size weren't enough to fit, and just
228 extending its size would break the existing applications. So, those parameters
229 were replaced by the usage of <link linkend="FE_GET_SET_PROPERTY">
230 <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> ioctl's. The
231 new API is flexible enough to add new parameters to existing delivery systems,
232 and to add newer delivery systems.</para>
233 <para>So, newer applications should use <link linkend="FE_GET_SET_PROPERTY">
234 <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in
235 order to be able to support the newer System Delivery like DVB-S2, DVB-T2,
236 DVB-C2, ISDB, etc.</para>
237 <para>All kinds of parameters are combined as an union in the FrontendParameters structure:</para>
239 struct dvb_frontend_parameters {
240 uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/
241 /⋆ intermediate frequency in kHz for QPSK ⋆/
242 fe_spectral_inversion_t inversion;
244 struct dvb_qpsk_parameters qpsk;
245 struct dvb_qam_parameters qam;
246 struct dvb_ofdm_parameters ofdm;
247 struct dvb_vsb_parameters vsb;
251 <para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate
252 frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
253 the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
254 OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz.
256 <section id="dvb-qpsk-parameters">
257 <title>QPSK parameters</title>
258 <para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para>
260 struct dvb_qpsk_parameters {
261 uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/
262 fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/
266 <section id="dvb-qam-parameters">
267 <title>QAM parameters</title>
268 <para>for cable QAM frontend you use the <constant>dvb_qam_parameters</constant> structure:</para>
270 struct dvb_qam_parameters {
271 uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/
272 fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/
273 fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/
277 <section id="dvb-vsb-parameters">
278 <title>VSB parameters</title>
279 <para>ATSC frontends are supported by the <constant>dvb_vsb_parameters</constant> structure:</para>
281 struct dvb_vsb_parameters {
282 fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/
286 <section id="dvb-ofdm-parameters">
287 <title>OFDM parameters</title>
288 <para>DVB-T frontends are supported by the <constant>dvb_ofdm_parameters</constant> structure:</para>
290 struct dvb_ofdm_parameters {
291 fe_bandwidth_t bandwidth;
292 fe_code_rate_t code_rate_HP; /⋆ high priority stream code rate ⋆/
293 fe_code_rate_t code_rate_LP; /⋆ low priority stream code rate ⋆/
294 fe_modulation_t constellation; /⋆ modulation type (see above) ⋆/
295 fe_transmit_mode_t transmission_mode;
296 fe_guard_interval_t guard_interval;
297 fe_hierarchy_t hierarchy_information;
301 <section id="fe-spectral-inversion-t">
302 <title>frontend spectral inversion</title>
303 <para>The Inversion field can take one of these values:
306 typedef enum fe_spectral_inversion {
310 } fe_spectral_inversion_t;
312 <para>It indicates if spectral inversion should be presumed or not. In the automatic setting
313 (<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
317 <section id="fe-code-rate-t">
318 <title>frontend code rate</title>
319 <para>The possible values for the <constant>fec_inner</constant> field used on
320 <link refend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and
321 <link refend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are:
324 typedef enum fe_code_rate {
339 <para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
343 <section id="fe-modulation-t">
344 <title>frontend modulation type for QAM, OFDM and VSB</title>
345 <para>For cable and terrestrial frontends, e. g. for
346 <link refend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>,
347 <link refend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and
348 <link refend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>,
349 it needs to specify the quadrature modulation mode which can be one of the following:
352 typedef enum fe_modulation {
369 <para>Finally, there are several more parameters for OFDM:
371 <section id="fe-transmit-mode-t">
372 <title>Number of carriers per channel</title>
374 typedef enum fe_transmit_mode {
375 TRANSMISSION_MODE_2K,
376 TRANSMISSION_MODE_8K,
377 TRANSMISSION_MODE_AUTO,
378 TRANSMISSION_MODE_4K,
379 TRANSMISSION_MODE_1K,
380 TRANSMISSION_MODE_16K,
381 TRANSMISSION_MODE_32K,
382 } fe_transmit_mode_t;
385 <section id="fe-bandwidth-t">
386 <title>frontend bandwidth</title>
388 typedef enum fe_bandwidth {
399 <section id="fe-guard-interval-t">
400 <title>frontend guard inverval</title>
402 typedef enum fe_guard_interval {
408 GUARD_INTERVAL_1_128,
409 GUARD_INTERVAL_19_128,
410 GUARD_INTERVAL_19_256,
411 } fe_guard_interval_t;
414 <section id="fe-hierarchy-t">
415 <title>frontend hierarchy</title>
417 typedef enum fe_hierarchy {
429 <section id="dvb-frontend-event">
430 <title>frontend events</title>
432 struct dvb_frontend_event {
434 struct dvb_frontend_parameters parameters;
441 <section id="frontend_fcalls">
442 <title>Frontend Function Calls</title>
444 <section id="frontend_f_open">
445 <title>open()</title>
446 <para>DESCRIPTION</para>
447 <informaltable><tgroup cols="1"><tbody><row>
449 <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
450 for subsequent use. Usually the first thing to do after a successful open is to
451 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
452 <para>The device can be opened in read-only mode, which only allows monitoring of
453 device status and statistics, or read/write mode, which allows any kind of use
454 (e.g. performing tuning operations.)
456 <para>In a system with multiple front-ends, it is usually the case that multiple devices
457 cannot be open in read/write mode simultaneously. As long as a front-end
458 device is opened in read/write mode, other open() calls in read/write mode will
459 either fail or block, depending on whether non-blocking or blocking mode was
460 specified. A front-end device opened in blocking mode can later be put into
461 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
462 system call. This is a standard system call, documented in the Linux manual
463 page for fcntl. When an open() call has succeeded, the device will be ready
464 for use in the specified mode. This implies that the corresponding hardware is
465 powered up, and that other front-ends may have been powered down to make
466 that possible.</para>
468 </row></tbody></tgroup></informaltable>
470 <para>SYNOPSIS</para>
471 <informaltable><tgroup cols="1"><tbody><row><entry
473 <para>int open(const char ⋆deviceName, int flags);</para>
475 </row></tbody></tgroup></informaltable>
478 <informaltable><tgroup cols="2"><tbody><row><entry
484 <para>Name of specific video device.</para>
488 <para>int flags</para>
491 <para>A bit-wise OR of the following flags:</para>
497 <para>O_RDONLY read-only access</para>
503 <para>O_RDWR read/write access</para>
509 <para>O_NONBLOCK open in non-blocking mode</para>
515 <para>(blocking mode is the default)</para>
517 </row></tbody></tgroup></informaltable>
520 <informaltable><tgroup cols="2"><tbody><row><entry
525 <para>Device driver not loaded/available.</para>
529 <para>EINTERNAL</para>
532 <para>Internal error.</para>
539 <para>Device or resource busy.</para>
546 <para>Invalid argument.</para>
548 </row></tbody></tgroup></informaltable>
551 <section id="frontend_f_close">
552 <title>close()</title>
555 <informaltable><tgroup cols="1"><tbody><row><entry
557 <para>This system call closes a previously opened front-end device. After closing
558 a front-end device, its corresponding hardware might be powered down
559 automatically.</para>
561 </row></tbody></tgroup></informaltable>
564 <informaltable><tgroup cols="1"><tbody><row><entry
566 <para>int close(int fd);</para>
568 </row></tbody></tgroup></informaltable>
571 <informaltable><tgroup cols="2"><tbody><row><entry
576 <para>File descriptor returned by a previous call to open().</para>
578 </row></tbody></tgroup></informaltable>
581 <informaltable><tgroup cols="2"><tbody><row><entry
586 <para>fd is not a valid open file descriptor.</para>
588 </row></tbody></tgroup></informaltable>
591 <section id="FE_READ_STATUS">
592 <title>FE_READ_STATUS</title>
595 <informaltable><tgroup cols="1"><tbody><row><entry
597 <para>This ioctl call returns status information about the front-end. This call only
598 requires read-only access to the device.</para>
600 </row></tbody></tgroup></informaltable>
603 <informaltable><tgroup cols="1"><tbody><row><entry
605 <para>int ioctl(int fd, int request = <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>,
606 fe_status_t ⋆status);</para>
608 </row></tbody></tgroup></informaltable>
612 <informaltable><tgroup cols="2"><tbody><row><entry
617 <para>File descriptor returned by a previous call to open().</para>
621 <para>int request</para>
624 <para>Equals <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> for this command.</para>
628 <para>struct fe_status_t
632 <para>Points to the location where the front-end status word is
635 </row></tbody></tgroup></informaltable>
638 <informaltable><tgroup cols="2"><tbody><row><entry
643 <para>fd is not a valid open file descriptor.</para>
650 <para>status points to invalid address.</para>
652 </row></tbody></tgroup></informaltable>
655 <section id="FE_READ_BER">
656 <title>FE_READ_BER</title>
659 <informaltable><tgroup cols="1"><tbody><row><entry
661 <para>This ioctl call returns the bit error rate for the signal currently
662 received/demodulated by the front-end. For this command, read-only access to
663 the device is sufficient.</para>
665 </row></tbody></tgroup></informaltable>
668 <informaltable><tgroup cols="1"><tbody><row><entry
670 <para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>,
671 uint32_t ⋆ber);</para>
673 </row></tbody></tgroup></informaltable>
676 <informaltable><tgroup cols="2"><tbody><row><entry
681 <para>File descriptor returned by a previous call to open().</para>
685 <para>int request</para>
688 <para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para>
692 <para>uint32_t *ber</para>
695 <para>The bit error rate is stored into *ber.</para>
697 </row></tbody></tgroup></informaltable>
700 <informaltable><tgroup cols="2"><tbody><row><entry
705 <para>fd is not a valid open file descriptor.</para>
712 <para>ber points to invalid address.</para>
716 <para>ENOSIGNAL</para>
719 <para>There is no signal, thus no meaningful bit error rate. Also
720 returned if the front-end is not turned on.</para>
727 <para>Function not available for this device.</para>
729 </row></tbody></tgroup></informaltable>
732 <section id="FE_READ_SNR">
733 <title>FE_READ_SNR</title>
737 <informaltable><tgroup cols="1"><tbody><row><entry
739 <para>This ioctl call returns the signal-to-noise ratio for the signal currently received
740 by the front-end. For this command, read-only access to the device is sufficient.</para>
742 </row></tbody></tgroup></informaltable>
745 <informaltable><tgroup cols="1"><tbody><row><entry
747 <para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t
750 </row></tbody></tgroup></informaltable>
753 <informaltable><tgroup cols="2"><tbody><row><entry
758 <para>File descriptor returned by a previous call to open().</para>
762 <para>int request</para>
765 <para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para>
769 <para>int16_t *snr</para>
772 <para>The signal-to-noise ratio is stored into *snr.</para>
774 </row></tbody></tgroup></informaltable>
778 <informaltable><tgroup cols="2"><tbody><row><entry
783 <para>fd is not a valid open file descriptor.</para>
790 <para>snr points to invalid address.</para>
794 <para>ENOSIGNAL</para>
797 <para>There is no signal, thus no meaningful signal strength
798 value. Also returned if front-end is not turned on.</para>
805 <para>Function not available for this device.</para>
807 </row></tbody></tgroup></informaltable>
810 <section id="FE_READ_SIGNAL_STRENGTH">
811 <title>FE_READ_SIGNAL_STRENGTH</title>
814 <informaltable><tgroup cols="1"><tbody><row><entry
816 <para>This ioctl call returns the signal strength value for the signal currently received
817 by the front-end. For this command, read-only access to the device is sufficient.</para>
819 </row></tbody></tgroup></informaltable>
822 <informaltable><tgroup cols="1"><tbody><row><entry
824 <para>int ioctl( int fd, int request =
825 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t ⋆strength);</para>
827 </row></tbody></tgroup></informaltable>
831 <informaltable><tgroup cols="2"><tbody><row><entry
836 <para>File descriptor returned by a previous call to open().</para>
840 <para>int request</para>
843 <para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this
848 <para>int16_t *strength</para>
851 <para>The signal strength value is stored into *strength.</para>
853 </row></tbody></tgroup></informaltable>
856 <informaltable><tgroup cols="2"><tbody><row><entry
861 <para>fd is not a valid open file descriptor.</para>
868 <para>status points to invalid address.</para>
872 <para>ENOSIGNAL</para>
875 <para>There is no signal, thus no meaningful signal strength
876 value. Also returned if front-end is not turned on.</para>
883 <para>Function not available for this device.</para>
885 </row></tbody></tgroup></informaltable>
888 <section id="FE_READ_UNCORRECTED_BLOCKS">
889 <title>FE_READ_UNCORRECTED_BLOCKS</title>
892 <informaltable><tgroup cols="1"><tbody><row><entry
894 <para>This ioctl call returns the number of uncorrected blocks detected by the device
895 driver during its lifetime. For meaningful measurements, the increment in block
896 count during a specific time interval should be calculated. For this command,
897 read-only access to the device is sufficient.</para>
901 <para>Note that the counter will wrap to zero after its maximum count has been
904 </row></tbody></tgroup></informaltable>
907 <informaltable><tgroup cols="1"><tbody><row><entry
909 <para>int ioctl( int fd, int request =
910 <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t ⋆ublocks);</para>
912 </row></tbody></tgroup></informaltable>
915 <informaltable><tgroup cols="2"><tbody><row><entry
920 <para>File descriptor returned by a previous call to open().</para>
924 <para>int request</para>
927 <para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this
932 <para>uint32_t *ublocks</para>
935 <para>The total number of uncorrected blocks seen by the driver
938 </row></tbody></tgroup></informaltable>
941 <informaltable><tgroup cols="2"><tbody><row><entry
946 <para>fd is not a valid open file descriptor.</para>
953 <para>ublocks points to invalid address.</para>
960 <para>Function not available for this device.</para>
962 </row></tbody></tgroup></informaltable>
965 <section id="FE_SET_FRONTEND">
966 <title>FE_SET_FRONTEND</title>
969 <informaltable><tgroup cols="1"><tbody><row><entry
971 <para>This ioctl call starts a tuning operation using specified parameters. The result
972 of this call will be successful if the parameters were valid and the tuning could
973 be initiated. The result of the tuning operation in itself, however, will arrive
974 asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and
975 FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before
976 the previous one was completed, the previous operation will be aborted in favor
977 of the new one. This command requires read/write access to the device.</para>
979 </row></tbody></tgroup></informaltable>
983 <informaltable><tgroup cols="1"><tbody><row><entry
985 <para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>,
986 struct dvb_frontend_parameters ⋆p);</para>
988 </row></tbody></tgroup></informaltable>
991 <informaltable><tgroup cols="2"><tbody><row><entry
996 <para>File descriptor returned by a previous call to open().</para>
1000 <para>int request</para>
1003 <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
1008 dvb_frontend_parameters
1012 <para>Points to parameters for tuning operation.</para>
1014 </row></tbody></tgroup></informaltable>
1017 <informaltable><tgroup cols="2"><tbody><row><entry
1022 <para>fd is not a valid open file descriptor.</para>
1029 <para>p points to invalid address.</para>
1036 <para>Maximum supported symbol rate reached.</para>
1038 </row></tbody></tgroup></informaltable>
1041 <section id="FE_GET_FRONTEND">
1042 <title>FE_GET_FRONTEND</title>
1045 <informaltable><tgroup cols="1"><tbody><row><entry
1047 <para>This ioctl call queries the currently effective frontend parameters. For this
1048 command, read-only access to the device is sufficient.</para>
1050 </row></tbody></tgroup></informaltable>
1054 <informaltable><tgroup cols="1"><tbody><row><entry
1056 <para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>,
1057 struct dvb_frontend_parameters ⋆p);</para>
1059 </row></tbody></tgroup></informaltable>
1063 <informaltable><tgroup cols="2"><tbody><row><entry
1068 <para>File descriptor returned by a previous call to open().</para>
1072 <para>int request</para>
1075 <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
1080 dvb_frontend_parameters
1084 <para>Points to parameters for tuning operation.</para>
1086 </row></tbody></tgroup></informaltable>
1091 <informaltable><tgroup cols="2"><tbody><row><entry
1096 <para>fd is not a valid open file descriptor.</para>
1103 <para>p points to invalid address.</para>
1110 <para>Maximum supported symbol rate reached.</para>
1112 </row></tbody></tgroup></informaltable>
1116 <section id="FE_GET_EVENT">
1117 <title>FE_GET_EVENT</title>
1120 <informaltable><tgroup cols="1"><tbody><row><entry
1122 <para>This ioctl call returns a frontend event if available. If an event is not
1123 available, the behavior depends on whether the device is in blocking or
1124 non-blocking mode. In the latter case, the call fails immediately with errno
1125 set to EWOULDBLOCK. In the former case, the call blocks until an event
1126 becomes available.</para>
1130 <para>The standard Linux poll() and/or select() system calls can be used with the
1131 device file descriptor to watch for new events. For select(), the file descriptor
1132 should be included in the exceptfds argument, and for poll(), POLLPRI should
1133 be specified as the wake-up condition. Since the event queue allocated is
1134 rather small (room for 8 events), the queue must be serviced regularly to avoid
1135 overflow. If an overflow happens, the oldest event is discarded from the queue,
1136 and an error (EOVERFLOW) occurs the next time the queue is read. After
1137 reporting the error condition in this fashion, subsequent
1138 <link linkend="FE_GET_EVENT">FE_GET_EVENT</link>
1139 calls will return events from the queue as usual.</para>
1143 <para>For the sake of implementation simplicity, this command requires read/write
1144 access to the device.</para>
1146 </row></tbody></tgroup></informaltable>
1150 <informaltable><tgroup cols="1"><tbody><row><entry
1152 <para>int ioctl(int fd, int request = QPSK_GET_EVENT,
1153 struct dvb_frontend_event ⋆ev);</para>
1155 </row></tbody></tgroup></informaltable>
1159 <informaltable><tgroup cols="2"><tbody><row><entry
1164 <para>File descriptor returned by a previous call to open().</para>
1168 <para>int request</para>
1171 <para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para>
1180 <para>Points to the location where the event,</para>
1186 <para>if any, is to be stored.</para>
1188 </row></tbody></tgroup></informaltable>
1192 <informaltable><tgroup cols="2"><tbody><row><entry
1197 <para>fd is not a valid open file descriptor.</para>
1204 <para>ev points to invalid address.</para>
1208 <para>EWOULDBLOCK</para>
1211 <para>There is no event pending, and the device is in
1212 non-blocking mode.</para>
1216 <para>EOVERFLOW</para>
1224 <para>Overflow in event queue - one or more events were lost.</para>
1226 </row></tbody></tgroup></informaltable>
1229 <section id="FE_GET_INFO">
1230 <title>FE_GET_INFO</title>
1233 <informaltable><tgroup cols="1"><tbody><row><entry
1235 <para>This ioctl call returns information about the front-end. This call only requires
1236 read-only access to the device.</para>
1238 </row></tbody></tgroup></informaltable>
1242 <informaltable><tgroup cols="1"><tbody><row><entry
1244 <para> int ioctl(int fd, int request = <link linkend="FE_GET_INFO">FE_GET_INFO</link>, struct
1245 dvb_frontend_info ⋆info);</para>
1247 </row></tbody></tgroup></informaltable>
1251 <informaltable><tgroup cols="2"><tbody><row><entry
1256 <para>File descriptor returned by a previous call to open().</para>
1260 <para>int request</para>
1263 <para>Equals <link linkend="FE_GET_INFO">FE_GET_INFO</link> for this command.</para>
1272 <para>Points to the location where the front-end information is
1273 to be stored.</para>
1275 </row></tbody></tgroup></informaltable>
1278 <informaltable><tgroup cols="2"><tbody><row><entry
1283 <para>fd is not a valid open file descriptor.</para>
1290 <para>info points to invalid address.</para>
1292 </row></tbody></tgroup></informaltable>
1295 <section id="FE_DISEQC_RESET_OVERLOAD">
1296 <title>FE_DISEQC_RESET_OVERLOAD</title>
1299 <informaltable><tgroup cols="1"><tbody><row><entry
1301 <para>If the bus has been automatically powered off due to power overload, this ioctl
1302 call restores the power to the bus. The call requires read/write access to the
1303 device. This call has no effect if the device is manually powered off. Not all
1304 DVB adapters support this ioctl.</para>
1306 </row></tbody></tgroup></informaltable>
1310 <informaltable><tgroup cols="1"><tbody><row><entry
1312 <para>int ioctl(int fd, int request =
1313 <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para>
1315 </row></tbody></tgroup></informaltable>
1318 <informaltable><tgroup cols="2"><tbody><row><entry
1323 <para>File descriptor returned by a previous call to open().</para>
1327 <para>int request</para>
1330 <para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this
1333 </row></tbody></tgroup></informaltable>
1337 <informaltable><tgroup cols="2"><tbody><row><entry
1342 <para>fd is not a valid file descriptor.</para>
1349 <para>Permission denied (needs read/write access).</para>
1353 <para>EINTERNAL</para>
1356 <para>Internal error in the device driver.</para>
1358 </row></tbody></tgroup></informaltable>
1361 <section id="FE_DISEQC_SEND_MASTER_CMD">
1362 <title>FE_DISEQC_SEND_MASTER_CMD</title>
1365 <informaltable><tgroup cols="1"><tbody><row><entry
1367 <para>This ioctl call is used to send a a DiSEqC command.</para>
1369 </row></tbody></tgroup></informaltable>
1372 <informaltable><tgroup cols="1"><tbody><row><entry
1374 <para>int ioctl(int fd, int request =
1375 <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct
1376 dvb_diseqc_master_cmd ⋆cmd);</para>
1378 </row></tbody></tgroup></informaltable>
1382 <informaltable><tgroup cols="2"><tbody><row><entry
1387 <para>File descriptor returned by a previous call to open().</para>
1391 <para>int request</para>
1394 <para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this
1400 dvb_diseqc_master_cmd
1404 <para>Pointer to the command to be transmitted.</para>
1406 </row></tbody></tgroup></informaltable>
1410 <informaltable><tgroup cols="2"><tbody><row><entry
1415 <para>fd is not a valid file descriptor.</para>
1422 <para>Seq points to an invalid address.</para>
1429 <para>The data structure referred to by seq is invalid in some
1437 <para>Permission denied (needs read/write access).</para>
1441 <para>EINTERNAL</para>
1444 <para>Internal error in the device driver.</para>
1446 </row></tbody></tgroup></informaltable>
1449 <section id="FE_DISEQC_RECV_SLAVE_REPLY">
1450 <title>FE_DISEQC_RECV_SLAVE_REPLY</title>
1453 <informaltable><tgroup cols="1"><tbody><row><entry
1455 <para>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</para>
1457 </row></tbody></tgroup></informaltable>
1461 <informaltable><tgroup cols="1"><tbody><row><entry
1463 <para>int ioctl(int fd, int request =
1464 <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct
1465 dvb_diseqc_slave_reply ⋆reply);</para>
1467 </row></tbody></tgroup></informaltable>
1471 <informaltable><tgroup cols="2"><tbody><row><entry
1476 <para>File descriptor returned by a previous call to open().</para>
1480 <para>int request</para>
1483 <para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this
1489 dvb_diseqc_slave_reply
1493 <para>Pointer to the command to be received.</para>
1495 </row></tbody></tgroup></informaltable>
1498 <informaltable><tgroup cols="2"><tbody><row><entry
1503 <para>fd is not a valid file descriptor.</para>
1510 <para>Seq points to an invalid address.</para>
1517 <para>The data structure referred to by seq is invalid in some
1525 <para>Permission denied (needs read/write access).</para>
1529 <para>EINTERNAL</para>
1532 <para>Internal error in the device driver.</para>
1534 </row></tbody></tgroup></informaltable>
1537 <section id="FE_DISEQC_SEND_BURST">
1538 <title>FE_DISEQC_SEND_BURST</title>
1541 <informaltable><tgroup cols="1"><tbody><row><entry
1543 <para>This ioctl call is used to send a 22KHz tone burst.</para>
1545 </row></tbody></tgroup></informaltable>
1549 <informaltable><tgroup cols="1"><tbody><row><entry
1551 <para>int ioctl(int fd, int request =
1552 <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para>
1554 </row></tbody></tgroup></informaltable>
1558 <informaltable><tgroup cols="2"><tbody><row><entry
1563 <para>File descriptor returned by a previous call to open().</para>
1567 <para>int request</para>
1570 <para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para>
1574 <para>fe_sec_mini_cmd_t
1578 <para>burst A or B.</para>
1580 </row></tbody></tgroup></informaltable>
1584 <informaltable><tgroup cols="2"><tbody><row><entry
1589 <para>fd is not a valid file descriptor.</para>
1596 <para>Seq points to an invalid address.</para>
1603 <para>The data structure referred to by seq is invalid in some
1611 <para>Permission denied (needs read/write access).</para>
1615 <para>EINTERNAL</para>
1618 <para>Internal error in the device driver.</para>
1620 </row></tbody></tgroup></informaltable>
1623 <section id="FE_SET_TONE">
1624 <title>FE_SET_TONE</title>
1627 <informaltable><tgroup cols="1"><tbody><row><entry
1629 <para>This call is used to set the generation of the continuous 22kHz tone. This call
1630 requires read/write permissions.</para>
1632 </row></tbody></tgroup></informaltable>
1635 <informaltable><tgroup cols="1"><tbody><row><entry
1637 <para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>,
1638 fe_sec_tone_mode_t tone);</para>
1640 </row></tbody></tgroup></informaltable>
1643 <informaltable><tgroup cols="2"><tbody><row><entry
1648 <para>File descriptor returned by a previous call to open().</para>
1652 <para>int request</para>
1655 <para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para>
1659 <para>fe_sec_tone_mode_t
1663 <para>The requested tone generation mode (on/off).</para>
1665 </row></tbody></tgroup></informaltable>
1668 <informaltable><tgroup cols="2"><tbody><row><entry
1673 <para>Device driver not loaded/available.</para>
1680 <para>Device or resource busy.</para>
1687 <para>Invalid argument.</para>
1694 <para>File not opened with read permissions.</para>
1698 <para>EINTERNAL</para>
1701 <para>Internal error in the device driver.</para>
1703 </row></tbody></tgroup></informaltable>
1706 <section id="FE_SET_VOLTAGE">
1707 <title>FE_SET_VOLTAGE</title>
1710 <informaltable><tgroup cols="1"><tbody><row><entry
1712 <para>This call is used to set the bus voltage. This call requires read/write
1715 </row></tbody></tgroup></informaltable>
1718 <informaltable><tgroup cols="1"><tbody><row><entry
1720 <para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>,
1721 fe_sec_voltage_t voltage);</para>
1723 </row></tbody></tgroup></informaltable>
1727 <informaltable><tgroup cols="2"><tbody><row><entry
1732 <para>File descriptor returned by a previous call to open().</para>
1736 <para>int request</para>
1739 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1743 <para>fe_sec_voltage_t
1747 <para>The requested bus voltage.</para>
1749 </row></tbody></tgroup></informaltable>
1753 <informaltable><tgroup cols="2"><tbody><row><entry
1758 <para>Device driver not loaded/available.</para>
1765 <para>Device or resource busy.</para>
1772 <para>Invalid argument.</para>
1779 <para>File not opened with read permissions.</para>
1783 <para>EINTERNAL</para>
1786 <para>Internal error in the device driver.</para>
1788 </row></tbody></tgroup></informaltable>
1791 <section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
1792 <title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
1795 <informaltable><tgroup cols="1"><tbody><row><entry
1797 <para>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate
1798 for long cables). This call requires read/write permissions. Not all DVB
1799 adapters support this ioctl.</para>
1801 </row></tbody></tgroup></informaltable>
1805 <informaltable><tgroup cols="1"><tbody><row><entry
1807 <para>int ioctl(int fd, int request =
1808 <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para>
1810 </row></tbody></tgroup></informaltable>
1814 <informaltable><tgroup cols="2"><tbody><row><entry
1819 <para>File descriptor returned by a previous call to open().</para>
1823 <para>int request</para>
1826 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1830 <para>int high</para>
1833 <para>The requested bus voltage.</para>
1835 </row></tbody></tgroup></informaltable>
1839 <informaltable><tgroup cols="2"><tbody><row><entry
1844 <para>Device driver not loaded/available.</para>
1851 <para>Device or resource busy.</para>
1858 <para>Invalid argument.</para>
1865 <para>File not opened with read permissions.</para>
1869 <para>EINTERNAL</para>
1872 <para>Internal error in the device driver.</para>
1874 </row></tbody></tgroup></informaltable>
1877 <section id="FE_SET_FRONTEND_TUNE_MODE">
1878 <title>FE_SET_FRONTEND_TUNE_MODE</title>
1879 <para>DESCRIPTION</para>
1880 <informaltable><tgroup cols="1"><tbody><row>
1881 <entry align="char">
1882 <para>Allow setting tuner mode flags to the frontend.</para>
1884 </row></tbody></tgroup></informaltable>
1886 <para>SYNOPSIS</para>
1887 <informaltable><tgroup cols="1"><tbody><row>
1888 <entry align="char">
1889 <para>int ioctl(int fd, int request =
1890 <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para>
1892 </row></tbody></tgroup></informaltable>
1894 <para>PARAMETERS</para>
1895 <informaltable><tgroup cols="2"><tbody><row>
1896 <entry align="char">
1897 <para>unsigned int flags</para>
1899 <entry align="char">
1901 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.
1904 </row></tbody></tgroup></informaltable>
1907 <informaltable><tgroup cols="2"><tbody><row>
1908 <entry align="char"><para>EINVAL</para></entry>
1909 <entry align="char"><para>Invalid argument.</para></entry>
1910 </row></tbody></tgroup></informaltable>
1913 <section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
1914 <title>FE_DISHNETWORK_SEND_LEGACY_CMD</title>
1915 <para>DESCRIPTION</para>
1916 <informaltable><tgroup cols="1"><tbody><row>
1917 <entry align="char">
1918 <para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para>
1919 <para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para>
1920 <para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para>
1922 </row></tbody></tgroup></informaltable>
1924 <para>SYNOPSIS</para>
1925 <informaltable><tgroup cols="1"><tbody><row>
1926 <entry align="char">
1927 <para>int ioctl(int fd, int request =
1928 <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para>
1930 </row></tbody></tgroup></informaltable>
1932 <para>PARAMETERS</para>
1933 <informaltable><tgroup cols="2"><tbody><row>
1934 <entry align="char">
1935 <para>unsigned long cmd</para>
1937 <entry align="char">
1939 sends the specified raw cmd to the dish via DISEqC.
1942 </row></tbody></tgroup></informaltable>
1945 <informaltable><tgroup cols="1"><tbody><row>
1946 <entry align="char">
1947 <para>There are no errors in use for this call</para>
1949 </row></tbody></tgroup></informaltable>