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

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

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

>
> 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".
>
I understand now, Thanks. I guess it should work for signed range, so I
would do:

@@ -117,7 +117,9 @@ playback_on_process(void *data)
     }

     if (avail == 0) {
-        memset(p, 0, n_bytes);
+        memset(p, 0, (int32_t) n_bytes);

CMIIW

Thanks,
Dorinda.

On Mon, Mar 13, 2023 at 2:37 PM Christian Schoenebeck <
qemu_oss@crudebyte.com> wrote:

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

[-- Attachment #2: Type: text/html, Size: 2792 bytes --]

  reply	other threads:[~2023-03-13 19:07 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
2023-03-13 19:06       ` Dorinda Bassey [this message]
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='CACzuRyz39A0ptHGY=8LNf=mXEkiTDD3OQ2a8gnk1_dbEn72YPw@mail.gmail.com' \
    --to=dbassey@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --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).