aboutsummaryrefslogtreecommitdiff
path: root/qapi/audio.json
blob: 9cba0df8a4e9e0ddb5eec670a830ab74b5f642d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# -*- mode: python -*-
#
# Copyright (C) 2015-2019 Zoltán Kővágó <DirtY.iCE.hu@gmail.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.

##
# = Audio
##

##
# @AudiodevPerDirectionOptions:
#
# General audio backend options that are used for both playback and
# recording.
#
# @mixing-engine: use QEMU's mixing engine to mix all streams inside QEMU and
#                 convert audio formats when not supported by the backend. When
#                 set to off, fixed-settings must be also off (default on,
#                 since 4.2)
#
# @fixed-settings: use fixed settings for host input/output. When off,
#                  frequency, channels and format must not be
#                  specified (default true)
#
# @frequency: frequency to use when using fixed settings
#             (default 44100)
#
# @channels: number of channels when using fixed settings (default 2)
#
# @voices: number of voices to use (default 1)
#
# @format: sample format to use when using fixed settings
#          (default s16)
#
# @buffer-length: the buffer length in microseconds
#
# Since: 4.0
##
{ 'struct': 'AudiodevPerDirectionOptions',
  'data': {
    '*mixing-engine':  'bool',
    '*fixed-settings': 'bool',
    '*frequency':      'uint32',
    '*channels':       'uint32',
    '*voices':         'uint32',
    '*format':         'AudioFormat',
    '*buffer-length':  'uint32' } }

##
# @AudiodevGenericOptions:
#
# Generic driver-specific options.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# Since: 4.0
##
{ 'struct': 'AudiodevGenericOptions',
  'data': {
    '*in':  'AudiodevPerDirectionOptions',
    '*out': 'AudiodevPerDirectionOptions' } }

##
# @AudiodevAlsaPerDirectionOptions:
#
# Options of the ALSA backend that are used for both playback and
# recording.
#
# @dev: the name of the ALSA device to use (default 'default')
#
# @period-length: the period length in microseconds
#
# @try-poll: attempt to use poll mode, falling back to non-polling
#            access on failure (default true)
#
# Since: 4.0
##
{ 'struct': 'AudiodevAlsaPerDirectionOptions',
  'base': 'AudiodevPerDirectionOptions',
  'data': {
    '*dev':           'str',
    '*period-length': 'uint32',
    '*try-poll':      'bool' } }

##
# @AudiodevAlsaOptions:
#
# Options of the ALSA audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# @threshold: set the threshold (in microseconds) when playback starts
#
# Since: 4.0
##
{ 'struct': 'AudiodevAlsaOptions',
  'data': {
    '*in':        'AudiodevAlsaPerDirectionOptions',
    '*out':       'AudiodevAlsaPerDirectionOptions',
    '*threshold': 'uint32' } }

##
# @AudiodevCoreaudioPerDirectionOptions:
#
# Options of the Core Audio backend that are used for both playback and
# recording.
#
# @buffer-count: number of buffers
#
# Since: 4.0
##
{ 'struct': 'AudiodevCoreaudioPerDirectionOptions',
  'base': 'AudiodevPerDirectionOptions',
  'data': {
    '*buffer-count': 'uint32' } }

##
# @AudiodevCoreaudioOptions:
#
# Options of the coreaudio audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# Since: 4.0
##
{ 'struct': 'AudiodevCoreaudioOptions',
  'data': {
    '*in':  'AudiodevCoreaudioPerDirectionOptions',
    '*out': 'AudiodevCoreaudioPerDirectionOptions' } }

##
# @AudiodevDsoundOptions:
#
# Options of the DirectSound audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# @latency: add extra latency to playback in microseconds
#           (default 10000)
#
# Since: 4.0
##
{ 'struct': 'AudiodevDsoundOptions',
  'data': {
    '*in':      'AudiodevPerDirectionOptions',
    '*out':     'AudiodevPerDirectionOptions',
    '*latency': 'uint32' } }

##
# @AudiodevJackPerDirectionOptions:
#
# Options of the JACK backend that are used for both playback and
# recording.
#
# @server-name: select from among several possible concurrent server instances
#               (default: environment variable $JACK_DEFAULT_SERVER if set, else "default")
#
# @client-name: the client name to use. The server will modify this name to
#               create a unique variant, if needed unless @exact-name is true (default: the
#               guest's name)
#
# @connect-ports: if set, a regular expression of JACK client port name(s) to
#                 monitor for and automatically connect to
#
# @start-server: start a jack server process if one is not already present
#                (default: false)
#
# @exact-name: use the exact name requested otherwise JACK automatically
#              generates a unique one, if needed (default: false)
#
# Since: 5.1
##
{ 'struct': 'AudiodevJackPerDirectionOptions',
  'base': 'AudiodevPerDirectionOptions',
  'data': {
    '*server-name':   'str',
    '*client-name':   'str',
    '*connect-ports': 'str',
    '*start-server':  'bool',
    '*exact-name':    'bool' } }

##
# @AudiodevJackOptions:
#
# Options of the JACK audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# Since: 5.1
##
{ 'struct': 'AudiodevJackOptions',
  'data': {
    '*in':  'AudiodevJackPerDirectionOptions',
    '*out': 'AudiodevJackPerDirectionOptions' } }

