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 # @AudiodevOssPerDirectionOptions:
158 # Options of the OSS backend that are used for both playback and
161 # @dev: file name of the OSS device (default '/dev/dsp')
163 # @buffer-count: number of buffers
165 # @try-poll: attempt to use poll mode, falling back to non-polling
166 # access on failure (default true)
170 { 'struct': 'AudiodevOssPerDirectionOptions',
171 'base': 'AudiodevPerDirectionOptions',
174 '*buffer-count': 'uint32',
175 '*try-poll': 'bool' } }
178 # @AudiodevOssOptions:
180 # Options of the OSS audio backend.
182 # @in: options of the capture stream
184 # @out: options of the playback stream
186 # @try-mmap: try using memory-mapped access, falling back to
187 # non-memory-mapped access on failure (default true)
189 # @exclusive: open device in exclusive mode (vmix won't work)
192 # @dsp-policy: set the timing policy of the device (between 0 and 10,
193 # where smaller number means smaller latency but higher
194 # CPU usage) or -1 to use fragment mode (option ignored
195 # on some platforms) (default 5)
199 { 'struct': 'AudiodevOssOptions',
201 '*in': 'AudiodevOssPerDirectionOptions',
202 '*out': 'AudiodevOssPerDirectionOptions',
204 '*exclusive': 'bool',
205 '*dsp-policy': 'uint32' } }
208 # @AudiodevPaPerDirectionOptions:
210 # Options of the Pulseaudio backend that are used for both playback and
213 # @name: name of the sink/source to use
215 # @stream-name: name of the PulseAudio stream created by qemu. Can be
216 # used to identify the stream in PulseAudio when you
217 # create multiple PulseAudio devices or run multiple qemu
218 # instances (default: audiodev's id, since 4.2)
220 # @latency: latency you want PulseAudio to achieve in microseconds
225 { 'struct': 'AudiodevPaPerDirectionOptions',
226 'base': 'AudiodevPerDirectionOptions',
229 '*stream-name': 'str',
230 '*latency': 'uint32' } }
233 # @AudiodevPaOptions:
235 # Options of the PulseAudio audio backend.
237 # @in: options of the capture stream
239 # @out: options of the playback stream
241 # @server: PulseAudio server address (default: let PulseAudio choose)
245 { 'struct': 'AudiodevPaOptions',
247 '*in': 'AudiodevPaPerDirectionOptions',
248 '*out': 'AudiodevPaPerDirectionOptions',
252 # @AudiodevWavOptions:
254 # Options of the wav audio backend.
256 # @in: options of the capture stream
258 # @out: options of the playback stream
260 # @path: name of the wav file to record (default 'qemu.wav')
264 { 'struct': 'AudiodevWavOptions',
266 '*in': 'AudiodevPerDirectionOptions',
267 '*out': 'AudiodevPerDirectionOptions',
274 # An enumeration of possible audio formats.
278 { 'enum': 'AudioFormat',
279 'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32' ] }
284 # An enumeration of possible audio backend drivers.
288 { 'enum': 'AudiodevDriver',
289 'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'oss', 'pa', 'sdl',
295 # Options of an audio backend.
297 # @id: identifier of the backend
299 # @driver: the backend driver to use
301 # @timer-period: timer period (in microseconds, 0: use lowest possible)
305 { 'union': 'Audiodev',
308 'driver': 'AudiodevDriver',
309 '*timer-period': 'uint32' },
310 'discriminator': 'driver',
312 'none': 'AudiodevGenericOptions',
313 'alsa': 'AudiodevAlsaOptions',
314 'coreaudio': 'AudiodevCoreaudioOptions',
315 'dsound': 'AudiodevDsoundOptions',
316 'oss': 'AudiodevOssOptions',
317 'pa': 'AudiodevPaOptions',
318 'sdl': 'AudiodevGenericOptions',
319 'spice': 'AudiodevGenericOptions',
320 'wav': 'AudiodevWavOptions' } }