1 .. -*- coding: utf-8; mode: rst -*-
9 This section describes the structures, data types and defines used when
10 talking to the audio device.
13 .. _audio-stream-source-t:
18 The audio stream source is set through the AUDIO_SELECT_SOURCE call
19 and can take the following values, depending on whether we are replaying
20 from an internal (demux) or external (user write) source.
28 } audio_stream_source_t;
30 AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the
31 frontend or the DVR device) as the source of the video stream. If
32 AUDIO_SOURCE_MEMORY is selected the stream comes from the application
33 through the ``write()`` system call.
36 .. _audio-play-state-t:
41 The following values can be returned by the AUDIO_GET_STATUS call
42 representing the state of audio playback.
54 .. _audio-channel-select-t:
56 audio_channel_select_t
57 ======================
59 The audio channel selected via AUDIO_CHANNEL_SELECT is determined by
71 } audio_channel_select_t;
79 The AUDIO_GET_STATUS call returns the following structure informing
80 about various states of the playback operation.
85 typedef struct audio_status {
86 boolean AV_sync_state;
88 audio_play_state_t play_state;
89 audio_stream_source_t stream_source;
90 audio_channel_select_t channel_select;
92 audio_mixer_t mixer_state;
101 The following structure is used by the AUDIO_SET_MIXER call to set the
107 typedef struct audio_mixer {
108 unsigned int volume_left;
109 unsigned int volume_right;
118 A call to AUDIO_GET_CAPABILITIES returns an unsigned integer with the
119 following bits set according to the hardwares capabilities.
124 #define AUDIO_CAP_DTS 1
125 #define AUDIO_CAP_LPCM 2
126 #define AUDIO_CAP_MP1 4
127 #define AUDIO_CAP_MP2 8
128 #define AUDIO_CAP_MP3 16
129 #define AUDIO_CAP_AAC 32
130 #define AUDIO_CAP_OGG 64
131 #define AUDIO_CAP_SDDS 128
132 #define AUDIO_CAP_AC3 256
140 The ioctl AUDIO_SET_KARAOKE uses the following format:
146 struct audio_karaoke {
152 If Vocal1 or Vocal2 are non-zero, they get mixed into left and right t
153 at 70% each. If both, Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed
154 into the left channel and Vocal2 into the right channel at 100% each. Ff
155 Melody is non-zero, the melody channel gets mixed into left and right.
158 .. _audio-attributes-t:
163 The following attributes can be set by a call to AUDIO_SET_ATTRIBUTES:
168 typedef uint16_t audio_attributes_t;
170 /* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
171 /* 12 multichannel extension */
172 /* 11-10 audio type (0=not spec, 1=language included) */
173 /* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
174 /* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
175 /* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
176 /* 2- 0 number of audio channels (n+1 channels) */