From: Stefan Herdler <herdler@nurfuerspam.de>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
linux-media@vger.kernel.org,
Tomasz Maciej Nowak <tmn505@gmail.com>,
Corinna Vinschen <vinschen@redhat.com>,
Soeren Moch <smoch@web.de>
Subject: [PATCH v3 3/6] Add documentation for audio.h (data types)
Date: Mon, 17 Jul 2023 04:04:43 +0200 [thread overview]
Message-ID: <20230717020446.28877-4-herdler@nurfuerspam.de> (raw)
In-Reply-To: <20230717020446.28877-1-herdler@nurfuerspam.de>
Add new documentation file for audio.h
Step 1: data types only
Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
---
.../media/dvb/legacy_dvb_audio.rst | 447 ++++++++++++++++++
1 file changed, 447 insertions(+)
create mode 100644 Documentation/userspace-api/media/dvb/legacy_dvb_audio.rst
diff --git a/Documentation/userspace-api/media/dvb/legacy_dvb_audio.rst b/Documentation/userspace-api/media/dvb/legacy_dvb_audio.rst
new file mode 100644
index 000000000000..4c994f8c97e5
--- /dev/null
+++ b/Documentation/userspace-api/media/dvb/legacy_dvb_audio.rst
@@ -0,0 +1,447 @@
+.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later OR GPL-2.0
+
+.. c:namespace:: dtv.legacy.audio
+
+.. _dvb_audio:
+
+================
+DVB Audio Device
+================
+
+.. attention:: Do **not** use in new drivers!
+ See: :ref:`legacy_dvb_decoder_notes`
+
+The DVB audio device controls the MPEG2 audio decoder of the DVB
+hardware. It can be accessed through ``/dev/dvb/adapter?/audio?``. Data
+types and ioctl definitions can be accessed by including
+``linux/dvb/audio.h`` in your application.
+
+Please note that most DVB cards don’t 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. Use :ref:`V4L2 ioctls<video>` for new drivers!
+
+
+Audio Data Types
+================
+
+This section describes the structures, data types and defines used when
+talking to the audio device.
+
+
+-----
+
+
+audio_stream_source_t
+---------------------
+
+Synopsis
+~~~~~~~~
+
+.. c:enum:: audio_stream_source_t
+
+.. code-block:: c
+
+ typedef enum {
+ AUDIO_SOURCE_DEMUX,
+ AUDIO_SOURCE_MEMORY
+ } audio_stream_source_t;
+
+Constants
+~~~~~~~~~
+
+.. flat-table::
+ :header-rows: 0
+ :stub-columns: 0
+
+ - ..
+
+ - ``AUDIO_SOURCE_DEMUX``
+
+ - :cspan:`1` Selects the demultiplexer (fed either by the frontend
+ or the DVR device) as the source of the video stream.
+
+ - ..
+
+ - ``AUDIO_SOURCE_MEMORY``
+
+ - Selects the stream from the application that comes through
+ the `write()`_ system call.
+
+Description
+~~~~~~~~~~~
+
+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.
+
+The data fed to the decoder is also controlled by the PID-filter.
+Output selection: :c:enum:`dmx_output` ``DMX_OUT_DECODER``.
+
+
+-----
+
+
+audio_play_state_t
+------------------
+
+Synopsis
+~~~~~~~~
+
+.. c:enum:: audio_play_state_t
+
+.. code-block:: c
+
+ typedef enum {
+ AUDIO_STOPPED,
+ AUDIO_PLAYING,
+ AUDIO_PAUSED
+ } audio_play_state_t;
+
+Constants
+~~~~~~~~~
+
+.. flat-table::
+ :header-rows: 0
+ :stub-columns: 0
+
+ - ..
+
+ - ``AUDIO_STOPPED``
+
+ - Audio is stopped.
+
+ - ..
+
+ - ``AUDIO_PLAYING``
+
+ - Audio is currently playing.
+
+ - ..
+
+ - ``AUDIO_PAUSE``
+
+ - Audio is frozen.
+
+Description
+~~~~~~~~~~~
+
+This values can be returned by the `AUDIO_GET_STATUS`_ call
+representing the state of audio playback.
+
+
+-----
+
+
+audio_channel_select_t
+----------------------
+
+Synopsis
+~~~~~~~~
+
+.. c:enum:: audio_channel_select_t
+
+.. code-block:: c
+
+ typedef enum {
+ AUDIO_STEREO,
+ AUDIO_MONO_LEFT,
+ AUDIO_MONO_RIGHT,
+ AUDIO_MONO,
+ AUDIO_STEREO_SWAPPED
+ } audio_channel_select_t;
+
+Constants
+~~~~~~~~~
+
+.. flat-table::
+ :header-rows: 0
+ :stub-columns: 0
+
+ - ..
+
+ - ``AUDIO_STEREO``
+
+ - Stereo.
+
+ - ..
+
+ - ``AUDIO_MONO_LEFT``
+
+ - Mono, select left stereo channel as source.
+
+ - ..
+
+ - ``AUDIO_MONO_RIGHT``
+
+ - Mono, select right stereo channel as source.
+
+ - ..
+
+ - ``AUDIO_MONO``
+
+ - Mono source only.
+
+ - ..
+
+ - ``AUDIO_STEREO_SWAPPED``
+
+ - Stereo, swap L & R.
+
+Description
+~~~~~~~~~~~
+
+The audio channel selected via `AUDIO_CHANNEL_SELECT`_ is determined by
+this values.
+
+
+-----
+
+
+audio_mixer_t
+-------------
+
+Synopsis
+~~~~~~~~
+
+.. c:struct:: audio_mixer
+
+.. code-block:: c
+
+ typedef struct audio_mixer {
+ unsigned int volume_left;
+ unsigned int volume_right;
+ } audio_mixer_t;
+
+Variables
+~~~~~~~~~
+
+.. flat-table::
+ :header-rows: 0
+ :stub-columns: 0
+
+ - ..
+
+ - ``unsigned int volume_left``
+
+ - Volume left channel.
+ Valid range: 0 ... 255
+
+ - ..
+
+ - ``unsigned int volume_right``
+
+ - Volume right channel.
+ Valid range: 0 ... 255
+
+Description
+~~~~~~~~~~~
+
+This structure is used by the `AUDIO_SET_MIXER`_ call to set the
+audio volume.
+
+
+-----
+
+
+audio_status
+------------
+
+Synopsis
+~~~~~~~~
+
+.. c:struct:: audio_status
+
+.. code-block:: c
+
+ typedef struct audio_status {
+ int AV_sync_state;
+ int mute_state;
+ audio_play_state_t play_state;
+ audio_stream_source_t stream_source;
+ audio_channel_select_t channel_select;
+ int bypass_mode;
+ audio_mixer_t mixer_state;
+ } audio_status_t;
+
+Variables
+~~~~~~~~~
+
+.. flat-table::
+ :header-rows: 0
+ :stub-columns: 0
+
+ - ..
+
+ - :rspan:`2` ``int AV_sync_state``
+
+ - :cspan:`1` Shows if A/V synchronization is ON or OFF.
+
+ - ..
+
+ - TRUE ( != 0 )
+
+ - AV-sync ON.
+
+ - ..
+
+ - FALSE ( == 0 )
+
+ - AV-sync OFF.
+
+ - ..
+
+ - :rspan:`2` ``int mute_state``
+
+ - :cspan:`1` Indicates if audio is muted or not.
+
+ - ..
+
+ - TRUE ( != 0 )
+
+ - mute audio
+
+ - ..
+
+ - FALSE ( == 0 )
+
+ - unmute audio
+
+ - ..
+
+ - `audio_play_state_t`_ ``play_state``
+
+ - Current playback state.
+
+ - ..
+
+ - `audio_stream_source_t`_ ``stream_source``
+
+ - Current source of the data.
+
+ - ..
+
+ - :rspan:`2` ``int bypass_mode``
+
+ - :cspan:`1` Is the decoding of the current Audio stream in
+ the DVB subsystem enabled or disabled.
+
+ - ..
+
+ - TRUE ( != 0 )
+
+ - Bypass disabled.
+
+ - ..
+
+ - FALSE ( == 0 )
+
+ - Bypass enabled.
+
+ - ..
+
+ - `audio_mixer_t`_ ``mixer_state``
+
+ - Current volume settings.
+
+Description
+~~~~~~~~~~~
+
+The `AUDIO_GET_STATUS`_ call returns this structure as information
+about various states of the playback operation.
+
+
+-----
+
+
+audio encodings
+---------------
+
+Synopsis
+~~~~~~~~
+
+.. 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
+
+Constants
+~~~~~~~~~
+
+.. flat-table::
+ :header-rows: 0
+ :stub-columns: 0
+
+ - ..
+
+ - ``AUDIO_CAP_DTS``
+
+ - :cspan:`1` The hardware accepts DTS audio tracks.
+
+ - ..
+
+ - ``AUDIO_CAP_LPCM``
+
+ - The hardware accepts uncompressed audio with
+ Linear Pulse-Code Modulation (LPCM)
+
+ - ..
+
+ - ``AUDIO_CAP_MP1``
+
+ - The hardware accepts MPEG-1 Audio Layer 1.
+
+ - ..
+
+ - ``AUDIO_CAP_MP2``
+
+ - The hardware accepts MPEG-1 Audio Layer 2.
+ Also known as MUSICAM.
+
+ - ..
+
+ - ``AUDIO_CAP_MP3``
+
+ - The hardware accepts MPEG-1 Audio Layer III.
+ Commomly known as .mp3.
+
+ - ..
+
+ - ``AUDIO_CAP_AAC``
+
+ - The hardware accepts AAC (Advanced Audio Coding).
+
+ - ..
+
+ - ``AUDIO_CAP_OGG``
+
+ - The hardware accepts Vorbis audio tracks.
+
+ - ..
+
+ - ``AUDIO_CAP_SDDS``
+
+ - The hardware accepts Sony Dynamic Digital Sound (SDDS).
+
+ - ..
+
+ - ``AUDIO_CAP_AC3``
+
+ - The hardware accepts Dolby Digital ATSC A/52 audio.
+ Also known as AC-3.
+
+Description
+~~~~~~~~~~~
+
+A call to `AUDIO_GET_CAPABILITIES`_ returns an unsigned integer with the
+following bits set according to the hardwares capabilities.
--
2.34.0
next prev parent reply other threads:[~2023-07-17 2:05 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 22:19 Future of the SAA7146 drivers Stefan Herdler
2023-01-31 8:45 ` Hans Verkuil
2023-01-31 23:56 ` Stefan Herdler
2023-02-01 9:15 ` Hans Verkuil
2023-02-01 11:35 ` Soeren Moch
2023-02-01 13:51 ` Hans Verkuil
2023-02-01 15:20 ` Soeren Moch
2023-02-01 16:37 ` Hans Verkuil
2023-02-08 8:42 ` Mauro Carvalho Chehab
2023-02-01 23:12 ` Stefan Herdler
2023-02-02 9:43 ` Soeren Moch
2023-02-02 21:26 ` Stefan Herdler
2023-02-03 0:58 ` Stefan Herdler
2023-02-03 8:50 ` Hans Verkuil
2023-02-06 0:06 ` Stefan Herdler
2023-02-08 9:08 ` Mauro Carvalho Chehab
2023-02-12 23:10 ` Stefan Herdler
2023-03-24 10:37 ` saa7146: please test the vb2 conversion! Hans Verkuil
2023-03-24 10:40 ` Hans Verkuil
2023-03-24 21:21 ` Stefan Herdler
2023-03-27 17:13 ` Tomasz Maciej Nowak
2023-04-06 22:43 ` Stefan Herdler
2023-04-07 7:04 ` Hans Verkuil
2023-04-09 22:36 ` Stefan Herdler
2023-04-11 7:29 ` Hans Verkuil
2023-04-12 10:11 ` Hans Verkuil
2023-04-12 11:16 ` Hans Verkuil
2023-04-14 0:15 ` Stefan Herdler
2023-04-14 8:36 ` Hans Verkuil
2023-04-15 21:15 ` Stefan Herdler
2023-03-25 1:44 ` [PATCH] Legacy DVB API: completion of documentation Stefan Herdler
2023-03-25 8:47 ` kernel test robot
2023-03-26 21:34 ` [PATCH v2] " Stefan Herdler
2023-03-27 18:28 ` Mauro Carvalho Chehab
2023-04-02 22:25 ` Stefan Herdler
2023-07-17 2:04 ` [PATCH v3 0/6] " Stefan Herdler
2023-07-17 2:04 ` [PATCH v3 1/6] Add documentation for legacy DVB decoder API Stefan Herdler
2023-07-17 2:04 ` [PATCH v3 2/6] Add documentation for osd.h Stefan Herdler
2023-07-17 2:04 ` Stefan Herdler [this message]
2023-07-19 9:09 ` [PATCH v3 3/6] Add documentation for audio.h (data types) kernel test robot
2023-07-17 2:04 ` [PATCH v3 4/6] Add documentation for audio.h (function calls) Stefan Herdler
2023-07-17 2:04 ` [PATCH v3 5/6] Add documentation for video.h (data types) Stefan Herdler
2023-07-17 2:04 ` [PATCH v3 6/6] Add documentation for video.h (function calls) Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 0/6] media: docs: uAPI: dvb/decoder: completing the documentation Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 1/6] " Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 2/6] media: docs: uAPI: dvb/osd: " Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 3/6] media: docs: uAPI: dvb/audio: completing the documentation (data types) Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 4/6] media: docs: uAPI: dvb/audio: completing the documentation (function calls) Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 5/6] media: docs: uAPI: dvb/video: completing the documentation (data types) Stefan Herdler
2024-01-28 23:32 ` [PATCH v4 6/6] media: docs: uAPI: dvb/video: completing the documentation (function calls) Stefan Herdler
2024-02-07 5:10 ` [PATCH v4 0/6] media: docs: uAPI: dvb/decoder: completing the documentation Mauro Carvalho Chehab
2024-02-08 23:56 ` Stefan Herdler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230717020446.28877-4-herdler@nurfuerspam.de \
--to=herdler@nurfuerspam.de \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=smoch@web.de \
--cc=tmn505@gmail.com \
--cc=vinschen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).