media: docs: move uAPI book to userspace-api/media

Since 2017, there is an space reserved for userspace API,
created by changeset 1d596dee38 ("docs: Create a user-space API guide").

As the media subsystem was one of the first subsystems to use
Sphinx, until this patch, we were keeping things on a separate
place.

Let's just use the new location, as having all uAPI altogether
will likely make things easier for developers.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab
2020-03-04 10:21:39 +01:00
parent 5dfb8db56b
commit 54f38fcae5
464 changed files with 464 additions and 462 deletions
@@ -0,0 +1,66 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_BILINGUAL_CHANNEL_SELECT:
==============================
AUDIO_BILINGUAL_CHANNEL_SELECT
==============================
Name
----
AUDIO_BILINGUAL_CHANNEL_SELECT
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_BILINGUAL_CHANNEL_SELECT, struct *audio_channel_select)
:name: AUDIO_BILINGUAL_CHANNEL_SELECT
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- audio_channel_select_t ch
- Select the output format of the audio (mono left/right, stereo).
Description
-----------
This ioctl is obsolete. Do not use in new drivers. It has been replaced
by the V4L2 ``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK`` control
for MPEG decoders controlled through V4L2.
This ioctl call asks the Audio Device to select the requested channel
for bilingual streams if possible.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,66 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_CHANNEL_SELECT:
====================
AUDIO_CHANNEL_SELECT
====================
Name
----
AUDIO_CHANNEL_SELECT
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_CHANNEL_SELECT, struct *audio_channel_select)
:name: AUDIO_CHANNEL_SELECT
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- audio_channel_select_t ch
- Select the output format of the audio (mono left/right, stereo).
Description
-----------
This ioctl is for Digital TV devices only. To control a V4L2 decoder use the
V4L2 ``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK`` control instead.
This ioctl call asks the Audio Device to select the requested channel if
possible.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,55 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_CLEAR_BUFFER:
==================
AUDIO_CLEAR_BUFFER
==================
Name
----
AUDIO_CLEAR_BUFFER
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_CLEAR_BUFFER)
:name: AUDIO_CLEAR_BUFFER
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
Description
-----------
This ioctl call asks the Audio Device to clear all software and hardware
buffers of the audio decoder device.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,56 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_CONTINUE:
==============
AUDIO_CONTINUE
==============
Name
----
AUDIO_CONTINUE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_CONTINUE)
:name: AUDIO_CONTINUE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
Description
-----------
This ioctl restarts the decoding and playing process previously paused
with AUDIO_PAUSE command.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,63 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _audio_fclose:
========================
Digital TV audio close()
========================
Name
----
Digital TV audio close()
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int close(int fd)
:name: dvb-audio-close
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
Description
-----------
This system call closes a previously opened audio device.
Return Value
------------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EBADF``
- fd is not a valid open file descriptor.
@@ -0,0 +1,115 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _audio_fopen:
=======================
Digital TV audio open()
=======================
Name
----
Digital TV audio open()
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int open(const char *deviceName, int flags)
:name: dvb-audio-open
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- const char \*deviceName
- Name of specific audio device.
- .. row 2
- int flags
- A bit-wise OR of the following flags:
- .. row 3
-
- O_RDONLY read-only access
- .. row 4
-
- O_RDWR read/write access
- .. row 5
-
- O_NONBLOCK open in non-blocking mode
- .. row 6
-
- (blocking mode is the default)
Description
-----------
This system call opens a named audio device (e.g.
/dev/dvb/adapter0/audio0) for subsequent use. When an open() call has
succeeded, the device will be ready for use. The significance of
blocking or non-blocking mode is described in the documentation for
functions where there is a difference. It does not affect the semantics
of the open() call itself. A 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. Only one user can open the Audio Device
in O_RDWR mode. All other attempts to open the device in this mode will
fail, and an error code will be returned. If the Audio Device is opened
in O_RDONLY mode, the only ioctl call that can be used is
AUDIO_GET_STATUS. All other call will return with an error code.
Return Value
------------
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``ENODEV``
- Device driver not loaded/available.
- .. row 2
- ``EBUSY``
- Device or resource busy.
- .. row 3
- ``EINVAL``
- Invalid argument.
@@ -0,0 +1,91 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _audio_fwrite:
=========================
Digital TV audio write()
=========================
Name
----
Digital TV audio write()
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: size_t write(int fd, const void *buf, size_t count)
:name: dvb-audio-write
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- void \*buf
- Pointer to the buffer containing the PES data.
- .. row 3
- size_t count
- Size of buf.
Description
-----------
This system call can only be used if AUDIO_SOURCE_MEMORY is selected
in the ioctl call AUDIO_SELECT_SOURCE. The data provided shall be in
PES format. If O_NONBLOCK is not specified the function will block
until buffer space is available. The amount of data to be transferred is
implied by count.
Return Value
------------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EPERM``
- Mode AUDIO_SOURCE_MEMORY not selected.
- .. row 2
- ``ENOMEM``
- Attempted to write more data than the internal buffer can hold.
- .. row 3
- ``EBADF``
- fd is not a valid open file descriptor.
@@ -0,0 +1,63 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_GET_CAPABILITIES:
======================
AUDIO_GET_CAPABILITIES
======================
Name
----
AUDIO_GET_CAPABILITIES
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_GET_CAPABILITIES, unsigned int *cap)
:name: AUDIO_GET_CAPABILITIES
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- unsigned int \*cap
- Returns a bit array of supported sound formats.
Description
-----------
This ioctl call asks the Audio Device to tell us about the decoding
capabilities of the audio hardware.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,63 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_GET_STATUS:
================
AUDIO_GET_STATUS
================
Name
----
AUDIO_GET_STATUS
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_GET_STATUS, struct audio_status *status)
:name: AUDIO_GET_STATUS
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- struct audio_status \*status
- Returns the current state of Audio Device.
Description
-----------
This ioctl call asks the Audio Device to return the current state of the
Audio Device.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_PAUSE:
===========
AUDIO_PAUSE
===========
Name
----
AUDIO_PAUSE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_PAUSE)
:name: AUDIO_PAUSE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
Description
-----------
This ioctl call suspends the audio stream being played. Decoding and
playing are paused. It is then possible to restart again decoding and
playing process of the audio stream using AUDIO_CONTINUE command.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,56 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_PLAY:
==========
AUDIO_PLAY
==========
Name
----
AUDIO_PLAY
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_PLAY)
:name: AUDIO_PLAY
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
Description
-----------
This ioctl call asks the Audio Device to start playing an audio stream
from the selected source.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,65 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SELECT_SOURCE:
===================
AUDIO_SELECT_SOURCE
===================
Name
----
AUDIO_SELECT_SOURCE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_SELECT_SOURCE, struct audio_stream_source *source)
:name: AUDIO_SELECT_SOURCE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- audio_stream_source_t source
- Indicates the source that shall be used for the Audio stream.
Description
-----------
This ioctl call informs the audio device which source shall be used for
the input data. The possible sources are demux or memory. If
AUDIO_SOURCE_MEMORY is selected, the data is fed to the Audio Device
through the write command.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,67 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SET_AV_SYNC:
=================
AUDIO_SET_AV_SYNC
=================
Name
----
AUDIO_SET_AV_SYNC
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_SET_AV_SYNC, boolean state)
:name: AUDIO_SET_AV_SYNC
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- boolean state
- Tells the Digital TV subsystem if A/V synchronization shall be ON or OFF.
TRUE: AV-sync ON
FALSE: AV-sync OFF
Description
-----------
This ioctl call asks the Audio Device to turn ON or OFF A/V
synchronization.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,70 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SET_BYPASS_MODE:
=====================
AUDIO_SET_BYPASS_MODE
=====================
Name
----
AUDIO_SET_BYPASS_MODE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_SET_BYPASS_MODE, boolean mode)
:name: AUDIO_SET_BYPASS_MODE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- boolean mode
- Enables or disables the decoding of the current Audio stream in
the Digital TV subsystem.
TRUE: Bypass is disabled
FALSE: Bypass is enabled
Description
-----------
This ioctl call asks the Audio Device to bypass the Audio decoder and
forward the stream without decoding. This mode shall be used if streams
that cant be handled by the Digital TV system shall be decoded. Dolby
DigitalTM streams are automatically forwarded by the Digital TV subsystem if
the hardware can handle it.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,67 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SET_ID:
============
AUDIO_SET_ID
============
Name
----
AUDIO_SET_ID
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_SET_ID, int id)
:name: AUDIO_SET_ID
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- int id
- audio sub-stream id
Description
-----------
This ioctl selects which sub-stream is to be decoded if a program or
system stream is sent to the video device. If no audio stream type is
set the id has to be in [0xC0,0xDF] for MPEG sound, in [0x80,0x87] for
AC3 and in [0xA0,0xA7] for LPCM. More specifications may follow for
other stream types. If the stream type is set the id just specifies the
substream id of the audio stream and only the first 5 bits are
recognized.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,61 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SET_MIXER:
===============
AUDIO_SET_MIXER
===============
Name
----
AUDIO_SET_MIXER
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_SET_MIXER, struct audio_mixer *mix)
:name: AUDIO_SET_MIXER
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- audio_mixer_t \*mix
- mixer settings.
Description
-----------
This ioctl lets you adjust the mixer settings of the audio decoder.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,71 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SET_MUTE:
==============
AUDIO_SET_MUTE
==============
Name
----
AUDIO_SET_MUTE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_SET_MUTE, boolean state)
:name: AUDIO_SET_MUTE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- boolean state
- Indicates if audio device shall mute or not.
TRUE: Audio Mute
FALSE: Audio Un-mute
Description
-----------
This ioctl is for Digital TV devices only. To control a V4L2 decoder use the
V4L2 :ref:`VIDIOC_DECODER_CMD` with the
``V4L2_DEC_CMD_START_MUTE_AUDIO`` flag instead.
This ioctl call asks the audio device to mute the stream that is
currently being played.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,77 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_SET_STREAMTYPE:
====================
AUDIO_SET_STREAMTYPE
====================
Name
----
AUDIO_SET_STREAMTYPE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(fd, AUDIO_SET_STREAMTYPE, int type)
:name: AUDIO_SET_STREAMTYPE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- int type
- stream type
Description
-----------
This ioctl tells the driver which kind of audio stream to expect. This
is useful if the stream offers several audio sub-streams like LPCM and
AC3.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- type is not a valid or supported stream type.
@@ -0,0 +1,56 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _AUDIO_STOP:
==========
AUDIO_STOP
==========
Name
----
AUDIO_STOP
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_STOP)
:name: AUDIO_STOP
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
Description
-----------
This ioctl call asks the Audio Device to stop playing the current
stream.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,34 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb_audio:
#######################
Digital TV Audio Device
#######################
The Digital TV audio device controls the MPEG2 audio decoder of the Digital
TV hardware. It can be accessed through ``/dev/dvb/adapter?/audio?``. Data
types and and ioctl definitions can be accessed by including
``linux/dvb/audio.h`` in your application.
Please note that some Digital TV cards dont have their own MPEG decoder, which
results in the omission of the audio and video device.
These ioctls were also used by V4L2 to control MPEG decoders implemented
in V4L2. The use of these ioctls for that purpose has been made obsolete
and proper V4L2 ioctls or controls have been created to replace that
functionality.
.. toctree::
:maxdepth: 1
audio_data_types
audio_function_calls
@@ -0,0 +1,123 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _audio_data_types:
****************
Audio Data Types
****************
This section describes the structures, data types and defines used when
talking to the audio device.
.. c:type:: audio_stream_source
The audio stream source is set through the AUDIO_SELECT_SOURCE call
and can take the following values, depending on whether we are replaying
from an internal (demux) or external (user write) source.
.. code-block:: c
typedef enum {
AUDIO_SOURCE_DEMUX,
AUDIO_SOURCE_MEMORY
} audio_stream_source_t;
AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the
frontend or the DVR device) as the source of the video stream. If
AUDIO_SOURCE_MEMORY is selected the stream comes from the application
through the ``write()`` system call.
.. c:type:: audio_play_state
The following values can be returned by the AUDIO_GET_STATUS call
representing the state of audio playback.
.. code-block:: c
typedef enum {
AUDIO_STOPPED,
AUDIO_PLAYING,
AUDIO_PAUSED
} audio_play_state_t;
.. c:type:: audio_channel_select
The audio channel selected via AUDIO_CHANNEL_SELECT is determined by
the following values.
.. code-block:: c
typedef enum {
AUDIO_STEREO,
AUDIO_MONO_LEFT,
AUDIO_MONO_RIGHT,
AUDIO_MONO,
AUDIO_STEREO_SWAPPED
} audio_channel_select_t;
.. c:type:: audio_status
The AUDIO_GET_STATUS call returns the following structure informing
about various states of the playback operation.
.. code-block:: c
typedef struct audio_status {
boolean AV_sync_state;
boolean mute_state;
audio_play_state_t play_state;
audio_stream_source_t stream_source;
audio_channel_select_t channel_select;
boolean bypass_mode;
audio_mixer_t mixer_state;
} audio_status_t;
.. c:type:: audio_mixer
The following structure is used by the AUDIO_SET_MIXER call to set the
audio volume.
.. code-block:: c
typedef struct audio_mixer {
unsigned int volume_left;
unsigned int volume_right;
} audio_mixer_t;
.. _audio_encodings:
audio encodings
===============
A call to AUDIO_GET_CAPABILITIES returns an unsigned integer with the
following bits set according to the hardwares capabilities.
.. code-block:: c
#define AUDIO_CAP_DTS 1
#define AUDIO_CAP_LPCM 2
#define AUDIO_CAP_MP1 4
#define AUDIO_CAP_MP2 8
#define AUDIO_CAP_MP3 16
#define AUDIO_CAP_AAC 32
#define AUDIO_CAP_OGG 64
#define AUDIO_CAP_SDDS 128
#define AUDIO_CAP_AC3 256
@@ -0,0 +1,37 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _audio_function_calls:
********************
Audio Function Calls
********************
.. toctree::
:maxdepth: 1
audio-fopen
audio-fclose
audio-fwrite
audio-stop
audio-play
audio-pause
audio-continue
audio-select-source
audio-set-mute
audio-set-av-sync
audio-set-bypass-mode
audio-channel-select
audio-bilingual-channel-select
audio-get-status
audio-get-capabilities
audio-clear-buffer
audio-set-id
audio-set-mixer
audio-set-streamtype
@@ -0,0 +1,50 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _ca_fclose:
=====================
Digital TV CA close()
=====================
Name
----
Digital TV CA close()
Synopsis
--------
.. c:function:: int close(int fd)
:name: dvb-ca-close
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
Description
-----------
This system call closes a previously opened CA device.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,84 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _ca_fopen:
====================
Digital TV CA open()
====================
Name
----
Digital TV CA open()
Synopsis
--------
.. c:function:: int open(const char *name, int flags)
:name: dvb-ca-open
Arguments
---------
``name``
Name of specific Digital TV CA device.
``flags``
A bit-wise OR of the following flags:
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``O_RDONLY``
- read-only access
- - ``O_RDWR``
- read/write access
- - ``O_NONBLOCK``
- open in non-blocking mode
(blocking mode is the default)
Description
-----------
This system call opens a named ca device (e.g. ``/dev/dvb/adapter?/ca?``)
for subsequent use.
When an ``open()`` call has succeeded, the device will be ready for use. The
significance of blocking or non-blocking mode is described in the
documentation for functions where there is a difference. It does not
affect the semantics of the ``open()`` call itself. A 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.
Only one user can open the CA Device in ``O_RDWR`` mode. All other
attempts to open the device in this mode will fail, and an error code
will be returned.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,53 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_GET_CAP:
==========
CA_GET_CAP
==========
Name
----
CA_GET_CAP
Synopsis
--------
.. c:function:: int ioctl(fd, CA_GET_CAP, struct ca_caps *caps)
:name: CA_GET_CAP
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
``caps``
Pointer to struct :c:type:`ca_caps`.
Description
-----------
Queries the Kernel for information about the available CA and descrambler
slots, and their types.
Return Value
------------
On success 0 is returned and :c:type:`ca_caps` is filled.
On error, -1 is returned and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,49 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_GET_DESCR_INFO:
=================
CA_GET_DESCR_INFO
=================
Name
----
CA_GET_DESCR_INFO
Synopsis
--------
.. c:function:: int ioctl(fd, CA_GET_DESCR_INFO, struct ca_descr_info *desc)
:name: CA_GET_DESCR_INFO
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
``desc``
Pointer to struct :c:type:`ca_descr_info`.
Description
-----------
Returns information about all descrambler slots.
Return Value
------------
On success 0 is returned, and :c:type:`ca_descr_info` is filled.
On error -1 is returned, and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,59 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_GET_MSG:
==========
CA_GET_MSG
==========
Name
----
CA_GET_MSG
Synopsis
--------
.. c:function:: int ioctl(fd, CA_GET_MSG, struct ca_msg *msg)
:name: CA_GET_MSG
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
``msg``
Pointer to struct :c:type:`ca_msg`.
Description
-----------
Receives a message via a CI CA module.
.. note::
Please notice that, on most drivers, this is done by reading from
the /dev/adapter?/ca? device node.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,64 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_GET_SLOT_INFO:
================
CA_GET_SLOT_INFO
================
Name
----
CA_GET_SLOT_INFO
Synopsis
--------
.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, struct ca_slot_info *info)
:name: CA_GET_SLOT_INFO
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
``info``
Pointer to struct :c:type:`ca_slot_info`.
Description
-----------
Returns information about a CA slot identified by
:c:type:`ca_slot_info`.slot_num.
Return Value
------------
On success 0 is returned, and :c:type:`ca_slot_info` is filled.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``ENODEV``
- the slot is not available.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,51 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_RESET:
========
CA_RESET
========
Name
----
CA_RESET
Synopsis
--------
.. c:function:: int ioctl(fd, CA_RESET)
:name: CA_RESET
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
Description
-----------
Puts the Conditional Access hardware on its initial state. It should
be called before start using the CA hardware.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,58 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_SEND_MSG:
===========
CA_SEND_MSG
===========
Name
----
CA_SEND_MSG
Synopsis
--------
.. c:function:: int ioctl(fd, CA_SEND_MSG, struct ca_msg *msg)
:name: CA_SEND_MSG
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
``msg``
Pointer to struct :c:type:`ca_msg`.
Description
-----------
Sends a message via a CI CA module.
.. note::
Please notice that, on most drivers, this is done by writing
to the /dev/adapter?/ca? device node.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,53 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _CA_SET_DESCR:
============
CA_SET_DESCR
============
Name
----
CA_SET_DESCR
Synopsis
--------
.. c:function:: int ioctl(fd, CA_SET_DESCR, struct ca_descr *desc)
:name: CA_SET_DESCR
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
``msg``
Pointer to struct :c:type:`ca_descr`.
Description
-----------
CA_SET_DESCR is used for feeding descrambler CA slots with descrambling
keys (referred as control words).
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,32 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb_ca:
####################
Digital TV CA Device
####################
The Digital TV CA device controls the conditional access hardware. It
can be accessed through ``/dev/dvb/adapter?/ca?``. Data types and and ioctl
definitions can be accessed by including ``linux/dvb/ca.h`` in your
application.
.. note::
There are three ioctls at this API that aren't documented:
:ref:`CA_GET_MSG`, :ref:`CA_SEND_MSG` and :ref:`CA_SET_DESCR`.
Documentation for them are welcome.
.. toctree::
:maxdepth: 1
ca_data_types
ca_function_calls
ca_high_level
@@ -0,0 +1,16 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _ca_data_types:
*************
CA Data Types
*************
.. kernel-doc:: include/uapi/linux/dvb/ca.h
@@ -0,0 +1,27 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _ca_function_calls:
*****************
CA Function Calls
*****************
.. toctree::
:maxdepth: 1
ca-fopen
ca-fclose
ca-reset
ca-get-cap
ca-get-slot-info
ca-get-descr-info
ca-get-msg
ca-send-msg
ca-set-descr
@@ -0,0 +1,157 @@
.. SPDX-License-Identifier: GPL-2.0
The High level CI API
=====================
.. note::
This documentation is outdated.
This document describes the high level CI API as in accordance to the
Linux DVB API.
With the High Level CI approach any new card with almost any random
architecture can be implemented with this style, the definitions
inside the switch statement can be easily adapted for any card, thereby
eliminating the need for any additional ioctls.
The disadvantage is that the driver/hardware has to manage the rest. For
the application programmer it would be as simple as sending/receiving an
array to/from the CI ioctls as defined in the Linux DVB API. No changes
have been made in the API to accommodate this feature.
Why the need for another CI interface?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is one of the most commonly asked question. Well a nice question.
Strictly speaking this is not a new interface.
The CI interface is defined in the DVB API in ca.h as:
.. code-block:: c
typedef struct ca_slot_info {
int num; /* slot number */
int type; /* CA interface this slot supports */
#define CA_CI 1 /* CI high level interface */
#define CA_CI_LINK 2 /* CI link layer level interface */
#define CA_CI_PHYS 4 /* CI physical layer level interface */
#define CA_DESCR 8 /* built-in descrambler */
#define CA_SC 128 /* simple smart card interface */
unsigned int flags;
#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
#define CA_CI_MODULE_READY 2
} ca_slot_info_t;
This CI interface follows the CI high level interface, which is not
implemented by most applications. Hence this area is revisited.
This CI interface is quite different in the case that it tries to
accommodate all other CI based devices, that fall into the other categories.
This means that this CI interface handles the EN50221 style tags in the
Application layer only and no session management is taken care of by the
application. The driver/hardware will take care of all that.
This interface is purely an EN50221 interface exchanging APDU's. This
means that no session management, link layer or a transport layer do
exist in this case in the application to driver communication. It is
as simple as that. The driver/hardware has to take care of that.
With this High Level CI interface, the interface can be defined with the
regular ioctls.
All these ioctls are also valid for the High level CI interface
#define CA_RESET _IO('o', 128)
#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
On querying the device, the device yields information thus:
.. code-block:: none
CA_GET_SLOT_INFO
----------------------------
Command = [info]
APP: Number=[1]
APP: Type=[1]
APP: flags=[1]
APP: CI High level interface
APP: CA/CI Module Present
CA_GET_CAP
----------------------------
Command = [caps]
APP: Slots=[1]
APP: Type=[1]
APP: Descrambler keys=[16]
APP: Type=[1]
CA_SEND_MSG
----------------------------
Descriptors(Program Level)=[ 09 06 06 04 05 50 ff f1]
Found CA descriptor @ program level
(20) ES type=[2] ES pid=[201] ES length =[0 (0x0)]
(25) ES type=[4] ES pid=[301] ES length =[0 (0x0)]
ca_message length is 25 (0x19) bytes
EN50221 CA MSG=[ 9f 80 32 19 03 01 2d d1 f0 08 01 09 06 06 04 05 50 ff f1 02 e0 c9 00 00 04 e1 2d 00 00]
Not all ioctl's are implemented in the driver from the API, the other
features of the hardware that cannot be implemented by the API are achieved
using the CA_GET_MSG and CA_SEND_MSG ioctls. An EN50221 style wrapper is
used to exchange the data to maintain compatibility with other hardware.
.. code-block:: c
/* a message to/from a CI-CAM */
typedef struct ca_msg {
unsigned int index;
unsigned int type;
unsigned int length;
unsigned char msg[256];
} ca_msg_t;
The flow of data can be described thus,
.. code-block:: none
App (User)
-----
parse
|
|
v
en50221 APDU (package)
--------------------------------------
| | | High Level CI driver
| | |
| v |
| en50221 APDU (unpackage) |
| | |
| | |
| v |
| sanity checks |
| | |
| | |
| v |
| do (H/W dep) |
--------------------------------------
| Hardware
|
v
The High Level CI interface uses the EN50221 DVB standard, following a
standard ensures futureproofness.
@@ -0,0 +1,30 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb_demux:
#######################
Digital TV Demux Device
#######################
The Digital TV demux device controls the MPEG-TS filters for the
digital TV. If the driver and hardware supports, those filters are
implemented at the hardware. Otherwise, the Kernel provides a software
emulation.
It can be accessed through ``/dev/adapter?/demux?``. Data types and and
ioctl definitions can be accessed by including ``linux/dvb/dmx.h`` in
your application.
.. toctree::
:maxdepth: 1
dmx_types
dmx_fcalls
@@ -0,0 +1,56 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_ADD_PID:
===========
DMX_ADD_PID
===========
Name
----
DMX_ADD_PID
Synopsis
--------
.. c:function:: int ioctl(fd, DMX_ADD_PID, __u16 *pid)
:name: DMX_ADD_PID
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``pid``
PID number to be filtered.
Description
-----------
This ioctl call allows to add multiple PIDs to a transport stream filter
previously set up with :ref:`DMX_SET_PES_FILTER` and output equal to
:c:type:`DMX_OUT_TSDEMUX_TAP <dmx_output>`.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,97 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_EXPBUF:
****************
ioctl DMX_EXPBUF
****************
Name
====
DMX_EXPBUF - Export a buffer as a DMABUF file descriptor.
.. warning:: this API is still experimental
Synopsis
========
.. c:function:: int ioctl( int fd, DMX_EXPBUF, struct dmx_exportbuffer *argp )
:name: DMX_EXPBUF
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <dmx_fopen>`.
``argp``
Pointer to struct :c:type:`dmx_exportbuffer`.
Description
===========
This ioctl is an extension to the memory mapping I/O method.
It can be used to export a buffer as a DMABUF file at any time after
buffers have been allocated with the :ref:`DMX_REQBUFS` ioctl.
To export a buffer, applications fill struct :c:type:`dmx_exportbuffer`.
Applications must set the ``index`` field. Valid index numbers
range from zero to the number of buffers allocated with :ref:`DMX_REQBUFS`
(struct :c:type:`dmx_requestbuffers` ``count``) minus one.
Additional flags may be posted in the ``flags`` field. Refer to a manual
for open() for details. Currently only O_CLOEXEC, O_RDONLY, O_WRONLY,
and O_RDWR are supported.
All other fields must be set to zero. In the
case of multi-planar API, every plane is exported separately using
multiple :ref:`DMX_EXPBUF` calls.
After calling :ref:`DMX_EXPBUF` the ``fd`` field will be set by a
driver, on success. This is a DMABUF file descriptor. The application may
pass it to other DMABUF-aware devices. It is recommended to close a DMABUF
file when it is no longer used to allow the associated memory to be reclaimed.
Examples
========
.. code-block:: c
int buffer_export(int v4lfd, enum dmx_buf_type bt, int index, int *dmafd)
{
struct dmx_exportbuffer expbuf;
memset(&expbuf, 0, sizeof(expbuf));
expbuf.type = bt;
expbuf.index = index;
if (ioctl(v4lfd, DMX_EXPBUF, &expbuf) == -1) {
perror("DMX_EXPBUF");
return -1;
}
*dmafd = expbuf.fd;
return 0;
}
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
A queue is not in MMAP mode or DMABUF exporting is not supported or
``flags`` or ``index`` fields are invalid.
@@ -0,0 +1,52 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx_fclose:
========================
Digital TV demux close()
========================
Name
----
Digital TV demux close()
Synopsis
--------
.. c:function:: int close(int fd)
:name: dvb-dmx-close
Arguments
---------
``fd``
File descriptor returned by a previous call to
:c:func:`open() <dvb-dmx-open>`.
Description
-----------
This system call deactivates and deallocates a filter that was
previously allocated via the :c:func:`open() <dvb-dmx-open>` call.
Return Value
------------
On success 0 is returned.
On error, -1 is returned and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,98 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx_fopen:
=======================
Digital TV demux open()
=======================
Name
----
Digital TV demux open()
Synopsis
--------
.. c:function:: int open(const char *deviceName, int flags)
:name: dvb-dmx-open
Arguments
---------
``name``
Name of specific Digital TV demux device.
``flags``
A bit-wise OR of the following flags:
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
-
- ``O_RDONLY``
- read-only access
-
- ``O_RDWR``
- read/write access
-
- ``O_NONBLOCK``
- open in non-blocking mode
(blocking mode is the default)
Description
-----------
This system call, used with a device name of ``/dev/dvb/adapter?/demux?``,
allocates a new filter and returns a handle which can be used for
subsequent control of that filter. This call has to be made for each
filter to be used, i.e. every returned file descriptor is a reference to
a single filter. ``/dev/dvb/adapter?/dvr?`` is a logical device to be used
for retrieving Transport Streams for digital video recording. When
reading from this device a transport stream containing the packets from
all PES filters set in the corresponding demux device
(``/dev/dvb/adapter?/demux?``) having the output set to ``DMX_OUT_TS_TAP``.
A recorded Transport Stream is replayed by writing to this device.
The significance of blocking or non-blocking mode is described in the
documentation for functions where there is a difference. It does not
affect the semantics of the ``open()`` call itself. A 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.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``EMFILE``
- “Too many open files”, i.e. no more filters available.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,87 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx_fread:
=======================
Digital TV demux read()
=======================
Name
----
Digital TV demux read()
Synopsis
--------
.. c:function:: size_t read(int fd, void *buf, size_t count)
:name: dvb-dmx-read
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
``buf``
Buffer to be filled
``count``
Max number of bytes to read
Description
-----------
This system call returns filtered data, which might be section or Packetized
Elementary Stream (PES) data. The filtered data is transferred from
the drivers internal circular buffer to ``buf``. The maximum amount of data
to be transferred is implied by count.
.. note::
if a section filter created with
:c:type:`DMX_CHECK_CRC <dmx_sct_filter_params>` flag set,
data that fails on CRC check will be silently ignored.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``EWOULDBLOCK``
- No data to return and ``O_NONBLOCK`` was specified.
- - ``EOVERFLOW``
- The filtered data was not read from the buffer in due time,
resulting in non-read data being lost. The buffer is flushed.
- - ``ETIMEDOUT``
- The section was not loaded within the stated timeout period.
See ioctl :ref:`DMX_SET_FILTER` for how to set a timeout.
- - ``EFAULT``
- The driver failed to write to the callers buffer due to an
invalid \*buf pointer.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,79 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx_fwrite:
========================
Digital TV demux write()
========================
Name
----
Digital TV demux write()
Synopsis
--------
.. c:function:: ssize_t write(int fd, const void *buf, size_t count)
:name: dvb-dmx-write
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
``buf``
Buffer with data to be written
``count``
Number of bytes at the buffer
Description
-----------
This system call is only provided by the logical device
``/dev/dvb/adapter?/dvr?``, associated with the physical demux device that
provides the actual DVR functionality. It is used for replay of a
digitally recorded Transport Stream. Matching filters have to be defined
in the corresponding physical demux device, ``/dev/dvb/adapter?/demux?``.
The amount of data to be transferred is implied by count.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``EWOULDBLOCK``
- No data was written. This might happen if ``O_NONBLOCK`` was
specified and there is no more buffer space available (if
``O_NONBLOCK`` is not specified the function will block until buffer
space is available).
- - ``EBUSY``
- This error code indicates that there are conflicting requests. The
corresponding demux device is setup to receive data from the
front- end. Make sure that these filters are stopped and that the
filters with input set to ``DMX_IN_DVR`` are started.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,71 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_GET_PES_PIDS:
================
DMX_GET_PES_PIDS
================
Name
----
DMX_GET_PES_PIDS
Synopsis
--------
.. c:function:: int ioctl(fd, DMX_GET_PES_PIDS, __u16 pids[5])
:name: DMX_GET_PES_PIDS
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``pids``
Array used to store 5 Program IDs.
Description
-----------
This ioctl allows to query a DVB device to return the first PID used
by audio, video, textext, subtitle and PCR programs on a given service.
They're stored as:
======================= ======== =======================================
PID element position content
======================= ======== =======================================
pids[DMX_PES_AUDIO] 0 first audio PID
pids[DMX_PES_VIDEO] 1 first video PID
pids[DMX_PES_TELETEXT] 2 first teletext PID
pids[DMX_PES_SUBTITLE] 3 first subtitle PID
pids[DMX_PES_PCR] 4 first Program Clock Reference PID
======================= ======== =======================================
.. note::
A value equal to 0xffff means that the PID was not filled by the
Kernel.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,73 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_GET_STC:
===========
DMX_GET_STC
===========
Name
----
DMX_GET_STC
Synopsis
--------
.. c:function:: int ioctl( int fd, DMX_GET_STC, struct dmx_stc *stc)
:name: DMX_GET_STC
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``stc``
Pointer to :c:type:`dmx_stc` where the stc data is to be stored.
Description
-----------
This ioctl call returns the current value of the system time counter
(which is driven by a PES filter of type :c:type:`DMX_PES_PCR <dmx_ts_pes>`).
Some hardware supports more than one STC, so you must specify which one by
setting the :c:type:`num <dmx_stc>` field of stc before the ioctl (range 0...n).
The result is returned in form of a ratio with a 64 bit numerator
and a 32 bit denominator, so the real 90kHz STC value is
``stc->stc / stc->base``.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- .. row 1
- ``EINVAL``
- Invalid stc number.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,125 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx-mmap:
*****************
Digital TV mmap()
*****************
Name
====
dmx-mmap - Map device memory into application address space
.. warning:: this API is still experimental
Synopsis
========
.. code-block:: c
#include <unistd.h>
#include <sys/mman.h>
.. c:function:: void *mmap( void *start, size_t length, int prot, int flags, int fd, off_t offset )
:name: dmx-mmap
Arguments
=========
``start``
Map the buffer to this address in the application's address space.
When the ``MAP_FIXED`` flag is specified, ``start`` must be a
multiple of the pagesize and mmap will fail when the specified
address cannot be used. Use of this option is discouraged;
applications should just specify a ``NULL`` pointer here.
``length``
Length of the memory area to map. This must be a multiple of the
DVB packet length (188, on most drivers).
``prot``
The ``prot`` argument describes the desired memory protection.
Regardless of the device type and the direction of data exchange it
should be set to ``PROT_READ`` | ``PROT_WRITE``, permitting read
and write access to image buffers. Drivers should support at least
this combination of flags.
``flags``
The ``flags`` parameter specifies the type of the mapped object,
mapping options and whether modifications made to the mapped copy of
the page are private to the process or are to be shared with other
references.
``MAP_FIXED`` requests that the driver selects no other address than
the one specified. If the specified address cannot be used,
:ref:`mmap() <dmx-mmap>` will fail. If ``MAP_FIXED`` is specified,
``start`` must be a multiple of the pagesize. Use of this option is
discouraged.
One of the ``MAP_SHARED`` or ``MAP_PRIVATE`` flags must be set.
``MAP_SHARED`` allows applications to share the mapped memory with
other (e. g. child-) processes.
.. note::
The Linux Digital TV applications should not set the
``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON``
flags.
``fd``
File descriptor returned by :ref:`open() <dmx_fopen>`.
``offset``
Offset of the buffer in device memory, as returned by
:ref:`DMX_QUERYBUF` ioctl.
Description
===========
The :ref:`mmap() <dmx-mmap>` function asks to map ``length`` bytes starting at
``offset`` in the memory of the device specified by ``fd`` into the
application address space, preferably at address ``start``. This latter
address is a hint only, and is usually specified as 0.
Suitable length and offset parameters are queried with the
:ref:`DMX_QUERYBUF` ioctl. Buffers must be allocated with the
:ref:`DMX_REQBUFS` ioctl before they can be queried.
To unmap buffers the :ref:`munmap() <dmx-munmap>` function is used.
Return Value
============
On success :ref:`mmap() <dmx-mmap>` returns a pointer to the mapped buffer. On
error ``MAP_FAILED`` (-1) is returned, and the ``errno`` variable is set
appropriately. Possible error codes are:
EBADF
``fd`` is not a valid file descriptor.
EACCES
``fd`` is not open for reading and writing.
EINVAL
The ``start`` or ``length`` or ``offset`` are not suitable. (E. g.
they are too large, or not aligned on a ``PAGESIZE`` boundary.)
The ``flags`` or ``prot`` value is not supported.
No buffers have been allocated with the
:ref:`DMX_REQBUFS` ioctl.
ENOMEM
Not enough physical or virtual memory was available to complete the
request.
@@ -0,0 +1,63 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx-munmap:
************
DVB munmap()
************
Name
====
dmx-munmap - Unmap device memory
.. warning:: This API is still experimental.
Synopsis
========
.. code-block:: c
#include <unistd.h>
#include <sys/mman.h>
.. c:function:: int munmap( void *start, size_t length )
:name: dmx-munmap
Arguments
=========
``start``
Address of the mapped buffer as returned by the
:ref:`mmap() <dmx-mmap>` function.
``length``
Length of the mapped buffer. This must be the same value as given to
:ref:`mmap() <dmx-mmap>`.
Description
===========
Unmaps a previously with the :ref:`mmap() <dmx-mmap>` function mapped
buffer and frees it, if possible.
Return Value
============
On success :ref:`munmap() <dmx-munmap>` returns 0, on failure -1 and the
``errno`` variable is set appropriately:
EINVAL
The ``start`` or ``length`` is incorrect, or no buffers have been
mapped yet.
@@ -0,0 +1,93 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_QBUF:
*************************
ioctl DMX_QBUF, DMX_DQBUF
*************************
Name
====
DMX_QBUF - DMX_DQBUF - Exchange a buffer with the driver
.. warning:: this API is still experimental
Synopsis
========
.. c:function:: int ioctl( int fd, DMX_QBUF, struct dmx_buffer *argp )
:name: DMX_QBUF
.. c:function:: int ioctl( int fd, DMX_DQBUF, struct dmx_buffer *argp )
:name: DMX_DQBUF
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <dmx_fopen>`.
``argp``
Pointer to struct :c:type:`dmx_buffer`.
Description
===========
Applications call the ``DMX_QBUF`` ioctl to enqueue an empty
(capturing) or filled (output) buffer in the driver's incoming queue.
The semantics depend on the selected I/O method.
To enqueue a buffer applications set the ``index`` field. Valid index
numbers range from zero to the number of buffers allocated with
:ref:`DMX_REQBUFS` (struct :c:type:`dmx_requestbuffers` ``count``) minus
one. The contents of the struct :c:type:`dmx_buffer` returned
by a :ref:`DMX_QUERYBUF` ioctl will do as well.
When ``DMX_QBUF`` is called with a pointer to this structure, it locks the
memory pages of the buffer in physical memory, so they cannot be swapped
out to disk. Buffers remain locked until dequeued, until the
the device is closed.
Applications call the ``DMX_DQBUF`` ioctl to dequeue a filled
(capturing) buffer from the driver's outgoing queue.
They just set the ``index`` field with the buffer ID to be queued.
When ``DMX_DQBUF`` is called with a pointer to struct :c:type:`dmx_buffer`,
the driver fills the remaining fields or returns an error code.
By default ``DMX_DQBUF`` blocks when no buffer is in the outgoing
queue. When the ``O_NONBLOCK`` flag was given to the
:ref:`open() <dmx_fopen>` function, ``DMX_DQBUF`` returns
immediately with an ``EAGAIN`` error code when no buffer is available.
The struct :c:type:`dmx_buffer` structure is specified in
:ref:`buffer`.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EAGAIN
Non-blocking I/O has been selected using ``O_NONBLOCK`` and no
buffer was in the outgoing queue.
EINVAL
The ``index`` is out of bounds, or no buffers have been allocated yet.
EIO
``DMX_DQBUF`` failed due to an internal error. Can also indicate
temporary problems like signal loss or CRC errors.
@@ -0,0 +1,72 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_QUERYBUF:
******************
ioctl DMX_QUERYBUF
******************
Name
====
DMX_QUERYBUF - Query the status of a buffer
.. warning:: this API is still experimental
Synopsis
========
.. c:function:: int ioctl( int fd, DMX_QUERYBUF, struct dvb_buffer *argp )
:name: DMX_QUERYBUF
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <dmx_fopen>`.
``argp``
Pointer to struct :c:type:`dvb_buffer`.
Description
===========
This ioctl is part of the mmap streaming I/O method. It can
be used to query the status of a buffer at any time after buffers have
been allocated with the :ref:`DMX_REQBUFS` ioctl.
Applications set the ``index`` field. Valid index numbers range from zero
to the number of buffers allocated with :ref:`DMX_REQBUFS`
(struct :c:type:`dvb_requestbuffers` ``count``) minus one.
After calling :ref:`DMX_QUERYBUF` with a pointer to this structure,
drivers return an error code or fill the rest of the structure.
On success, the ``offset`` will contain the offset of the buffer from the
start of the device memory, the ``length`` field its size, and the
``bytesused`` the number of bytes occupied by data in the buffer (payload).
Return Value
============
On success 0 is returned, the ``offset`` will contain the offset of the
buffer from the start of the device memory, the ``length`` field its size,
and the ``bytesused`` the number of bytes occupied by data in the buffer
(payload).
On error it returns -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
The ``index`` is out of bounds.
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_REMOVE_PID:
==============
DMX_REMOVE_PID
==============
Name
----
DMX_REMOVE_PID
Synopsis
--------
.. c:function:: int ioctl(fd, DMX_REMOVE_PID, __u16 *pid)
:name: DMX_REMOVE_PID
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``pid``
PID of the PES filter to be removed.
Description
-----------
This ioctl call allows to remove a PID when multiple PIDs are set on a
transport stream filter, e. g. a filter previously set up with output
equal to :c:type:`DMX_OUT_TSDEMUX_TAP <dmx_output>`, created via either
:ref:`DMX_SET_PES_FILTER` or :ref:`DMX_ADD_PID`.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,83 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_REQBUFS:
*****************
ioctl DMX_REQBUFS
*****************
Name
====
DMX_REQBUFS - Initiate Memory Mapping and/or DMA buffer I/O
.. warning:: this API is still experimental
Synopsis
========
.. c:function:: int ioctl( int fd, DMX_REQBUFS, struct dmx_requestbuffers *argp )
:name: DMX_REQBUFS
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <dmx_fopen>`.
``argp``
Pointer to struct :c:type:`dmx_requestbuffers`.
Description
===========
This ioctl is used to initiate a memory mapped or DMABUF based demux I/O.
Memory mapped buffers are located in device memory and must be allocated
with this ioctl before they can be mapped into the application's address
space. User buffers are allocated by applications themselves, and this
ioctl is merely used to switch the driver into user pointer I/O mode and
to setup some internal structures. Similarly, DMABUF buffers are
allocated by applications through a device driver, and this ioctl only
configures the driver into DMABUF I/O mode without performing any direct
allocation.
To allocate device buffers applications initialize all fields of the
struct :c:type:`dmx_requestbuffers` structure. They set the ``count`` field
to the desired number of buffers, and ``size`` to the size of each
buffer.
When the ioctl is called with a pointer to this structure, the driver will
attempt to allocate the requested number of buffers and it stores the actual
number allocated in the ``count`` field. The ``count`` can be smaller than the number requested, even zero, when the driver runs out of free memory. A larger
number is also possible when the driver requires more buffers to
function correctly. The actual allocated buffer size can is returned
at ``size``, and can be smaller than what's requested.
When this I/O method is not supported, the ioctl returns an ``EOPNOTSUPP``
error code.
Applications can call :ref:`DMX_REQBUFS` again to change the number of
buffers, however this cannot succeed when any buffers are still mapped.
A ``count`` value of zero frees all buffers, after aborting or finishing
any DMA in progress.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EOPNOTSUPP
The the requested I/O method is not supported.
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_SET_BUFFER_SIZE:
===================
DMX_SET_BUFFER_SIZE
===================
Name
----
DMX_SET_BUFFER_SIZE
Synopsis
--------
.. c:function:: int ioctl( int fd, DMX_SET_BUFFER_SIZE, unsigned long size)
:name: DMX_SET_BUFFER_SIZE
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``size``
Unsigned long size
Description
-----------
This ioctl call is used to set the size of the circular buffer used for
filtered data. The default size is two maximum sized sections, i.e. if
this function is not called a buffer size of ``2 * 4096`` bytes will be
used.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,64 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_SET_FILTER:
==============
DMX_SET_FILTER
==============
Name
----
DMX_SET_FILTER
Synopsis
--------
.. c:function:: int ioctl( int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)
:name: DMX_SET_FILTER
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``params``
Pointer to structure containing filter parameters.
Description
-----------
This ioctl call sets up a filter according to the filter and mask
parameters provided. A timeout may be defined stating number of seconds
to wait for a section to be loaded. A value of 0 means that no timeout
should be applied. Finally there is a flag field where it is possible to
state whether a section should be CRC-checked, whether the filter should
be a ”one-shot” filter, i.e. if the filtering operation should be
stopped after the first section is received, and whether the filtering
operation should be started immediately (without waiting for a
:ref:`DMX_START` ioctl call). If a filter was previously set-up, this
filter will be canceled, and the receive buffer will be flushed.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,76 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_SET_PES_FILTER:
==================
DMX_SET_PES_FILTER
==================
Name
----
DMX_SET_PES_FILTER
Synopsis
--------
.. c:function:: int ioctl( int fd, DMX_SET_PES_FILTER, struct dmx_pes_filter_params *params)
:name: DMX_SET_PES_FILTER
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
``params``
Pointer to structure containing filter parameters.
Description
-----------
This ioctl call sets up a PES filter according to the parameters
provided. By a PES filter is meant a filter that is based just on the
packet identifier (PID), i.e. no PES header or payload filtering
capability is supported.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- .. row 1
- ``EBUSY``
- This error code indicates that there are conflicting requests.
There are active filters filtering data from another input source.
Make sure that these filters are stopped before starting this
filter.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,75 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_START:
=========
DMX_START
=========
Name
----
DMX_START
Synopsis
--------
.. c:function:: int ioctl( int fd, DMX_START)
:name: DMX_START
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
Description
-----------
This ioctl call is used to start the actual filtering operation defined
via the ioctl calls :ref:`DMX_SET_FILTER` or :ref:`DMX_SET_PES_FILTER`.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- Invalid argument, i.e. no filtering parameters provided via the
:ref:`DMX_SET_FILTER` or :ref:`DMX_SET_PES_FILTER` ioctls.
- .. row 2
- ``EBUSY``
- This error code indicates that there are conflicting requests.
There are active filters filtering data from another input source.
Make sure that these filters are stopped before starting this
filter.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,52 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _DMX_STOP:
========
DMX_STOP
========
Name
----
DMX_STOP
Synopsis
--------
.. c:function:: int ioctl( int fd, DMX_STOP)
:name: DMX_STOP
Arguments
---------
``fd``
File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
Description
-----------
This ioctl call is used to stop the actual filtering operation defined
via the ioctl calls :ref:`DMX_SET_FILTER` or :ref:`DMX_SET_PES_FILTER` and
started via the :ref:`DMX_START` command.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,37 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx_fcalls:
********************
Demux Function Calls
********************
.. toctree::
:maxdepth: 1
dmx-fopen
dmx-fclose
dmx-fread
dmx-fwrite
dmx-mmap
dmx-munmap
dmx-start
dmx-stop
dmx-set-filter
dmx-set-pes-filter
dmx-set-buffer-size
dmx-get-stc
dmx-get-pes-pids
dmx-add-pid
dmx-remove-pid
dmx-reqbufs
dmx-querybuf
dmx-expbuf
dmx-qbuf
@@ -0,0 +1,16 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dmx_types:
****************
Demux Data Types
****************
.. kernel-doc:: include/uapi/linux/dvb/dmx.h
@@ -0,0 +1,32 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb-fe-read-status:
***************************************
Querying frontend status and statistics
***************************************
Once :ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` is called, the
frontend will run a kernel thread that will periodically check for the
tuner lock status and provide statistics about the quality of the
signal.
The information about the frontend tuner locking status can be queried
using :ref:`FE_READ_STATUS`.
Signal statistics are provided via
:ref:`FE_GET_PROPERTY`.
.. note::
Most statistics require the demodulator to be fully locked
(e. g. with :c:type:`FE_HAS_LOCK <fe_status>` bit set). See
:ref:`Frontend statistics indicators <frontend-stat-properties>` for
more details.
@@ -0,0 +1,22 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. c:type:: dvb_frontend_event
***************
frontend events
***************
.. code-block:: c
struct dvb_frontend_event {
fe_status_t status;
struct dvb_frontend_parameters parameters;
};
@@ -0,0 +1,126 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. c:type:: dvb_frontend_parameters
*******************
frontend parameters
*******************
The kind of parameters passed to the frontend device for tuning depend
on the kind of hardware you are using.
The struct ``dvb_frontend_parameters`` uses a union with specific
per-system parameters. However, as newer delivery systems required more
data, the structure size weren't enough to fit, and just extending its
size would break the existing applications. So, those parameters were
replaced by the usage of
:ref:`FE_GET_PROPERTY/FE_SET_PROPERTY <FE_GET_PROPERTY>`
ioctl's. The new API is flexible enough to add new parameters to
existing delivery systems, and to add newer delivery systems.
So, newer applications should use
:ref:`FE_GET_PROPERTY/FE_SET_PROPERTY <FE_GET_PROPERTY>`
instead, in order to be able to support the newer System Delivery like
DVB-S2, DVB-T2, DVB-C2, ISDB, etc.
All kinds of parameters are combined as a union in the
``dvb_frontend_parameters`` structure:
.. code-block:: c
struct dvb_frontend_parameters {
uint32_t frequency; /* (absolute) frequency in Hz for QAM/OFDM */
/* intermediate frequency in kHz for QPSK */
fe_spectral_inversion_t inversion;
union {
struct dvb_qpsk_parameters qpsk;
struct dvb_qam_parameters qam;
struct dvb_ofdm_parameters ofdm;
struct dvb_vsb_parameters vsb;
} u;
};
In the case of QPSK frontends the ``frequency`` field specifies the
intermediate frequency, i.e. the offset which is effectively added to
the local oscillator frequency (LOF) of the LNB. The intermediate
frequency has to be specified in units of kHz. For QAM and OFDM
frontends the ``frequency`` specifies the absolute frequency and is
given in Hz.
.. c:type:: dvb_qpsk_parameters
QPSK parameters
===============
For satellite QPSK frontends you have to use the ``dvb_qpsk_parameters``
structure:
.. code-block:: c
struct dvb_qpsk_parameters {
uint32_t symbol_rate; /* symbol rate in Symbols per second */
fe_code_rate_t fec_inner; /* forward error correction (see above) */
};
.. c:type:: dvb_qam_parameters
QAM parameters
==============
for cable QAM frontend you use the ``dvb_qam_parameters`` structure:
.. code-block:: c
struct dvb_qam_parameters {
uint32_t symbol_rate; /* symbol rate in Symbols per second */
fe_code_rate_t fec_inner; /* forward error correction (see above) */
fe_modulation_t modulation; /* modulation type (see above) */
};
.. c:type:: dvb_vsb_parameters
VSB parameters
==============
ATSC frontends are supported by the ``dvb_vsb_parameters`` structure:
.. code-block:: c
struct dvb_vsb_parameters {
fe_modulation_t modulation; /* modulation type (see above) */
};
.. c:type:: dvb_ofdm_parameters
OFDM parameters
===============
DVB-T frontends are supported by the ``dvb_ofdm_parameters`` structure:
.. code-block:: c
struct dvb_ofdm_parameters {
fe_bandwidth_t bandwidth;
fe_code_rate_t code_rate_HP; /* high priority stream code rate */
fe_code_rate_t code_rate_LP; /* low priority stream code rate */
fe_modulation_t constellation; /* modulation type (see above) */
fe_transmit_mode_t transmission_mode;
fe_guard_interval_t guard_interval;
fe_hierarchy_t hierarchy_information;
};
@@ -0,0 +1,126 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. include:: <isonum.txt>
.. _dvbapi:
########################
Part II - Digital TV API
########################
.. note::
This API is also known as Linux **DVB API**.
It it was originally written to support the European digital TV
standard (DVB), and later extended to support all digital TV standards.
In order to avoid confusion, within this document, it was opted to refer to
it, and to associated hardware as **Digital TV**.
The word **DVB** is reserved to be used for:
- the Digital TV API version
(e. g. DVB API version 3 or DVB API version 5);
- digital TV data types (enums, structs, defines, etc);
- digital TV device nodes (``/dev/dvb/...``);
- the European DVB standard.
**Version 5.10**
.. only:: html
.. class:: toc-title
Table of Contents
.. toctree::
:maxdepth: 5
:numbered:
intro
frontend
demux
ca
net
legacy_dvb_apis
examples
headers
**********************
Revision and Copyright
**********************
Authors:
- J. K. Metzler, Ralph <rjkm@metzlerbros.de>
- Original author of the Digital TV API documentation.
- O. C. Metzler, Marcus <rjkm@metzlerbros.de>
- Original author of the Digital TV API documentation.
- Carvalho Chehab, Mauro <mchehab+samsung@kernel.org>
- Ported document to Docbook XML, addition of DVBv5 API, documentation gaps fix.
**Copyright** |copy| 2002-2003 : Convergence GmbH
**Copyright** |copy| 2009-2017 : Mauro Carvalho Chehab
****************
Revision History
****************
:revision: 2.2.0 / 2017-09-01 (*mcc*)
Most gaps between the uAPI document and the Kernel implementation
got fixed for the non-legacy API.
:revision: 2.1.0 / 2015-05-29 (*mcc*)
DocBook improvements and cleanups, in order to document the system calls
on a more standard way and provide more description about the current
Digital TV API.
:revision: 2.0.4 / 2011-05-06 (*mcc*)
Add more information about DVBv5 API, better describing the frontend
GET/SET props ioctl's.
:revision: 2.0.3 / 2010-07-03 (*mcc*)
Add some frontend capabilities flags, present on kernel, but missing at
the specs.
:revision: 2.0.2 / 2009-10-25 (*mcc*)
documents FE_SET_FRONTEND_TUNE_MODE and
FE_DISHETWORK_SEND_LEGACY_CMD ioctls.
:revision: 2.0.1 / 2009-09-16 (*mcc*)
Added ISDB-T test originally written by Patrick Boettcher
:revision: 2.0.0 / 2009-09-06 (*mcc*)
Conversion from LaTex to DocBook XML. The contents is the same as the
original LaTex version.
:revision: 1.0.0 / 2003-07-24 (*rjkm*)
Initial revision on LaTEX.
@@ -0,0 +1,133 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend-properties:
**************
Property types
**************
Tuning into a Digital TV physical channel and starting decoding it
requires changing a set of parameters, in order to control the tuner,
the demodulator, the Linear Low-noise Amplifier (LNA) and to set the
antenna subsystem via Satellite Equipment Control - SEC (on satellite
systems). The actual parameters are specific to each particular digital
TV standards, and may change as the digital TV specs evolves.
In the past (up to DVB API version 3 - DVBv3), the strategy used was to have a
union with the parameters needed to tune for DVB-S, DVB-C, DVB-T and
ATSC delivery systems grouped there. The problem is that, as the second
generation standards appeared, the size of such union was not big
enough to group the structs that would be required for those new
standards. Also, extending it would break userspace.
So, the legacy union/struct based approach was deprecated, in favor
of a properties set approach. On such approach,
:ref:`FE_GET_PROPERTY and FE_SET_PROPERTY <FE_GET_PROPERTY>` are used
to setup the frontend and read its status.
The actual action is determined by a set of dtv_property cmd/data pairs.
With one single ioctl, is possible to get/set up to 64 properties.
This section describes the new and recommended way to set the frontend,
with supports all digital TV delivery systems.
.. note::
1. On Linux DVB API version 3, setting a frontend was done via
struct :c:type:`dvb_frontend_parameters`.
2. Don't use DVB API version 3 calls on hardware with supports
newer standards. Such API provides no support or a very limited
support to new standards and/or new hardware.
3. Nowadays, most frontends support multiple delivery systems.
Only with DVB API version 5 calls it is possible to switch between
the multiple delivery systems supported by a frontend.
4. DVB API version 5 is also called *S2API*, as the first
new standard added to it was DVB-S2.
**Example**: in order to set the hardware to tune into a DVB-C channel
at 651 kHz, modulated with 256-QAM, FEC 3/4 and symbol rate of 5.217
Mbauds, those properties should be sent to
:ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` ioctl:
:ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` = SYS_DVBC_ANNEX_A
:ref:`DTV_FREQUENCY <DTV-FREQUENCY>` = 651000000
:ref:`DTV_MODULATION <DTV-MODULATION>` = QAM_256
:ref:`DTV_INVERSION <DTV-INVERSION>` = INVERSION_AUTO
:ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>` = 5217000
:ref:`DTV_INNER_FEC <DTV-INNER-FEC>` = FEC_3_4
:ref:`DTV_TUNE <DTV-TUNE>`
The code that would that would do the above is show in
:ref:`dtv-prop-example`.
.. code-block:: c
:caption: Example: Setting digital TV frontend properties
:name: dtv-prop-example
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/dvb/frontend.h>
static struct dtv_property props[] = {
{ .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_DVBC_ANNEX_A },
{ .cmd = DTV_FREQUENCY, .u.data = 651000000 },
{ .cmd = DTV_MODULATION, .u.data = QAM_256 },
{ .cmd = DTV_INVERSION, .u.data = INVERSION_AUTO },
{ .cmd = DTV_SYMBOL_RATE, .u.data = 5217000 },
{ .cmd = DTV_INNER_FEC, .u.data = FEC_3_4 },
{ .cmd = DTV_TUNE }
};
static struct dtv_properties dtv_prop = {
.num = 6, .props = props
};
int main(void)
{
int fd = open("/dev/dvb/adapter0/frontend0", O_RDWR);
if (!fd) {
perror ("open");
return -1;
}
if (ioctl(fd, FE_SET_PROPERTY, &dtv_prop) == -1) {
perror("ioctl");
return -1;
}
printf("Frontend set\\n");
return 0;
}
.. attention:: While it is possible to directly call the Kernel code like the
above example, it is strongly recommended to use
`libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it
provides abstraction to work with the supported digital TV standards and
provides methods for usual operations like program scanning and to
read/write channel descriptor files.
.. toctree::
:maxdepth: 1
fe_property_parameters
frontend-stat-properties
frontend-property-terrestrial-systems
frontend-property-cable-systems
frontend-property-satellite-systems
frontend-header
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is dual-licensed: you can use it either under the terms
of the GPL 2.0 or the GFDL 1.1+ license, at your option. Note that this
dual licensing only applies to this file, and not this project as a
whole.
a) This file is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation version 2 of
the License.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Or, alternatively,
b) Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.1 or any later version published by the Free Software
Foundation, with no Invariant Sections, no Front-Cover Texts
and no Back-Cover Texts. A copy of the license is included at
Documentation/userspace-api/media/fdl-appendix.rst.
TODO: replace it to GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
-->
<svg id="svg2" width="15.847cm" height="8.4187cm" fill-rule="evenodd" stroke-linejoin="round" stroke-width="28.222" preserveAspectRatio="xMidYMid" version="1.2" viewBox="0 0 23770.123 12628.122" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><defs id="defs142"><marker id="Arrow1Lend" overflow="visible" orient="auto"><path id="path954" transform="matrix(-.8 0 0 -.8 -10 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill-rule="evenodd" stroke="#000" stroke-width="1pt"/></marker><marker id="marker1243" overflow="visible" orient="auto"><path id="path1241" transform="matrix(-.8 0 0 -.8 -10 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill-rule="evenodd" stroke="#000" stroke-width="1pt"/></marker></defs><metadata id="metadata519"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><rect id="rect197" class="BoundingBox" x="5355.1" y="13.122" width="18403" height="9603" fill="none"/><path id="path199" d="m14556 9614.1h-9200v-9600h18400v9600z" fill="#fff"/><path id="path201" d="m14556 9614.1h-9200v-9600h18400v9600z" fill="none" stroke="#000"/><rect id="rect206" class="BoundingBox" x="13.122" y="4013.1" width="4544" height="2403" fill="none"/><path id="path208" d="m2285.1 6414.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path210" d="m2285.1 6414.1h-2271v-2400h4541v2400z" fill="none" stroke="#000"/><text id="text212" class="TextShape" x="-2443.8779" y="-4585.8779"><tspan id="tspan214" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan216" class="TextPosition"
x="1281.1219" y="5435.1221"><tspan id="tspan218" fill="#000000">Antena</tspan></tspan></tspan></text>
<rect id="rect223" class="BoundingBox" x="6213.1" y="1813.1" width="4544" height="2403" fill="none"/><path id="path225" d="m8485.1 4214.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path227" d="m8485.1 4214.1h-2271v-2400h4541v2400z" fill="none" stroke="#000"/><text id="text229" class="TextShape" x="-2443.8779" y="-4585.8779"><tspan id="tspan231" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan233" class="TextPosition" x="7217.1221" y="3235.1221"><tspan id="tspan235" fill="#000000">Frontend</tspan></tspan></tspan></text>
<rect id="rect240" class="BoundingBox" x="12113" y="1813.1" width="4544" height="2403" fill="none"/><path id="path242" d="m14385 4214.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path244" d="m14385 4214.1h-2271v-2400h4541v2400z" fill="none" stroke="#000"/><text id="text246" class="TextShape" x="-2443.8779" y="-4585.8779"><tspan id="tspan248" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan250" class="TextPosition" x="13944.122" y="3235.1221"><tspan id="tspan252" fill="#000000">CA</tspan></tspan></tspan></text>
<rect id="rect257" class="BoundingBox" x="18113" y="1813.1" width="4544" height="2403" fill="none"/><path id="path259" d="m20385 4214.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path261" d="m20385 4214.1h-2271v-2400h4541v2400z" fill="none" stroke="#000"/><text id="text263" class="TextShape" x="-2443.8779" y="-4585.8779"><tspan id="tspan265" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan267" class="TextPosition" x="19384.123" y="3235.1221"><tspan id="tspan269" fill="#000000">Demux</tspan></tspan></tspan></text>
<rect id="rect274" class="BoundingBox" x="6113.1" y="5813.1" width="4544" height="2403" fill="none"/><path id="path276" d="m8385.1 8214.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path278" d="m8385.1 8214.1h-2271v-2400h4541v2400z" fill="none" stroke="#000"/><text id="text280" class="TextShape" x="-2443.8779" y="-4585.8779"><tspan id="tspan282" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan284" class="TextPosition" x="7733.1221" y="7235.1221"><tspan id="tspan286" fill="#000000">SEC</tspan></tspan></tspan></text>
<rect id="rect291" class="BoundingBox" x="12213" y="5813.1" width="4544" height="2403" fill="none"/><path id="path293" d="m14485 8214.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path295" d="m14485 8214.1h-2271v-2400h4541v2400z" fill="none" stroke="#000" stroke-dasharray="28.22200113,56.44400226" stroke-width="28.222"/><text id="text297" class="TextShape" x="-2443.8779" y="-4903.3779"><tspan id="tspan299" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan301" class="TextPosition" x="13676.122" y="6917.6221"><tspan id="tspan303" fill="#000000">Audio</tspan></tspan></tspan></text>
<rect id="rect308" class="BoundingBox" x="18113" y="5813.1" width="4544" height="2403" fill="none"/><path id="path310" d="m20385 8214.1h-2271v-2400h4541v2400z" fill="#fff"/><path id="path312" d="m20385 8214.1h-2271v-2400h4541v2400z" fill="none" stroke="#000" stroke-dasharray="28.22200113,56.44400226" stroke-width="28.222"/><text id="text314" class="TextShape" x="-2443.8779" y="-4903.3779"><tspan id="tspan316" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan318" class="TextPosition" x="19583.123" y="6917.6221"><tspan id="tspan320" fill="#000000">Video</tspan></tspan></tspan></text>
<rect id="rect325" class="BoundingBox" x="15213" y="10213" width="4544" height="2403" fill="none"/><path id="path327" d="m17485 12614h-2271v-2400h4541v2400z" fill="#fff"/><path id="path329" d="m17485 12614h-2271v-2400h4541v2400z" fill="none" stroke="#000" stroke-dasharray="28.22200113,56.44400226" stroke-width="28.222"/><text id="text331" class="TextShape" x="-2443.8779" y="-4585.8779"><tspan id="tspan333" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400"><tspan id="tspan335" class="TextPosition" x="17076.123" y="11635.122"><tspan id="tspan337" fill="#000000">TV</tspan></tspan></tspan></text>
<rect id="rect342" class="BoundingBox" x="4555.1" y="3014.1" width="1661" height="2202" fill="none"/><path id="path344" d="m4556.1 5214.1 1400-1857" fill="none" stroke="#000"/><path id="path346" d="m6215.1 3014.1-391 269 240 181z"/><rect id="rect351" class="BoundingBox" x="4555.1" y="5213.1" width="1561" height="1802" fill="none"/><path id="path353" d="m4556.1 5214.1 1277 1475" fill="none" stroke="#000"/><path id="path355" d="m6115.1 7014.1-181-438-227 196z"/><rect id="rect360" class="BoundingBox" x="10755" y="2864.1" width="1361" height="301" fill="none"/><path id="path362" d="m10756 3014.1h929" fill="none" stroke="#000"/><path id="path364" d="m12115 3014.1-450-150v300z"/><rect id="rect369" class="BoundingBox" x="16655" y="2864.1" width="1461" height="301" fill="none"/><path id="path371" d="m16656 3014.1h1029" fill="none" stroke="#000"/><path id="path373" d="m18115
3014.1-450-150v300z"/><rect id="rect378" class="BoundingBox" x="20235" y="4213.1" width="301" height="1602" fill="none"/><rect id="rect387" class="BoundingBox" x="17485" y="8213.1" width="2902" height="2002" fill="none"/><path id="path389" d="m20385 8214.1-2546 1756" fill="none" stroke="#000" stroke-dasharray="28.22200113,56.44400226" stroke-width="28.222"/><path id="path391" d="m17485 10214 456-132-171-247z"/><rect id="rect396" class="BoundingBox" x="14484" y="8213.1" width="3002" height="2002" fill="none"/><path id="path398" d="m14485 8214.1 2642 1761" fill="none" stroke="#000" stroke-dasharray="28.22200113,56.44400226" stroke-width="28.222"/><path id="path400" d="m17485 10214-291-374-167 249z"/><rect id="rect405" class="BoundingBox" x="14485" y="4213.1" width="5902" height="1629" fill="none"/><path id="path949" d="m20387 4213.1v1629" fill="none" marker-end="url(#Arrow1Lend)"
stroke="#000" stroke-dasharray="26.45879596, 52.91759192999999328" stroke-linejoin="miter" stroke-width="26.459"/><path id="path1233" d="m20385 4214.1-3628 1599" fill="none" marker-end="url(#marker1243)" stroke="#000" stroke-dasharray="26.45879596, 52.91759193" stroke-linejoin="miter" stroke-width="26.459"/><text id="text297-3" class="TextShape" x="-2911.9202" y="-4257.2061" font-size="12px" stroke-width="1"><tspan id="tspan299-6" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400" stroke-width="1"><tspan id="tspan301-7" class="TextPosition" x="13208.079" y="7563.793" stroke-width="1"><tspan id="tspan303-5" fill="#000000" stroke-width="1">Decoder</tspan></tspan></tspan></text>
<text id="text297-3-3" class="TextShape" x="2950.9287" y="-4259.5928" font-size="12px" stroke-width="1"><tspan id="tspan299-6-5" class="TextParagraph" font-family="sans-serif" font-size="635px" font-weight="400" stroke-width="1"><tspan id="tspan301-7-6" class="TextPosition" x="19070.928" y="7561.4053" stroke-width="1"><tspan id="tspan303-5-2" fill="#000000" stroke-width="1">Decoder</tspan></tspan></tspan></text>
</svg>
@@ -0,0 +1,23 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb_examples:
********
Examples
********
In the past, we used to have a set of examples here. However, those
examples got out of date and doesn't even compile nowadays.
Also, nowadays, the best is to use the libdvbv5 DVB API nowadays,
with is fully documented.
Please refer to the `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__
for updated/recommended examples.
@@ -0,0 +1,81 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
******************
Frontend bandwidth
******************
.. c:type:: fe_bandwidth
.. flat-table:: enum fe_bandwidth
:header-rows: 1
:stub-columns: 0
- .. row 1
- ID
- Description
- .. row 2
- .. _BANDWIDTH-AUTO:
``BANDWIDTH_AUTO``
- Autodetect bandwidth (if supported)
- .. row 3
- .. _BANDWIDTH-1-712-MHZ:
``BANDWIDTH_1_712_MHZ``
- 1.712 MHz
- .. row 4
- .. _BANDWIDTH-5-MHZ:
``BANDWIDTH_5_MHZ``
- 5 MHz
- .. row 5
- .. _BANDWIDTH-6-MHZ:
``BANDWIDTH_6_MHZ``
- 6 MHz
- .. row 6
- .. _BANDWIDTH-7-MHZ:
``BANDWIDTH_7_MHZ``
- 7 MHz
- .. row 7
- .. _BANDWIDTH-8-MHZ:
``BANDWIDTH_8_MHZ``
- 8 MHz
- .. row 8
- .. _BANDWIDTH-10-MHZ:
``BANDWIDTH_10_MHZ``
- 10 MHz
@@ -0,0 +1,55 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_DISEQC_RECV_SLAVE_REPLY:
********************************
ioctl FE_DISEQC_RECV_SLAVE_REPLY
********************************
Name
====
FE_DISEQC_RECV_SLAVE_REPLY - Receives reply from a DiSEqC 2.0 command
Synopsis
========
.. c:function:: int ioctl( int fd, FE_DISEQC_RECV_SLAVE_REPLY, struct dvb_diseqc_slave_reply *argp )
:name: FE_DISEQC_RECV_SLAVE_REPLY
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``argp``
pointer to struct :c:type:`dvb_diseqc_slave_reply`.
Description
===========
Receives reply from a DiSEqC 2.0 command.
The received message is stored at the buffer pointed by ``argp``.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,53 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_DISEQC_RESET_OVERLOAD:
******************************
ioctl FE_DISEQC_RESET_OVERLOAD
******************************
Name
====
FE_DISEQC_RESET_OVERLOAD - Restores the power to the antenna subsystem, if it was powered off due - to power overload.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_DISEQC_RESET_OVERLOAD, NULL )
:name: FE_DISEQC_RESET_OVERLOAD
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
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 Digital TV adapters support this ioctl.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,59 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_DISEQC_SEND_BURST:
**************************
ioctl FE_DISEQC_SEND_BURST
**************************
Name
====
FE_DISEQC_SEND_BURST - Sends a 22KHz tone burst for 2x1 mini DiSEqC satellite selection.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_DISEQC_SEND_BURST, enum fe_sec_mini_cmd tone )
:name: FE_DISEQC_SEND_BURST
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``tone``
An integer enumered value described at :c:type:`fe_sec_mini_cmd`.
Description
===========
This ioctl is used to set the generation of a 22kHz tone burst for mini
DiSEqC satellite selection for 2x1 switches. This call requires
read/write permissions.
It provides support for what's specified at
`Digital Satellite Equipment Control (DiSEqC) - Simple "ToneBurst" Detection Circuit specification. <http://www.eutelsat.com/files/contributed/satellites/pdf/Diseqc/associated%20docs/simple_tone_burst_detec.pdf>`__
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,56 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_DISEQC_SEND_MASTER_CMD:
*******************************
ioctl FE_DISEQC_SEND_MASTER_CMD
*******************************
Name
====
FE_DISEQC_SEND_MASTER_CMD - Sends a DiSEqC command
Synopsis
========
.. c:function:: int ioctl( int fd, FE_DISEQC_SEND_MASTER_CMD, struct dvb_diseqc_master_cmd *argp )
:name: FE_DISEQC_SEND_MASTER_CMD
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``argp``
pointer to struct
:c:type:`dvb_diseqc_master_cmd`
Description
===========
Sends the DiSEqC command pointed by :c:type:`dvb_diseqc_master_cmd`
to the antenna subsystem.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,62 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_DISHNETWORK_SEND_LEGACY_CMD:
******************************
FE_DISHNETWORK_SEND_LEGACY_CMD
******************************
Name
====
FE_DISHNETWORK_SEND_LEGACY_CMD
Synopsis
========
.. c:function:: int ioctl(int fd, FE_DISHNETWORK_SEND_LEGACY_CMD, unsigned long cmd)
:name: FE_DISHNETWORK_SEND_LEGACY_CMD
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``cmd``
Sends the specified raw cmd to the dish via DISEqC.
Description
===========
.. warning::
This is a very obscure legacy command, used only at stv0299
driver. Should not be used on newer drivers.
It provides a non-standard method for selecting Diseqc voltage on the
frontend, for Dish Network legacy switches.
As support for this ioctl were added in 2004, this means that such
dishes were already legacy in 2004.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,61 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_ENABLE_HIGH_LNB_VOLTAGE:
********************************
ioctl FE_ENABLE_HIGH_LNB_VOLTAGE
********************************
Name
====
FE_ENABLE_HIGH_LNB_VOLTAGE - Select output DC level between normal LNBf voltages or higher LNBf - voltages.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_ENABLE_HIGH_LNB_VOLTAGE, unsigned int high )
:name: FE_ENABLE_HIGH_LNB_VOLTAGE
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``high``
Valid flags:
- 0 - normal 13V and 18V.
- >0 - enables slightly higher voltages instead of 13/18V, in order
to compensate for long antenna cables.
Description
===========
Select output DC level between normal LNBf voltages or higher LNBf
voltages between 0 (normal) or a value grater than 0 for higher
voltages.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,78 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_GET_EVENT:
************
FE_GET_EVENT
************
Name
====
FE_GET_EVENT
.. attention:: This ioctl is deprecated.
Synopsis
========
.. c:function:: int ioctl(int fd, FE_GET_EVENT, struct dvb_frontend_event *ev)
:name: FE_GET_EVENT
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``ev``
Points to the location where the event, if any, is to be stored.
Description
===========
This ioctl call returns a frontend event if available. If an event is
not available, the behavior depends on whether the device is in blocking
or non-blocking mode. In the latter case, the call fails immediately
with errno set to ``EWOULDBLOCK``. In the former case, the call blocks until
an event becomes available.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EWOULDBLOCK``
- There is no event pending, and the device is in non-blocking mode.
- .. row 2
- ``EOVERFLOW``
- Overflow in event queue - one or more events were lost.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,69 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_GET_FRONTEND:
***************
FE_GET_FRONTEND
***************
Name
====
FE_GET_FRONTEND
.. attention:: This ioctl is deprecated.
Synopsis
========
.. c:function:: int ioctl(int fd, FE_GET_FRONTEND, struct dvb_frontend_parameters *p)
:name: FE_GET_FRONTEND
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``p``
Points to parameters for tuning operation.
Description
===========
This ioctl call queries the currently effective frontend parameters. For
this command, read-only access to the device is sufficient.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- Maximum supported symbol rate reached.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,70 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_GET_INFO:
*****************
ioctl FE_GET_INFO
*****************
Name
====
FE_GET_INFO - Query Digital TV frontend capabilities and returns information
about the - front-end. This call only requires read-only access to the device.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_GET_INFO, struct dvb_frontend_info *argp )
:name: FE_GET_INFO
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``argp``
pointer to struct struct
:c:type:`dvb_frontend_info`
Description
===========
All Digital TV frontend devices support the :ref:`FE_GET_INFO` ioctl. It is
used to identify kernel devices compatible with this specification and to
obtain information about driver and hardware capabilities. The ioctl
takes a pointer to dvb_frontend_info which is filled by the driver.
When the driver is not compatible with this specification the ioctl
returns an error.
frontend capabilities
=====================
Capabilities describe what a frontend can do. Some capabilities are
supported only on some specific frontend types.
The frontend capabilities are described at :c:type:`fe_caps`.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,83 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_GET_PROPERTY:
**************************************
ioctl FE_SET_PROPERTY, FE_GET_PROPERTY
**************************************
Name
====
FE_SET_PROPERTY - FE_GET_PROPERTY - FE_SET_PROPERTY sets one or more frontend properties. - FE_GET_PROPERTY returns one or more frontend properties.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_GET_PROPERTY, struct dtv_properties *argp )
:name: FE_GET_PROPERTY
.. c:function:: int ioctl( int fd, FE_SET_PROPERTY, struct dtv_properties *argp )
:name: FE_SET_PROPERTY
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``argp``
Pointer to struct :c:type:`dtv_properties`.
Description
===========
All Digital TV frontend devices support the ``FE_SET_PROPERTY`` and
``FE_GET_PROPERTY`` ioctls. The supported properties and statistics
depends on the delivery system and on the device:
- ``FE_SET_PROPERTY:``
- This ioctl is used to set one or more frontend properties.
- This is the basic command to request the frontend to tune into
some frequency and to start decoding the digital TV signal.
- This call requires read/write access to the device.
.. note::
At return, the values aren't updated to reflect the actual
parameters used. If the actual parameters are needed, an explicit
call to ``FE_GET_PROPERTY`` is needed.
- ``FE_GET_PROPERTY:``
- This ioctl is used to get properties and statistics from the
frontend.
- No properties are changed, and statistics aren't reset.
- This call only requires read-only access to the device.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_READ_BER:
***********
FE_READ_BER
***********
Name
====
FE_READ_BER
.. attention:: This ioctl is deprecated.
Synopsis
========
.. c:function:: int ioctl(int fd, FE_READ_BER, uint32_t *ber)
:name: FE_READ_BER
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``ber``
The bit error rate is stored into \*ber.
Description
===========
This ioctl call returns the bit error rate for the signal currently
received/demodulated by the front-end. For this command, read-only
access to the device is sufficient.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_READ_SIGNAL_STRENGTH:
***********************
FE_READ_SIGNAL_STRENGTH
***********************
Name
====
FE_READ_SIGNAL_STRENGTH
.. attention:: This ioctl is deprecated.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_READ_SIGNAL_STRENGTH, uint16_t *strength)
:name: FE_READ_SIGNAL_STRENGTH
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``strength``
The signal strength value is stored into \*strength.
Description
===========
This ioctl call returns the signal strength value for the signal
currently received by the front-end. For this command, read-only access
to the device is sufficient.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_READ_SNR:
***********
FE_READ_SNR
***********
Name
====
FE_READ_SNR
.. attention:: This ioctl is deprecated.
Synopsis
========
.. c:function:: int ioctl(int fd, FE_READ_SNR, int16_t *snr)
:name: FE_READ_SNR
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``snr``
The signal-to-noise ratio is stored into \*snr.
Description
===========
This ioctl call returns the signal-to-noise ratio for the signal
currently received by the front-end. For this command, read-only access
to the device is sufficient.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,72 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_READ_STATUS:
********************
ioctl FE_READ_STATUS
********************
Name
====
FE_READ_STATUS - Returns status information about the front-end. This call only requires - read-only access to the device
Synopsis
========
.. c:function:: int ioctl( int fd, FE_READ_STATUS, unsigned int *status )
:name: FE_READ_STATUS
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``status``
pointer to a bitmask integer filled with the values defined by enum
:c:type:`fe_status`.
Description
===========
All Digital TV frontend devices support the ``FE_READ_STATUS`` ioctl. It is
used to check about the locking status of the frontend after being
tuned. The ioctl takes a pointer to an integer where the status will be
written.
.. note::
The size of status is actually sizeof(enum fe_status), with
varies according with the architecture. This needs to be fixed in the
future.
int fe_status
=============
The fe_status parameter is used to indicate the current state and/or
state changes of the frontend hardware. It is produced using the enum
:c:type:`fe_status` values on a bitmask
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,59 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_READ_UNCORRECTED_BLOCKS:
**************************
FE_READ_UNCORRECTED_BLOCKS
**************************
Name
====
FE_READ_UNCORRECTED_BLOCKS
.. attention:: This ioctl is deprecated.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_READ_UNCORRECTED_BLOCKS, uint32_t *ublocks)
:name: FE_READ_UNCORRECTED_BLOCKS
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``ublocks``
The total number of uncorrected blocks seen by the driver so far.
Description
===========
This ioctl call returns the number of uncorrected blocks detected by the
device driver during its lifetime. For meaningful measurements, the
increment in block count during a specific time interval should be
calculated. For this command, read-only access to the device is
sufficient.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,64 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_SET_FRONTEND_TUNE_MODE:
*******************************
ioctl FE_SET_FRONTEND_TUNE_MODE
*******************************
Name
====
FE_SET_FRONTEND_TUNE_MODE - Allow setting tuner mode flags to the frontend.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_SET_FRONTEND_TUNE_MODE, unsigned int flags )
:name: FE_SET_FRONTEND_TUNE_MODE
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``flags``
Valid flags:
- 0 - normal tune mode
- ``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.
Description
===========
Allow setting tuner mode flags to the frontend, between 0 (normal) or
``FE_TUNE_MODE_ONESHOT`` mode
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,78 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_SET_FRONTEND:
***************
FE_SET_FRONTEND
***************
.. attention:: This ioctl is deprecated.
Name
====
FE_SET_FRONTEND
Synopsis
========
.. c:function:: int ioctl(int fd, FE_SET_FRONTEND, struct dvb_frontend_parameters *p)
:name: FE_SET_FRONTEND
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
``p``
Points to parameters for tuning operation.
Description
===========
This ioctl call starts a tuning operation using specified parameters.
The result of this call will be successful if the parameters were valid
and the tuning could be initiated. The result of the tuning operation in
itself, however, will arrive asynchronously as an event (see
documentation for :ref:`FE_GET_EVENT` and
FrontendEvent.) If a new :ref:`FE_SET_FRONTEND`
operation is initiated before the previous one was completed, the
previous operation will be aborted in favor of the new one. This command
requires read/write access to the device.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- .. row 1
- ``EINVAL``
- Maximum supported symbol rate reached.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,65 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_SET_TONE:
*****************
ioctl FE_SET_TONE
*****************
Name
====
FE_SET_TONE - Sets/resets the generation of the continuous 22kHz tone.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_SET_TONE, enum fe_sec_tone_mode tone )
:name: FE_SET_TONE
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``tone``
an integer enumered value described at :c:type:`fe_sec_tone_mode`
Description
===========
This ioctl is used to set the generation of the continuous 22kHz tone.
This call requires read/write permissions.
Usually, satellite antenna subsystems require that the digital TV device
to send a 22kHz tone in order to select between high/low band on some
dual-band LNBf. It is also used to send signals to DiSEqC equipment, but
this is done using the DiSEqC ioctls.
.. attention:: If more than one device is connected to the same antenna,
setting a tone may interfere on other devices, as they may lose the
capability of selecting the band. So, it is recommended that applications
would change to SEC_TONE_OFF when the device is not used.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,69 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _FE_SET_VOLTAGE:
********************
ioctl FE_SET_VOLTAGE
********************
Name
====
FE_SET_VOLTAGE - Allow setting the DC level sent to the antenna subsystem.
Synopsis
========
.. c:function:: int ioctl( int fd, FE_SET_VOLTAGE, enum fe_sec_voltage voltage )
:name: FE_SET_VOLTAGE
Arguments
=========
``fd``
File descriptor returned by :ref:`open() <frontend_f_open>`.
``voltage``
an integer enumered value described at :c:type:`fe_sec_voltage`
Description
===========
This ioctl allows to set the DC voltage level sent through the antenna
cable to 13V, 18V or off.
Usually, a satellite antenna subsystems require that the digital TV
device to send a DC voltage to feed power to the LNBf. Depending on the
LNBf type, the polarization or the intermediate frequency (IF) of the
LNBf can controlled by the voltage level. Other devices (for example,
the ones that implement DISEqC and multipoint LNBf's don't need to
control the voltage level, provided that either 13V or 18V is sent to
power up the LNBf.
.. attention:: if more than one device is connected to the same antenna,
setting a voltage level may interfere on other devices, as they may lose
the capability of setting polarization or IF. So, on those cases, setting
the voltage to SEC_VOLTAGE_OFF while the device is not is used is
recommended.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,98 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
*************
Frontend type
*************
For historical reasons, frontend types are named by the type of
modulation used in transmission. The fontend types are given by
fe_type_t type, defined as:
.. c:type:: fe_type
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. flat-table:: Frontend types
:header-rows: 1
:stub-columns: 0
:widths: 3 1 4
- .. row 1
- fe_type
- Description
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` equivalent
type
- .. row 2
- .. _FE-QPSK:
``FE_QPSK``
- For DVB-S standard
- ``SYS_DVBS``
- .. row 3
- .. _FE-QAM:
``FE_QAM``
- For DVB-C annex A standard
- ``SYS_DVBC_ANNEX_A``
- .. row 4
- .. _FE-OFDM:
``FE_OFDM``
- For DVB-T standard
- ``SYS_DVBT``
- .. row 5
- .. _FE-ATSC:
``FE_ATSC``
- For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used
in US.
- ``SYS_ATSC`` (terrestrial) or ``SYS_DVBC_ANNEX_B`` (cable)
Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described
at the above, as they're supported via the new
:ref:`FE_GET_PROPERTY/FE_GET_SET_PROPERTY <FE_GET_PROPERTY>`
ioctl's, using the :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
parameter.
In the old days, struct :c:type:`dvb_frontend_info`
used to contain ``fe_type_t`` field to indicate the delivery systems,
filled with either ``FE_QPSK, FE_QAM, FE_OFDM`` or ``FE_ATSC``. While this
is still filled to keep backward compatibility, the usage of this field
is deprecated, as it can report just one delivery system, but some
devices support multiple delivery systems. Please use
:ref:`DTV_ENUM_DELSYS <DTV-ENUM-DELSYS>` instead.
On devices that support multiple delivery systems, struct
:c:type:`dvb_frontend_info`::``fe_type_t`` is
filled with the currently standard, as selected by the last call to
:ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` using the
:ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` property.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,13 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
Frontend uAPI data types
========================
.. kernel-doc:: include/uapi/linux/dvb/frontend.h
@@ -0,0 +1,82 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend-property-cable-systems:
*****************************************
Properties used on cable delivery systems
*****************************************
.. _dvbc-params:
DVB-C delivery system
=====================
The DVB-C Annex-A is the widely used cable standard. Transmission uses
QAM modulation.
The DVB-C Annex-C is optimized for 6MHz, and is used in Japan. It
supports a subset of the Annex A modulation types, and a roll-off of
0.13, instead of 0.15
The following parameters are valid for DVB-C Annex A/C:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>`
- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
- :ref:`DTV_LNA <DTV-LNA>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _dvbc-annex-b-params:
DVB-C Annex B delivery system
=============================
The DVB-C Annex-B is only used on a few Countries like the United
States.
The following parameters are valid for DVB-C Annex B:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_LNA <DTV-LNA>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
@@ -0,0 +1,112 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend-property-satellite-systems:
*********************************************
Properties used on satellite delivery systems
*********************************************
.. _dvbs-params:
DVB-S delivery system
=====================
The following parameters are valid for DVB-S:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>`
- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
- :ref:`DTV_VOLTAGE <DTV-VOLTAGE>`
- :ref:`DTV_TONE <DTV-TONE>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
Future implementations might add those two missing parameters:
- :ref:`DTV_DISEQC_MASTER <DTV-DISEQC-MASTER>`
- :ref:`DTV_DISEQC_SLAVE_REPLY <DTV-DISEQC-SLAVE-REPLY>`
.. _dvbs2-params:
DVB-S2 delivery system
======================
In addition to all parameters valid for DVB-S, DVB-S2 supports the
following parameters:
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_PILOT <DTV-PILOT>`
- :ref:`DTV_ROLLOFF <DTV-ROLLOFF>`
- :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
- :ref:`DTV_SCRAMBLING_SEQUENCE_INDEX <DTV-SCRAMBLING-SEQUENCE-INDEX>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _turbo-params:
Turbo code delivery system
==========================
In addition to all parameters valid for DVB-S, turbo code supports the
following parameters:
- :ref:`DTV_MODULATION <DTV-MODULATION>`
.. _isdbs-params:
ISDB-S delivery system
======================
The following parameters are valid for ISDB-S:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>`
- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
- :ref:`DTV_VOLTAGE <DTV-VOLTAGE>`
- :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
@@ -0,0 +1,301 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend-property-terrestrial-systems:
***********************************************
Properties used on terrestrial delivery systems
***********************************************
.. _dvbt-params:
DVB-T delivery system
=====================
The following parameters are valid for DVB-T:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_CODE_RATE_HP <DTV-CODE-RATE-HP>`
- :ref:`DTV_CODE_RATE_LP <DTV-CODE-RATE-LP>`
- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
- :ref:`DTV_HIERARCHY <DTV-HIERARCHY>`
- :ref:`DTV_LNA <DTV-LNA>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _dvbt2-params:
DVB-T2 delivery system
======================
DVB-T2 support is currently in the early stages of development, so
expect that this section maygrow and become more detailed with time.
The following parameters are valid for DVB-T2:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_CODE_RATE_HP <DTV-CODE-RATE-HP>`
- :ref:`DTV_CODE_RATE_LP <DTV-CODE-RATE-LP>`
- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
- :ref:`DTV_HIERARCHY <DTV-HIERARCHY>`
- :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
- :ref:`DTV_LNA <DTV-LNA>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _isdbt:
ISDB-T delivery system
======================
This ISDB-T/ISDB-Tsb API extension should reflect all information needed
to tune any ISDB-T/ISDB-Tsb hardware. Of course it is possible that some
very sophisticated devices won't need certain parameters to tune.
The information given here should help application writers to know how
to handle ISDB-T and ISDB-Tsb hardware using the Linux Digital TV API.
The details given here about ISDB-T and ISDB-Tsb are just enough to
basically show the dependencies between the needed parameter values, but
surely some information is left out. For more detailed information see
the following documents:
ARIB STD-B31 - "Transmission System for Digital Terrestrial Television
Broadcasting" and
ARIB TR-B14 - "Operational Guidelines for Digital Terrestrial Television
Broadcasting".
In order to understand the ISDB specific parameters, one has to have
some knowledge the channel structure in ISDB-T and ISDB-Tsb. I.e. it has
to be known to the reader that an ISDB-T channel consists of 13
segments, that it can have up to 3 layer sharing those segments, and
things like that.
The following parameters are valid for ISDB-T:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
- :ref:`DTV_ISDBT_LAYER_ENABLED <DTV-ISDBT-LAYER-ENABLED>`
- :ref:`DTV_ISDBT_PARTIAL_RECEPTION <DTV-ISDBT-PARTIAL-RECEPTION>`
- :ref:`DTV_ISDBT_SOUND_BROADCASTING <DTV-ISDBT-SOUND-BROADCASTING>`
- :ref:`DTV_ISDBT_SB_SUBCHANNEL_ID <DTV-ISDBT-SB-SUBCHANNEL-ID>`
- :ref:`DTV_ISDBT_SB_SEGMENT_IDX <DTV-ISDBT-SB-SEGMENT-IDX>`
- :ref:`DTV_ISDBT_SB_SEGMENT_COUNT <DTV-ISDBT-SB-SEGMENT-COUNT>`
- :ref:`DTV_ISDBT_LAYERA_FEC <DTV-ISDBT-LAYER-FEC>`
- :ref:`DTV_ISDBT_LAYERA_MODULATION <DTV-ISDBT-LAYER-MODULATION>`
- :ref:`DTV_ISDBT_LAYERA_SEGMENT_COUNT <DTV-ISDBT-LAYER-SEGMENT-COUNT>`
- :ref:`DTV_ISDBT_LAYERA_TIME_INTERLEAVING <DTV-ISDBT-LAYER-TIME-INTERLEAVING>`
- :ref:`DTV_ISDBT_LAYERB_FEC <DTV-ISDBT-LAYER-FEC>`
- :ref:`DTV_ISDBT_LAYERB_MODULATION <DTV-ISDBT-LAYER-MODULATION>`
- :ref:`DTV_ISDBT_LAYERB_SEGMENT_COUNT <DTV-ISDBT-LAYER-SEGMENT-COUNT>`
- :ref:`DTV_ISDBT_LAYERB_TIME_INTERLEAVING <DTV-ISDBT-LAYER-TIME-INTERLEAVING>`
- :ref:`DTV_ISDBT_LAYERC_FEC <DTV-ISDBT-LAYER-FEC>`
- :ref:`DTV_ISDBT_LAYERC_MODULATION <DTV-ISDBT-LAYER-MODULATION>`
- :ref:`DTV_ISDBT_LAYERC_SEGMENT_COUNT <DTV-ISDBT-LAYER-SEGMENT-COUNT>`
- :ref:`DTV_ISDBT_LAYERC_TIME_INTERLEAVING <DTV-ISDBT-LAYER-TIME-INTERLEAVING>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _atsc-params:
ATSC delivery system
====================
The following parameters are valid for ATSC:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _atscmh-params:
ATSC-MH delivery system
=======================
The following parameters are valid for ATSC-MH:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
- :ref:`DTV_ATSCMH_FIC_VER <DTV-ATSCMH-FIC-VER>`
- :ref:`DTV_ATSCMH_PARADE_ID <DTV-ATSCMH-PARADE-ID>`
- :ref:`DTV_ATSCMH_NOG <DTV-ATSCMH-NOG>`
- :ref:`DTV_ATSCMH_TNOG <DTV-ATSCMH-TNOG>`
- :ref:`DTV_ATSCMH_SGN <DTV-ATSCMH-SGN>`
- :ref:`DTV_ATSCMH_PRC <DTV-ATSCMH-PRC>`
- :ref:`DTV_ATSCMH_RS_FRAME_MODE <DTV-ATSCMH-RS-FRAME-MODE>`
- :ref:`DTV_ATSCMH_RS_FRAME_ENSEMBLE <DTV-ATSCMH-RS-FRAME-ENSEMBLE>`
- :ref:`DTV_ATSCMH_RS_CODE_MODE_PRI <DTV-ATSCMH-RS-CODE-MODE-PRI>`
- :ref:`DTV_ATSCMH_RS_CODE_MODE_SEC <DTV-ATSCMH-RS-CODE-MODE-SEC>`
- :ref:`DTV_ATSCMH_SCCC_BLOCK_MODE <DTV-ATSCMH-SCCC-BLOCK-MODE>`
- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_A <DTV-ATSCMH-SCCC-CODE-MODE-A>`
- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_B <DTV-ATSCMH-SCCC-CODE-MODE-B>`
- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_C <DTV-ATSCMH-SCCC-CODE-MODE-C>`
- :ref:`DTV_ATSCMH_SCCC_CODE_MODE_D <DTV-ATSCMH-SCCC-CODE-MODE-D>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
.. _dtmb-params:
DTMB delivery system
====================
The following parameters are valid for DTMB:
- :ref:`DTV_API_VERSION <DTV-API-VERSION>`
- :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
- :ref:`DTV_TUNE <DTV-TUNE>`
- :ref:`DTV_CLEAR <DTV-CLEAR>`
- :ref:`DTV_FREQUENCY <DTV-FREQUENCY>`
- :ref:`DTV_MODULATION <DTV-MODULATION>`
- :ref:`DTV_BANDWIDTH_HZ <DTV-BANDWIDTH-HZ>`
- :ref:`DTV_INVERSION <DTV-INVERSION>`
- :ref:`DTV_INNER_FEC <DTV-INNER-FEC>`
- :ref:`DTV_GUARD_INTERVAL <DTV-GUARD-INTERVAL>`
- :ref:`DTV_TRANSMISSION_MODE <DTV-TRANSMISSION-MODE>`
- :ref:`DTV_INTERLEAVING <DTV-INTERLEAVING>`
- :ref:`DTV_LNA <DTV-LNA>`
In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
are also valid.
@@ -0,0 +1,252 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend-stat-properties:
******************************
Frontend statistics indicators
******************************
The values are returned via ``dtv_property.stat``. If the property is
supported, ``dtv_property.stat.len`` is bigger than zero.
For most delivery systems, ``dtv_property.stat.len`` will be 1 if the
stats is supported, and the properties will return a single value for
each parameter.
It should be noted, however, that new OFDM delivery systems like ISDB
can use different modulation types for each group of carriers. On such
standards, up to 3 groups of statistics can be provided, and
``dtv_property.stat.len`` is updated to reflect the "global" metrics,
plus one metric per each carrier group (called "layer" on ISDB).
So, in order to be consistent with other delivery systems, the first
value at :c:type:`dtv_property.stat.dtv_stats <dtv_stats>` array refers
to the global metric. The other elements of the array represent each
layer, starting from layer A(index 1), layer B (index 2) and so on.
The number of filled elements are stored at ``dtv_property.stat.len``.
Each element of the ``dtv_property.stat.dtv_stats`` array consists on
two elements:
- ``svalue`` or ``uvalue``, where ``svalue`` is for signed values of
the measure (dB measures) and ``uvalue`` is for unsigned values
(counters, relative scale)
- ``scale`` - Scale for the value. It can be:
- ``FE_SCALE_NOT_AVAILABLE`` - The parameter is supported by the
frontend, but it was not possible to collect it (could be a
transitory or permanent condition)
- ``FE_SCALE_DECIBEL`` - parameter is a signed value, measured in
1/1000 dB
- ``FE_SCALE_RELATIVE`` - parameter is a unsigned value, where 0
means 0% and 65535 means 100%.
- ``FE_SCALE_COUNTER`` - parameter is a unsigned value that counts
the occurrence of an event, like bit error, block error, or lapsed
time.
.. _DTV-STAT-SIGNAL-STRENGTH:
DTV_STAT_SIGNAL_STRENGTH
========================
Indicates the signal strength level at the analog part of the tuner or
of the demod.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_DECIBEL`` - signal strength is in 0.001 dBm units, power
measured in miliwatts. This value is generally negative.
- ``FE_SCALE_RELATIVE`` - The frontend provides a 0% to 100%
measurement for power (actually, 0 to 65535).
.. _DTV-STAT-CNR:
DTV_STAT_CNR
============
Indicates the Signal to Noise ratio for the main carrier.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_DECIBEL`` - Signal/Noise ratio is in 0.001 dB units.
- ``FE_SCALE_RELATIVE`` - The frontend provides a 0% to 100%
measurement for Signal/Noise (actually, 0 to 65535).
.. _DTV-STAT-PRE-ERROR-BIT-COUNT:
DTV_STAT_PRE_ERROR_BIT_COUNT
============================
Measures the number of bit errors before the forward error correction
(FEC) on the inner coding block (before Viterbi, LDPC or other inner
code).
This measure is taken during the same interval as
``DTV_STAT_PRE_TOTAL_BIT_COUNT``.
In order to get the BER (Bit Error Rate) measurement, it should be
divided by
:ref:`DTV_STAT_PRE_TOTAL_BIT_COUNT <DTV-STAT-PRE-TOTAL-BIT-COUNT>`.
This measurement is monotonically increased, as the frontend gets more
bit count measurements. The frontend may reset it when a
channel/transponder is tuned.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_COUNTER`` - Number of error bits counted before the inner
coding.
.. _DTV-STAT-PRE-TOTAL-BIT-COUNT:
DTV_STAT_PRE_TOTAL_BIT_COUNT
============================
Measures the amount of bits received before the inner code block, during
the same period as
:ref:`DTV_STAT_PRE_ERROR_BIT_COUNT <DTV-STAT-PRE-ERROR-BIT-COUNT>`
measurement was taken.
It should be noted that this measurement can be smaller than the total
amount of bits on the transport stream, as the frontend may need to
manually restart the measurement, losing some data between each
measurement interval.
This measurement is monotonically increased, as the frontend gets more
bit count measurements. The frontend may reset it when a
channel/transponder is tuned.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_COUNTER`` - Number of bits counted while measuring
:ref:`DTV_STAT_PRE_ERROR_BIT_COUNT <DTV-STAT-PRE-ERROR-BIT-COUNT>`.
.. _DTV-STAT-POST-ERROR-BIT-COUNT:
DTV_STAT_POST_ERROR_BIT_COUNT
=============================
Measures the number of bit errors after the forward error correction
(FEC) done by inner code block (after Viterbi, LDPC or other inner
code).
This measure is taken during the same interval as
``DTV_STAT_POST_TOTAL_BIT_COUNT``.
In order to get the BER (Bit Error Rate) measurement, it should be
divided by
:ref:`DTV_STAT_POST_TOTAL_BIT_COUNT <DTV-STAT-POST-TOTAL-BIT-COUNT>`.
This measurement is monotonically increased, as the frontend gets more
bit count measurements. The frontend may reset it when a
channel/transponder is tuned.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_COUNTER`` - Number of error bits counted after the inner
coding.
.. _DTV-STAT-POST-TOTAL-BIT-COUNT:
DTV_STAT_POST_TOTAL_BIT_COUNT
=============================
Measures the amount of bits received after the inner coding, during the
same period as
:ref:`DTV_STAT_POST_ERROR_BIT_COUNT <DTV-STAT-POST-ERROR-BIT-COUNT>`
measurement was taken.
It should be noted that this measurement can be smaller than the total
amount of bits on the transport stream, as the frontend may need to
manually restart the measurement, losing some data between each
measurement interval.
This measurement is monotonically increased, as the frontend gets more
bit count measurements. The frontend may reset it when a
channel/transponder is tuned.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_COUNTER`` - Number of bits counted while measuring
:ref:`DTV_STAT_POST_ERROR_BIT_COUNT <DTV-STAT-POST-ERROR-BIT-COUNT>`.
.. _DTV-STAT-ERROR-BLOCK-COUNT:
DTV_STAT_ERROR_BLOCK_COUNT
==========================
Measures the number of block errors after the outer forward error
correction coding (after Reed-Solomon or other outer code).
This measurement is monotonically increased, as the frontend gets more
bit count measurements. The frontend may reset it when a
channel/transponder is tuned.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_COUNTER`` - Number of error blocks counted after the outer
coding.
.. _DTV-STAT-TOTAL-BLOCK-COUNT:
DTV-STAT_TOTAL_BLOCK_COUNT
==========================
Measures the total number of blocks received during the same period as
:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>`
measurement was taken.
It can be used to calculate the PER indicator, by dividing
:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>` by
:ref:`DTV-STAT-TOTAL-BLOCK-COUNT`.
Possible scales for this metric are:
- ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
measurement was not complete yet.
- ``FE_SCALE_COUNTER`` - Number of blocks counted while measuring
:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>`.
@@ -0,0 +1,63 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb_frontend:
#######################
Digital TV Frontend API
#######################
The Digital TV frontend API was designed to support three groups of delivery
systems: Terrestrial, cable and Satellite. Currently, the following
delivery systems are supported:
- 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)
- Satellite systems: DVB-S, DVB-S2, DVB Turbo, ISDB-S, DSS
The Digital TV frontend controls several sub-devices including:
- Tuner
- Digital TV demodulator
- Low noise amplifier (LNA)
- Satellite Equipment Control (SEC) [#f1]_.
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) and MMT (MPEG Media Transport)
is not yet handled by this API but a future extension is possible.
.. [#f1]
On Satellite 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 <http://www.eutelsat.com/satellites/4_5_5.html>`__.
.. toctree::
:maxdepth: 1
query-dvb-frontend-info
dvb-fe-read-status
dvbproperty
frontend_fcalls
@@ -0,0 +1,57 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend_f_close:
***************************
Digital TV frontend close()
***************************
Name
====
fe-close - Close a frontend device
Synopsis
========
.. code-block:: c
#include <unistd.h>
.. c:function:: int close( int fd )
:name: dvb-fe-close
Arguments
=========
``fd``
File descriptor returned by :c:func:`open() <dvb-fe-open>`.
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.
Return Value
============
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,117 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend_f_open:
***************************
Digital TV frontend open()
***************************
Name
====
fe-open - Open a frontend device
Synopsis
========
.. code-block:: c
#include <fcntl.h>
.. c:function:: int open( const char *device_name, int flags )
:name: dvb-fe-open
Arguments
=========
``device_name``
Device to be opened.
``flags``
Open flags. Access can either be ``O_RDWR`` or ``O_RDONLY``.
Multiple opens are allowed with ``O_RDONLY``. In this mode, only
query and read ioctls are allowed.
Only one open is allowed in ``O_RDWR``. In this mode, all ioctls are
allowed.
When the ``O_NONBLOCK`` flag is given, the system calls may return
``EAGAIN`` error code when no data is available or when the device
driver is temporarily busy.
Other flags have no effect.
Description
===========
This system call opens a named frontend device
(``/dev/dvb/adapter?/frontend?``) for subsequent use. Usually the first
thing to do after a successful open is to find out the frontend type
with :ref:`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.
Return Value
============
On success :ref:`open() <frontend_f_open>` returns the new file descriptor.
On error, -1 is returned, and the ``errno`` variable is set appropriately.
Possible error codes are:
On success 0 is returned, and :c:type:`ca_slot_info` is filled.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``EPERM``
- The caller has no permission to access the device.
- - ``EBUSY``
- The the device driver is already in use.
- - ``EMFILE``
- The process already has the maximum number of files open.
- - ``ENFILE``
- The limit on the total number of files open on the system has been
reached.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
@@ -0,0 +1,31 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend_fcalls:
#######################
Frontend Function Calls
#######################
.. toctree::
:maxdepth: 1
frontend_f_open
frontend_f_close
fe-get-info
fe-read-status
fe-get-property
fe-diseqc-reset-overload
fe-diseqc-send-master-cmd
fe-diseqc-recv-slave-reply
fe-diseqc-send-burst
fe-set-tone
fe-set-voltage
fe-enable-high-lnb-voltage
fe-set-frontend-tune-mode
@@ -0,0 +1,45 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend_legacy_types:
Frontend Legacy Data Types
==========================
.. toctree::
:maxdepth: 1
fe-type-t
fe-bandwidth-t
dvb-frontend-parameters
dvb-frontend-event
.. _frontend_legacy_fcalls:
Frontend Legacy Function Calls
==============================
Those functions are defined at DVB version 3. The support is kept in the
kernel due to compatibility issues only. Their usage is strongly not
recommended
.. toctree::
:maxdepth: 1
fe-read-ber
fe-read-snr
fe-read-signal-strength
fe-read-uncorrected-blocks
fe-set-frontend
fe-get-frontend
fe-get-event
fe-dishnetwork-send-legacy-cmd
@@ -0,0 +1,25 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _frontend_legacy_dvbv3_api:
***********************************************
Digital TV 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.
.. toctree::
:maxdepth: 1
frontend_legacy_api
@@ -0,0 +1,30 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
****************************
Digital TV uAPI header files
****************************
Digital TV uAPI headers
***********************
.. kernel-include:: $BUILDDIR/frontend.h.rst
.. kernel-include:: $BUILDDIR/dmx.h.rst
.. kernel-include:: $BUILDDIR/ca.h.rst
.. kernel-include:: $BUILDDIR/net.h.rst
Legacy uAPI
***********
.. kernel-include:: $BUILDDIR/audio.h.rst
.. kernel-include:: $BUILDDIR/video.h.rst
@@ -0,0 +1,190 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _dvb_introdution:
************
Introduction
************
.. _requisites:
What you need to know
=====================
The reader of this document is required to have some knowledge in the
area of digital video broadcasting (Digital TV) and should be familiar with
part I of the MPEG2 specification ISO/IEC 13818 (aka ITU-T H.222), i.e
you should know what a program/transport stream (PS/TS) is and what is
meant by a packetized elementary stream (PES) or an I-frame.
Various Digital TV standards documents are available for download at:
- European standards (DVB): http://www.dvb.org and/or http://www.etsi.org.
- American standards (ATSC): https://www.atsc.org/standards/
- Japanese standards (ISDB): http://www.dibeg.org/
It is also necessary to know how to access Linux devices and how to
use ioctl calls. This also includes the knowledge of C or C++.
.. _history:
History
=======
The first API for Digital TV cards we used at Convergence in late 1999 was an
extension of the Video4Linux API which was primarily developed for frame
grabber cards. As such it was not really well suited to be used for Digital
TV cards and their new features like recording MPEG streams and filtering
several section and PES data streams at the same time.
In early 2000, Convergence was approached by Nokia with a proposal for a new
standard Linux Digital TV API. As a commitment to the development of terminals
based on open standards, Nokia and Convergence made it available to all
Linux developers and published it on https://linuxtv.org in September
2000. With the Linux driver for the Siemens/Hauppauge DVB PCI card,
Convergence provided a first implementation of the Linux Digital TV API.
Convergence was the maintainer of the Linux Digital TV API in the early
days.
Now, the API is maintained by the LinuxTV community (i.e. you, the reader
of this document). The Linux Digital TV API is constantly reviewed and
improved together with the improvements at the subsystem's core at the
Kernel.
.. _overview:
Overview
========
.. _stb_components:
.. kernel-figure:: dvbstb.svg
:alt: dvbstb.svg
:align: center
Components of a Digital TV card/STB
A Digital TV card or set-top-box (STB) usually consists of the
following main hardware components:
Frontend consisting of tuner and digital TV demodulator
Here the raw signal reaches the digital TV hardware from a satellite dish or
antenna or directly from cable. The frontend down-converts and
demodulates this signal into an MPEG transport stream (TS). In case
of a satellite frontend, this includes a facility for satellite
equipment control (SEC), which allows control of LNB polarization,
multi feed switches or dish rotors.
Conditional Access (CA) hardware like CI adapters and smartcard slots
The complete TS is passed through the CA hardware. Programs to which
the user has access (controlled by the smart card) are decoded in
real time and re-inserted into the TS.
.. note::
Not every digital TV hardware provides conditional access hardware.
Demultiplexer which filters the incoming Digital TV MPEG-TS stream
The demultiplexer splits the TS into its components like audio and
video streams. Besides usually several of such audio and video
streams it also contains data streams with information about the
programs offered in this or other streams of the same provider.
Audio and video decoder
The main targets of the demultiplexer are audio and video
decoders. After decoding, they pass on the uncompressed audio and
video to the computer screen or to a TV set.
.. note::
Modern hardware usually doesn't have a separate decoder hardware, as
such functionality can be provided by the main CPU, by the graphics
adapter of the system or by a signal processing hardware embedded on
a Systems on a Chip (SoC) integrated circuit.
It may also not be needed for certain usages (e.g. for data-only
uses like “internet over satellite”).
:ref:`stb_components` shows a crude schematic of the control and data
flow between those components.
.. _dvb_devices:
Linux Digital TV Devices
========================
The Linux Digital TV API lets you control these hardware components through
currently six Unix-style character devices for video, audio, frontend,
demux, CA and IP-over-DVB networking. The video and audio devices
control the MPEG2 decoder hardware, the frontend device the tuner and
the Digital TV demodulator. The demux device gives you control over the PES
and section filters of the hardware. If the hardware does not support
filtering these filters can be implemented in software. Finally, the CA
device controls all the conditional access capabilities of the hardware.
It can depend on the individual security requirements of the platform,
if and how many of the CA functions are made available to the
application through this device.
All devices can be found in the ``/dev`` tree under ``/dev/dvb``. The
individual devices are called:
- ``/dev/dvb/adapterN/audioM``,
- ``/dev/dvb/adapterN/videoM``,
- ``/dev/dvb/adapterN/frontendM``,
- ``/dev/dvb/adapterN/netM``,
- ``/dev/dvb/adapterN/demuxM``,
- ``/dev/dvb/adapterN/dvrM``,
- ``/dev/dvb/adapterN/caM``,
where ``N`` enumerates the Digital TV cards in a system starting from 0, and
``M`` enumerates the devices of each type within each adapter, starting
from 0, too. We will omit the “``/dev/dvb/adapterN/``\ ” in the further
discussion of these devices.
More details about the data structures and function calls of all the
devices are described in the following chapters.
.. _include_files:
API include files
=================
For each of the Digital TV devices a corresponding include file exists. The
Digital TV API include files should be included in application sources with a
partial path like:
.. code-block:: c
#include <linux/dvb/ca.h>
#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>
#include <linux/dvb/net.h>
To enable applications to support different API version, an additional
include file ``linux/dvb/version.h`` exists, which defines the constant
``DVB_API_VERSION``. This document describes ``DVB_API_VERSION 5.10``.
@@ -0,0 +1,39 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/userspace-api/media/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _legacy_dvb_apis:
***************************
Digital TV Deprecated APIs
***************************
The APIs described here **should not** be used on new drivers or applications.
The DVBv3 frontend API has issues with new delivery systems, including
DVB-S2, DVB-T2, ISDB, etc.
There's just one driver for a very legacy hardware using the Digital TV
audio and video APIs. No modern drivers should use it. Instead, audio and
video should be using the V4L2 and ALSA APIs, and the pipelines should
be set via the Media Controller API.
.. attention::
The APIs described here doesn't necessarily reflect the current
code implementation, as this section of the document was written
for DVB version 1, while the code reflects DVB version 3
implementation.
.. toctree::
:maxdepth: 1
frontend_legacy_dvbv3_api
video
audio

Some files were not shown because too many files have changed in this diff Show More