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
20 # QEMU and convert audio formats when not supported by the
21 # backend. When set to off, fixed-settings must be also off
22 # (default on, since 4.2)
24 # @fixed-settings: use fixed settings for host input/output. When
25 # off, frequency, channels and format must not be specified
28 # @frequency: frequency to use when using fixed settings (default
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 (default
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
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 (default
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
189 # instances (default: environment variable $JACK_DEFAULT_SERVER if
190 # set, else "default")
192 # @client-name: the client name to use. The server will modify this
193 # name to create a unique variant, if needed unless @exact-name is
194 # true (default: the guest's name)
196 # @connect-ports: if set, a regular expression of JACK client port
197 # name(s) to monitor for and automatically connect to
199 # @start-server: start a jack server process if one is not already
200 # present (default: false)
202 # @exact-name: use the exact name requested otherwise JACK
203 # automatically generates a unique one, if needed (default: false)
207 { 'struct': 'AudiodevJackPerDirectionOptions',
208 'base': 'AudiodevPerDirectionOptions',
210 '*server-name': 'str',
211 '*client-name': 'str',
212 '*connect-ports': 'str',
213 '*start-server': 'bool',
214 '*exact-name': 'bool' } }
217 # @AudiodevJackOptions:
219 # Options of the JACK audio backend.
221 # @in: options of the capture stream
223 # @out: options of the playback stream
227 { 'struct': 'AudiodevJackOptions',
229 '*in': 'AudiodevJackPerDirectionOptions',
230 '*out': 'AudiodevJackPerDirectionOptions' } }
233 # @AudiodevOssPerDirectionOptions:
235 # Options of the OSS backend that are used for both playback and
238 # @dev: file name of the OSS device (default '/dev/dsp')
240 # @buffer-count: number of buffers
242 # @try-poll: attempt to use poll mode, falling back to non-polling
243 # access on failure (default true)
247 { 'struct': 'AudiodevOssPerDirectionOptions',
248 'base': 'AudiodevPerDirectionOptions',
251 '*buffer-count': 'uint32',
252 '*try-poll': 'bool' } }
255 # @AudiodevOssOptions:
257 # Options of the OSS audio backend.
259 # @in: options of the capture stream
261 # @out: options of the playback stream
263 # @try-mmap: try using memory-mapped access, falling back to
264 # non-memory-mapped access on failure (default true)
266 # @exclusive: open device in exclusive mode (vmix won't work) (default
269 # @dsp-policy: set the timing policy of the device (between 0 and 10,
270 # where smaller number means smaller latency but higher CPU usage)
271 # or -1 to use fragment mode (option ignored on some platforms)
276 { 'struct': 'AudiodevOssOptions',
278 '*in': 'AudiodevOssPerDirectionOptions',
279 '*out': 'AudiodevOssPerDirectionOptions',
281 '*exclusive': 'bool',
282 '*dsp-policy': 'uint32' } }
285 # @AudiodevPaPerDirectionOptions:
287 # Options of the Pulseaudio backend that are used for both playback
290 # @name: name of the sink/source to use
292 # @stream-name: name of the PulseAudio stream created by qemu. Can be
293 # used to identify the stream in PulseAudio when you create
294 # multiple PulseAudio devices or run multiple qemu instances
295 # (default: audiodev's id, since 4.2)
297 # @latency: latency you want PulseAudio to achieve in microseconds
302 { 'struct': 'AudiodevPaPerDirectionOptions',
303 'base': 'AudiodevPerDirectionOptions',
306 '*stream-name': 'str',
307 '*latency': 'uint32' } }
310 # @AudiodevPaOptions:
312 # Options of the PulseAudio audio backend.
314 # @in: options of the capture stream
316 # @out: options of the playback stream
318 # @server: PulseAudio server address (default: let PulseAudio choose)
322 { 'struct': 'AudiodevPaOptions',
324 '*in': 'AudiodevPaPerDirectionOptions',
325 '*out': 'AudiodevPaPerDirectionOptions',
329 # @AudiodevPipewirePerDirectionOptions:
331 # Options of the Pipewire backend that are used for both playback and
334 # @name: name of the sink/source to use
336 # @stream-name: name of the Pipewire stream created by qemu. Can be
337 # used to identify the stream in Pipewire when you create multiple
338 # Pipewire devices or run multiple qemu instances (default:
341 # @latency: latency you want Pipewire to achieve in microseconds
346 { 'struct': 'AudiodevPipewirePerDirectionOptions',
347 'base': 'AudiodevPerDirectionOptions',
350 '*stream-name': 'str',
351 '*latency': 'uint32' } }
354 # @AudiodevPipewireOptions:
356 # Options of the Pipewire audio backend.
358 # @in: options of the capture stream
360 # @out: options of the playback stream
364 { 'struct': 'AudiodevPipewireOptions',
366 '*in': 'AudiodevPipewirePerDirectionOptions',
367 '*out': 'AudiodevPipewirePerDirectionOptions' } }
370 # @AudiodevSdlPerDirectionOptions:
372 # Options of the SDL audio backend that are used for both playback and
375 # @buffer-count: number of buffers (default 4)
379 { 'struct': 'AudiodevSdlPerDirectionOptions',
380 'base': 'AudiodevPerDirectionOptions',
382 '*buffer-count': 'uint32' } }
385 # @AudiodevSdlOptions:
387 # Options of the SDL audio backend.
389 # @in: options of the recording stream
391 # @out: options of the playback stream
395 { 'struct': 'AudiodevSdlOptions',
397 '*in': 'AudiodevSdlPerDirectionOptions',
398 '*out': 'AudiodevSdlPerDirectionOptions' } }
401 # @AudiodevWavOptions:
403 # Options of the wav audio backend.
405 # @in: options of the capture stream
407 # @out: options of the playback stream
409 # @path: name of the wav file to record (default 'qemu.wav')
413 { 'struct': 'AudiodevWavOptions',
415 '*in': 'AudiodevPerDirectionOptions',
416 '*out': 'AudiodevPerDirectionOptions',
422 # An enumeration of possible audio formats.
424 # @u8: unsigned 8 bit integer
426 # @s8: signed 8 bit integer
428 # @u16: unsigned 16 bit integer
430 # @s16: signed 16 bit integer
432 # @u32: unsigned 32 bit integer
434 # @s32: signed 32 bit integer
436 # @f32: single precision floating-point (since 5.0)
440 { 'enum': 'AudioFormat',
441 'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }
446 # An enumeration of possible audio backend drivers.
448 # @jack: JACK audio backend (since 5.1)
452 { 'enum': 'AudiodevDriver',
454 { 'name': 'alsa', 'if': 'CONFIG_AUDIO_ALSA' },
455 { 'name': 'coreaudio', 'if': 'CONFIG_AUDIO_COREAUDIO' },
456 { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
457 { 'name': 'dsound', 'if': 'CONFIG_AUDIO_DSOUND' },
458 { 'name': 'jack', 'if': 'CONFIG_AUDIO_JACK' },
459 { 'name': 'oss', 'if': 'CONFIG_AUDIO_OSS' },
460 { 'name': 'pa', 'if': 'CONFIG_AUDIO_PA' },
461 { 'name': 'pipewire', 'if': 'CONFIG_AUDIO_PIPEWIRE' },
462 { 'name': 'sdl', 'if': 'CONFIG_AUDIO_SDL' },
463 { 'name': 'sndio', 'if': 'CONFIG_AUDIO_SNDIO' },
464 { 'name': 'spice', 'if': 'CONFIG_SPICE' },
470 # Options of an audio backend.
472 # @id: identifier of the backend
474 # @driver: the backend driver to use
476 # @timer-period: timer period (in microseconds, 0: use lowest
481 { 'union': 'Audiodev',
484 'driver': 'AudiodevDriver',
485 '*timer-period': 'uint32' },
486 'discriminator': 'driver',
488 'none': 'AudiodevGenericOptions',
489 'alsa': { 'type': 'AudiodevAlsaOptions',
490 'if': 'CONFIG_AUDIO_ALSA' },
491 'coreaudio': { 'type': 'AudiodevCoreaudioOptions',
492 'if': 'CONFIG_AUDIO_COREAUDIO' },
493 'dbus': { 'type': 'AudiodevGenericOptions',
494 'if': 'CONFIG_DBUS_DISPLAY' },
495 'dsound': { 'type': 'AudiodevDsoundOptions',
496 'if': 'CONFIG_AUDIO_DSOUND' },
497 'jack': { 'type': 'AudiodevJackOptions',
498 'if': 'CONFIG_AUDIO_JACK' },
499 'oss': { 'type': 'AudiodevOssOptions',
500 'if': 'CONFIG_AUDIO_OSS' },
501 'pa': { 'type': 'AudiodevPaOptions',
502 'if': 'CONFIG_AUDIO_PA' },
503 'pipewire': { 'type': 'AudiodevPipewireOptions',
504 'if': 'CONFIG_AUDIO_PIPEWIRE' },
505 'sdl': { 'type': 'AudiodevSdlOptions',
506 'if': 'CONFIG_AUDIO_SDL' },
507 'sndio': { 'type': 'AudiodevSndioOptions',
508 'if': 'CONFIG_AUDIO_SNDIO' },
509 'spice': { 'type': 'AudiodevGenericOptions',
510 'if': 'CONFIG_SPICE' },
511 'wav': 'AudiodevWavOptions' } }
516 # Returns information about audiodev configuration
518 # Returns: array of @Audiodev
522 { 'command': 'query-audiodevs',
523 'returns': ['Audiodev'] }