##
# @AudiodevOssPerDirectionOptions:
#
# Options of the OSS backend that are used for both playback and
# recording.
#
# @dev: file name of the OSS device (default '/dev/dsp')
#
# @buffer-count: number of buffers
#
# @try-poll: attempt to use poll mode, falling back to non-polling
#            access on failure (default true)
#
# Since: 4.0
##
{ 'struct': 'AudiodevOssPerDirectionOptions',
  'base': 'AudiodevPerDirectionOptions',
  'data': {
    '*dev':          'str',
    '*buffer-count': 'uint32',
    '*try-poll':     'bool' } }

##
# @AudiodevOssOptions:
#
# Options of the OSS audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# @try-mmap: try using memory-mapped access, falling back to
#            non-memory-mapped access on failure (default true)
#
# @exclusive: open device in exclusive mode (vmix won't work)
#             (default false)
#
# @dsp-policy: set the timing policy of the device (between 0 and 10,
#              where smaller number means smaller latency but higher
#              CPU usage) or -1 to use fragment mode (option ignored
#              on some platforms) (default 5)
#
# Since: 4.0
##
{ 'struct': 'AudiodevOssOptions',
  'data': {
    '*in':         'AudiodevOssPerDirectionOptions',
    '*out':        'AudiodevOssPerDirectionOptions',
    '*try-mmap':   'bool',
    '*exclusive':  'bool',
    '*dsp-policy': 'uint32' } }

##
# @AudiodevPaPerDirectionOptions:
#
# Options of the Pulseaudio backend that are used for both playback and
# recording.
#
# @name: name of the sink/source to use
#
# @stream-name: name of the PulseAudio stream created by qemu.  Can be
#               used to identify the stream in PulseAudio when you
#               create multiple PulseAudio devices or run multiple qemu
#               instances (default: audiodev's id, since 4.2)
#
# @latency: latency you want PulseAudio to achieve in microseconds
#           (default 15000)
#
# Since: 4.0
##
{ 'struct': 'AudiodevPaPerDirectionOptions',
  'base': 'AudiodevPerDirectionOptions',
  'data': {
    '*name': 'str',
    '*stream-name': 'str',
    '*latency': 'uint32' } }

##
# @AudiodevPaOptions:
#
# Options of the PulseAudio audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# @server: PulseAudio server address (default: let PulseAudio choose)
#
# Since: 4.0
##
{ 'struct': 'AudiodevPaOptions',
  'data': {
    '*in':     'AudiodevPaPerDirectionOptions',
    '*out':    'AudiodevPaPerDirectionOptions',
    '*server': 'str' } }

##
# @AudiodevSdlPerDirectionOptions:
#
# Options of the SDL audio backend that are used for both playback and
# recording.
#
# @buffer-count: number of buffers (default 4)
#
# Since: 6.0
##
{ 'struct': 'AudiodevSdlPerDirectionOptions',
  'base': 'AudiodevPerDirectionOptions',
  'data': {
    '*buffer-count': 'uint32' } }

##
# @AudiodevSdlOptions:
#
# Options of the SDL audio backend.
#
# @in: options of the recording stream
#
# @out: options of the playback stream
#
# Since: 6.0
##
{ 'struct': 'AudiodevSdlOptions',
  'data': {
    '*in':  'AudiodevSdlPerDirectionOptions',
    '*out': 'AudiodevSdlPerDirectionOptions' } }

##
# @AudiodevWavOptions:
#
# Options of the wav audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# @path: name of the wav file to record (default 'qemu.wav')
#
# Since: 4.0
##
{ 'struct': 'AudiodevWavOptions',
  'data': {
    '*in':   'AudiodevPerDirectionOptions',
    '*out':  'AudiodevPerDirectionOptions',
    '*path': 'str' } }


##
# @AudioFormat:
#
# An enumeration of possible audio formats.
#
# @u8: unsigned 8 bit integer
#
# @s8: signed 8 bit integer
#
# @u16: unsigned 16 bit integer
#
# @s16: signed 16 bit integer
#
# @u32: unsigned 32 bit integer
#
# @s32: signed 32 bit integer
#
# @f32: single precision floating-point (since 5.0)
#
# Since: 4.0
##
{ 'enum': 'AudioFormat',
  'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }

##
# @AudiodevDriver:
#
# An enumeration of possible audio backend drivers.
#
# @jack: JACK audio backend (since 5.1)
#
# Since: 4.0
##
{ 'enum': 'AudiodevDriver',
  'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'jack', 'oss', 'pa',
            'sdl', 'spice', 'wav' ] }

##
# @Audiodev:
#
# Options of an audio backend.
#
# @id: identifier of the backend
#
# @driver: the backend driver to use
#
# @timer-period: timer period (in microseconds, 0: use lowest possible)
#
# Since: 4.0
##
{ 'union': 'Audiodev',
  'base': {
    'id':            'str',
    'driver':        'AudiodevDriver',
    '*timer-period': 'uint32' },
  'discriminator': 'driver',
  'data': {
    'none':      'AudiodevGenericOptions',
    'alsa':      'AudiodevAlsaOptions',
    'coreaudio': 'AudiodevCoreaudioOptions',
    'dsound':    'AudiodevDsoundOptions',
    'jack':      'AudiodevJackOptions',
    'oss':       'AudiodevOssOptions',
    'pa':        'AudiodevPaOptions',
    'sdl':       'AudiodevSdlOptions',
    'spice':     'AudiodevGenericOptions',
    'wav':       'AudiodevWavOptions' } }