qemu/include/hw/audio
Mark Cave-Ayland 5243e5543e asc: generate silence if FIFO empty but engine still running
MacOS (un)helpfully leaves the FIFO engine running even when all the samples have
been written to the hardware, and expects the FIFO status flags and IRQ to be
updated continuously.

There is an additional problem in that not all audio backends guarantee an
all-zero output when there is no FIFO data available, in particular the Windows
dsound backend which re-uses its internal circular buffer causing the last played
sound to loop indefinitely.

Whilst this is effectively a bug in the Windows dsound backend, work around it
for now using a simple heuristic: if the FIFO remains empty for half a cycle
(~23ms) then continuously fill the generated buffer with empty silence.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20231004083806.757242-9-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2023-10-06 10:33:43 +02:00
..
asc.h asc: generate silence if FIFO empty but engine still running 2023-10-06 10:33:43 +02:00
pcspk.h qom: Put name parameter before value / visitor parameter 2020-07-10 15:18:08 +02:00
soundhw.h introduce -audio as a replacement for -soundhw 2022-05-14 12:33:44 +02:00
wm8750.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00