6.2.3.2. DVB Audio Device — The Linux Kernel documentation
The Linux Kernel 7.4.0-rc3 Quick search Contents Working with the development community Development process Submitting patches Code of conduct Maintainer handbook All development-process docs Internal API manuals Core API Driver APIs Subsystems Locking Development tools and processes Licensing rules Writing documentation Development tools Testing guide Hacking guide Tracing Fault injection Livepatching Rust User-oriented documentation Administration Build system Reporting issues Userspace tools Userspace API System calls Security-related interfaces Devices and I/O OpenCAPI (Open Coherent Accelerator Processor Interface) Allocating dma-buf using heaps Exchanging pixel buffers Firmware Control (FWCTL) Userspace API GPIO IOMMUFD Linux Media Infrastructure userspace API Dell Systems Management Base Driver VDUSE - “vDPA Device in Userspace” ISA Plug & Play support Everything else Firmware-related documentation Firmware Firmware and Devicetree Architecture-specific documentation CPU architectures Other documentation Unsorted documentation Translations Translations This Page Show Source 6.2.3.2.
DVB Audio Device ¶ Attention Do not use in new drivers! See: General 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 V4L2 ioctls for new drivers! 6.2.3.2.1. Audio Data Types ¶ This section describes the structures, data types and defines used when talking to the audio device. 6.2.3.2.1.1. audio_stream_source_t ¶ 6.2.3.2.1.1.1.
Synopsis ¶ enum audio_stream_source_t ¶ typedef enum { AUDIO_SOURCE_DEMUX , AUDIO_SOURCE_MEMORY } audio_stream_source_t ; 6.2.3.2.1.1.2. Constants ¶ AUDIO_SOURCE_DEMUX 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. 6.2.3.2.1.1.3. 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: dmx_output DMX_OUT_DECODER . 6.2.3.2.1.2. audio_play_state_t ¶ 6.2.3.2.1.2.1. Synopsis ¶ enum audio_play_state_t ¶ typedef enum { AUDIO_STOPPED , AUDIO_PLAYING , AUDIO_PAUSED } audio_play_state_t ; 6.2.3.2.1.2.2. Constants ¶ AUDIO_STOPPED Audio is stopped. AUDIO_PLAYING Audio is currently playing. AUDIO_PAUSE Audio is frozen. 6.2.3.2.1.2.3.
Description ¶ This values can be returned by the AUDIO_GET_STATUS call representing the state of audio playback. 6.2.3.2.1.3. audio_channel_select_t ¶ 6.2.3.2.1.3.1. Synopsis ¶ enum audio_channel_select_t ¶ typedef enum { AUDIO_STEREO , AUDIO_MONO_LEFT , AUDIO_MONO_RIGHT , AUDIO_MONO , AUDIO_STEREO_SWAPPED } audio_channel_select_t ; 6.2.3.2.1.3.2. Constants ¶ 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. 6.2.3.2.1.3.3. Description ¶ The audio channel selected via AUDIO_CHANNEL_SELECT is determined by this value. 6.2.3.2.1.4. audio_mixer_t ¶ 6.2.3.2.1.4.1. Synopsis ¶ struct audio_mixer ¶ typedef struct audio_mixer { unsigned int volume_left ; unsigned int volume_right ; } audio_mixer_t ; 6.2.3.2.1.4.2.
Variables ¶ unsigned int volume_left Volume left channel. Valid range: 0 ... 255 unsigned int volume_right Volume right channel. Valid range: 0 ... 255 6.2.3.2.1.4.3. Description ¶ This structure is used by the AUDIO_SET_MIXER call to set the audio volume. 6.2.3.2.1.5. audio_status ¶ 6.2.3.2.1.5.1. Synopsis ¶ struct audio_status ¶ 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 ; 6.2.3.2.1.5.2.
Variables ¶ int AV_sync_state Shows if A/V synchronization is ON or OFF. TRUE ( != 0 ) AV-sync ON. FALSE ( == 0 ) AV-sync OFF. int mute_state 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. int bypass_mode 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. 6.2.3.2.1.5.3. Description ¶ The AUDIO_GET_STATUS call returns this structure as information about various states of the playback operation. 6.2.3.2.1.6. audio encodings ¶ 6.2.3.2.1.6.1. Synopsis ¶ #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 6.2.3.2.1.6.2.
Constants ¶ AUDIO_CAP_DTS 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. Commonly 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. 6.2.3.2.1.6.3. Description ¶ A call to AUDIO_GET_CAPABILITIES returns an unsigned integer with the following bits set according to the hardware’s capabilities. 6.2.3.2.2. Audio Function Calls ¶ 6.2.3.2.2.1.
AUDIO_STOP ¶ 6.2.3.2.2.1.1. Synopsis ¶ AUDIO_STOP ¶ int ioctl ( int fd , int request = AUDIO_STOP ) 6.2.3.2.2.1.2. Arguments ¶ int fd File descriptor returned by a previous call to open() . int request Equals AUDIO_STOP for this command. 6.2.3.2.2.1.3. Description ¶ Attention Do not use in new drivers! See: General Notes This ioctl call asks the Audio Device to stop playing the current stream. 6.2.3.2.2.1.4. 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 Generic Error Codes chapter. 6.2.3.2.2.2. AUDIO_PLAY ¶ 6.2.3.2.2.2.1. Synopsis ¶ AUDIO_PLAY ¶ int ioctl ( int fd , int request = AUDIO_PLAY ) 6.2.3.2.2.2.2. Arguments ¶ int fd File descriptor returned by a previous call to open() . int request Equals AUDIO_PLAY for this command. 6.2.3.2.2.2.3. Description ¶ Attention Do not use in new drivers! See: General Notes This ioctl call asks the Audio Device to start playing an audio stream from the selected source.
6.2.3.2.2.2.4. 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 Generic Error Codes chapter. 6.2.3.2.2.3. AUDIO_PAUSE ¶ 6.2.3.2.2.3.1. Synopsis ¶ AUDIO_PAUSE ¶ int ioctl ( int fd , int request = AUDIO_PAUSE ) 6.2.3.2.2.3.2. Arguments ¶ int fd File descriptor returned by a previous call to open() . int request Equals AUDIO_PAUSE for this command.
6.2.3.2.2.3.3. Description ¶ Attention Do not use in new drivers! See: General Notes This ioctl call suspends the audio stream be
The rest of this page is on the live site.