From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq1Tu-0003WR-OD for qemu-devel@nongnu.org; Mon, 09 Dec 2013 09:06:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq1Tp-00027e-1N for qemu-devel@nongnu.org; Mon, 09 Dec 2013 09:06:42 -0500 From: Gerd Hoffmann Date: Mon, 9 Dec 2013 15:06:14 +0100 Message-Id: <1386597974-26506-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1386597974-26506-1-git-send-email-kraxel@redhat.com> References: <1386597974-26506-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 4/4] intel-hda: fix position buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Vassili Karpov (malc)" , Gerd Hoffmann , qemu-stable@nongnu.org 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(+) 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); } -- 1.8.3.1