From: Gerd Hoffmann Date: Fri, 29 Nov 2013 13:25:33 +0000 (+0100) Subject: intel-hda: fix position buffer X-Git-Tag: v2.0.0-rc0~187^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d58ce68a454e5ae9cbde0308def379e272f13b10;p=thirdparty%2Fqemu.git 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 --- diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 43272643946..6ab8c245d3e 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); }