qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: "Volker Rümelin" <vr_qemu@t-online.de>, qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	kraxel@redhat.com, armbru@redhat.com, pbonzini@redhat.com,
	wtaymans@redhat.com, qemu-devel@nongnu.org,
	"Dorinda Bassey" <dbassey@redhat.com>
Subject: Re: [PATCH v7] audio/pwaudio.c: Add Pipewire audio backend for QEMU
Date: Mon, 13 Mar 2023 14:31:10 +0100	[thread overview]
Message-ID: <3379148.aeAvL9zz9z@silver> (raw)
In-Reply-To: <CACzuRyyyt-L+iwFHOS3Tq5hQ9OToedyM79fmtKU3+X6KpUDSsw@mail.gmail.com>

On Monday, March 13, 2023 2:11:11 PM CET Dorinda Bassey wrote:
> Hi Volker,
> 
> 
> > To hear this,
> > start QEMU with qemu-system-x86_64 -machine pcspk-audiodev=audio0
> > -device ich9-intel-hda -device hda-duplex,audiodev=audio0 -audiodev
> > pipewire,id=audio0,out.mixing-engine=off ...
> >
> I hear the clipped audio stream with these options. IMO, I don't think
> memset is responsible for that behaviour, I still hear the harsh sound with
> "-audiodev pa". I also tried using an alternative like:
> 
> @@ -117,7 +118,7 @@ playback_on_process(void *data)
>      }
> 
>      if (avail == 0) {
> -        memset(p, 0, n_bytes);
> +        p = g_malloc0(sizeof(n_bytes));
>      } else {
> 
> The clipped audio issue is still persistent.

Are you sure about sizeof(n_bytes) here? That's 4. ;-)

Volker's point was that "silence" is the center of the wave range. With signed
range that's zero, yes, but with unsigned range that's 2^(bitdepth) / 2.

So you need to memset() the correct value to generate "silence".

Best regards,
Christian Schoenebeck




  reply	other threads:[~2023-03-13 13:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 17:10 [PATCH v7] audio/pwaudio.c: Add Pipewire audio backend for QEMU Dorinda Bassey
2023-03-07 14:41 ` Marc-André Lureau
2023-03-07 16:21   ` Dorinda Bassey
2023-03-08 10:39 ` Marc-André Lureau
2023-03-08 21:15   ` Volker Rümelin
2023-03-09 13:24   ` Dorinda Bassey
2023-03-10  6:42 ` Volker Rümelin
2023-03-11 12:08   ` [PATCH] DO-NOT-MERGE: pipewire sample code Volker Rümelin
2023-03-11 16:19     ` Volker Rümelin
2023-03-13 12:28       ` Dorinda Bassey
2023-03-13 20:05         ` Volker Rümelin
2023-03-14 11:50           ` Dorinda Bassey
2023-03-14 19:26             ` Volker Rümelin
2023-03-12  8:01 ` [PATCH v7] audio/pwaudio.c: Add Pipewire audio backend for QEMU Volker Rümelin
2023-03-13 13:11   ` Dorinda Bassey
2023-03-13 13:31     ` Christian Schoenebeck [this message]
2023-03-13 19:06       ` Dorinda Bassey
2023-03-14 11:11         ` Christian Schoenebeck
2023-03-13 19:22     ` Volker Rümelin

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=3379148.aeAvL9zz9z@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=armbru@redhat.com \
    --cc=dbassey@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vr_qemu@t-online.de \
    --cc=wtaymans@redhat.com \
    /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).