OSDN Git Service

audio/hda: create millisecond timers that handle IO
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 22 Jun 2018 11:11:56 +0000 (13:11 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 25 Jun 2018 11:57:57 +0000 (13:57 +0200)
commit280c1e1cdb24d80ecdfcdfc679ccc5e8ed7af45d
tree4e556006e53d2c6752ce74b9cd0e46efea563d99
parent46012db666990ff2eed1d3dc199ab8006439a93b
audio/hda: create millisecond timers that handle IO

Currently, the HDA device tries to sync itself with the QEMU audio
backend by waiting for the guest driver to handle buffer completion
interrupts. This causes the backend to often read too much data from the
device, as well as running out of data whenever the guest takes too long
to handle the interrupt.

According to the HDA specification, the guest is also not required to
use interrupts, but can also sync itself by polling the LPIB registers.

This patch will introduce high frequency (1000Hz) timers that interface
with the device and allow for much smoother emulation of the LPIB
registers. Since the timing is now provided by these timers, the need
to wait for buffer completion interrupts also ceases.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180622111200.30561-2-kraxel@redhat.com
Message-id: 20171015184033.2951-3-martin@schrodt.org

[ kraxel: keep old code for compatibility with older qemu versions,
          add property to switch code paths at runtime ]
[ kraxel: new code is disabled by default, use-timer=on enables it ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/audio/hda-codec.c
hw/audio/intel-hda.c