From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3XBJ-0004lp-TC for qemu-devel@nongnu.org; Fri, 12 Jun 2015 18:12:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3XBE-0008UC-TC for qemu-devel@nongnu.org; Fri, 12 Jun 2015 18:12:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3XBE-0008U6-Mb for qemu-devel@nongnu.org; Fri, 12 Jun 2015 18:12:04 -0400 Message-ID: <557B592E.20103@redhat.com> Date: Fri, 12 Jun 2015 16:11:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <5dee9d7d95eb2260edcc0de0d1090366f159b03f.1434111578.git.DirtY.iCE.hu@gmail.com> In-Reply-To: <5dee9d7d95eb2260edcc0de0d1090366f159b03f.1434111578.git.DirtY.iCE.hu@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uoUMID1sOdnEimu0dvtCgh3lUIgDmG108" Subject: Re: [Qemu-devel] [PATCH 07/12] qapi: qapi for audio backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?IkvFkXbDoWfDsywgWm9sdMOhbiI=?= , qemu-devel@nongnu.org Cc: Gerd Hoffmann This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uoUMID1sOdnEimu0dvtCgh3lUIgDmG108 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/12/2015 06:33 AM, K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n wrote: > This patch adds structures into qapi to replace the existing configurat= ion > structures used by audio backends currently. This qapi will be the base= of the > -audiodev command line parameter (that replaces the old environment var= iables > based config). >=20 > This is not a 1:1 translation of the old options, I've tried to make th= em much > more consistent (e.g. almost every backend had an option to specify buf= fer size, > but the name was different for every backend, and some backends require= d usecs, > while some other required frames, samples or bytes). Also tried to redu= ce the > number of abbreviations used by the config keys. >=20 > Some of the more important changes: > * use `in` and `out` instead of `ADC` and `DAC`, as the former is more = user > friendly imho > * moved buffer settings into the global setting area (so it's the same = for all > backends that support it. Backends that can't change buffer size will= simply > ignore them). Also using usecs, as it's probably more user friendly t= han > samples or bytes. > * try-poll is now an alsa and oss backend specific option (as all other= backends > currently ignore it) >=20 > Signed-off-by: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n >=20 > --- > +++ b/qapi/audio.json > @@ -0,0 +1,217 @@ > +# -*- mode: python -*- > + > +## > +# @AudiodevNoneOptions Might be nice to include copyright/license, but this is not the first =2Ejson file missing it. > +# > +# The none, coreaudio, sdl and spice audio backend has no options. s/has/have/ > +# > +# Since: 2.4 > +## > +{ 'struct': 'AudiodevNoneOptions', > + 'data': { } } Maybe s/None/No/ (since it is shared by backends that have no options), but I can live with it as-is (since it is used by the 'none' backend). > +## > +# @AudiodevAlsaOptions > +# > +# Options of the alsa audio backend. > +# > +# @in: #optional options of the capture stream > +# > +# @out: #optional options of the playback stream Marked optional here... > +# > +# @threshold: #optional set the threshold (in frames) when playback st= arts > +# > +# Since: 2.4 > +## > +{ 'struct': 'AudiodevAlsaOptions', > + 'data': { > + 'in': 'AudiodevAlsaPerDirectionOptions', > + 'out': 'AudiodevAlsaPerDirectionOptions', =2E..but not here. > + '*threshold': 'int' } } > + > +## > +# @AudiodevDsoundOptions > +# > +# Options of the dsound audio backend. > +# > +# @latency-millis: #optional add extra latency to playback > +# > +# Since: 2.4 > +## > +{ 'struct': 'AudiodevDsoundOptions', > + 'data': { > + '*latency-millis': 'int' } } Style question - should we just call this 'latency', and document the milliseconds unit in the description? But having the name latency_millis in C code might not be all that bad, so you may not want to change this o= ne. > +## > +# @AudiodevOssOptions > +# > +# Options of the oss audio backend. > +# > +# @in: #optional options of the capture stream > +# > +# @out: #optional options of the playback stream > +# > +# @mmap: #optional try using memory mapped access > +# > +# @exclusive: #optional open device in exclusive mode (vmix wont work)= s/wont/won't/ > +# > +# @dsp-policy: #optional set the timing policy of the device, -1 to us= e fragment > +# mode (option ignored on some platforms) > +# > +# Since: 2.4 > +## > +{ 'struct': 'AudiodevOssOptions', > + 'data': { > + 'in': 'AudiodevOssPerDirectionOptions', > + 'out': 'AudiodevOssPerDirectionOptions', Again, inconsistent on the optional marking. > +## > +# @AudiodevPerDirectionOptions > +# > +# General audio backend options that are used for both playback and re= cording. > +# > +# @fixed-settings: #optional use fixed settings for host DAC/ADC > +# > +# @frequency: #optional frequency to use when using fixed settings > +# > +# @channels: #optional number of channels when using fixed settings > +# > +# @format: #optional sample fortmat to use when using fixed settings s/fortmat/format/ > +# > +# @buffer-usecs: #optional the buffer size in microseconds > +# > +# @buffer-count: #optional nuber of buffers > +# s/nuber/number/ > +# Since: 2.4 > +## > +{ 'struct': 'AudiodevPerDirectionOptions', > + 'data': { > + '*fixed-settings': 'bool', > + '*frequency': 'int', > + '*channels': 'int', > + '*voices': 'int', > + '*format': 'AudioFormat', > + '*buffer-usecs': 'int', > + '*buffer-count': 'int' } } > + > +## > +# @Audiodev > +# > +# Captures the configuration of an audio backend. > +# > +# @id: identifier of the backend > +# > +# @in: #optional options of the capture stream > +# > +# @out: #optional options of the playback stream > +# > +# @timer-period: #optional timer period in HZ (0 - use lowest possible= ) > +# > +# @opts: audio backend specific options > +# > +# Since: 2.4 > +## > +{ 'struct': 'Audiodev', > + 'data': { > + '*id': 'str', > + 'in': 'AudiodevPerDirectionOptions', > + 'out': 'AudiodevPerDirectionOptions', Another mismatch in optional marking. > + '*timer-period': 'int', > + 'opts': 'AudiodevBackendOptions' } } >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --uoUMID1sOdnEimu0dvtCgh3lUIgDmG108 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVe1kuAAoJEKeha0olJ0Nq44wIAIWLq9Kl16fRJKPBPFfpy+sQ lnEFfZiIeV7lIi8jwZ1edr/cis3VYdszzYjouepb8hd5w5uuORrqe8IXNIMaxMdZ FFZISQd1an9YQ1HchBAbKcMyrYx/SC3OZyQ9/EOpo+PhhlTwkN09/tgotbdohxiJ gHo5e6gG2fyn+Pg12zfdnhhIbhYf0XMXwfJOV9wT4kxZ/nixl0z0O6UI8mLYLaWU lN4bEx/C3Sdm2Q3OTa6myUo0xqQmNeHrJzKiVTUgtxYTst0CXaT/EfLZ83lF/qBI 6PzOGrNce0dVFKFc9IOVh9IOZQaPv6u3YI3hOs6QO2KJgvWpg+nI8MjOK33b318= =/v3c -----END PGP SIGNATURE----- --uoUMID1sOdnEimu0dvtCgh3lUIgDmG108--