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 # @AudiodevPipewirePerDirectionOptions:
330 # Options of the Pipewire backend that are used for both playback and
333 # @name: name of the sink/source to use
335 # @stream-name: name of the Pipewire stream created by qemu. Can be
336 # used to identify the stream in Pipewire when you
337 # create multiple Pipewire devices or run multiple qemu
338 # instances (default: audiodev's id)
340 # @latency: latency you want Pipewire to achieve in microseconds
345 { 'struct': 'AudiodevPipewirePerDirectionOptions',
346 'base': 'AudiodevPerDirectionOptions',
349 '*stream-name': 'str',
350 '*latency': 'uint32' } }
353 # @AudiodevPipewireOptions:
355 # Options of the Pipewire audio backend.
357 # @in: options of the capture stream
359 # @out: options of the playback stream
363 { 'struct': 'AudiodevPipewireOptions',
365 '*in': 'AudiodevPipewirePerDirectionOptions',
366 '*out': 'AudiodevPipewirePerDirectionOptions' } }
369 # @AudiodevSdlPerDirectionOptions:
371 # Options of the SDL audio backend that are used for both playback and
374 # @buffer-count: number of buffers (default 4)
378 { 'struct': 'AudiodevSdlPerDirectionOptions',
379 'base': 'AudiodevPerDirectionOptions',
381 '*buffer-count': 'uint32' } }
384 # @AudiodevSdlOptions:
386 # Options of the SDL audio backend.
388 # @in: options of the recording stream
390 # @out: options of the playback stream
394 { 'struct': 'AudiodevSdlOptions',
396 '*in': 'AudiodevSdlPerDirectionOptions',
397 '*out': 'AudiodevSdlPerDirectionOptions' } }
400 # @AudiodevWavOptions:
402 # Options of the wav audio backend.
404 # @in: options of the capture stream
406 # @out: options of the playback stream
408 # @path: name of the wav file to record (default 'qemu.wav')
412 { 'struct': 'AudiodevWavOptions',
414 '*in': 'AudiodevPerDirectionOptions',
415 '*out': 'AudiodevPerDirectionOptions',
421 # An enumeration of possible audio formats.
423 # @u8: unsigned 8 bit integer
425 # @s8: signed 8 bit integer
427 # @u16: unsigned 16 bit integer
429 # @s16: signed 16 bit integer
431 # @u32: unsigned 32 bit integer
433 # @s32: signed 32 bit integer
435 # @f32: single precision floating-point (since 5.0)
439 { 'enum': 'AudioFormat',
440 'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }
445 # An enumeration of possible audio backend drivers.
447 # @jack: JACK audio backend (since 5.1)
451 { 'enum': 'AudiodevDriver',
453 { 'name': 'alsa', 'if': 'CONFIG_AUDIO_ALSA' },
454 { 'name': 'coreaudio', 'if': 'CONFIG_AUDIO_COREAUDIO' },
455 { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
456 { 'name': 'dsound', 'if': 'CONFIG_AUDIO_DSOUND' },
457 { 'name': 'jack', 'if': 'CONFIG_AUDIO_JACK' },
458 { 'name': 'oss', 'if': 'CONFIG_AUDIO_OSS' },
459 { 'name': 'pa', 'if': 'CONFIG_AUDIO_PA' },
460 { 'name': 'pipewire', 'if': 'CONFIG_AUDIO_PIPEWIRE' },
461 { 'name': 'sdl', 'if': 'CONFIG_AUDIO_SDL' },
462 { 'name': 'sndio', 'if': 'CONFIG_AUDIO_SNDIO' },
463 { 'name': 'spice', 'if': 'CONFIG_SPICE' },
469 # Options of an audio backend.
471 # @id: identifier of the backend
473 # @driver: the backend driver to use
475 # @timer-period: timer period (in microseconds, 0: use lowest possible)
479 { 'union': 'Audiodev',
482 'driver': 'AudiodevDriver',
483 '*timer-period': 'uint32' },
484 'discriminator': 'driver',
486 'none': 'AudiodevGenericOptions',
487 'alsa': { 'type': 'AudiodevAlsaOptions',
488 'if': 'CONFIG_AUDIO_ALSA' },
489 'coreaudio': { 'type': 'AudiodevCoreaudioOptions',
490 'if': 'CONFIG_AUDIO_COREAUDIO' },
491 'dbus': { 'type': 'AudiodevGenericOptions',
492 'if': 'CONFIG_DBUS_DISPLAY' },
493 'dsound': { 'type': 'AudiodevDsoundOptions',
494 'if': 'CONFIG_AUDIO_DSOUND' },
495 'jack': { 'type': 'AudiodevJackOptions',
496 'if': 'CONFIG_AUDIO_JACK' },
497 'oss': { 'type': 'AudiodevOssOptions',
498 'if': 'CONFIG_AUDIO_OSS' },
499 'pa': { 'type': 'AudiodevPaOptions',
500 'if': 'CONFIG_AUDIO_PA' },
501 'pipewire': { 'type': 'AudiodevPipewireOptions',
502 'if': 'CONFIG_AUDIO_PIPEWIRE' },
503 'sdl': { 'type': 'AudiodevSdlOptions',
504 'if': 'CONFIG_AUDIO_SDL' },
505 'sndio': { 'type': 'AudiodevSndioOptions',
506 'if': 'CONFIG_AUDIO_SNDIO' },
507 'spice': { 'type': 'AudiodevGenericOptions',
508 'if': 'CONFIG_SPICE' },
509 'wav': 'AudiodevWavOptions' } }
514 # Returns information about audiodev configuration
516 # Returns: array of @Audiodev
521 { 'command': 'query-audiodevs',
522 'returns': ['Audiodev'] }