target/mips: Simplify decode_opc_mxu() ifdef'ry
[qemu/ar7.git] / qapi / audio.json
blob9cba0df8a4e9e0ddb5eec670a830ab74b5f642d3
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 # = Audio
13 # @AudiodevPerDirectionOptions:
15 # General audio backend options that are used for both playback and
16 # recording.
18 # @mixing-engine: use QEMU's mixing engine to mix all streams inside QEMU and
19 #                 convert audio formats when not supported by the backend. When
20 #                 set to off, fixed-settings must be also off (default on,
21 #                 since 4.2)
23 # @fixed-settings: use fixed settings for host input/output. When off,
24 #                  frequency, channels and format must not be
25 #                  specified (default true)
27 # @frequency: frequency to use when using fixed settings
28 #             (default 44100)
30 # @channels: number of channels when using fixed settings (default 2)
32 # @voices: number of voices to use (default 1)
34 # @format: sample format to use when using fixed settings
35 #          (default s16)
37 # @buffer-length: the buffer length in microseconds
39 # Since: 4.0
41 { 'struct': 'AudiodevPerDirectionOptions',
42   'data': {
43     '*mixing-engine':  'bool',
44     '*fixed-settings': 'bool',
45     '*frequency':      'uint32',
46     '*channels':       'uint32',
47     '*voices':         'uint32',
48     '*format':         'AudioFormat',
49     '*buffer-length':  'uint32' } }
52 # @AudiodevGenericOptions:
54 # Generic driver-specific options.
56 # @in: options of the capture stream
58 # @out: options of the playback stream
60 # Since: 4.0
62 { 'struct': 'AudiodevGenericOptions',
63   'data': {
64     '*in':  'AudiodevPerDirectionOptions',
65     '*out': 'AudiodevPerDirectionOptions' } }
68 # @AudiodevAlsaPerDirectionOptions:
70 # Options of the ALSA backend that are used for both playback and
71 # recording.
73 # @dev: the name of the ALSA device to use (default 'default')
75 # @period-length: the period length in microseconds
77 # @try-poll: attempt to use poll mode, falling back to non-polling
78 #            access on failure (default true)
80 # Since: 4.0
82 { 'struct': 'AudiodevAlsaPerDirectionOptions',
83   'base': 'AudiodevPerDirectionOptions',
84   'data': {
85     '*dev':           'str',
86     '*period-length': 'uint32',
87     '*try-poll':      'bool' } }
90 # @AudiodevAlsaOptions:
92 # Options of the ALSA audio backend.
94 # @in: options of the capture stream
96 # @out: options of the playback stream
98 # @threshold: set the threshold (in microseconds) when playback starts
100 # Since: 4.0
102 { 'struct': 'AudiodevAlsaOptions',
103   'data': {
104     '*in':        'AudiodevAlsaPerDirectionOptions',
105     '*out':       'AudiodevAlsaPerDirectionOptions',
106     '*threshold': 'uint32' } }
109 # @AudiodevCoreaudioPerDirectionOptions:
111 # Options of the Core Audio backend that are used for both playback and
112 # recording.
114 # @buffer-count: number of buffers
116 # Since: 4.0
118 { 'struct': 'AudiodevCoreaudioPerDirectionOptions',
119   'base': 'AudiodevPerDirectionOptions',
120   'data': {
121     '*buffer-count': 'uint32' } }
124 # @AudiodevCoreaudioOptions:
126 # Options of the coreaudio audio backend.
128 # @in: options of the capture stream
130 # @out: options of the playback stream
132 # Since: 4.0
134 { 'struct': 'AudiodevCoreaudioOptions',
135   'data': {
136     '*in':  'AudiodevCoreaudioPerDirectionOptions',
137     '*out': 'AudiodevCoreaudioPerDirectionOptions' } }
140 # @AudiodevDsoundOptions:
142 # Options of the DirectSound audio backend.
144 # @in: options of the capture stream
146 # @out: options of the playback stream
148 # @latency: add extra latency to playback in microseconds
149 #           (default 10000)
151 # Since: 4.0
153 { 'struct': 'AudiodevDsoundOptions',
154   'data': {
155     '*in':      'AudiodevPerDirectionOptions',
156     '*out':     'AudiodevPerDirectionOptions',
157     '*latency': 'uint32' } }
160 # @AudiodevJackPerDirectionOptions:
162 # Options of the JACK backend that are used for both playback and
163 # recording.
165 # @server-name: select from among several possible concurrent server instances
166 #               (default: environment variable $JACK_DEFAULT_SERVER if set, else "default")
168 # @client-name: the client name to use. The server will modify this name to
169 #               create a unique variant, if needed unless @exact-name is true (default: the
170 #               guest's name)
172 # @connect-ports: if set, a regular expression of JACK client port name(s) to
173 #                 monitor for and automatically connect to
175 # @start-server: start a jack server process if one is not already present
176 #                (default: false)
178 # @exact-name: use the exact name requested otherwise JACK automatically
179 #              generates a unique one, if needed (default: false)
181 # Since: 5.1
183 { 'struct': 'AudiodevJackPerDirectionOptions',
184   'base': 'AudiodevPerDirectionOptions',
185   'data': {
186     '*server-name':   'str',
187     '*client-name':   'str',
188     '*connect-ports': 'str',
189     '*start-server':  'bool',
190     '*exact-name':    'bool' } }
193 # @AudiodevJackOptions:
195 # Options of the JACK audio backend.
197 # @in: options of the capture stream
199 # @out: options of the playback stream
201 # Since: 5.1
203 { 'struct': 'AudiodevJackOptions',
204   'data': {
205     '*in':  'AudiodevJackPerDirectionOptions',
206     '*out': 'AudiodevJackPerDirectionOptions' } }
209 # @AudiodevOssPerDirectionOptions:
211 # Options of the OSS backend that are used for both playback and
212 # recording.
214 # @dev: file name of the OSS device (default '/dev/dsp')
216 # @buffer-count: number of buffers
218 # @try-poll: attempt to use poll mode, falling back to non-polling
219 #            access on failure (default true)
221 # Since: 4.0
223 { 'struct': 'AudiodevOssPerDirectionOptions',
224   'base': 'AudiodevPerDirectionOptions',
225   'data': {
226     '*dev':          'str',
227     '*buffer-count': 'uint32',
228     '*try-poll':     'bool' } }
231 # @AudiodevOssOptions:
233 # Options of the OSS audio backend.
235 # @in: options of the capture stream
237 # @out: options of the playback stream
239 # @try-mmap: try using memory-mapped access, falling back to
240 #            non-memory-mapped access on failure (default true)
242 # @exclusive: open device in exclusive mode (vmix won't work)
243 #             (default false)
245 # @dsp-policy: set the timing policy of the device (between 0 and 10,
246 #              where smaller number means smaller latency but higher
247 #              CPU usage) or -1 to use fragment mode (option ignored
248 #              on some platforms) (default 5)
250 # Since: 4.0
252 { 'struct': 'AudiodevOssOptions',
253   'data': {
254     '*in':         'AudiodevOssPerDirectionOptions',
255     '*out':        'AudiodevOssPerDirectionOptions',
256     '*try-mmap':   'bool',
257     '*exclusive':  'bool',
258     '*dsp-policy': 'uint32' } }
261 # @AudiodevPaPerDirectionOptions:
263 # Options of the Pulseaudio backend that are used for both playback and
264 # recording.
266 # @name: name of the sink/source to use
268 # @stream-name: name of the PulseAudio stream created by qemu.  Can be
269 #               used to identify the stream in PulseAudio when you
270 #               create multiple PulseAudio devices or run multiple qemu
271 #               instances (default: audiodev's id, since 4.2)
273 # @latency: latency you want PulseAudio to achieve in microseconds
274 #           (default 15000)
276 # Since: 4.0
278 { 'struct': 'AudiodevPaPerDirectionOptions',
279   'base': 'AudiodevPerDirectionOptions',
280   'data': {
281     '*name': 'str',
282     '*stream-name': 'str',
283     '*latency': 'uint32' } }
286 # @AudiodevPaOptions:
288 # Options of the PulseAudio audio backend.
290 # @in: options of the capture stream
292 # @out: options of the playback stream
294 # @server: PulseAudio server address (default: let PulseAudio choose)
296 # Since: 4.0
298 { 'struct': 'AudiodevPaOptions',
299   'data': {
300     '*in':     'AudiodevPaPerDirectionOptions',
301     '*out':    'AudiodevPaPerDirectionOptions',
302     '*server': 'str' } }
305 # @AudiodevSdlPerDirectionOptions:
307 # Options of the SDL audio backend that are used for both playback and
308 # recording.
310 # @buffer-count: number of buffers (default 4)
312 # Since: 6.0
314 { 'struct': 'AudiodevSdlPerDirectionOptions',
315   'base': 'AudiodevPerDirectionOptions',
316   'data': {
317     '*buffer-count': 'uint32' } }
320 # @AudiodevSdlOptions:
322 # Options of the SDL audio backend.
324 # @in: options of the recording stream
326 # @out: options of the playback stream
328 # Since: 6.0
330 { 'struct': 'AudiodevSdlOptions',
331   'data': {
332     '*in':  'AudiodevSdlPerDirectionOptions',
333     '*out': 'AudiodevSdlPerDirectionOptions' } }
336 # @AudiodevWavOptions:
338 # Options of the wav audio backend.
340 # @in: options of the capture stream
342 # @out: options of the playback stream
344 # @path: name of the wav file to record (default 'qemu.wav')
346 # Since: 4.0
348 { 'struct': 'AudiodevWavOptions',
349   'data': {
350     '*in':   'AudiodevPerDirectionOptions',
351     '*out':  'AudiodevPerDirectionOptions',
352     '*path': 'str' } }
356 # @AudioFormat:
358 # An enumeration of possible audio formats.
360 # @u8: unsigned 8 bit integer
362 # @s8: signed 8 bit integer
364 # @u16: unsigned 16 bit integer
366 # @s16: signed 16 bit integer
368 # @u32: unsigned 32 bit integer
370 # @s32: signed 32 bit integer
372 # @f32: single precision floating-point (since 5.0)
374 # Since: 4.0
376 { 'enum': 'AudioFormat',
377   'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }
380 # @AudiodevDriver:
382 # An enumeration of possible audio backend drivers.
384 # @jack: JACK audio backend (since 5.1)
386 # Since: 4.0
388 { 'enum': 'AudiodevDriver',
389   'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'jack', 'oss', 'pa',
390             'sdl', 'spice', 'wav' ] }
393 # @Audiodev:
395 # Options of an audio backend.
397 # @id: identifier of the backend
399 # @driver: the backend driver to use
401 # @timer-period: timer period (in microseconds, 0: use lowest possible)
403 # Since: 4.0
405 { 'union': 'Audiodev',
406   'base': {
407     'id':            'str',
408     'driver':        'AudiodevDriver',
409     '*timer-period': 'uint32' },
410   'discriminator': 'driver',
411   'data': {
412     'none':      'AudiodevGenericOptions',
413     'alsa':      'AudiodevAlsaOptions',
414     'coreaudio': 'AudiodevCoreaudioOptions',
415     'dsound':    'AudiodevDsoundOptions',
416     'jack':      'AudiodevJackOptions',
417     'oss':       'AudiodevOssOptions',
418     'pa':        'AudiodevPaOptions',
419     'sdl':       'AudiodevSdlOptions',
420     'spice':     'AudiodevGenericOptions',
421     'wav':       'AudiodevWavOptions' } }