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 standard</entry>
49 <entry><constant>SYS_DVBC_ANNEX_A</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.
67 <para>The usage of this field is deprecated, as it doesn't report all supported standards, and
68 will provide an incomplete information for frontends that support multiple delivery systems.
69 Please use <link linkend="DTV_ENUM_DELSYS">DTV_ENUM_DELSYS</link> instead.</para>
72 <section id="fe-caps-t">
73 <title>frontend capabilities</title>
75 <para>Capabilities describe what a frontend can do. Some capabilities can only be supported for
76 a specific frontend type.</para>
78 typedef enum fe_caps {
80 FE_CAN_INVERSION_AUTO = 0x1,
84 FE_CAN_FEC_4_5 = 0x10,
85 FE_CAN_FEC_5_6 = 0x20,
86 FE_CAN_FEC_6_7 = 0x40,
87 FE_CAN_FEC_7_8 = 0x80,
88 FE_CAN_FEC_8_9 = 0x100,
89 FE_CAN_FEC_AUTO = 0x200,
91 FE_CAN_QAM_16 = 0x800,
92 FE_CAN_QAM_32 = 0x1000,
93 FE_CAN_QAM_64 = 0x2000,
94 FE_CAN_QAM_128 = 0x4000,
95 FE_CAN_QAM_256 = 0x8000,
96 FE_CAN_QAM_AUTO = 0x10000,
97 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
98 FE_CAN_BANDWIDTH_AUTO = 0x40000,
99 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
100 FE_CAN_HIERARCHY_AUTO = 0x100000,
101 FE_CAN_8VSB = 0x200000,
102 FE_CAN_16VSB = 0x400000,
103 FE_HAS_EXTENDED_CAPS = 0x800000,
104 FE_CAN_TURBO_FEC = 0x8000000,
105 FE_CAN_2G_MODULATION = 0x10000000,
106 FE_NEEDS_BENDING = 0x20000000,
107 FE_CAN_RECOVER = 0x40000000,
108 FE_CAN_MUTE_TS = 0x80000000
113 <section id="dvb-frontend-info">
114 <title>frontend information</title>
116 <para>Information about the frontend ca be queried with
117 <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
120 struct dvb_frontend_info {
123 uint32_t frequency_min;
124 uint32_t frequency_max;
125 uint32_t frequency_stepsize;
126 uint32_t frequency_tolerance;
127 uint32_t symbol_rate_min;
128 uint32_t symbol_rate_max;
129 uint32_t symbol_rate_tolerance; /⋆ ppm ⋆/
130 uint32_t notifier_delay; /⋆ ms ⋆/
136 <section id="dvb-diseqc-master-cmd">
137 <title>diseqc master command</title>
139 <para>A message sent from the frontend to DiSEqC capable equipment.</para>
141 struct dvb_diseqc_master_cmd {
142 uint8_t msg [6]; /⋆ { framing, address, command, data[3] } ⋆/
143 uint8_t msg_len; /⋆ valid values are 3...6 ⋆/
147 <section role="subsection" id="dvb-diseqc-slave-reply">
148 <title>diseqc slave reply</title>
150 <para>A reply to the frontend from DiSEqC 2.0 capable equipment.</para>
152 struct dvb_diseqc_slave_reply {
153 uint8_t msg [4]; /⋆ { framing, data [3] } ⋆/
154 uint8_t msg_len; /⋆ valid values are 0...4, 0 means no msg ⋆/
155 int timeout; /⋆ return from ioctl after timeout ms with ⋆/
156 }; /⋆ errorcode when no message was received ⋆/
160 <section id="fe-sec-voltage-t">
161 <title>diseqc slave reply</title>
162 <para>The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation
163 (horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched
164 consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
166 typedef enum fe_sec_voltage {
173 <section id="fe-sec-tone-mode-t">
174 <title>SEC continuous tone</title>
176 <para>The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
177 high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
178 be switched consistently to the DiSEqC commands as described in the DiSEqC
181 typedef enum fe_sec_tone_mode {
184 } fe_sec_tone_mode_t;
188 <section id="fe-sec-mini-cmd-t">
189 <title>SEC tone burst</title>
191 <para>The 22KHz tone burst is usually used with non-DiSEqC capable switches to select
192 between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to
193 be switched consistently to the DiSEqC commands as described in the DiSEqC
196 typedef enum fe_sec_mini_cmd {
205 <section id="fe-status-t">
206 <title>frontend status</title>
207 <para>Several functions of the frontend device use the fe_status data type defined
210 typedef enum fe_status {
211 FE_HAS_SIGNAL = 0x01, /⋆ found something above the noise level ⋆/
212 FE_HAS_CARRIER = 0x02, /⋆ found a DVB signal ⋆/
213 FE_HAS_VITERBI = 0x04, /⋆ FEC is stable ⋆/
214 FE_HAS_SYNC = 0x08, /⋆ found sync bytes ⋆/
215 FE_HAS_LOCK = 0x10, /⋆ everything's working... ⋆/
216 FE_TIMEDOUT = 0x20, /⋆ no lock within the last ~2 seconds ⋆/
217 FE_REINIT = 0x40 /⋆ frontend was reinitialized, ⋆/
218 } fe_status_t; /⋆ application is recommned to reset ⋆/
220 <para>to indicate the current state and/or state changes of the frontend hardware.
225 <section id="dvb-frontend-parameters">
226 <title>frontend parameters</title>
227 <para>The kind of parameters passed to the frontend device for tuning depend on
228 the kind of hardware you are using.</para>
229 <para>The struct <constant>dvb_frontend_parameters</constant> uses an
230 union with specific per-system parameters. However, as newer delivery systems
231 required more data, the structure size weren't enough to fit, and just
232 extending its size would break the existing applications. So, those parameters
233 were replaced by the usage of <link linkend="FE_GET_SET_PROPERTY">
234 <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> ioctl's. The
235 new API is flexible enough to add new parameters to existing delivery systems,
236 and to add newer delivery systems.</para>
237 <para>So, newer applications should use <link linkend="FE_GET_SET_PROPERTY">
238 <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in
239 order to be able to support the newer System Delivery like DVB-S2, DVB-T2,
240 DVB-C2, ISDB, etc.</para>
241 <para>All kinds of parameters are combined as an union in the FrontendParameters structure:</para>
243 struct dvb_frontend_parameters {
244 uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/
245 /⋆ intermediate frequency in kHz for QPSK ⋆/
246 fe_spectral_inversion_t inversion;
248 struct dvb_qpsk_parameters qpsk;
249 struct dvb_qam_parameters qam;
250 struct dvb_ofdm_parameters ofdm;
251 struct dvb_vsb_parameters vsb;
255 <para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate
256 frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
257 the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
258 OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz.
260 <section id="dvb-qpsk-parameters">
261 <title>QPSK parameters</title>
262 <para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para>
264 struct dvb_qpsk_parameters {
265 uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/
266 fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/
270 <section id="dvb-qam-parameters">
271 <title>QAM parameters</title>
272 <para>for cable QAM frontend you use the <constant>dvb_qam_parameters</constant> structure:</para>
274 struct dvb_qam_parameters {
275 uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/
276 fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/
277 fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/
281 <section id="dvb-vsb-parameters">
282 <title>VSB parameters</title>
283 <para>ATSC frontends are supported by the <constant>dvb_vsb_parameters</constant> structure:</para>
285 struct dvb_vsb_parameters {
286 fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/
290 <section id="dvb-ofdm-parameters">
291 <title>OFDM parameters</title>
292 <para>DVB-T frontends are supported by the <constant>dvb_ofdm_parameters</constant> structure:</para>
294 struct dvb_ofdm_parameters {
295 fe_bandwidth_t bandwidth;
296 fe_code_rate_t code_rate_HP; /⋆ high priority stream code rate ⋆/
297 fe_code_rate_t code_rate_LP; /⋆ low priority stream code rate ⋆/
298 fe_modulation_t constellation; /⋆ modulation type (see above) ⋆/
299 fe_transmit_mode_t transmission_mode;
300 fe_guard_interval_t guard_interval;
301 fe_hierarchy_t hierarchy_information;
305 <section id="fe-spectral-inversion-t">
306 <title>frontend spectral inversion</title>
307 <para>The Inversion field can take one of these values:
310 typedef enum fe_spectral_inversion {
314 } fe_spectral_inversion_t;
316 <para>It indicates if spectral inversion should be presumed or not. In the automatic setting
317 (<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
321 <section id="fe-code-rate-t">
322 <title>frontend code rate</title>
323 <para>The possible values for the <constant>fec_inner</constant> field used on
324 <link refend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and
325 <link refend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are:
328 typedef enum fe_code_rate {
343 <para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
347 <section id="fe-modulation-t">
348 <title>frontend modulation type for QAM, OFDM and VSB</title>
349 <para>For cable and terrestrial frontends, e. g. for
350 <link refend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>,
351 <link refend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and
352 <link refend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>,
353 it needs to specify the quadrature modulation mode which can be one of the following:
356 typedef enum fe_modulation {
373 <para>Finally, there are several more parameters for OFDM:
375 <section id="fe-transmit-mode-t">
376 <title>Number of carriers per channel</title>
378 typedef enum fe_transmit_mode {
379 TRANSMISSION_MODE_2K,
380 TRANSMISSION_MODE_8K,
381 TRANSMISSION_MODE_AUTO,
382 TRANSMISSION_MODE_4K,
383 TRANSMISSION_MODE_1K,
384 TRANSMISSION_MODE_16K,
385 TRANSMISSION_MODE_32K,
386 } fe_transmit_mode_t;
389 <section id="fe-bandwidth-t">
390 <title>frontend bandwidth</title>
392 typedef enum fe_bandwidth {
403 <section id="fe-guard-interval-t">
404 <title>frontend guard inverval</title>
406 typedef enum fe_guard_interval {
412 GUARD_INTERVAL_1_128,
413 GUARD_INTERVAL_19_128,
414 GUARD_INTERVAL_19_256,
415 } fe_guard_interval_t;
418 <section id="fe-hierarchy-t">
419 <title>frontend hierarchy</title>
421 typedef enum fe_hierarchy {
433 <section id="dvb-frontend-event">
434 <title>frontend events</title>
436 struct dvb_frontend_event {
438 struct dvb_frontend_parameters parameters;
445 <section id="frontend_fcalls">
446 <title>Frontend Function Calls</title>
448 <section id="frontend_f_open">
449 <title>open()</title>
450 <para>DESCRIPTION</para>
451 <informaltable><tgroup cols="1"><tbody><row>
453 <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
454 for subsequent use. Usually the first thing to do after a successful open is to
455 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
456 <para>The device can be opened in read-only mode, which only allows monitoring of
457 device status and statistics, or read/write mode, which allows any kind of use
458 (e.g. performing tuning operations.)
460 <para>In a system with multiple front-ends, it is usually the case that multiple devices
461 cannot be open in read/write mode simultaneously. As long as a front-end
462 device is opened in read/write mode, other open() calls in read/write mode will
463 either fail or block, depending on whether non-blocking or blocking mode was
464 specified. A front-end device opened in blocking mode can later be put into
465 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
466 system call. This is a standard system call, documented in the Linux manual
467 page for fcntl. When an open() call has succeeded, the device will be ready
468 for use in the specified mode. This implies that the corresponding hardware is
469 powered up, and that other front-ends may have been powered down to make
470 that possible.</para>
472 </row></tbody></tgroup></informaltable>
474 <para>SYNOPSIS</para>
475 <informaltable><tgroup cols="1"><tbody><row><entry
477 <para>int open(const char ⋆deviceName, int flags);</para>
479 </row></tbody></tgroup></informaltable>
482 <informaltable><tgroup cols="2"><tbody><row><entry
488 <para>Name of specific video device.</para>
492 <para>int flags</para>
495 <para>A bit-wise OR of the following flags:</para>
501 <para>O_RDONLY read-only access</para>
507 <para>O_RDWR read/write access</para>
513 <para>O_NONBLOCK open in non-blocking mode</para>
519 <para>(blocking mode is the default)</para>
521 </row></tbody></tgroup></informaltable>
522 <para>RETURN VALUE</para>
523 <informaltable><tgroup cols="2"><tbody><row><entry
528 <para>Device driver not loaded/available.</para>
532 <para>EINTERNAL</para>
535 <para>Internal error.</para>
542 <para>Device or resource busy.</para>
549 <para>Invalid argument.</para>
551 </row></tbody></tgroup></informaltable>
554 <section id="frontend_f_close">
555 <title>close()</title>
558 <informaltable><tgroup cols="1"><tbody><row><entry
560 <para>This system call closes a previously opened front-end device. After closing
561 a front-end device, its corresponding hardware might be powered down
562 automatically.</para>
564 </row></tbody></tgroup></informaltable>
567 <informaltable><tgroup cols="1"><tbody><row><entry
569 <para>int close(int fd);</para>
571 </row></tbody></tgroup></informaltable>
574 <informaltable><tgroup cols="2"><tbody><row><entry
579 <para>File descriptor returned by a previous call to open().</para>
581 </row></tbody></tgroup></informaltable>
582 <para>RETURN VALUE</para>
583 <informaltable><tgroup cols="2"><tbody><row><entry
588 <para>fd is not a valid open file descriptor.</para>
590 </row></tbody></tgroup></informaltable>
593 <section id="FE_READ_STATUS">
594 <title>FE_READ_STATUS</title>
597 <informaltable><tgroup cols="1"><tbody><row><entry
599 <para>This ioctl call returns status information about the front-end. This call only
600 requires read-only access to the device.</para>
602 </row></tbody></tgroup></informaltable>
605 <informaltable><tgroup cols="1"><tbody><row><entry
607 <para>int ioctl(int fd, int request = <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>,
608 fe_status_t ⋆status);</para>
610 </row></tbody></tgroup></informaltable>
614 <informaltable><tgroup cols="2"><tbody><row><entry
619 <para>File descriptor returned by a previous call to open().</para>
623 <para>int request</para>
626 <para>Equals <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> for this command.</para>
630 <para>struct fe_status_t
634 <para>Points to the location where the front-end status word is
637 </row></tbody></tgroup></informaltable>
638 <para>RETURN VALUE</para>
639 <informaltable><tgroup cols="2"><tbody><row><entry
644 <para>fd is not a valid open file descriptor.</para>
651 <para>status points to invalid address.</para>
653 </row></tbody></tgroup></informaltable>
656 <section id="FE_READ_BER">
657 <title>FE_READ_BER</title>
660 <informaltable><tgroup cols="1"><tbody><row><entry
662 <para>This ioctl call returns the bit error rate for the signal currently
663 received/demodulated by the front-end. For this command, read-only access to
664 the device is sufficient.</para>
666 </row></tbody></tgroup></informaltable>
669 <informaltable><tgroup cols="1"><tbody><row><entry
671 <para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>,
672 uint32_t ⋆ber);</para>
674 </row></tbody></tgroup></informaltable>
677 <informaltable><tgroup cols="2"><tbody><row><entry
682 <para>File descriptor returned by a previous call to open().</para>
686 <para>int request</para>
689 <para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para>
693 <para>uint32_t *ber</para>
696 <para>The bit error rate is stored into *ber.</para>
698 </row></tbody></tgroup></informaltable>
703 <section id="FE_READ_SNR">
704 <title>FE_READ_SNR</title>
708 <informaltable><tgroup cols="1"><tbody><row><entry
710 <para>This ioctl call returns the signal-to-noise ratio for the signal currently received
711 by the front-end. For this command, read-only access to the device is sufficient.</para>
713 </row></tbody></tgroup></informaltable>
716 <informaltable><tgroup cols="1"><tbody><row><entry
718 <para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t
721 </row></tbody></tgroup></informaltable>
724 <informaltable><tgroup cols="2"><tbody><row><entry
729 <para>File descriptor returned by a previous call to open().</para>
733 <para>int request</para>
736 <para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para>
740 <para>int16_t *snr</para>
743 <para>The signal-to-noise ratio is stored into *snr.</para>
745 </row></tbody></tgroup></informaltable>
750 <section id="FE_READ_SIGNAL_STRENGTH">
751 <title>FE_READ_SIGNAL_STRENGTH</title>
754 <informaltable><tgroup cols="1"><tbody><row><entry
756 <para>This ioctl call returns the signal strength value for the signal currently received
757 by the front-end. For this command, read-only access to the device is sufficient.</para>
759 </row></tbody></tgroup></informaltable>
762 <informaltable><tgroup cols="1"><tbody><row><entry
764 <para>int ioctl( int fd, int request =
765 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t ⋆strength);</para>
767 </row></tbody></tgroup></informaltable>
771 <informaltable><tgroup cols="2"><tbody><row><entry
776 <para>File descriptor returned by a previous call to open().</para>
780 <para>int request</para>
783 <para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this
788 <para>int16_t *strength</para>
791 <para>The signal strength value is stored into *strength.</para>
793 </row></tbody></tgroup></informaltable>
798 <section id="FE_READ_UNCORRECTED_BLOCKS">
799 <title>FE_READ_UNCORRECTED_BLOCKS</title>
802 <informaltable><tgroup cols="1"><tbody><row><entry
804 <para>This ioctl call returns the number of uncorrected blocks detected by the device
805 driver during its lifetime. For meaningful measurements, the increment in block
806 count during a specific time interval should be calculated. For this command,
807 read-only access to the device is sufficient.</para>
811 <para>Note that the counter will wrap to zero after its maximum count has been
814 </row></tbody></tgroup></informaltable>
817 <informaltable><tgroup cols="1"><tbody><row><entry
819 <para>int ioctl( int fd, int request =
820 <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t ⋆ublocks);</para>
822 </row></tbody></tgroup></informaltable>
825 <informaltable><tgroup cols="2"><tbody><row><entry
830 <para>File descriptor returned by a previous call to open().</para>
834 <para>int request</para>
837 <para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this
842 <para>uint32_t *ublocks</para>
845 <para>The total number of uncorrected blocks seen by the driver
848 </row></tbody></tgroup></informaltable>
853 <section id="FE_SET_FRONTEND">
854 <title>FE_SET_FRONTEND</title>
857 <informaltable><tgroup cols="1"><tbody><row><entry
859 <para>This ioctl call starts a tuning operation using specified parameters. The result
860 of this call will be successful if the parameters were valid and the tuning could
861 be initiated. The result of the tuning operation in itself, however, will arrive
862 asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and
863 FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before
864 the previous one was completed, the previous operation will be aborted in favor
865 of the new one. This command requires read/write access to the device.</para>
867 </row></tbody></tgroup></informaltable>
871 <informaltable><tgroup cols="1"><tbody><row><entry
873 <para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>,
874 struct dvb_frontend_parameters ⋆p);</para>
876 </row></tbody></tgroup></informaltable>
879 <informaltable><tgroup cols="2"><tbody><row><entry
884 <para>File descriptor returned by a previous call to open().</para>
888 <para>int request</para>
891 <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
896 dvb_frontend_parameters
900 <para>Points to parameters for tuning operation.</para>
902 </row></tbody></tgroup></informaltable>
905 <informaltable><tgroup cols="2"><tbody><row><entry
910 <para>Maximum supported symbol rate reached.</para>
912 </row></tbody></tgroup></informaltable>
915 <section id="FE_GET_FRONTEND">
916 <title>FE_GET_FRONTEND</title>
919 <informaltable><tgroup cols="1"><tbody><row><entry
921 <para>This ioctl call queries the currently effective frontend parameters. For this
922 command, read-only access to the device is sufficient.</para>
924 </row></tbody></tgroup></informaltable>
928 <informaltable><tgroup cols="1"><tbody><row><entry
930 <para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>,
931 struct dvb_frontend_parameters ⋆p);</para>
933 </row></tbody></tgroup></informaltable>
937 <informaltable><tgroup cols="2"><tbody><row><entry
942 <para>File descriptor returned by a previous call to open().</para>
946 <para>int request</para>
949 <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
954 dvb_frontend_parameters
958 <para>Points to parameters for tuning operation.</para>
960 </row></tbody></tgroup></informaltable>
963 <informaltable><tgroup cols="2"><tbody><row><entry
968 <para>Maximum supported symbol rate reached.</para>
970 </row></tbody></tgroup></informaltable>
974 <section id="FE_GET_EVENT">
975 <title>FE_GET_EVENT</title>
978 <informaltable><tgroup cols="1"><tbody><row><entry
980 <para>This ioctl call returns a frontend event if available. If an event is not
981 available, the behavior depends on whether the device is in blocking or
982 non-blocking mode. In the latter case, the call fails immediately with errno
983 set to EWOULDBLOCK. In the former case, the call blocks until an event
984 becomes available.</para>
988 <para>The standard Linux poll() and/or select() system calls can be used with the
989 device file descriptor to watch for new events. For select(), the file descriptor
990 should be included in the exceptfds argument, and for poll(), POLLPRI should
991 be specified as the wake-up condition. Since the event queue allocated is
992 rather small (room for 8 events), the queue must be serviced regularly to avoid
993 overflow. If an overflow happens, the oldest event is discarded from the queue,
994 and an error (EOVERFLOW) occurs the next time the queue is read. After
995 reporting the error condition in this fashion, subsequent
996 <link linkend="FE_GET_EVENT">FE_GET_EVENT</link>
997 calls will return events from the queue as usual.</para>
1001 <para>For the sake of implementation simplicity, this command requires read/write
1002 access to the device.</para>
1004 </row></tbody></tgroup></informaltable>
1008 <informaltable><tgroup cols="1"><tbody><row><entry
1010 <para>int ioctl(int fd, int request = QPSK_GET_EVENT,
1011 struct dvb_frontend_event ⋆ev);</para>
1013 </row></tbody></tgroup></informaltable>
1017 <informaltable><tgroup cols="2"><tbody><row><entry
1022 <para>File descriptor returned by a previous call to open().</para>
1026 <para>int request</para>
1029 <para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para>
1038 <para>Points to the location where the event,</para>
1044 <para>if any, is to be stored.</para>
1046 </row></tbody></tgroup></informaltable>
1049 <informaltable><tgroup cols="2"><tbody><row><entry
1051 <para>EWOULDBLOCK</para>
1054 <para>There is no event pending, and the device is in
1055 non-blocking mode.</para>
1059 <para>EOVERFLOW</para>
1062 <para>Overflow in event queue - one or more events were lost.</para>
1064 </row></tbody></tgroup></informaltable>
1067 <section id="FE_GET_INFO">
1068 <title>FE_GET_INFO</title>
1071 <informaltable><tgroup cols="1"><tbody><row><entry
1073 <para>This ioctl call returns information about the front-end. This call only requires
1074 read-only access to the device.</para>
1076 </row></tbody></tgroup></informaltable>
1080 <informaltable><tgroup cols="1"><tbody><row><entry
1082 <para> int ioctl(int fd, int request = <link linkend="FE_GET_INFO">FE_GET_INFO</link>, struct
1083 dvb_frontend_info ⋆info);</para>
1085 </row></tbody></tgroup></informaltable>
1089 <informaltable><tgroup cols="2"><tbody><row><entry
1094 <para>File descriptor returned by a previous call to open().</para>
1098 <para>int request</para>
1101 <para>Equals <link linkend="FE_GET_INFO">FE_GET_INFO</link> for this command.</para>
1110 <para>Points to the location where the front-end information is
1111 to be stored.</para>
1113 </row></tbody></tgroup></informaltable>
1117 <section id="FE_DISEQC_RESET_OVERLOAD">
1118 <title>FE_DISEQC_RESET_OVERLOAD</title>
1121 <informaltable><tgroup cols="1"><tbody><row><entry
1123 <para>If the bus has been automatically powered off due to power overload, this ioctl
1124 call restores the power to the bus. The call requires read/write access to the
1125 device. This call has no effect if the device is manually powered off. Not all
1126 DVB adapters support this ioctl.</para>
1128 </row></tbody></tgroup></informaltable>
1132 <informaltable><tgroup cols="1"><tbody><row><entry
1134 <para>int ioctl(int fd, int request =
1135 <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para>
1137 </row></tbody></tgroup></informaltable>
1140 <informaltable><tgroup cols="2"><tbody><row><entry
1145 <para>File descriptor returned by a previous call to open().</para>
1149 <para>int request</para>
1152 <para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this
1155 </row></tbody></tgroup></informaltable>
1160 <section id="FE_DISEQC_SEND_MASTER_CMD">
1161 <title>FE_DISEQC_SEND_MASTER_CMD</title>
1164 <informaltable><tgroup cols="1"><tbody><row><entry
1166 <para>This ioctl call is used to send a a DiSEqC command.</para>
1168 </row></tbody></tgroup></informaltable>
1171 <informaltable><tgroup cols="1"><tbody><row><entry
1173 <para>int ioctl(int fd, int request =
1174 <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct
1175 dvb_diseqc_master_cmd ⋆cmd);</para>
1177 </row></tbody></tgroup></informaltable>
1181 <informaltable><tgroup cols="2"><tbody><row><entry
1186 <para>File descriptor returned by a previous call to open().</para>
1190 <para>int request</para>
1193 <para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this
1199 dvb_diseqc_master_cmd
1203 <para>Pointer to the command to be transmitted.</para>
1205 </row></tbody></tgroup></informaltable>
1210 <section id="FE_DISEQC_RECV_SLAVE_REPLY">
1211 <title>FE_DISEQC_RECV_SLAVE_REPLY</title>
1214 <informaltable><tgroup cols="1"><tbody><row><entry
1216 <para>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</para>
1218 </row></tbody></tgroup></informaltable>
1222 <informaltable><tgroup cols="1"><tbody><row><entry
1224 <para>int ioctl(int fd, int request =
1225 <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct
1226 dvb_diseqc_slave_reply ⋆reply);</para>
1228 </row></tbody></tgroup></informaltable>
1232 <informaltable><tgroup cols="2"><tbody><row><entry
1237 <para>File descriptor returned by a previous call to open().</para>
1241 <para>int request</para>
1244 <para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this
1250 dvb_diseqc_slave_reply
1254 <para>Pointer to the command to be received.</para>
1256 </row></tbody></tgroup></informaltable>
1260 <section id="FE_DISEQC_SEND_BURST">
1261 <title>FE_DISEQC_SEND_BURST</title>
1264 <informaltable><tgroup cols="1"><tbody><row><entry
1266 <para>This ioctl call is used to send a 22KHz tone burst.</para>
1268 </row></tbody></tgroup></informaltable>
1272 <informaltable><tgroup cols="1"><tbody><row><entry
1274 <para>int ioctl(int fd, int request =
1275 <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para>
1277 </row></tbody></tgroup></informaltable>
1281 <informaltable><tgroup cols="2"><tbody><row><entry
1286 <para>File descriptor returned by a previous call to open().</para>
1290 <para>int request</para>
1293 <para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para>
1297 <para>fe_sec_mini_cmd_t
1301 <para>burst A or B.</para>
1303 </row></tbody></tgroup></informaltable>
1308 <section id="FE_SET_TONE">
1309 <title>FE_SET_TONE</title>
1312 <informaltable><tgroup cols="1"><tbody><row><entry
1314 <para>This call is used to set the generation of the continuous 22kHz tone. This call
1315 requires read/write permissions.</para>
1317 </row></tbody></tgroup></informaltable>
1320 <informaltable><tgroup cols="1"><tbody><row><entry
1322 <para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>,
1323 fe_sec_tone_mode_t tone);</para>
1325 </row></tbody></tgroup></informaltable>
1328 <informaltable><tgroup cols="2"><tbody><row><entry
1333 <para>File descriptor returned by a previous call to open().</para>
1337 <para>int request</para>
1340 <para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para>
1344 <para>fe_sec_tone_mode_t
1348 <para>The requested tone generation mode (on/off).</para>
1350 </row></tbody></tgroup></informaltable>
1354 <section id="FE_SET_VOLTAGE">
1355 <title>FE_SET_VOLTAGE</title>
1358 <informaltable><tgroup cols="1"><tbody><row><entry
1360 <para>This call is used to set the bus voltage. This call requires read/write
1363 </row></tbody></tgroup></informaltable>
1366 <informaltable><tgroup cols="1"><tbody><row><entry
1368 <para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>,
1369 fe_sec_voltage_t voltage);</para>
1371 </row></tbody></tgroup></informaltable>
1375 <informaltable><tgroup cols="2"><tbody><row><entry
1380 <para>File descriptor returned by a previous call to open().</para>
1384 <para>int request</para>
1387 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1391 <para>fe_sec_voltage_t
1395 <para>The requested bus voltage.</para>
1397 </row></tbody></tgroup></informaltable>
1402 <section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
1403 <title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
1406 <informaltable><tgroup cols="1"><tbody><row><entry
1408 <para>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate
1409 for long cables). This call requires read/write permissions. Not all DVB
1410 adapters support this ioctl.</para>
1412 </row></tbody></tgroup></informaltable>
1416 <informaltable><tgroup cols="1"><tbody><row><entry
1418 <para>int ioctl(int fd, int request =
1419 <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para>
1421 </row></tbody></tgroup></informaltable>
1425 <informaltable><tgroup cols="2"><tbody><row><entry
1430 <para>File descriptor returned by a previous call to open().</para>
1434 <para>int request</para>
1437 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1441 <para>int high</para>
1444 <para>The requested bus voltage.</para>
1446 </row></tbody></tgroup></informaltable>
1451 <section id="FE_SET_FRONTEND_TUNE_MODE">
1452 <title>FE_SET_FRONTEND_TUNE_MODE</title>
1453 <para>DESCRIPTION</para>
1454 <informaltable><tgroup cols="1"><tbody><row>
1455 <entry align="char">
1456 <para>Allow setting tuner mode flags to the frontend.</para>
1458 </row></tbody></tgroup></informaltable>
1460 <para>SYNOPSIS</para>
1461 <informaltable><tgroup cols="1"><tbody><row>
1462 <entry align="char">
1463 <para>int ioctl(int fd, int request =
1464 <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para>
1466 </row></tbody></tgroup></informaltable>
1468 <para>PARAMETERS</para>
1469 <informaltable><tgroup cols="2"><tbody><row>
1470 <entry align="char">
1471 <para>unsigned int flags</para>
1473 <entry align="char">
1475 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.
1478 </row></tbody></tgroup></informaltable>
1483 <section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
1484 <title>FE_DISHNETWORK_SEND_LEGACY_CMD</title>
1485 <para>DESCRIPTION</para>
1486 <informaltable><tgroup cols="1"><tbody><row>
1487 <entry align="char">
1488 <para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para>
1489 <para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para>
1490 <para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para>
1492 </row></tbody></tgroup></informaltable>
1494 <para>SYNOPSIS</para>
1495 <informaltable><tgroup cols="1"><tbody><row>
1496 <entry align="char">
1497 <para>int ioctl(int fd, int request =
1498 <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para>
1500 </row></tbody></tgroup></informaltable>
1502 <para>PARAMETERS</para>
1503 <informaltable><tgroup cols="2"><tbody><row>
1504 <entry align="char">
1505 <para>unsigned long cmd</para>
1507 <entry align="char">
1509 sends the specified raw cmd to the dish via DISEqC.
1512 </row></tbody></tgroup></informaltable>