qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "\"Kővágó, Zoltán\"" <dirty.ice.hu@gmail.com>, qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 07/12] qapi: qapi for audio backends
Date: Fri, 12 Jun 2015 16:11:58 -0600	[thread overview]
Message-ID: <557B592E.20103@redhat.com> (raw)
In-Reply-To: <5dee9d7d95eb2260edcc0de0d1090366f159b03f.1434111578.git.DirtY.iCE.hu@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5458 bytes --]

On 06/12/2015 06:33 AM, Kővágó, Zoltán wrote:
> This patch adds structures into qapi to replace the existing configuration
> structures used by audio backends currently. This qapi will be the base of the
> -audiodev command line parameter (that replaces the old environment variables
> based config).
> 
> This is not a 1:1 translation of the old options, I've tried to make them much
> more consistent (e.g. almost every backend had an option to specify buffer size,
> but the name was different for every backend, and some backends required usecs,
> while some other required frames, samples or bytes). Also tried to reduce the
> number of abbreviations used by the config keys.
> 
> 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 than
>   samples or bytes.
> * try-poll is now an alsa and oss backend specific option (as all other backends
>   currently ignore it)
> 
> Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
> 
> ---

> +++ b/qapi/audio.json
> @@ -0,0 +1,217 @@
> +# -*- mode: python -*-
> +
> +##
> +# @AudiodevNoneOptions

Might be nice to include copyright/license, but this is not the first
.json 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 starts
> +#
> +# Since: 2.4
> +##
> +{ 'struct': 'AudiodevAlsaOptions',
> +  'data': {
> +    'in':         'AudiodevAlsaPerDirectionOptions',
> +    'out':        'AudiodevAlsaPerDirectionOptions',

...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 one.


> +##
> +# @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 use 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 recording.
> +#
> +# @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' } }
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-06-12 22:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 12:33 [Qemu-devel] [PATCH 00/12] -audiodev option Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 01/12] audio: remove LOG_TO_MONITOR along with default_mon Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 02/12] audio: remove plive Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 03/12] dsoundaudio: remove *_retries kludges Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 04/12] dsoundaudio: remove primary buffer Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 05/12] alsaaudio: use trace events instead of verbose Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 06/12] ossaudio: use trace events instead of debug config flag Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 07/12] qapi: qapi for audio backends Kővágó, Zoltán
2015-06-12 22:11   ` Eric Blake [this message]
2015-06-12 22:59     ` Kővágó Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 08/12] qapi: support nested structs in OptsVisitor Kővágó, Zoltán
2015-06-15  8:39   ` Gerd Hoffmann
2015-06-12 12:33 ` [Qemu-devel] [PATCH 09/12] opts: do not print separator before first item in qemu_opts_print Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 10/12] qapi: AllocVisitor Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 11/12] audio: use qapi AudioFormat instead of audfmt_e Kővágó, Zoltán
2015-06-12 12:33 ` [Qemu-devel] [PATCH 12/12] audio: -audiodev command line option Kővágó, Zoltán
2015-06-15  9:01 ` [Qemu-devel] [PATCH 00/12] -audiodev option Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557B592E.20103@redhat.com \
    --to=eblake@redhat.com \
    --cc=dirty.ice.hu@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).