qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: WANG Xuerui <i.qemu@xen0n.name>
To: Brad Smith <brad@comstyle.com>, qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH] audio: Add sndio backend
Date: Wed, 10 Nov 2021 14:22:23 +0800	[thread overview]
Message-ID: <f1a61afe-9be4-557e-1f35-ed8d9ea53cad@xen0n.name> (raw)
In-Reply-To: <YYdh3l1HTh+kpONa@humpty.home.comstyle.com>


On 2021/11/7 13:19, Brad Smith wrote:
> audio: Add sndio backend
>
> Add a sndio backend.
>
> sndio is the native API used by OpenBSD, although it has been ported to
> other *BSD's and Linux (packages for Ubuntu, Debian, Void, Arch, etc.).
>
> The C code is from Alexandre Ratchov <alex@caoua.org> and the rest of
> the bits are from me.

As pointed out by others, this is lacking Signed-off-by lines; IIUC you
may contact Alexandre to get theirs, and then add yours.

I'm not familiar with this part of qemu, so what follows is only a
somewhat brief review. That said...

> ---
>  audio/audio.c          |   1 +
>  audio/audio_template.h |   2 +
>  audio/meson.build      |   1 +
>  audio/sndioaudio.c     | 555 +++++++++++++++++++++++++++++++++++++++++
>  meson.build            |   7 +
>  meson_options.txt      |   4 +-
>  qapi/audio.json        |  25 +-
>  qemu-options.hx        |   8 +
>  tests/vm/freebsd       |   3 +
>  9 files changed, 604 insertions(+), 2 deletions(-)
>  create mode 100644 audio/sndioaudio.c
>
> diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c
> new file mode 100644
> index 0000000000..204af07781
> --- /dev/null
> +++ b/audio/sndioaudio.c
> @@ -0,0 +1,555 @@
> +/*
> + * Copyright (c) 2019 Alexandre Ratchov <alex@caoua.org>
> + *
> + * Permission to use, copy, modify, and distribute this software for any
> + * purpose with or without fee is hereby granted, provided that the above
> + * copyright notice and this permission notice appear in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
Perhaps using an SPDX license identifier would be better?
> +
> +/*
> + * TODO :
> + *
> + * Use a single device and open it in full-duplex rather than
> + * opening it twice (once for playback once for recording).
> + *
> + * This is the only way to ensure that playback doesn't drift with respect
> + * to recording, which is what guest systems expect.
> + */
> +
> +#include <poll.h>
> +#include <sndio.h>
> +#include "qemu/osdep.h"
> +#include "qemu-common.h"
> +#include "qemu/main-loop.h"
> +#include "audio.h"
> +#include "trace.h"
> +
> +#define AUDIO_CAP "sndio"
> +#include "audio_int.h"
> +
> +/* default latency in ms if no option is set */
> +#define SNDIO_LATENCY_US   50000

Maybe you mean "microseconds" in the comment? 50 *seconds* seems a bit
long ;)



  parent reply	other threads:[~2021-11-10  6:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07  5:19 [PATCH] audio: Add sndio backend Brad Smith
2021-11-08 13:03 ` Christian Schoenebeck
2021-11-13 20:40   ` Brad Smith
2021-11-14 13:18     ` Christian Schoenebeck
2021-11-18 19:25       ` Brad Smith
2021-11-08 14:58 ` Paolo Bonzini
2021-11-09 21:53   ` Brad Smith
2021-11-13 11:38     ` Paolo Bonzini
2021-11-13 20:41   ` Brad Smith
2021-11-10  6:22 ` WANG Xuerui [this message]
2021-11-13 21:09   ` Brad Smith
2021-11-13 15:55 ` Volker Rümelin
2021-11-19 20:23 ` Volker Rümelin
2021-12-09 19:08 ` Volker Rümelin
  -- strict thread matches above, loose matches on Subject: below --
2020-03-04 14:50 Brad Smith
2020-03-04 15:04 ` no-reply
2020-03-05  8:50   ` Gerd Hoffmann
2020-03-05 17:07     ` Brad Smith
2020-03-06  8:23       ` Gerd Hoffmann
2020-03-05 20:46 ` Eric Blake

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=f1a61afe-9be4-557e-1f35-ed8d9ea53cad@xen0n.name \
    --to=i.qemu@xen0n.name \
    --cc=brad@comstyle.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).