sm501: Drop unneded variable
[qemu/ar7.git] / qapi / audio.json
blobf62bd0d7f6eca2b2b0ba31a040013690264a7c48
1 # -*- mode: python -*-
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.
8 ##
9 # @AudiodevPerDirectionOptions:
11 # General audio backend options that are used for both playback and
12 # recording.
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,
17 #                 since 4.2)
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
24 #             (default 44100)
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
31 #          (default s16)
33 # @buffer-length: the buffer length in microseconds
35 # Since: 4.0
37 { 'struct': 'AudiodevPerDirectionOptions',
38   'data': {
39     '*mixing-engine':  'bool',
40     '*fixed-settings': 'bool',
41     '*frequency':      'uint32',
42     '*channels':       'uint32',
43     '*voices':         '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
56 # Since: 4.0
58 { 'struct': 'AudiodevGenericOptions',
59   'data': {
60     '*in':  'AudiodevPerDirectionOptions',
61     '*out': 'AudiodevPerDirectionOptions' } }
64 # @AudiodevAlsaPerDirectionOptions:
66 # Options of the ALSA backend that are used for both playback and
67 # recording.
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)
76 # Since: 4.0
78 { 'struct': 'AudiodevAlsaPerDirectionOptions',
79   'base': 'AudiodevPerDirectionOptions',
80   'data': {
81     '*dev':           'str',
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
96 # Since: 4.0
98 { 'struct': 'AudiodevAlsaOptions',
99   'data': {
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
108 # recording.
110 # @buffer-count: number of buffers
112 # Since: 4.0
114 { 'struct': 'AudiodevCoreaudioPerDirectionOptions',
115   'base': 'AudiodevPerDirectionOptions',
116   'data': {
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
128 # Since: 4.0
130 { 'struct': 'AudiodevCoreaudioOptions',
131   'data': {
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
145 #           (default 10000)
147 # Since: 4.0
149 { 'struct': 'AudiodevDsoundOptions',
150   'data': {
151     '*in':      'AudiodevPerDirectionOptions',
152     '*out':     'AudiodevPerDirectionOptions',
153     '*latency': 'uint32' } }
156 # @AudiodevJackPerDirectionOptions:
158 # Options of the JACK backend that are used for both playback and
159 # recording.
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
166 # guest's name)
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
172 # (default: false)
174 # @exact-name: use the exact name requested otherwise JACK automatically
175 # generates a unique one, if needed (default: false)
177 # Since: 5.1
179 { 'struct': 'AudiodevJackPerDirectionOptions',
180   'base': 'AudiodevPerDirectionOptions',
181   'data': {
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
197 # Since: 5.1
199 { 'struct': 'AudiodevJackOptions',
200   'data': {
201     '*in':  'AudiodevJackPerDirectionOptions',
202     '*out': 'AudiodevJackPerDirectionOptions' } }
205 # @AudiodevOssPerDirectionOptions:
207 # Options of the OSS backend that are used for both playback and
208 # recording.
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)
217 # Since: 4.0
219 { 'struct': 'AudiodevOssPerDirectionOptions',
220   'base': 'AudiodevPerDirectionOptions',
221   'data': {
222     '*dev':          'str',
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)
239 #             (default false)
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)
246 # Since: 4.0
248 { 'struct': 'AudiodevOssOptions',
249   'data': {
250     '*in':         'AudiodevOssPerDirectionOptions',
251     '*out':        'AudiodevOssPerDirectionOptions',
252     '*try-mmap':   'bool',
253     '*exclusive':  'bool',
254     '*dsp-policy': 'uint32' } }
257 # @AudiodevPaPerDirectionOptions:
259 # Options of the Pulseaudio backend that are used for both playback and
260 # recording.
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
270 #           (default 15000)
272 # Since: 4.0
274 { 'struct': 'AudiodevPaPerDirectionOptions',
275   'base': 'AudiodevPerDirectionOptions',
276   'data': {
277     '*name': 'str',
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)
292 # Since: 4.0
294 { 'struct': 'AudiodevPaOptions',
295   'data': {
296     '*in':     'AudiodevPaPerDirectionOptions',
297     '*out':    'AudiodevPaPerDirectionOptions',
298     '*server': 'str' } }
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')
311 # Since: 4.0
313 { 'struct': 'AudiodevWavOptions',
314   'data': {
315     '*in':   'AudiodevPerDirectionOptions',
316     '*out':  'AudiodevPerDirectionOptions',
317     '*path': 'str' } }
321 # @AudioFormat:
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)
339 # Since: 4.0
341 { 'enum': 'AudioFormat',
342   'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32', 'f32' ] }
345 # @AudiodevDriver:
347 # An enumeration of possible audio backend drivers.
349 # @jack: JACK audio backend (since 5.1)
351 # Since: 4.0
353 { 'enum': 'AudiodevDriver',
354   'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'jack', 'oss', 'pa',
355             'sdl', 'spice', 'wav' ] }
358 # @Audiodev:
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)
368 # Since: 4.0
370 { 'union': 'Audiodev',
371   'base': {
372     'id':            'str',
373     'driver':        'AudiodevDriver',
374     '*timer-period': 'uint32' },
375   'discriminator': 'driver',
376   'data': {
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' } }