to check the format, this call seems to return garbage, but doesn't fail.
The call is marked as obsolete in the alsa interface, so maybe it's just
bitrotten. Qemu then uses the returned format and will prepare samples
in that format, which of course then results in very garbled output since
alsa expects the samples in the format qemu initially configured.
The patch removes the extra query and just sets the format to what qemu
configured earlier in the same function.
--- /dev/null
+diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
+index 2f6c764..b27a3e7 100644
+--- a/audio/alsaaudio.c
++++ b/audio/alsaaudio.c
+@@ -422,11 +422,15 @@ static int alsa_open (int in, struct alsa_params_req *req,
+ goto err;
+ }
+
++#if 0
+ err = snd_pcm_hw_params_get_format (hw_params, &obtfmt);
+ if (err < 0) {
+ alsa_logerr2 (err, typ, "Failed to get format\n");
+ goto err;
+ }
++#else
++ obtfmt = req->fmt;
++#endif
+
+ if (alsa_to_audfmt (obtfmt, &obt->fmt, &obt->endianness)) {
+ dolog ("Invalid format was returned %d\n", obtfmt);
use-vga-cmdline
disable-aio
ps2-passthrough
+
+alsa-fix