diff mbox series

[02/12] audio: fix GUS audio playback with out.mixing-engine=off

Message ID 20220923183640.8314-2-vr_qemu@t-online.de
State New
Headers show
Series audio: misc. improvements and bug fixes | expand

Commit Message

Volker Rümelin Sept. 23, 2022, 6:36 p.m. UTC
Fix GUS audio playback with out.mixing-engine=off.

The GUS audio device needs to know the amount of samples to
produce in advance.

To reproduce start qemu with
-parallel none -device gus,audiodev=audio0
-audiodev pa,id=audio0,out.mixing-engine=off

and start the cartoon.exe demo in a FreeDOS guest. The demo file
is available on the download page of the GUSemu32 author.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
 audio/audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Marc-André Lureau Sept. 27, 2022, 11:54 a.m. UTC | #1
On Fri, Sep 23, 2022 at 10:39 PM Volker Rümelin <vr_qemu@t-online.de> wrote:

> Fix GUS audio playback with out.mixing-engine=off.
>
> The GUS audio device needs to know the amount of samples to
> produce in advance.
>
> To reproduce start qemu with
> -parallel none -device gus,audiodev=audio0
> -audiodev pa,id=audio0,out.mixing-engine=off
>
> and start the cartoon.exe demo in a FreeDOS guest. The demo file
> is available on the download page of the GUSemu32 author.
>
> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
>

lgtm
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---
>  audio/audio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/audio/audio.c b/audio/audio.c
> index 04f685fe24..343786243d 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -1139,7 +1139,8 @@ static void audio_run_out (AudioState *s)
>              }
>
>              if (sw->active) {
> -                sw->callback.fn(sw->callback.opaque, INT_MAX);
> +                sw->callback.fn(sw->callback.opaque,
> +                                hw_free * sw->info.bytes_per_frame);
>              }
>
>              continue;
> --
> 2.35.3
>
>
>
diff mbox series

Patch

diff --git a/audio/audio.c b/audio/audio.c
index 04f685fe24..343786243d 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1139,7 +1139,8 @@  static void audio_run_out (AudioState *s)
             }
 
             if (sw->active) {
-                sw->callback.fn(sw->callback.opaque, INT_MAX);
+                sw->callback.fn(sw->callback.opaque,
+                                hw_free * sw->info.bytes_per_frame);
             }
 
             continue;