libvhost-user: Remove unnecessary FD flag check for event file descriptors
[qemu/kevin.git] / qapi / audio.json
blob97aee3728835aa98da18e800310e5c30fe291372
1 # -*- mode: python -*-
3 # Copyright (C) 2015-2019 Zoltán Kővágó <DirtY.iCE.hu@gmail.com>
5 # This work is licensed under the terms of the GNU GPL, version 2 or later.
6 # See the COPYING file in the top-level directory.
8 ##
9 # @AudiodevPerDirectionOptions:
11 # General audio backend options that are used for both playback and
12 # recording.
14 # @fixed-settings: use fixed settings for host input/output. When off,
15 #                  frequency, channels and format must not be
16 #                  specified (default true)
18 # @frequency: frequency to use when using fixed settings
19 #             (default 44100)
21 # @channels: number of channels when using fixed settings (default 2)
23 # @voices: number of voices to use (default 1)
25 # @format: sample format to use when using fixed settings
26 #          (default s16)
28 # @buffer-length: the buffer length in microseconds
30 # Since: 4.0
32 { 'struct': 'AudiodevPerDirectionOptions',
33   'data': {
34     '*fixed-settings': 'bool',
35     '*frequency':      'uint32',
36     '*channels':       'uint32',
37     '*voices':         'uint32',
38     '*format':         'AudioFormat',
39     '*buffer-length':  'uint32' } }
42 # @AudiodevGenericOptions:
44 # Generic driver-specific options.
46 # @in: options of the capture stream
48 # @out: options of the playback stream
50 # Since: 4.0
52 { 'struct': 'AudiodevGenericOptions',
53   'data': {
54     '*in':  'AudiodevPerDirectionOptions',
55     '*out': 'AudiodevPerDirectionOptions' } }
58 # @AudiodevAlsaPerDirectionOptions:
60 # Options of the ALSA backend that are used for both playback and
61 # recording.
63 # @dev: the name of the ALSA device to use (default 'default')
65 # @period-length: the period length in microseconds
67 # @try-poll: attempt to use poll mode, falling back to non-polling
68 #            access on failure (default true)
70 # Since: 4.0
72 { 'struct': 'AudiodevAlsaPerDirectionOptions',
73   'base': 'AudiodevPerDirectionOptions',
74   'data': {
75     '*dev':           'str',
76     '*period-length': 'uint32',
77     '*try-poll':      'bool' } }
80 # @AudiodevAlsaOptions:
82 # Options of the ALSA audio backend.
84 # @in: options of the capture stream
86 # @out: options of the playback stream
88 # @threshold: set the threshold (in microseconds) when playback starts
90 # Since: 4.0
92 { 'struct': 'AudiodevAlsaOptions',
93   'data': {
94     '*in':        'AudiodevAlsaPerDirectionOptions',
95     '*out':       'AudiodevAlsaPerDirectionOptions',
96     '*threshold': 'uint32' } }
99 # @AudiodevCoreaudioPerDirectionOptions:
101 # Options of the Core Audio backend that are used for both playback and
102 # recording.
104 # @buffer-count: number of buffers
106 # Since: 4.0
108 { 'struct': 'AudiodevCoreaudioPerDirectionOptions',
109   'base': 'AudiodevPerDirectionOptions',
110   'data': {
111     '*buffer-count': 'uint32' } }
114 # @AudiodevCoreaudioOptions:
116 # Options of the coreaudio audio backend.
118 # @in: options of the capture stream
120 # @out: options of the playback stream
122 # Since: 4.0
124 { 'struct': 'AudiodevCoreaudioOptions',
125   'data': {
126     '*in':  'AudiodevCoreaudioPerDirectionOptions',
127     '*out': 'AudiodevCoreaudioPerDirectionOptions' } }
130 # @AudiodevDsoundOptions:
132 # Options of the DirectSound audio backend.
134 # @in: options of the capture stream
136 # @out: options of the playback stream
138 # @latency: add extra latency to playback in microseconds
139 #           (default 10000)
141 # Since: 4.0
143 { 'struct': 'AudiodevDsoundOptions',
144   'data': {
145     '*in':      'AudiodevPerDirectionOptions',
146     '*out':     'AudiodevPerDirectionOptions',
147     '*latency': 'uint32' } }
150 # @AudiodevOssPerDirectionOptions:
152 # Options of the OSS backend that are used for both playback and
153 # recording.
155 # @dev: file name of the OSS device (default '/dev/dsp')
157 # @buffer-count: number of buffers
159 # @try-poll: attempt to use poll mode, falling back to non-polling
160 #            access on failure (default true)
162 # Since: 4.0
164 { 'struct': 'AudiodevOssPerDirectionOptions',
165   'base': 'AudiodevPerDirectionOptions',
166   'data': {
167     '*dev':          'str',
168     '*buffer-count': 'uint32',
169     '*try-poll':     'bool' } }
172 # @AudiodevOssOptions:
174 # Options of the OSS audio backend.
176 # @in: options of the capture stream
178 # @out: options of the playback stream
180 # @try-mmap: try using memory-mapped access, falling back to
181 #            non-memory-mapped access on failure (default true)
183 # @exclusive: open device in exclusive mode (vmix won't work)
184 #             (default false)
186 # @dsp-policy: set the timing policy of the device (between 0 and 10,
187 #              where smaller number means smaller latency but higher
188 #              CPU usage) or -1 to use fragment mode (option ignored
189 #              on some platforms) (default 5)
191 # Since: 4.0
193 { 'struct': 'AudiodevOssOptions',
194   'data': {
195     '*in':         'AudiodevOssPerDirectionOptions',
196     '*out':        'AudiodevOssPerDirectionOptions',
197     '*try-mmap':   'bool',
198     '*exclusive':  'bool',
199     '*dsp-policy': 'uint32' } }
202 # @AudiodevPaPerDirectionOptions:
204 # Options of the Pulseaudio backend that are used for both playback and
205 # recording.
207 # @name: name of the sink/source to use
209 # Since: 4.0
211 { 'struct': 'AudiodevPaPerDirectionOptions',
212   'base': 'AudiodevPerDirectionOptions',
213   'data': {
214     '*name': 'str' } }
217 # @AudiodevPaOptions:
219 # Options of the PulseAudio audio backend.
221 # @in: options of the capture stream
223 # @out: options of the playback stream
225 # @server: PulseAudio server address (default: let PulseAudio choose)
227 # Since: 4.0
229 { 'struct': 'AudiodevPaOptions',
230   'data': {
231     '*in':     'AudiodevPaPerDirectionOptions',
232     '*out':    'AudiodevPaPerDirectionOptions',
233     '*server': 'str' } }
236 # @AudiodevWavOptions:
238 # Options of the wav audio backend.
240 # @in: options of the capture stream
242 # @out: options of the playback stream
244 # @path: name of the wav file to record (default 'qemu.wav')
246 # Since: 4.0
248 { 'struct': 'AudiodevWavOptions',
249   'data': {
250     '*in':   'AudiodevPerDirectionOptions',
251     '*out':  'AudiodevPerDirectionOptions',
252     '*path': 'str' } }
256 # @AudioFormat:
258 # An enumeration of possible audio formats.
260 # Since: 4.0
262 { 'enum': 'AudioFormat',
263   'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32' ] }
266 # @AudiodevDriver:
268 # An enumeration of possible audio backend drivers.
270 # Since: 4.0
272 { 'enum': 'AudiodevDriver',
273   'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'oss', 'pa', 'sdl',
274             'spice', 'wav' ] }
277 # @Audiodev:
279 # Options of an audio backend.
281 # @id: identifier of the backend
283 # @driver: the backend driver to use
285 # @timer-period: timer period (in microseconds, 0: use lowest possible)
287 # Since: 4.0
289 { 'union': 'Audiodev',
290   'base': {
291     'id':            'str',
292     'driver':        'AudiodevDriver',
293     '*timer-period': 'uint32' },
294   'discriminator': 'driver',
295   'data': {
296     'none':      'AudiodevGenericOptions',
297     'alsa':      'AudiodevAlsaOptions',
298     'coreaudio': 'AudiodevCoreaudioOptions',
299     'dsound':    'AudiodevDsoundOptions',
300     'oss':       'AudiodevOssOptions',
301     'pa':        'AudiodevPaOptions',
302     'sdl':       'AudiodevGenericOptions',
303     'spice':     'AudiodevGenericOptions',
304     'wav':       'AudiodevWavOptions' } }