The Problem

you are attempting to Record/Replay your QEMU execution, but your Replay is crashing (sometimes) when handling sound:

(qemu) qemu: Missing audio out event in the replay log

The Root Cause

from the QEMU invocation docs:

`in|out.mixing-engine=on|off`

Use QEMU’s mixing engine to mix all streams inside QEMU and convert audio formats when not supported by the backend. When off, fixed-settings must be off too. Note that disabling this option means that the selected backend must support multiple streams and the audio formats used by the virtual cards, otherwise you’ll get no sound. It’s not recommended to disable this option unless you want to use 5.1 or 7.1 audio, as mixing engine only supports mono and stereo audio. Default is on.

(it seems like) this default setting can result in audio playback that is not identical to the recording (thus triggering the fatal error described above)

The Solution

add out.mixing-engine=off to the parameters for audiodev

  • ⚠️ this can work in basic situations, but make sure to understand the implications of changing this default (as noted in the docs excerpt above)
# minimal example with PC Speaker routed to audiodev
-audiodev alsa,id=snd,out.mixing-engine=off \
-machine pcspk-audiodev=snd