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.
14 # @AudiodevPerDirectionOptions:
16 # General audio backend options that are used for both playback and
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,
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
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
38 # @buffer-length: the buffer length in microseconds
42 { 'struct': 'AudiodevPerDirectionOptions',
44 '*mixing-engine': 'bool',
45 '*fixed-settings': 'bool',
46 '*frequency': 'uint32',
47 '*channels': '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
63 { 'struct': 'AudiodevGenericOptions',
65 '*in': 'AudiodevPerDirectionOptions',
66 '*out': 'AudiodevPerDirectionOptions' } }
69 # @AudiodevAlsaPerDirectionOptions:
71 # Options of the ALSA backend that are used for both playback and
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)
83 { 'struct': 'AudiodevAlsaPerDirectionOptions',
84 'base': 'AudiodevPerDirectionOptions',
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
103 { 'struct': 'AudiodevAlsaOptions',
105 '*in': 'AudiodevAlsaPerDirectionOptions',
106 '*out': 'AudiodevAlsaPerDirectionOptions',
107 '*threshold': 'uint32' } }
110 # @AudiodevSndioOptions:
112 # Options of the sndio audio backend.
114 # @in: options of the capture stream
116 # @out: options of the playback stream
118 # @dev: the name of the sndio device to use (default 'default')
120 # @latency: play buffer size (in microseconds)
124 { 'struct': 'AudiodevSndioOptions',
126 '*in': 'AudiodevPerDirectionOptions',
127 '*out': 'AudiodevPerDirectionOptions',
129 '*latency': 'uint32'} }
132 # @AudiodevCoreaudioPerDirectionOptions:
134 # Options of the Core Audio backend that are used for both playback and
137 # @buffer-count: number of buffers
141 { 'struct': 'AudiodevCoreaudioPerDirectionOptions',
142 'base': 'AudiodevPerDirectionOptions',
144 '*buffer-count': 'uint32' } }
147 # @AudiodevCoreaudioOptions:
149 # Options of the coreaudio audio backend.
151 # @in: options of the capture stream
153 # @out: options of the playback stream
157 { 'struct': 'AudiodevCoreaudioOptions',
159 '*in': 'AudiodevCoreaudioPerDirectionOptions',
160 '*out': 'AudiodevCoreaudioPerDirectionOptions' } }
163 # @AudiodevDsoundOptions:
165 # Options of the DirectSound audio backend.
167 # @in: options of the capture stream
169 # @out: options of the playback stream
171 # @latency: add extra latency to playback in microseconds
176 { 'struct': 'AudiodevDsoundOptions',
178 '*in': 'AudiodevPerDirectionOptions',
179 '*out': 'AudiodevPerDirectionOptions',
180 '*latency': 'uint32' } }
183 # @AudiodevJackPerDirectionOptions:
185 # Options of the JACK backend that are used for both playback and
188 # @server-name: select from among several possible concurrent server instances
189 # (default: environment variable $JACK_DEFAULT_SERVER if set, else "default")
191 # @client-name: the client name to use. The server will modify this name to
192 # create a unique variant, if needed unless @exact-name is true (default: the
195 # @connect-ports: if set, a regular expression of JACK client port name(s) to
196 # monitor for and automatically connect to
198 # @start-server: start a jack server process if one is not already present
201 # @exact-name: use the exact name requested otherwise JACK automatically
202 # generates a unique one, if needed (default: false)
206 { 'struct': 'AudiodevJackPerDirectionOptions',
207 'base': 'AudiodevPerDirectionOptions',
209 '*server-name': 'str',
210 '*client-name': 'str',
211 '*connect-ports': 'str',
212 '*start-server': 'bool',
213 '*exact-name': 'bool' } }
216 # @AudiodevJackOptions:
218 # Options of the JACK audio backend.
220 # @in: options of the capture stream
222 # @out: options of the playback stream
226 { 'struct': 'AudiodevJackOptions',
228 '*in': 'AudiodevJackPerDirectionOptions',
229 '*out': 'AudiodevJackPerDirectionOptions' } }
232 # @AudiodevOssPerDirectionOptions:
234 # Options of the OSS backend that are used for both playback and
237 # @dev: file name of the OSS device (default '/dev/dsp')
239 # @buffer-count: number of buffers
241 # @try-poll: attempt to use poll mode, falling back to non-polling
242 # access on failure (default true)
246 { 'struct': 'AudiodevOssPerDirectionOptions',
247 'base': 'AudiodevPerDirectionOptions',
250 '*buffer-count': 'uint32',
251 '*try-poll': 'bool' } }
254 # @AudiodevOssOptions:
256 # Options of the OSS audio backend.
258 # @in: options of the capture stream
260 # @out: options of the playback stream
262 # @try-mmap: try using memory-mapped access, falling back to
263 # non-memory-mapped access on failure (default true)
265 # @exclusive: open device in exclusive mode (vmix won't work)
268 # @dsp-policy: set the timing policy of the device (between 0 and 10,
269 # where smaller number means smaller latency but higher
270 # CPU usage) or -1 to use fragment mode (option ignored
271 # on some platforms) (default 5)
275 { 'struct': 'AudiodevOssOptions',
277 '*in': 'AudiodevOssPerDirectionOptions',
278 '*out': 'AudiodevOssPerDirectionOptions',
280 '*exclusive': 'bool',
281 '*dsp-policy': 'uint32' } }
284 # @AudiodevPaPerDirectionOptions:
286 # Options of the Pulseaudio backend that are used for both playback and
289 # @name: name of the sink/source to use
291 # @stream-name: name of the PulseAudio stream created by qemu. Can be
292 # used to identify the stream in PulseAudio when you
293 # create multiple PulseAudio devices or run multiple qemu
294 # instances (default: audiodev's id, since 4.2)
296 # @latency: latency you want PulseAudio to achieve in microseconds
301 { 'struct': 'AudiodevPaPerDirectionOptions',
302 'base': 'AudiodevPerDirectionOptions',
305 '*stream-name': 'str',
306 '*latency': 'uint32' } }
309 # @AudiodevPaOptions:
311 # Options of the PulseAudio audio backend.
313 # @in: options of the capture stream
315 # @out: options of the playback stream
317 # @server: PulseAudio server address (default: let PulseAudio choose)
321 { 'struct': 'AudiodevPaOptions',
323 '*in': 'AudiodevPaPerDirectionOptions',
324 '*out': 'AudiodevPaPerDirectionOptions',
328 # @AudiodevSdlPerDirectionOptions:
330 # Options of the SDL audio backend that are used for both playback and
333 # @buffer-count: number of buffers (default 4)
337 { 'struct': 'AudiodevSdlPerDirectionOptions',
338 'base': 'AudiodevPerDirectionOptions',
340 '*buffer-count': 'uint32' } }
343 # @AudiodevSdlOptions:
345 # Options of the SDL audio backend.
347 # @in: options of the recording stream
349 # @out: options of the playback stream
353 { 'struct': 'AudiodevSdlOptions',
355 '*in': 'AudiodevSdlPerDirectionOptions',
356 '*out': 'AudiodevSdlPerDirectionOptions' } }
359 # @AudiodevWavOptions:
361 # Options of the wav audio backend.
363 # @in: options of the capture stream
365 # @out: options of the playback stream
367 # @path: name of the wav file to record (default 'qemu.wav')
371 { 'struct': 'AudiodevWavOptions',
373 '*in': 'AudiodevPerDirectionOptions',
374 '*out': 'AudiodevPerDirectionOptions',
380 # An enumeration of possible audio formats.
382 # @u8: unsigned 8 bit integer
384 # @s8: signed 8 bit integer
386 # @u16: unsigned 16 bit integer
388 # @s16: signed 16 bit integer
390 # @u32: unsigned 32 bit integer
392 # @s32: signed 32 bit integer
394 # @f32: single precision floating-point (since 5.0)
398 { 'enum': 'AudioFormat',
399 'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }
404 # An enumeration of possible audio backend drivers.
406 # @jack: JACK audio backend (since 5.1)
410 { 'enum': 'AudiodevDriver',
412 { 'name': 'alsa', 'if': 'CONFIG_AUDIO_ALSA' },
413 { 'name': 'coreaudio', 'if': 'CONFIG_AUDIO_COREAUDIO' },
414 { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
415 { 'name': 'dsound', 'if': 'CONFIG_AUDIO_DSOUND' },
416 { 'name': 'jack', 'if': 'CONFIG_AUDIO_JACK' },
417 { 'name': 'oss', 'if': 'CONFIG_AUDIO_OSS' },
418 { 'name': 'pa', 'if': 'CONFIG_AUDIO_PA' },
419 { 'name': 'sdl', 'if': 'CONFIG_AUDIO_SDL' },
420 { 'name': 'sndio', 'if': 'CONFIG_AUDIO_SNDIO' },
421 { 'name': 'spice', 'if': 'CONFIG_SPICE' },
427 # Options of an audio backend.
429 # @id: identifier of the backend
431 # @driver: the backend driver to use
433 # @timer-period: timer period (in microseconds, 0: use lowest possible)
437 { 'union': 'Audiodev',
440 'driver': 'AudiodevDriver',
441 '*timer-period': 'uint32' },
442 'discriminator': 'driver',
444 'none': 'AudiodevGenericOptions',
445 'alsa': { 'type': 'AudiodevAlsaOptions',
446 'if': 'CONFIG_AUDIO_ALSA' },
447 'coreaudio': { 'type': 'AudiodevCoreaudioOptions',
448 'if': 'CONFIG_AUDIO_COREAUDIO' },
449 'dbus': { 'type': 'AudiodevGenericOptions',
450 'if': 'CONFIG_DBUS_DISPLAY' },
451 'dsound': { 'type': 'AudiodevDsoundOptions',
452 'if': 'CONFIG_AUDIO_DSOUND' },
453 'jack': { 'type': 'AudiodevJackOptions',
454 'if': 'CONFIG_AUDIO_JACK' },
455 'oss': { 'type': 'AudiodevOssOptions',
456 'if': 'CONFIG_AUDIO_OSS' },
457 'pa': { 'type': 'AudiodevPaOptions',
458 'if': 'CONFIG_AUDIO_PA' },
459 'sdl': { 'type': 'AudiodevSdlOptions',
460 'if': 'CONFIG_AUDIO_SDL' },
461 'sndio': { 'type': 'AudiodevSndioOptions',
462 'if': 'CONFIG_AUDIO_SNDIO' },
463 'spice': { 'type': 'AudiodevGenericOptions',
464 'if': 'CONFIG_SPICE' },
465 'wav': 'AudiodevWavOptions' } }
470 # Returns information about audiodev configuration
472 # Returns: array of @Audiodev
477 { 'command': 'query-audiodevs',
478 'returns': ['Audiodev'] }