Merge tag 'v7.1.0-rc2'
[qemu/ar7.git] / qapi / audio.json
blob8099e3d7f13ba8aa721fbd1047565f3cbdee82b1
1 # -*- mode: python -*-
2 # vim: filetype=python
4 # Copyright (C) 2015-2019 Zoltán Kővágó <DirtY.iCE.hu@gmail.com>
6 # This work is licensed under the terms of the GNU GPL, version 2 or later.
7 # See the COPYING file in the top-level directory.
9 ##
10 # = Audio
14 # @AudiodevPerDirectionOptions:
16 # General audio backend options that are used for both playback and
17 # recording.
19 # @mixing-engine: use QEMU's mixing engine to mix all streams inside QEMU and
20 #                 convert audio formats when not supported by the backend. When
21 #                 set to off, fixed-settings must be also off (default on,
22 #                 since 4.2)
24 # @fixed-settings: use fixed settings for host input/output. When off,
25 #                  frequency, channels and format must not be
26 #                  specified (default true)
28 # @frequency: frequency to use when using fixed settings
29 #             (default 44100)
31 # @channels: number of channels when using fixed settings (default 2)
33 # @voices: number of voices to use (default 1)
35 # @format: sample format to use when using fixed settings
36 #          (default s16)
38 # @buffer-length: the buffer length in microseconds
40 # Since: 4.0
42 { 'struct': 'AudiodevPerDirectionOptions',
43   'data': {
44     '*mixing-engine':  'bool',
45     '*fixed-settings': 'bool',
46     '*frequency':      'uint32',
47     '*channels':       'uint32',
48     '*voices':         'uint32',
49     '*format':         'AudioFormat',
50     '*buffer-length':  'uint32' } }
53 # @AudiodevGenericOptions:
55 # Generic driver-specific options.
57 # @in: options of the capture stream
59 # @out: options of the playback stream
61 # Since: 4.0
63 { 'struct': 'AudiodevGenericOptions',
64   'data': {
65     '*in':  'AudiodevPerDirectionOptions',
66     '*out': 'AudiodevPerDirectionOptions' } }
69 # @AudiodevAlsaPerDirectionOptions:
71 # Options of the ALSA backend that are used for both playback and
72 # recording.
74 # @dev: the name of the ALSA device to use (default 'default')
76 # @period-length: the period length in microseconds
78 # @try-poll: attempt to use poll mode, falling back to non-polling
79 #            access on failure (default true)
81 # Since: 4.0
83 { 'struct': 'AudiodevAlsaPerDirectionOptions',
84   'base': 'AudiodevPerDirectionOptions',
85   'data': {
86     '*dev':           'str',
87     '*period-length': 'uint32',
88     '*try-poll':      'bool' } }
91 # @AudiodevAlsaOptions:
93 # Options of the ALSA audio backend.
95 # @in: options of the capture stream
97 # @out: options of the playback stream
99 # @threshold: set the threshold (in microseconds) when playback starts
101 # Since: 4.0
103 { 'struct': 'AudiodevAlsaOptions',
104   'data': {
105     '*in':        'AudiodevAlsaPerDirectionOptions',
106     '*out':       'AudiodevAlsaPerDirectionOptions',
107     '*threshold': 'uint32' } }
110 # @AudiodevCoreaudioPerDirectionOptions:
112 # Options of the Core Audio backend that are used for both playback and
113 # recording.
115 # @buffer-count: number of buffers
117 # Since: 4.0
119 { 'struct': 'AudiodevCoreaudioPerDirectionOptions',
120   'base': 'AudiodevPerDirectionOptions',
121   'data': {
122     '*buffer-count': 'uint32' } }
125 # @AudiodevCoreaudioOptions:
127 # Options of the coreaudio audio backend.
129 # @in: options of the capture stream
131 # @out: options of the playback stream
133 # Since: 4.0
135 { 'struct': 'AudiodevCoreaudioOptions',
136   'data': {
137     '*in':  'AudiodevCoreaudioPerDirectionOptions',
138     '*out': 'AudiodevCoreaudioPerDirectionOptions' } }
141 # @AudiodevDsoundOptions:
143 # Options of the DirectSound audio backend.
145 # @in: options of the capture stream
147 # @out: options of the playback stream
149 # @latency: add extra latency to playback in microseconds
150 #           (default 10000)
152 # Since: 4.0
154 { 'struct': 'AudiodevDsoundOptions',
155   'data': {
156     '*in':      'AudiodevPerDirectionOptions',
157     '*out':     'AudiodevPerDirectionOptions',
158     '*latency': 'uint32' } }
161 # @AudiodevJackPerDirectionOptions:
163 # Options of the JACK backend that are used for both playback and
164 # recording.
166 # @server-name: select from among several possible concurrent server instances
167 #               (default: environment variable $JACK_DEFAULT_SERVER if set, else "default")
169 # @client-name: the client name to use. The server will modify this name to
170 #               create a unique variant, if needed unless @exact-name is true (default: the
171 #               guest's name)
173 # @connect-ports: if set, a regular expression of JACK client port name(s) to
174 #                 monitor for and automatically connect to
176 # @start-server: start a jack server process if one is not already present
177 #                (default: false)
179 # @exact-name: use the exact name requested otherwise JACK automatically
180 #              generates a unique one, if needed (default: false)
182 # Since: 5.1
184 { 'struct': 'AudiodevJackPerDirectionOptions',
185   'base': 'AudiodevPerDirectionOptions',
186   'data': {
187     '*server-name':   'str',
188     '*client-name':   'str',
189     '*connect-ports': 'str',
190     '*start-server':  'bool',
191     '*exact-name':    'bool' } }
194 # @AudiodevJackOptions:
196 # Options of the JACK audio backend.
198 # @in: options of the capture stream
200 # @out: options of the playback stream
202 # Since: 5.1
204 { 'struct': 'AudiodevJackOptions',
205   'data': {
206     '*in':  'AudiodevJackPerDirectionOptions',
207     '*out': 'AudiodevJackPerDirectionOptions' } }
210 # @AudiodevOssPerDirectionOptions:
212 # Options of the OSS backend that are used for both playback and
213 # recording.
215 # @dev: file name of the OSS device (default '/dev/dsp')
217 # @buffer-count: number of buffers
219 # @try-poll: attempt to use poll mode, falling back to non-polling
220 #            access on failure (default true)
222 # Since: 4.0
224 { 'struct': 'AudiodevOssPerDirectionOptions',
225   'base': 'AudiodevPerDirectionOptions',
226   'data': {
227     '*dev':          'str',
228     '*buffer-count': 'uint32',
229     '*try-poll':     'bool' } }
232 # @AudiodevOssOptions:
234 # Options of the OSS audio backend.
236 # @in: options of the capture stream
238 # @out: options of the playback stream
240 # @try-mmap: try using memory-mapped access, falling back to
241 #            non-memory-mapped access on failure (default true)
243 # @exclusive: open device in exclusive mode (vmix won't work)
244 #             (default false)
246 # @dsp-policy: set the timing policy of the device (between 0 and 10,
247 #              where smaller number means smaller latency but higher
248 #              CPU usage) or -1 to use fragment mode (option ignored
249 #              on some platforms) (default 5)
251 # Since: 4.0
253 { 'struct': 'AudiodevOssOptions',
254   'data': {
255     '*in':         'AudiodevOssPerDirectionOptions',
256     '*out':        'AudiodevOssPerDirectionOptions',
257     '*try-mmap':   'bool',
258     '*exclusive':  'bool',
259     '*dsp-policy': 'uint32' } }
262 # @AudiodevPaPerDirectionOptions:
264 # Options of the Pulseaudio backend that are used for both playback and
265 # recording.
267 # @name: name of the sink/source to use
269 # @stream-name: name of the PulseAudio stream created by qemu.  Can be
270 #               used to identify the stream in PulseAudio when you
271 #               create multiple PulseAudio devices or run multiple qemu
272 #               instances (default: audiodev's id, since 4.2)
274 # @latency: latency you want PulseAudio to achieve in microseconds
275 #           (default 15000)
277 # Since: 4.0
279 { 'struct': 'AudiodevPaPerDirectionOptions',
280   'base': 'AudiodevPerDirectionOptions',
281   'data': {
282     '*name': 'str',
283     '*stream-name': 'str',
284     '*latency': 'uint32' } }
287 # @AudiodevPaOptions:
289 # Options of the PulseAudio audio backend.
291 # @in: options of the capture stream
293 # @out: options of the playback stream
295 # @server: PulseAudio server address (default: let PulseAudio choose)
297 # Since: 4.0
299 { 'struct': 'AudiodevPaOptions',
300   'data': {
301     '*in':     'AudiodevPaPerDirectionOptions',
302     '*out':    'AudiodevPaPerDirectionOptions',
303     '*server': 'str' } }
306 # @AudiodevSdlPerDirectionOptions:
308 # Options of the SDL audio backend that are used for both playback and
309 # recording.
311 # @buffer-count: number of buffers (default 4)
313 # Since: 6.0
315 { 'struct': 'AudiodevSdlPerDirectionOptions',
316   'base': 'AudiodevPerDirectionOptions',
317   'data': {
318     '*buffer-count': 'uint32' } }
321 # @AudiodevSdlOptions:
323 # Options of the SDL audio backend.
325 # @in: options of the recording stream
327 # @out: options of the playback stream
329 # Since: 6.0
331 { 'struct': 'AudiodevSdlOptions',
332   'data': {
333     '*in':  'AudiodevSdlPerDirectionOptions',
334     '*out': 'AudiodevSdlPerDirectionOptions' } }
337 # @AudiodevWavOptions:
339 # Options of the wav audio backend.
341 # @in: options of the capture stream
343 # @out: options of the playback stream
345 # @path: name of the wav file to record (default 'qemu.wav')
347 # Since: 4.0
349 { 'struct': 'AudiodevWavOptions',
350   'data': {
351     '*in':   'AudiodevPerDirectionOptions',
352     '*out':  'AudiodevPerDirectionOptions',
353     '*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', 'dbus', '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     'dbus':      'AudiodevGenericOptions',
416     'dsound':    'AudiodevDsoundOptions',
417     'jack':      'AudiodevJackOptions',
418     'oss':       'AudiodevOssOptions',
419     'pa':        'AudiodevPaOptions',
420     'sdl':       'AudiodevSdlOptions',
421     'spice':     'AudiodevGenericOptions',
422     'wav':       'AudiodevWavOptions' } }