From 7f0ba7bb4378f22b017e08947219a352d491bac4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 2 Dec 2013 10:16:18 +0100 Subject: adlib: fix patching of port I/O addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 2b21fb5 (adlib: sort offsets in portio registration, 2013-08-14) fixed the offsets in adlib_portio_list, but forgot the matching indices in adlib_realizefn. Reported at http://virtuallyfun.superglobalmegacorp.com/?p=3616 by "neozeed". Signed-off-by: Paolo Bonzini Reviewed-by: Hervé Poussineau Signed-off-by: Gerd Hoffmann --- hw/audio/adlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c index bd8e9d9..e88d2dd 100644 --- a/hw/audio/adlib.c +++ b/hw/audio/adlib.c @@ -347,8 +347,8 @@ static void adlib_realizefn (DeviceState *dev, Error **errp) s->samples = AUD_get_buffer_size_out (s->voice) >> SHIFT; s->mixbuf = g_malloc0 (s->samples << SHIFT); - adlib_portio_list[1].offset = s->port; - adlib_portio_list[2].offset = s->port + 8; + adlib_portio_list[0].offset = s->port; + adlib_portio_list[1].offset = s->port + 8; portio_list_init (port_list, OBJECT(s), adlib_portio_list, s, "adlib"); portio_list_add (port_list, isa_address_space_io(&s->parent_obj), 0); } -- cgit v1.1 From d58ce68a454e5ae9cbde0308def379e272f13b10 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 29 Nov 2013 14:25:33 +0100 Subject: intel-hda: fix position buffer Fix position buffer updates to use the correct stream offset. Without this patch both IN (record) and OUT (playback) streams will update the IN buffer positions. The linux kernel notices and complains: hda-intel: Invalid position buffer, using LPIB read method instead. The bug may also lead to glitches when recording and playing at the same time: https://bugzilla.redhat.com/show_bug.cgi?id=947785 Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann --- hw/audio/intel-hda.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw') diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 4327264..6ab8c24 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -444,6 +444,7 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, } } if (d->dp_lbase & 0x01) { + s = st - d->st; addr = intel_hda_addr(d->dp_lbase & ~0x01, d->dp_ubase); stl_le_pci_dma(&d->pci, addr + 8*s, st->lpib); } -- cgit v1.1