]> xenbits.xen.org Git - xenclient/ioemu-pq.git/commitdiff
Qemu makes an alsa call to set the sample format. It then queries alsa
authorJean Guyader <jean.guyader@eu.citrix.com>
Mon, 8 Jun 2009 13:23:59 +0000 (14:23 +0100)
committerJean Guyader <jean.guyader@eu.citrix.com>
Mon, 8 Jun 2009 13:23:59 +0000 (14:23 +0100)
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.

master/alsa-fix [new file with mode: 0644]
master/series

diff --git a/master/alsa-fix b/master/alsa-fix
new file mode 100644 (file)
index 0000000..46e20a5
--- /dev/null
@@ -0,0 +1,20 @@
+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);
index db7806877f5561ce16b039a2efa858e02b7e86c5..881b4c7d03303362fee29ece4304fdb35338fc40 100644 (file)
@@ -15,3 +15,5 @@ intel
 use-vga-cmdline
 disable-aio
 ps2-passthrough
+
+alsa-fix