qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7] audio/pwaudio.c: Add Pipewire audio backend for QEMU


From: Christian Schoenebeck
Subject: Re: [PATCH v7] audio/pwaudio.c: Add Pipewire audio backend for QEMU
Date: Mon, 13 Mar 2023 14:31:10 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]