The DVB frontend API was designed to support three types of delivery systems: Terrestrial systems: DVB-T, DVB-T2, ATSC, ATSC M/H, ISDB-T, DVB-H, DTMB, CMMB Cable systems: DVB-C Annex A/C, ClearQAM (DVB-C Annex B), ISDB-C Satellital systems: DVB-S, DVB-S2, DVB Turbo, ISDB-S, DSS The DVB frontend controls several sub-devices including: Tuner, Digital TV demodulator Low noise amplifier (LNA) Satellite Equipment Control (SEC) hardware (only for Satellite). The frontend can be accessed through /dev/dvb/adapter?/frontend?. Data types and ioctl definitions can be accessed by including linux/dvb/frontend.h in your application. NOTE: Transmission via the internet (DVB-IP) is not yet handled by this API but a future extension is possible. On Satellital systems, the API support for the Satellite Equipment Control (SEC) allows to power control and to send/receive signals to control the antenna subsystem, selecting the polarization and choosing the Intermediate Frequency IF) of the Low Noise Block Converter Feed Horn (LNBf). It supports the DiSEqC and V-SEC protocols. The DiSEqC (digital SEC) specification is available at Eutelsat.
Querying frontend information Information about the frontend can be queried with FE_GET_INFO.
&sub-frontend_get_info;
Querying frontend status Information about the frontend tuner locking status can be queried with FE_READ_STATUS.
&sub-frontend_read_status; &sub-dvbproperty;
diseqc master command A message sent from the frontend to DiSEqC capable equipment. struct dvb_diseqc_master_cmd { uint8_t msg [6]; /⋆ { framing, address, command, data[3] } ⋆/ uint8_t msg_len; /⋆ valid values are 3...6 ⋆/ };
diseqc slave reply A reply to the frontend from DiSEqC 2.0 capable equipment. struct dvb_diseqc_slave_reply { uint8_t msg [4]; /⋆ { framing, data [3] } ⋆/ uint8_t msg_len; /⋆ valid values are 0...4, 0 means no msg ⋆/ int timeout; /⋆ return from ioctl after timeout ms with ⋆/ }; /⋆ errorcode when no message was received ⋆/
diseqc slave reply The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation (horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched consistently to the DiSEqC commands as described in the DiSEqC spec. typedef enum fe_sec_voltage { SEC_VOLTAGE_13, SEC_VOLTAGE_18 } fe_sec_voltage_t;
SEC continuous tone The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to be switched consistently to the DiSEqC commands as described in the DiSEqC spec. typedef enum fe_sec_tone_mode { SEC_TONE_ON, SEC_TONE_OFF } fe_sec_tone_mode_t;
SEC tone burst The 22KHz tone burst is usually used with non-DiSEqC capable switches to select between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to be switched consistently to the DiSEqC commands as described in the DiSEqC spec. typedef enum fe_sec_mini_cmd { SEC_MINI_A, SEC_MINI_B } fe_sec_mini_cmd_t;
frontend spectral inversion The Inversion field can take one of these values: typedef enum fe_spectral_inversion { INVERSION_OFF, INVERSION_ON, INVERSION_AUTO } fe_spectral_inversion_t; It indicates if spectral inversion should be presumed or not. In the automatic setting (INVERSION_AUTO) the hardware will try to figure out the correct setting by itself.
frontend code rate The possible values for the fec_inner field used on struct dvb_qpsk_parameters and struct dvb_qam_parameters are: typedef enum fe_code_rate { FEC_NONE = 0, FEC_1_2, FEC_2_3, FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7, FEC_7_8, FEC_8_9, FEC_AUTO, FEC_3_5, FEC_9_10, } fe_code_rate_t; which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto detection.
frontend modulation type for QAM, OFDM and VSB For cable and terrestrial frontends, e. g. for struct dvb_qpsk_parameters, struct dvb_qam_parameters and struct dvb_qam_parameters, it needs to specify the quadrature modulation mode which can be one of the following: typedef enum fe_modulation { QPSK, QAM_16, QAM_32, QAM_64, QAM_128, QAM_256, QAM_AUTO, VSB_8, VSB_16, PSK_8, APSK_16, APSK_32, DQPSK, } fe_modulation_t;
More OFDM parameters
Number of carriers per channel typedef enum fe_transmit_mode { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_AUTO, TRANSMISSION_MODE_4K, TRANSMISSION_MODE_1K, TRANSMISSION_MODE_16K, TRANSMISSION_MODE_32K, } fe_transmit_mode_t;
frontend bandwidth typedef enum fe_bandwidth { BANDWIDTH_8_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_6_MHZ, BANDWIDTH_AUTO, BANDWIDTH_5_MHZ, BANDWIDTH_10_MHZ, BANDWIDTH_1_712_MHZ, } fe_bandwidth_t;
frontend guard inverval typedef enum fe_guard_interval { GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_8, GUARD_INTERVAL_1_4, GUARD_INTERVAL_AUTO, GUARD_INTERVAL_1_128, GUARD_INTERVAL_19_128, GUARD_INTERVAL_19_256, } fe_guard_interval_t;
frontend hierarchy typedef enum fe_hierarchy { HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_4, HIERARCHY_AUTO } fe_hierarchy_t;
Frontend Function Calls
open() DESCRIPTION This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) for subsequent use. Usually the first thing to do after a successful open is to find out the frontend type with FE_GET_INFO. The device can be opened in read-only mode, which only allows monitoring of device status and statistics, or read/write mode, which allows any kind of use (e.g. performing tuning operations.) In a system with multiple front-ends, it is usually the case that multiple devices cannot be open in read/write mode simultaneously. As long as a front-end device is opened in read/write mode, other open() calls in read/write mode will either fail or block, depending on whether non-blocking or blocking mode was specified. A front-end device opened in blocking mode can later be put into non-blocking mode (and vice versa) using the F_SETFL command of the fcntl system call. This is a standard system call, documented in the Linux manual page for fcntl. When an open() call has succeeded, the device will be ready for use in the specified mode. This implies that the corresponding hardware is powered up, and that other front-ends may have been powered down to make that possible. SYNOPSIS int open(const char ⋆deviceName, int flags); PARAMETERS const char *deviceName Name of specific video device. int flags A bit-wise OR of the following flags: O_RDONLY read-only access O_RDWR read/write access O_NONBLOCK open in non-blocking mode (blocking mode is the default) RETURN VALUE ENODEV Device driver not loaded/available. EINTERNAL Internal error. EBUSY Device or resource busy. EINVAL Invalid argument.
close() DESCRIPTION This system call closes a previously opened front-end device. After closing a front-end device, its corresponding hardware might be powered down automatically. SYNOPSIS int close(int fd); PARAMETERS int fd File descriptor returned by a previous call to open(). RETURN VALUE EBADF fd is not a valid open file descriptor.
FE_DISEQC_RESET_OVERLOAD DESCRIPTION If the bus has been automatically powered off due to power overload, this ioctl call restores the power to the bus. The call requires read/write access to the device. This call has no effect if the device is manually powered off. Not all DVB adapters support this ioctl. SYNOPSIS int ioctl(int fd, int request = FE_DISEQC_RESET_OVERLOAD); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_DISEQC_RESET_OVERLOAD for this command. &return-value-dvb;
FE_DISEQC_SEND_MASTER_CMD DESCRIPTION This ioctl call is used to send a a DiSEqC command. SYNOPSIS int ioctl(int fd, int request = FE_DISEQC_SEND_MASTER_CMD, struct dvb_diseqc_master_cmd ⋆cmd); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_DISEQC_SEND_MASTER_CMD for this command. struct dvb_diseqc_master_cmd *cmd Pointer to the command to be transmitted. &return-value-dvb;
FE_DISEQC_RECV_SLAVE_REPLY DESCRIPTION This ioctl call is used to receive reply to a DiSEqC 2.0 command. SYNOPSIS int ioctl(int fd, int request = FE_DISEQC_RECV_SLAVE_REPLY, struct dvb_diseqc_slave_reply ⋆reply); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_DISEQC_RECV_SLAVE_REPLY for this command. struct dvb_diseqc_slave_reply *reply Pointer to the command to be received. &return-value-dvb;
FE_DISEQC_SEND_BURST DESCRIPTION This ioctl call is used to send a 22KHz tone burst. SYNOPSIS int ioctl(int fd, int request = FE_DISEQC_SEND_BURST, fe_sec_mini_cmd_t burst); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_DISEQC_SEND_BURST for this command. fe_sec_mini_cmd_t burst burst A or B. &return-value-dvb;
FE_SET_TONE DESCRIPTION This call is used to set the generation of the continuous 22kHz tone. This call requires read/write permissions. SYNOPSIS int ioctl(int fd, int request = FE_SET_TONE, fe_sec_tone_mode_t tone); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_SET_TONE for this command. fe_sec_tone_mode_t tone The requested tone generation mode (on/off). &return-value-dvb;
FE_SET_VOLTAGE DESCRIPTION This call is used to set the bus voltage. This call requires read/write permissions. SYNOPSIS int ioctl(int fd, int request = FE_SET_VOLTAGE, fe_sec_voltage_t voltage); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_SET_VOLTAGE for this command. fe_sec_voltage_t voltage The requested bus voltage. &return-value-dvb;
FE_ENABLE_HIGH_LNB_VOLTAGE DESCRIPTION If high != 0 enables slightly higher voltages instead of 13/18V (to compensate for long cables). This call requires read/write permissions. Not all DVB adapters support this ioctl. SYNOPSIS int ioctl(int fd, int request = FE_ENABLE_HIGH_LNB_VOLTAGE, int high); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals FE_SET_VOLTAGE for this command. int high The requested bus voltage. &return-value-dvb;
FE_SET_FRONTEND_TUNE_MODE DESCRIPTION Allow setting tuner mode flags to the frontend. SYNOPSIS int ioctl(int fd, int request = FE_SET_FRONTEND_TUNE_MODE, unsigned int flags); PARAMETERS unsigned int flags 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. &return-value-dvb;
DVB Frontend legacy API (a. k. a. DVBv3) The usage of this API is deprecated, as it doesn't support all digital TV standards, doesn't provide good statistics measurements and provides incomplete information. This is kept only to support legacy applications. &sub-frontend_legacy_api;