From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5VXZ-0005rJ-BC for qemu-devel@nongnu.org; Thu, 18 Jun 2015 04:51:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5VXV-0006nd-4k for qemu-devel@nongnu.org; Thu, 18 Jun 2015 04:51:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5VXU-0006nE-UQ for qemu-devel@nongnu.org; Thu, 18 Jun 2015 04:51:13 -0400 From: Markus Armbruster References: <87si9qg4kt.fsf@blackfin.pond.sub.org> <558151FC.9000703@gmail.com> <87zj3y7dyk.fsf@blackfin.pond.sub.org> <5581630F.1070701@gmail.com> <87fv5q317m.fsf@blackfin.pond.sub.org> <55817BBC.60904@gmail.com> <87h9q6720y.fsf@blackfin.pond.sub.org> <55820F0E.4050203@gmail.com> Date: Thu, 18 Jun 2015 10:51:09 +0200 In-Reply-To: <55820F0E.4050203@gmail.com> (=?utf-8?B?IkvFkXbDoWfDsyBab2x0?= =?utf-8?B?w6FuIidz?= message of "Thu, 18 Jun 2015 02:21:34 +0200") Message-ID: <87fv5p4cxu.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/6] qapi: qapi for audio backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?S8WRdsOhZ8OzIFpvbHTDoW4=?= Cc: Michael Roth , Gerd Hoffmann , qemu-devel@nongnu.org "K=C5=91v=C3=A1g=C3=B3 Zolt=C3=A1n" writes: > 2015-06-17 18:06 keltez=C3=A9ssel, Markus Armbruster =C3=ADrta: >> "K=C5=91v=C3=A1g=C3=B3 Zolt=C3=A1n" writes: >> >>> 2015-06-17 15:37 keltez=C3=A9ssel, Markus Armbruster =C3=ADrta: >>>> "K=C5=91v=C3=A1g=C3=B3 Zolt=C3=A1n" writes: >>>> >>>>> 2015-06-17 13:48 keltez=C3=A9ssel, Markus Armbruster =C3=ADrta: >>>>>> "K=C5=91v=C3=A1g=C3=B3 Zolt=C3=A1n" writes: >>>>>> >>>>>>> 2015-06-17 09:46 keltez=C3=A9ssel, Markus Armbruster =C3=ADrta: >> [...] >>>>>>>>> +## >>>>>>>>> +# @AudiodevBackendOptions >>>>>>>>> +# >>>>>>>>> +# A discriminated record of audio backends. >>>>>>>>> +# >>>>>>>>> +# Since: 2.4 >>>>>>>>> +## >>>>>>>>> +{ 'union': 'AudiodevBackendOptions', >>>>>>>>> + 'data': { >>>>>>>>> + 'none': 'AudiodevNoOptions', >>>>>>>>> + 'alsa': 'AudiodevAlsaOptions', >>>>>>>>> + 'coreaudio': 'AudiodevNoOptions', >>>>>>>>> + 'dsound': 'AudiodevDsoundOptions', >>>>>>>>> + 'oss': 'AudiodevOssOptions', >>>>>>>>> + 'pa': 'AudiodevPaOptions', >>>>>>>>> + 'sdl': 'AudiodevNoOptions', >>>>>>>>> + 'spice': 'AudiodevNoOptions', >>>>>>>>> + 'wav': 'AudiodevWavOptions' } } >>>>>>>>> + >>>>>>>>> +## >>>>>>>>> +# @AudioFormat >>>>>>>>> +# >>>>>>>>> +# An enumeration of possible audio formats. >>>>>>>>> +# >>>>>>>>> +# Since: 2.4 >>>>>>>>> +## >>>>>>>>> +{ 'enum': 'AudioFormat', >>>>>>>>> + 'data': [ 'u8', 's8', 'u16', 's16', 'u32', 's32' ] } >>>>>>>>> + >>>>>>>>> +## >>>>>>>>> +# @AudiodevPerDirectionOptions >>>>>>>>> +# >>>>>>>>> +# General audio backend options that are used for both playback >>>>>>>>> and recording. >>>>>>>>> +# >>>>>>>>> +# @fixed-settings: #optional use fixed settings for host DAC/ADC >>>>>>>>> +# >>>>>>>>> +# @frequency: #optional frequency to use when using fixed settin= gs >>>>>>>>> +# >>>>>>>>> +# @channels: #optional number of channels when using fixed setti= ngs >>>>>>>>> +# >>>>>>>>> +# @format: #optional sample format to use when using fixed setti= ngs >>>>>>>> >>>>>>>> Are these guys used when @fixed-settings is off? >>>>>>> >>>>>>> No. >>>>>> >>>>>> If @fixed-settings, are the other three all required? If not, what = are >>>>>> their defaults? >>>>> >>>>> No, they all have defaults: 44100 Hz, 2 channels and s16 format. >>>> >>>> Okay, this sort of explains why you have @fixed-settings. >>>> >>>> My first thought was that @fixed-settings is redundant, because we can >>>> have any of @frequency, @channels, @format imply fixed settings. Exce= pt >>>> that doesn't let you ask for the *default* fixed settings, as you have >>>> to specify at least one. >>>> >>>> What's the default for @fixed-settings? >>> >>> It's on by default. >>> >>>> What if I specify frequency, channels or format together with explicit >>>> fixed-settings: false? >>> >>> They will be ignored. >>> >>> The audio system currently work like this: when an audio frontend >>> wants to open an output with some format (frequency, channels, format) >>> it checks fixed-settings. If it's false, it will just open the stream >>> with the frontend specified settings. If it's true, it'll convert it >>> into the format specified by @frequency, @channels, @format, then pass >>> this converted/recoded stream to the backend. >> >> So user typically specifies either fixed-settings=3Doff, or any >> combination of the other three (including none of them). Correct? >> >> We could reject the non-sensical combination of fixed-settings=3Doff plus >> any of the other three instead of silently ignoring their values. >> Matter of taste, your choice. >> >> Whatever you do, make sure to document how these four work together. >> >> Thank you for educating me so patiently. > > The audio backend currently works like that you can pass any > non-sensical values to it, like negative frequency, or 'kdp' count of > channels, it will silently fallback to some default value, or just > fail, but qemu will continue to run. We can make the new config more > strict (and we should, I think), so if you have any idea where should > we be more strict (without creating a backward compatibility > headache), don't hesitate to point it out. When a sensible default value exists, making the parameter optional is usually a good idea. We should refuse to start on non-sensical configuration, not silently substitute defaults or disable the affected component (here: audio backend). I can't give you more specific guidance, because I'm an audio ignoramus :)