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="frontend_type">
24 <title>frontend type</title>
26 <para>For historical reasons frontend types are named after the type of modulation used in
29 typedef enum fe_type {
30 FE_QPSK, /⋆ DVB-S ⋆/
31 FE_QAM, /⋆ DVB-C ⋆/
32 FE_OFDM /⋆ DVB-T ⋆/
38 <section id="frontend_caps">
39 <title>frontend capabilities</title>
41 <para>Capabilities describe what a frontend can do. Some capabilities can only be supported for
42 a specific frontend type.</para>
44 typedef enum fe_caps {
46 FE_CAN_INVERSION_AUTO = 0x1,
50 FE_CAN_FEC_4_5 = 0x10,
51 FE_CAN_FEC_5_6 = 0x20,
52 FE_CAN_FEC_6_7 = 0x40,
53 FE_CAN_FEC_7_8 = 0x80,
54 FE_CAN_FEC_8_9 = 0x100,
55 FE_CAN_FEC_AUTO = 0x200,
57 FE_CAN_QAM_16 = 0x800,
58 FE_CAN_QAM_32 = 0x1000,
59 FE_CAN_QAM_64 = 0x2000,
60 FE_CAN_QAM_128 = 0x4000,
61 FE_CAN_QAM_256 = 0x8000,
62 FE_CAN_QAM_AUTO = 0x10000,
63 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
64 FE_CAN_BANDWIDTH_AUTO = 0x40000,
65 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
66 FE_CAN_HIERARCHY_AUTO = 0x100000,
67 FE_CAN_8VSB = 0x200000,
68 FE_CAN_16VSB = 0x400000,
69 FE_HAS_EXTENDED_CAPS = 0x800000,
70 FE_CAN_TURBO_FEC = 0x8000000,
71 FE_CAN_2G_MODULATION = 0x10000000,
72 FE_NEEDS_BENDING = 0x20000000,
73 FE_CAN_RECOVER = 0x40000000,
74 FE_CAN_MUTE_TS = 0x80000000
79 <section id="frontend_info">
80 <title>frontend information</title>
82 <para>Information about the frontend ca be queried with
83 <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
86 struct dvb_frontend_info {
89 uint32_t frequency_min;
90 uint32_t frequency_max;
91 uint32_t frequency_stepsize;
92 uint32_t frequency_tolerance;
93 uint32_t symbol_rate_min;
94 uint32_t symbol_rate_max;
95 uint32_t symbol_rate_tolerance; /⋆ ppm ⋆/
96 uint32_t notifier_delay; /⋆ ms ⋆/
102 <section id="frontend_diseqc">
103 <title>diseqc master command</title>
105 <para>A message sent from the frontend to DiSEqC capable equipment.</para>
107 struct dvb_diseqc_master_cmd {
108 uint8_t msg [6]; /⋆ { framing, address, command, data[3] } ⋆/
109 uint8_t msg_len; /⋆ valid values are 3...6 ⋆/
113 <section role="subsection">
114 <title>diseqc slave reply</title>
116 <para>A reply to the frontend from DiSEqC 2.0 capable equipment.</para>
118 struct dvb_diseqc_slave_reply {
119 uint8_t msg [4]; /⋆ { framing, data [3] } ⋆/
120 uint8_t msg_len; /⋆ valid values are 0...4, 0 means no msg ⋆/
121 int timeout; /⋆ return from ioctl after timeout ms with ⋆/
122 }; /⋆ errorcode when no message was received ⋆/
126 <section id="frontend_diseqc_slave_reply">
127 <title>diseqc slave reply</title>
128 <para>The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation
129 (horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched
130 consistently to the DiSEqC commands as described in the DiSEqC spec.</para>
132 typedef enum fe_sec_voltage {
139 <section id="frontend_sec_tone">
140 <title>SEC continuous tone</title>
142 <para>The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the
143 high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to
144 be switched consistently to the DiSEqC commands as described in the DiSEqC
147 typedef enum fe_sec_tone_mode {
150 } fe_sec_tone_mode_t;
154 <section id="frontend_sec_burst">
155 <title>SEC tone burst</title>
157 <para>The 22KHz tone burst is usually used with non-DiSEqC capable switches to select
158 between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to
159 be switched consistently to the DiSEqC commands as described in the DiSEqC
162 typedef enum fe_sec_mini_cmd {
171 <section id="frontend_status">
172 <title>frontend status</title>
173 <para>Several functions of the frontend device use the fe_status data type defined
176 typedef enum fe_status {
177 FE_HAS_SIGNAL = 0x01, /⋆ found something above the noise level ⋆/
178 FE_HAS_CARRIER = 0x02, /⋆ found a DVB signal ⋆/
179 FE_HAS_VITERBI = 0x04, /⋆ FEC is stable ⋆/
180 FE_HAS_SYNC = 0x08, /⋆ found sync bytes ⋆/
181 FE_HAS_LOCK = 0x10, /⋆ everything's working... ⋆/
182 FE_TIMEDOUT = 0x20, /⋆ no lock within the last ~2 seconds ⋆/
183 FE_REINIT = 0x40 /⋆ frontend was reinitialized, ⋆/
184 } fe_status_t; /⋆ application is recommned to reset ⋆/
186 <para>to indicate the current state and/or state changes of the frontend hardware.
191 <section id="frontend_params">
192 <title>frontend parameters</title>
193 <para>The kind of parameters passed to the frontend device for tuning depend on
194 the kind of hardware you are using. All kinds of parameters are combined as an
195 union in the FrontendParameters structure:</para>
197 struct dvb_frontend_parameters {
198 uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/
199 /⋆ intermediate frequency in kHz for QPSK ⋆/
200 fe_spectral_inversion_t inversion;
202 struct dvb_qpsk_parameters qpsk;
203 struct dvb_qam_parameters qam;
204 struct dvb_ofdm_parameters ofdm;
208 <para>For satellite QPSK frontends you have to use the <constant>QPSKParameters</constant> member defined by</para>
210 struct dvb_qpsk_parameters {
211 uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/
212 fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/
215 <para>for cable QAM frontend you use the <constant>QAMParameters</constant> structure</para>
217 struct dvb_qam_parameters {
218 uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/
219 fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/
220 fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/
223 <para>DVB-T frontends are supported by the <constant>OFDMParamters</constant> structure
226 struct dvb_ofdm_parameters {
227 fe_bandwidth_t bandwidth;
228 fe_code_rate_t code_rate_HP; /⋆ high priority stream code rate ⋆/
229 fe_code_rate_t code_rate_LP; /⋆ low priority stream code rate ⋆/
230 fe_modulation_t constellation; /⋆ modulation type (see above) ⋆/
231 fe_transmit_mode_t transmission_mode;
232 fe_guard_interval_t guard_interval;
233 fe_hierarchy_t hierarchy_information;
236 <para>In the case of QPSK frontends the <constant>Frequency</constant> field specifies the intermediate
237 frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
238 the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
239 OFDM frontends the Frequency specifies the absolute frequency and is given in
242 <para>The Inversion field can take one of these values:
245 typedef enum fe_spectral_inversion {
249 } fe_spectral_inversion_t;
251 <para>It indicates if spectral inversion should be presumed or not. In the automatic setting
252 (<constant>INVERSION_AUTO</constant>) the hardware will try to figure out the correct setting by
255 <para>The possible values for the <constant>FEC_inner</constant> field are
258 typedef enum fe_code_rate {
271 <para>which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto
274 <para>For cable and terrestrial frontends (QAM and OFDM) one also has to specify the quadrature
275 modulation mode which can be one of the following:
278 typedef enum fe_modulation {
288 <para>Finally, there are several more parameters for OFDM:
291 typedef enum fe_transmit_mode {
292 TRANSMISSION_MODE_2K,
293 TRANSMISSION_MODE_8K,
294 TRANSMISSION_MODE_AUTO
295 } fe_transmit_mode_t;
298 typedef enum fe_bandwidth {
306 typedef enum fe_guard_interval {
312 } fe_guard_interval_t;
315 typedef enum fe_hierarchy {
326 <section id="frontend_events">
327 <title>frontend events</title>
329 struct dvb_frontend_event {
331 struct dvb_frontend_parameters parameters;
338 <section id="frontend_fcalls">
339 <title>Frontend Function Calls</title>
341 <section id="frontend_f_open">
342 <title>open()</title>
343 <para>DESCRIPTION</para>
344 <informaltable><tgroup cols="1"><tbody><row>
346 <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
347 for subsequent use. Usually the first thing to do after a successful open is to
348 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
349 <para>The device can be opened in read-only mode, which only allows monitoring of
350 device status and statistics, or read/write mode, which allows any kind of use
351 (e.g. performing tuning operations.)
353 <para>In a system with multiple front-ends, it is usually the case that multiple devices
354 cannot be open in read/write mode simultaneously. As long as a front-end
355 device is opened in read/write mode, other open() calls in read/write mode will
356 either fail or block, depending on whether non-blocking or blocking mode was
357 specified. A front-end device opened in blocking mode can later be put into
358 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl
359 system call. This is a standard system call, documented in the Linux manual
360 page for fcntl. When an open() call has succeeded, the device will be ready
361 for use in the specified mode. This implies that the corresponding hardware is
362 powered up, and that other front-ends may have been powered down to make
363 that possible.</para>
365 </row></tbody></tgroup></informaltable>
367 <para>SYNOPSIS</para>
368 <informaltable><tgroup cols="1"><tbody><row><entry
370 <para>int open(const char ⋆deviceName, int flags);</para>
372 </row></tbody></tgroup></informaltable>
375 <informaltable><tgroup cols="2"><tbody><row><entry
381 <para>Name of specific video device.</para>
385 <para>int flags</para>
388 <para>A bit-wise OR of the following flags:</para>
394 <para>O_RDONLY read-only access</para>
400 <para>O_RDWR read/write access</para>
406 <para>O_NONBLOCK open in non-blocking mode</para>
412 <para>(blocking mode is the default)</para>
414 </row></tbody></tgroup></informaltable>
417 <informaltable><tgroup cols="2"><tbody><row><entry
422 <para>Device driver not loaded/available.</para>
426 <para>EINTERNAL</para>
429 <para>Internal error.</para>
436 <para>Device or resource busy.</para>
443 <para>Invalid argument.</para>
445 </row></tbody></tgroup></informaltable>
448 <section id="frontend_f_close">
449 <title>close()</title>
452 <informaltable><tgroup cols="1"><tbody><row><entry
454 <para>This system call closes a previously opened front-end device. After closing
455 a front-end device, its corresponding hardware might be powered down
456 automatically.</para>
458 </row></tbody></tgroup></informaltable>
461 <informaltable><tgroup cols="1"><tbody><row><entry
463 <para>int close(int fd);</para>
465 </row></tbody></tgroup></informaltable>
468 <informaltable><tgroup cols="2"><tbody><row><entry
473 <para>File descriptor returned by a previous call to open().</para>
475 </row></tbody></tgroup></informaltable>
478 <informaltable><tgroup cols="2"><tbody><row><entry
483 <para>fd is not a valid open file descriptor.</para>
485 </row></tbody></tgroup></informaltable>
488 <section id="FE_READ_STATUS">
489 <title>FE_READ_STATUS</title>
492 <informaltable><tgroup cols="1"><tbody><row><entry
494 <para>This ioctl call returns status information about the front-end. This call only
495 requires read-only access to the device.</para>
497 </row></tbody></tgroup></informaltable>
500 <informaltable><tgroup cols="1"><tbody><row><entry
502 <para>int ioctl(int fd, int request = <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>,
503 fe_status_t ⋆status);</para>
505 </row></tbody></tgroup></informaltable>
509 <informaltable><tgroup cols="2"><tbody><row><entry
514 <para>File descriptor returned by a previous call to open().</para>
518 <para>int request</para>
521 <para>Equals <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> for this command.</para>
525 <para>struct fe_status_t
529 <para>Points to the location where the front-end status word is
532 </row></tbody></tgroup></informaltable>
535 <informaltable><tgroup cols="2"><tbody><row><entry
540 <para>fd is not a valid open file descriptor.</para>
547 <para>status points to invalid address.</para>
549 </row></tbody></tgroup></informaltable>
552 <section id="FE_READ_BER">
553 <title>FE_READ_BER</title>
556 <informaltable><tgroup cols="1"><tbody><row><entry
558 <para>This ioctl call returns the bit error rate for the signal currently
559 received/demodulated by the front-end. For this command, read-only access to
560 the device is sufficient.</para>
562 </row></tbody></tgroup></informaltable>
565 <informaltable><tgroup cols="1"><tbody><row><entry
567 <para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>,
568 uint32_t ⋆ber);</para>
570 </row></tbody></tgroup></informaltable>
573 <informaltable><tgroup cols="2"><tbody><row><entry
578 <para>File descriptor returned by a previous call to open().</para>
582 <para>int request</para>
585 <para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para>
589 <para>uint32_t *ber</para>
592 <para>The bit error rate is stored into *ber.</para>
594 </row></tbody></tgroup></informaltable>
597 <informaltable><tgroup cols="2"><tbody><row><entry
602 <para>fd is not a valid open file descriptor.</para>
609 <para>ber points to invalid address.</para>
613 <para>ENOSIGNAL</para>
616 <para>There is no signal, thus no meaningful bit error rate. Also
617 returned if the front-end is not turned on.</para>
624 <para>Function not available for this device.</para>
626 </row></tbody></tgroup></informaltable>
629 <section id="FE_READ_SNR">
630 <title>FE_READ_SNR</title>
634 <informaltable><tgroup cols="1"><tbody><row><entry
636 <para>This ioctl call returns the signal-to-noise ratio for the signal currently received
637 by the front-end. For this command, read-only access to the device is sufficient.</para>
639 </row></tbody></tgroup></informaltable>
642 <informaltable><tgroup cols="1"><tbody><row><entry
644 <para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t
647 </row></tbody></tgroup></informaltable>
650 <informaltable><tgroup cols="2"><tbody><row><entry
655 <para>File descriptor returned by a previous call to open().</para>
659 <para>int request</para>
662 <para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para>
666 <para>int16_t *snr</para>
669 <para>The signal-to-noise ratio is stored into *snr.</para>
671 </row></tbody></tgroup></informaltable>
675 <informaltable><tgroup cols="2"><tbody><row><entry
680 <para>fd is not a valid open file descriptor.</para>
687 <para>snr points to invalid address.</para>
691 <para>ENOSIGNAL</para>
694 <para>There is no signal, thus no meaningful signal strength
695 value. Also returned if front-end is not turned on.</para>
702 <para>Function not available for this device.</para>
704 </row></tbody></tgroup></informaltable>
707 <section id="FE_READ_SIGNAL_STRENGTH">
708 <title>FE_READ_SIGNAL_STRENGTH</title>
711 <informaltable><tgroup cols="1"><tbody><row><entry
713 <para>This ioctl call returns the signal strength value for the signal currently received
714 by the front-end. For this command, read-only access to the device is sufficient.</para>
716 </row></tbody></tgroup></informaltable>
719 <informaltable><tgroup cols="1"><tbody><row><entry
721 <para>int ioctl( int fd, int request =
722 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t ⋆strength);</para>
724 </row></tbody></tgroup></informaltable>
728 <informaltable><tgroup cols="2"><tbody><row><entry
733 <para>File descriptor returned by a previous call to open().</para>
737 <para>int request</para>
740 <para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this
745 <para>int16_t *strength</para>
748 <para>The signal strength value is stored into *strength.</para>
750 </row></tbody></tgroup></informaltable>
753 <informaltable><tgroup cols="2"><tbody><row><entry
758 <para>fd is not a valid open file descriptor.</para>
765 <para>status points to invalid address.</para>
769 <para>ENOSIGNAL</para>
772 <para>There is no signal, thus no meaningful signal strength
773 value. Also returned if front-end is not turned on.</para>
780 <para>Function not available for this device.</para>
782 </row></tbody></tgroup></informaltable>
785 <section id="FE_READ_UNCORRECTED_BLOCKS">
786 <title>FE_READ_UNCORRECTED_BLOCKS</title>
789 <informaltable><tgroup cols="1"><tbody><row><entry
791 <para>This ioctl call returns the number of uncorrected blocks detected by the device
792 driver during its lifetime. For meaningful measurements, the increment in block
793 count during a specific time interval should be calculated. For this command,
794 read-only access to the device is sufficient.</para>
798 <para>Note that the counter will wrap to zero after its maximum count has been
801 </row></tbody></tgroup></informaltable>
804 <informaltable><tgroup cols="1"><tbody><row><entry
806 <para>int ioctl( int fd, int request =
807 <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t ⋆ublocks);</para>
809 </row></tbody></tgroup></informaltable>
812 <informaltable><tgroup cols="2"><tbody><row><entry
817 <para>File descriptor returned by a previous call to open().</para>
821 <para>int request</para>
824 <para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this
829 <para>uint32_t *ublocks</para>
832 <para>The total number of uncorrected blocks seen by the driver
835 </row></tbody></tgroup></informaltable>
838 <informaltable><tgroup cols="2"><tbody><row><entry
843 <para>fd is not a valid open file descriptor.</para>
850 <para>ublocks points to invalid address.</para>
857 <para>Function not available for this device.</para>
859 </row></tbody></tgroup></informaltable>
862 <section id="FE_SET_FRONTEND">
863 <title>FE_SET_FRONTEND</title>
866 <informaltable><tgroup cols="1"><tbody><row><entry
868 <para>This ioctl call starts a tuning operation using specified parameters. The result
869 of this call will be successful if the parameters were valid and the tuning could
870 be initiated. The result of the tuning operation in itself, however, will arrive
871 asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and
872 FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before
873 the previous one was completed, the previous operation will be aborted in favor
874 of the new one. This command requires read/write access to the device.</para>
876 </row></tbody></tgroup></informaltable>
880 <informaltable><tgroup cols="1"><tbody><row><entry
882 <para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>,
883 struct dvb_frontend_parameters ⋆p);</para>
885 </row></tbody></tgroup></informaltable>
888 <informaltable><tgroup cols="2"><tbody><row><entry
893 <para>File descriptor returned by a previous call to open().</para>
897 <para>int request</para>
900 <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
905 dvb_frontend_parameters
909 <para>Points to parameters for tuning operation.</para>
911 </row></tbody></tgroup></informaltable>
914 <informaltable><tgroup cols="2"><tbody><row><entry
919 <para>fd is not a valid open file descriptor.</para>
926 <para>p points to invalid address.</para>
933 <para>Maximum supported symbol rate reached.</para>
935 </row></tbody></tgroup></informaltable>
938 <section id="FE_GET_FRONTEND">
939 <title>FE_GET_FRONTEND</title>
942 <informaltable><tgroup cols="1"><tbody><row><entry
944 <para>This ioctl call queries the currently effective frontend parameters. For this
945 command, read-only access to the device is sufficient.</para>
947 </row></tbody></tgroup></informaltable>
951 <informaltable><tgroup cols="1"><tbody><row><entry
953 <para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>,
954 struct dvb_frontend_parameters ⋆p);</para>
956 </row></tbody></tgroup></informaltable>
960 <informaltable><tgroup cols="2"><tbody><row><entry
965 <para>File descriptor returned by a previous call to open().</para>
969 <para>int request</para>
972 <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
977 dvb_frontend_parameters
981 <para>Points to parameters for tuning operation.</para>
983 </row></tbody></tgroup></informaltable>
988 <informaltable><tgroup cols="2"><tbody><row><entry
993 <para>fd is not a valid open file descriptor.</para>
1000 <para>p points to invalid address.</para>
1007 <para>Maximum supported symbol rate reached.</para>
1009 </row></tbody></tgroup></informaltable>
1013 <section id="FE_GET_EVENT">
1014 <title>FE_GET_EVENT</title>
1017 <informaltable><tgroup cols="1"><tbody><row><entry
1019 <para>This ioctl call returns a frontend event if available. If an event is not
1020 available, the behavior depends on whether the device is in blocking or
1021 non-blocking mode. In the latter case, the call fails immediately with errno
1022 set to EWOULDBLOCK. In the former case, the call blocks until an event
1023 becomes available.</para>
1027 <para>The standard Linux poll() and/or select() system calls can be used with the
1028 device file descriptor to watch for new events. For select(), the file descriptor
1029 should be included in the exceptfds argument, and for poll(), POLLPRI should
1030 be specified as the wake-up condition. Since the event queue allocated is
1031 rather small (room for 8 events), the queue must be serviced regularly to avoid
1032 overflow. If an overflow happens, the oldest event is discarded from the queue,
1033 and an error (EOVERFLOW) occurs the next time the queue is read. After
1034 reporting the error condition in this fashion, subsequent
1035 <link linkend="FE_GET_EVENT">FE_GET_EVENT</link>
1036 calls will return events from the queue as usual.</para>
1040 <para>For the sake of implementation simplicity, this command requires read/write
1041 access to the device.</para>
1043 </row></tbody></tgroup></informaltable>
1047 <informaltable><tgroup cols="1"><tbody><row><entry
1049 <para>int ioctl(int fd, int request = QPSK_GET_EVENT,
1050 struct dvb_frontend_event ⋆ev);</para>
1052 </row></tbody></tgroup></informaltable>
1056 <informaltable><tgroup cols="2"><tbody><row><entry
1061 <para>File descriptor returned by a previous call to open().</para>
1065 <para>int request</para>
1068 <para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para>
1077 <para>Points to the location where the event,</para>
1083 <para>if any, is to be stored.</para>
1085 </row></tbody></tgroup></informaltable>
1089 <informaltable><tgroup cols="2"><tbody><row><entry
1094 <para>fd is not a valid open file descriptor.</para>
1101 <para>ev points to invalid address.</para>
1105 <para>EWOULDBLOCK</para>
1108 <para>There is no event pending, and the device is in
1109 non-blocking mode.</para>
1113 <para>EOVERFLOW</para>
1121 <para>Overflow in event queue - one or more events were lost.</para>
1123 </row></tbody></tgroup></informaltable>
1126 <section id="FE_GET_INFO">
1127 <title>FE_GET_INFO</title>
1130 <informaltable><tgroup cols="1"><tbody><row><entry
1132 <para>This ioctl call returns information about the front-end. This call only requires
1133 read-only access to the device.</para>
1135 </row></tbody></tgroup></informaltable>
1139 <informaltable><tgroup cols="1"><tbody><row><entry
1141 <para> int ioctl(int fd, int request = <link linkend="FE_GET_INFO">FE_GET_INFO</link>, struct
1142 dvb_frontend_info ⋆info);</para>
1144 </row></tbody></tgroup></informaltable>
1148 <informaltable><tgroup cols="2"><tbody><row><entry
1153 <para>File descriptor returned by a previous call to open().</para>
1157 <para>int request</para>
1160 <para>Equals <link linkend="FE_GET_INFO">FE_GET_INFO</link> for this command.</para>
1169 <para>Points to the location where the front-end information is
1170 to be stored.</para>
1172 </row></tbody></tgroup></informaltable>
1175 <informaltable><tgroup cols="2"><tbody><row><entry
1180 <para>fd is not a valid open file descriptor.</para>
1187 <para>info points to invalid address.</para>
1189 </row></tbody></tgroup></informaltable>
1192 <section id="FE_DISEQC_RESET_OVERLOAD">
1193 <title>FE_DISEQC_RESET_OVERLOAD</title>
1196 <informaltable><tgroup cols="1"><tbody><row><entry
1198 <para>If the bus has been automatically powered off due to power overload, this ioctl
1199 call restores the power to the bus. The call requires read/write access to the
1200 device. This call has no effect if the device is manually powered off. Not all
1201 DVB adapters support this ioctl.</para>
1203 </row></tbody></tgroup></informaltable>
1207 <informaltable><tgroup cols="1"><tbody><row><entry
1209 <para>int ioctl(int fd, int request =
1210 <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para>
1212 </row></tbody></tgroup></informaltable>
1215 <informaltable><tgroup cols="2"><tbody><row><entry
1220 <para>File descriptor returned by a previous call to open().</para>
1224 <para>int request</para>
1227 <para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this
1230 </row></tbody></tgroup></informaltable>
1234 <informaltable><tgroup cols="2"><tbody><row><entry
1239 <para>fd is not a valid file descriptor.</para>
1246 <para>Permission denied (needs read/write access).</para>
1250 <para>EINTERNAL</para>
1253 <para>Internal error in the device driver.</para>
1255 </row></tbody></tgroup></informaltable>
1258 <section id="FE_DISEQC_SEND_MASTER_CMD">
1259 <title>FE_DISEQC_SEND_MASTER_CMD</title>
1262 <informaltable><tgroup cols="1"><tbody><row><entry
1264 <para>This ioctl call is used to send a a DiSEqC command.</para>
1266 </row></tbody></tgroup></informaltable>
1269 <informaltable><tgroup cols="1"><tbody><row><entry
1271 <para>int ioctl(int fd, int request =
1272 <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct
1273 dvb_diseqc_master_cmd ⋆cmd);</para>
1275 </row></tbody></tgroup></informaltable>
1279 <informaltable><tgroup cols="2"><tbody><row><entry
1284 <para>File descriptor returned by a previous call to open().</para>
1288 <para>int request</para>
1291 <para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this
1297 dvb_diseqc_master_cmd
1301 <para>Pointer to the command to be transmitted.</para>
1303 </row></tbody></tgroup></informaltable>
1307 <informaltable><tgroup cols="2"><tbody><row><entry
1312 <para>fd is not a valid file descriptor.</para>
1319 <para>Seq points to an invalid address.</para>
1326 <para>The data structure referred to by seq is invalid in some
1334 <para>Permission denied (needs read/write access).</para>
1338 <para>EINTERNAL</para>
1341 <para>Internal error in the device driver.</para>
1343 </row></tbody></tgroup></informaltable>
1346 <section id="FE_DISEQC_RECV_SLAVE_REPLY">
1347 <title>FE_DISEQC_RECV_SLAVE_REPLY</title>
1350 <informaltable><tgroup cols="1"><tbody><row><entry
1352 <para>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</para>
1354 </row></tbody></tgroup></informaltable>
1358 <informaltable><tgroup cols="1"><tbody><row><entry
1360 <para>int ioctl(int fd, int request =
1361 <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct
1362 dvb_diseqc_slave_reply ⋆reply);</para>
1364 </row></tbody></tgroup></informaltable>
1368 <informaltable><tgroup cols="2"><tbody><row><entry
1373 <para>File descriptor returned by a previous call to open().</para>
1377 <para>int request</para>
1380 <para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this
1386 dvb_diseqc_slave_reply
1390 <para>Pointer to the command to be received.</para>
1392 </row></tbody></tgroup></informaltable>
1395 <informaltable><tgroup cols="2"><tbody><row><entry
1400 <para>fd is not a valid file descriptor.</para>
1407 <para>Seq points to an invalid address.</para>
1414 <para>The data structure referred to by seq is invalid in some
1422 <para>Permission denied (needs read/write access).</para>
1426 <para>EINTERNAL</para>
1429 <para>Internal error in the device driver.</para>
1431 </row></tbody></tgroup></informaltable>
1434 <section id="FE_DISEQC_SEND_BURST">
1435 <title>FE_DISEQC_SEND_BURST</title>
1438 <informaltable><tgroup cols="1"><tbody><row><entry
1440 <para>This ioctl call is used to send a 22KHz tone burst.</para>
1442 </row></tbody></tgroup></informaltable>
1446 <informaltable><tgroup cols="1"><tbody><row><entry
1448 <para>int ioctl(int fd, int request =
1449 <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para>
1451 </row></tbody></tgroup></informaltable>
1455 <informaltable><tgroup cols="2"><tbody><row><entry
1460 <para>File descriptor returned by a previous call to open().</para>
1464 <para>int request</para>
1467 <para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para>
1471 <para>fe_sec_mini_cmd_t
1475 <para>burst A or B.</para>
1477 </row></tbody></tgroup></informaltable>
1481 <informaltable><tgroup cols="2"><tbody><row><entry
1486 <para>fd is not a valid file descriptor.</para>
1493 <para>Seq points to an invalid address.</para>
1500 <para>The data structure referred to by seq is invalid in some
1508 <para>Permission denied (needs read/write access).</para>
1512 <para>EINTERNAL</para>
1515 <para>Internal error in the device driver.</para>
1517 </row></tbody></tgroup></informaltable>
1520 <section id="FE_SET_TONE">
1521 <title>FE_SET_TONE</title>
1524 <informaltable><tgroup cols="1"><tbody><row><entry
1526 <para>This call is used to set the generation of the continuous 22kHz tone. This call
1527 requires read/write permissions.</para>
1529 </row></tbody></tgroup></informaltable>
1532 <informaltable><tgroup cols="1"><tbody><row><entry
1534 <para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>,
1535 fe_sec_tone_mode_t tone);</para>
1537 </row></tbody></tgroup></informaltable>
1540 <informaltable><tgroup cols="2"><tbody><row><entry
1545 <para>File descriptor returned by a previous call to open().</para>
1549 <para>int request</para>
1552 <para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para>
1556 <para>fe_sec_tone_mode_t
1560 <para>The requested tone generation mode (on/off).</para>
1562 </row></tbody></tgroup></informaltable>
1565 <informaltable><tgroup cols="2"><tbody><row><entry
1570 <para>Device driver not loaded/available.</para>
1577 <para>Device or resource busy.</para>
1584 <para>Invalid argument.</para>
1591 <para>File not opened with read permissions.</para>
1595 <para>EINTERNAL</para>
1598 <para>Internal error in the device driver.</para>
1600 </row></tbody></tgroup></informaltable>
1603 <section id="FE_SET_VOLTAGE">
1604 <title>FE_SET_VOLTAGE</title>
1607 <informaltable><tgroup cols="1"><tbody><row><entry
1609 <para>This call is used to set the bus voltage. This call requires read/write
1612 </row></tbody></tgroup></informaltable>
1615 <informaltable><tgroup cols="1"><tbody><row><entry
1617 <para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>,
1618 fe_sec_voltage_t voltage);</para>
1620 </row></tbody></tgroup></informaltable>
1624 <informaltable><tgroup cols="2"><tbody><row><entry
1629 <para>File descriptor returned by a previous call to open().</para>
1633 <para>int request</para>
1636 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1640 <para>fe_sec_voltage_t
1644 <para>The requested bus voltage.</para>
1646 </row></tbody></tgroup></informaltable>
1650 <informaltable><tgroup cols="2"><tbody><row><entry
1655 <para>Device driver not loaded/available.</para>
1662 <para>Device or resource busy.</para>
1669 <para>Invalid argument.</para>
1676 <para>File not opened with read permissions.</para>
1680 <para>EINTERNAL</para>
1683 <para>Internal error in the device driver.</para>
1685 </row></tbody></tgroup></informaltable>
1688 <section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
1689 <title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
1692 <informaltable><tgroup cols="1"><tbody><row><entry
1694 <para>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate
1695 for long cables). This call requires read/write permissions. Not all DVB
1696 adapters support this ioctl.</para>
1698 </row></tbody></tgroup></informaltable>
1702 <informaltable><tgroup cols="1"><tbody><row><entry
1704 <para>int ioctl(int fd, int request =
1705 <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para>
1707 </row></tbody></tgroup></informaltable>
1711 <informaltable><tgroup cols="2"><tbody><row><entry
1716 <para>File descriptor returned by a previous call to open().</para>
1720 <para>int request</para>
1723 <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1727 <para>int high</para>
1730 <para>The requested bus voltage.</para>
1732 </row></tbody></tgroup></informaltable>
1736 <informaltable><tgroup cols="2"><tbody><row><entry
1741 <para>Device driver not loaded/available.</para>
1748 <para>Device or resource busy.</para>
1755 <para>Invalid argument.</para>
1762 <para>File not opened with read permissions.</para>
1766 <para>EINTERNAL</para>
1769 <para>Internal error in the device driver.</para>
1771 </row></tbody></tgroup></informaltable>
1774 <section id="FE_SET_FRONTEND_TUNE_MODE">
1775 <title>FE_SET_FRONTEND_TUNE_MODE</title>
1776 <para>DESCRIPTION</para>
1777 <informaltable><tgroup cols="1"><tbody><row>
1778 <entry align="char">
1779 <para>Allow setting tuner mode flags to the frontend.</para>
1781 </row></tbody></tgroup></informaltable>
1783 <para>SYNOPSIS</para>
1784 <informaltable><tgroup cols="1"><tbody><row>
1785 <entry align="char">
1786 <para>int ioctl(int fd, int request =
1787 <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para>
1789 </row></tbody></tgroup></informaltable>
1791 <para>PARAMETERS</para>
1792 <informaltable><tgroup cols="2"><tbody><row>
1793 <entry align="char">
1794 <para>unsigned int flags</para>
1796 <entry align="char">
1798 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.
1801 </row></tbody></tgroup></informaltable>
1804 <informaltable><tgroup cols="2"><tbody><row>
1805 <entry align="char"><para>EINVAL</para></entry>
1806 <entry align="char"><para>Invalid argument.</para></entry>
1807 </row></tbody></tgroup></informaltable>
1810 <section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
1811 <title>FE_DISHNETWORK_SEND_LEGACY_CMD</title>
1812 <para>DESCRIPTION</para>
1813 <informaltable><tgroup cols="1"><tbody><row>
1814 <entry align="char">
1815 <para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para>
1816 <para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para>
1817 <para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para>
1819 </row></tbody></tgroup></informaltable>
1821 <para>SYNOPSIS</para>
1822 <informaltable><tgroup cols="1"><tbody><row>
1823 <entry align="char">
1824 <para>int ioctl(int fd, int request =
1825 <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para>
1827 </row></tbody></tgroup></informaltable>
1829 <para>PARAMETERS</para>
1830 <informaltable><tgroup cols="2"><tbody><row>
1831 <entry align="char">
1832 <para>unsigned long cmd</para>
1834 <entry align="char">
1836 sends the specified raw cmd to the dish via DISEqC.
1839 </row></tbody></tgroup></informaltable>
1842 <informaltable><tgroup cols="1"><tbody><row>
1843 <entry align="char">
1844 <para>There are no errors in use for this call</para>
1846 </row></tbody></tgroup></informaltable>