[Qemu-devel] [PATCH v4 0/2] Improve audio output quality

Martin Schrodt posted 2 patches 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171015184033.2951-1-martin@schrodt.org
Test checkpatch passed
Test docker passed
Test s390x passed
audio/audio.c        |   5 +
audio/audio_int.h    |   2 +
audio/paaudio.c      | 635 +++++++++++++++++++++------------------------------
hw/audio/hda-codec.c | 193 ++++++++++++----
hw/audio/intel-hda.c |   7 -
5 files changed, 416 insertions(+), 426 deletions(-)
[Qemu-devel] [PATCH v4 0/2] Improve audio output quality
Posted by Martin Schrodt 6 years, 6 months ago
Motivation for this:

After being annoyed for too long with the crackling QEMU produces, I decided
to dive in and try to fix this. 

This has already been tested by several people, please see the corresponding
Reddit-thread:

https://www.reddit.com/r/VFIO/comments/74vokw/improved_pulse_audio_driver_for_qemu/

I presented this to the list a few days ago, but it was in too rough a state,
so I cleaned it up and wrote better commit messages.

This is still missing proper handling for VMState-migration, which I will need a bit of assistance with.

Sorry for v4 already, having a hard time with the style checker bots... :(

Signed-off-by: Martin Schrodt <martin@schrodt.org>

Martin Schrodt (2):
  audio/paaudio: remove separate PA feeder threads
  audio/hda: create millisecond timers that handle IO

 audio/audio.c        |   5 +
 audio/audio_int.h    |   2 +
 audio/paaudio.c      | 635 +++++++++++++++++++++------------------------------
 hw/audio/hda-codec.c | 193 ++++++++++++----
 hw/audio/intel-hda.c |   7 -
 5 files changed, 416 insertions(+), 426 deletions(-)

-- 
2.14.2


Re: [Qemu-devel] [PATCH v4 0/2] Improve audio output quality
Posted by Gerd Hoffmann 6 years, 6 months ago
  Hi,

> This is still missing proper handling for VMState-migration, which I
> will need a bit of assistance with.

See attachment.  It adds a bool to the state and a property to turn
on/off the timer.  It also adds a vmstate subsection, which will only
saved in case the timer is in use.  Also extends the compat list so the
timer will be turned off for old machine types (-M pc-i440fx-2.10 &
older).

Background: Using "-M pc-i440fx-2.10" instead of "-M pc" puts qemu into
2.10 compatibility mode.  Live migration is supposed to work even
between different qemu versions as long as they use the same machine
type.

Missing:  Continue to use the old code in case the timer is turned off
(needed for backward compatibility).  Most of the changes are in the
callbacks, probably it is easiest to rename the existing callbacks
(_compat or _notimer postfix for example) and register the old or new
ones depending on the use_timer variable.

> Sorry for v4 already, having a hard time with the style checker
> bots... :(

There is scripts/checkpatch.pl to run those tests locally.

Which guests did you test with?

I did a brief test with Windows 7 and still have sound dropouts, even
though it seems to not be as bad as before.  Didn't investigate yet
why.

cheers,
  Gerd
Re: [Qemu-devel] [PATCH v4 0/2] Improve audio output quality
Posted by Gerd Hoffmann 6 years, 6 months ago
  Hi,

> Which guests did you test with?
> 
> I did a brief test with Windows 7 and still have sound dropouts, even
> though it seems to not be as bad as before.  Didn't investigate yet
> why.

Played around a bit more.  Windows 10 seems to work a bit better. 
Pushed some incremental patches.

https://www.kraxel.org/cgit/qemu/log/?h=testing/hda

cheers,
  Gerd