3 # Copyright (C) 2015-2019 Zoltán Kővágó <DirtY.iCE.hu@gmail.com>
5 # This work is licensed under the terms of the GNU GPL, version 2 or later.
6 # See the COPYING file in the top-level directory.
9 # @AudiodevPerDirectionOptions:
11 # General audio backend options that are used for both playback and
14 # @mixing-engine: use QEMU's mixing engine to mix all streams inside QEMU and
15 # convert audio formats when not supported by the backend. When
16 # set to off, fixed-settings must be also off (default on,
19 # @fixed-settings: use fixed settings for host input/output. When off,
20 # frequency, channels and format must not be
21 # specified (default true)
23 # @frequency: frequency to use when using fixed settings
26 # @channels: number of channels when using fixed settings (default 2)
28 # @voices: number of voices to use (default 1)
30 # @format: sample format to use when using fixed settings
33 # @buffer-length: the buffer length in microseconds
37 { 'struct': 'AudiodevPerDirectionOptions',
39 '*mixing-engine': 'bool',
40 '*fixed-settings': 'bool',
41 '*frequency': 'uint32',
42 '*channels': 'uint32',
44 '*format': 'AudioFormat',
45 '*buffer-length': 'uint32' } }
48 # @AudiodevGenericOptions:
50 # Generic driver-specific options.
52 # @in: options of the capture stream
54 # @out: options of the playback stream
58 { 'struct': 'AudiodevGenericOptions',
60 '*in': 'AudiodevPerDirectionOptions',
61 '*out': 'AudiodevPerDirectionOptions' } }
64 # @AudiodevAlsaPerDirectionOptions:
66 # Options of the ALSA backend that are used for both playback and
69 # @dev: the name of the ALSA device to use (default 'default')
71 # @period-length: the period length in microseconds
73 # @try-poll: attempt to use poll mode, falling back to non-polling
74 # access on failure (default true)
78 { 'struct': 'AudiodevAlsaPerDirectionOptions',
79 'base': 'AudiodevPerDirectionOptions',
82 '*period-length': 'uint32',
83 '*try-poll': 'bool' } }
86 # @AudiodevAlsaOptions:
88 # Options of the ALSA audio backend.
90 # @in: options of the capture stream
92 # @out: options of the playback stream
94 # @threshold: set the threshold (in microseconds) when playback starts
98 { 'struct': 'AudiodevAlsaOptions',
100 '*in': 'AudiodevAlsaPerDirectionOptions',
101 '*out': 'AudiodevAlsaPerDirectionOptions',
102 '*threshold': 'uint32' } }
105 # @AudiodevCoreaudioPerDirectionOptions:
107 # Options of the Core Audio backend that are used for both playback and
110 # @buffer-count: number of buffers
114 { 'struct': 'AudiodevCoreaudioPerDirectionOptions',
115 'base': 'AudiodevPerDirectionOptions',
117 '*buffer-count': 'uint32' } }
120 # @AudiodevCoreaudioOptions:
122 # Options of the coreaudio audio backend.
124 # @in: options of the capture stream
126 # @out: options of the playback stream
130 { 'struct': 'AudiodevCoreaudioOptions',
132 '*in': 'AudiodevCoreaudioPerDirectionOptions',
133 '*out': 'AudiodevCoreaudioPerDirectionOptions' } }
136 # @AudiodevDsoundOptions:
138 # Options of the DirectSound audio backend.
140 # @in: options of the capture stream
142 # @out: options of the playback stream
144 # @latency: add extra latency to playback in microseconds
149 { 'struct': 'AudiodevDsoundOptions',
151 '*in': 'AudiodevPerDirectionOptions',
152 '*out': 'AudiodevPerDirectionOptions',
153 '*latency': 'uint32' } }
156 # @AudiodevJackPerDirectionOptions:
158 # Options of the JACK backend that are used for both playback and
161 # @server-name: select from among several possible concurrent server instances
162 # (default: environment variable $JACK_DEFAULT_SERVER if set, else "default")
164 # @client-name: the client name to use. The server will modify this name to
165 # create a unique variant, if needed unless @exact-name is true (default: the
168 # @connect-ports: if set, a regular expression of JACK client port name(s) to
169 # monitor for and automatically connect to
171 # @start-server: start a jack server process if one is not already present
174 # @exact-name: use the exact name requested otherwise JACK automatically
175 # generates a unique one, if needed (default: false)
179 { 'struct': 'AudiodevJackPerDirectionOptions',
180 'base': 'AudiodevPerDirectionOptions',
182 '*server-name': 'str',
183 '*client-name': 'str',
184 '*connect-ports': 'str',
185 '*start-server': 'bool',
186 '*exact-name': 'bool' } }
189 # @AudiodevJackOptions:
191 # Options of the JACK audio backend.
193 # @in: options of the capture stream
195 # @out: options of the playback stream
199 { 'struct': 'AudiodevJackOptions',
201 '*in': 'AudiodevJackPerDirectionOptions',
202 '*out': 'AudiodevJackPerDirectionOptions' } }
205 # @AudiodevOssPerDirectionOptions:
207 # Options of the OSS backend that are used for both playback and
210 # @dev: file name of the OSS device (default '/dev/dsp')
212 # @buffer-count: number of buffers
214 # @try-poll: attempt to use poll mode, falling back to non-polling
215 # access on failure (default true)
219 { 'struct': 'AudiodevOssPerDirectionOptions',
220 'base': 'AudiodevPerDirectionOptions',
223 '*buffer-count': 'uint32',
224 '*try-poll': 'bool' } }
227 # @AudiodevOssOptions:
229 # Options of the OSS audio backend.
231 # @in: options of the capture stream
233 # @out: options of the playback stream
235 # @try-mmap: try using memory-mapped access, falling back to
236 # non-memory-mapped access on failure (default true)
238 # @exclusive: open device in exclusive mode (vmix won't work)
241 # @dsp-policy: set the timing policy of the device (between 0 and 10,
242 # where smaller number means smaller latency but higher
243 # CPU usage) or -1 to use fragment mode (option ignored
244 # on some platforms) (default 5)
248 { 'struct': 'AudiodevOssOptions',
250 '*in': 'AudiodevOssPerDirectionOptions',
251 '*out': 'AudiodevOssPerDirectionOptions',
253 '*exclusive': 'bool',
254 '*dsp-policy': 'uint32' } }
257 # @AudiodevPaPerDirectionOptions:
259 # Options of the Pulseaudio backend that are used for both playback and
262 # @name: name of the sink/source to use
264 # @stream-name: name of the PulseAudio stream created by qemu. Can be
265 # used to identify the stream in PulseAudio when you
266 # create multiple PulseAudio devices or run multiple qemu
267 # instances (default: audiodev's id, since 4.2)
269 # @latency: latency you want PulseAudio to achieve in microseconds
274 { 'struct': 'AudiodevPaPerDirectionOptions',
275 'base': 'AudiodevPerDirectionOptions',
278 '*stream-name': 'str',
279 '*latency': 'uint32' } }
282 # @AudiodevPaOptions:
284 # Options of the PulseAudio audio backend.
286 # @in: options of the capture stream
288 # @out: options of the playback stream
290 # @server: PulseAudio server address (default: let PulseAudio choose)
294 { 'struct': 'AudiodevPaOptions',
296 '*in': 'AudiodevPaPerDirectionOptions',
297 '*out': 'AudiodevPaPerDirectionOptions',
301 # @AudiodevWavOptions:
303 # Options of the wav audio backend.
305 # @in: options of the capture stream
307 # @out: options of the playback stream
309 # @path: name of the wav file to record (default 'qemu.wav')
313 { 'struct': 'AudiodevWavOptions',
315 '*in': 'AudiodevPerDirectionOptions',
316 '*out': 'AudiodevPerDirectionOptions',
323 # An enumeration of possible audio formats.
325 # @u8: unsigned 8 bit integer
327 # @s8: signed 8 bit integer
329 # @u16: unsigned 16 bit integer
331 # @s16: signed 16 bit integer
333 # @u32: unsigned 32 bit integer
335 # @s32: signed 32 bit integer
337 # @f32: single precision floating-point (since 5.0)
341 { 'enum': 'AudioFormat',
342 'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }
347 # An enumeration of possible audio backend drivers.
349 # @jack: JACK audio backend (since 5.1)
353 { 'enum': 'AudiodevDriver',
354 'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'jack', 'oss', 'pa',
355 'sdl', 'spice', 'wav' ] }
360 # Options of an audio backend.
362 # @id: identifier of the backend
364 # @driver: the backend driver to use
366 # @timer-period: timer period (in microseconds, 0: use lowest possible)
370 { 'union': 'Audiodev',
373 'driver': 'AudiodevDriver',
374 '*timer-period': 'uint32' },
375 'discriminator': 'driver',
377 'none': 'AudiodevGenericOptions',
378 'alsa': 'AudiodevAlsaOptions',
379 'coreaudio': 'AudiodevCoreaudioOptions',
380 'dsound': 'AudiodevDsoundOptions',
381 'jack': 'AudiodevJackOptions',
382 'oss': 'AudiodevOssOptions',
383 'pa': 'AudiodevPaOptions',
384 'sdl': 'AudiodevGenericOptions',
385 'spice': 'AudiodevGenericOptions',
386 'wav': 'AudiodevWavOptions' } }