From: Gerd Hoffmann <kraxel@redhat.com>
To: Martin Schrodt <martin@schrodt.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 0/2] Improve audio output quality
Date: Wed, 18 Oct 2017 08:48:05 +0200 [thread overview]
Message-ID: <1508309285.10073.6.camel@redhat.com> (raw)
In-Reply-To: <20171015184033.2951-1-martin@schrodt.org>
[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]
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
[-- Attachment #2: 0001-hda-buffer-compatibility-fluff.patch --]
[-- Type: text/x-patch, Size: 2634 bytes --]
From 7f7a8b2bb818ff7a76cfa592e06b2d271a0f8bcd Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 16 Oct 2017 12:22:57 +0200
Subject: [PATCH] hda buffer compatibility fluff
---
include/hw/compat.h | 4 ++++
hw/audio/hda-codec.c | 26 ++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/include/hw/compat.h b/include/hw/compat.h
index cf389b4e85..22d154035e 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -10,6 +10,10 @@
.driver = "virtio-tablet-device",\
.property = "wheel-axis",\
.value = "false",\
+ },{\
+ .driver = "hda-audio",\
+ .property = "use-timer",\
+ .value = "false",\
},
#define HW_COMPAT_2_9 \
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index ab89158bfc..df7fc87f96 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -185,6 +185,7 @@ struct HDAAudioState {
/* properties */
uint32_t debug;
bool mixer;
+ bool use_timer;
};
static inline int64_t hda_bytes_per_second(HDAAudioStream *st)
@@ -696,6 +697,26 @@ static void hda_audio_reset(DeviceState *dev)
}
}
+static bool vmstate_hda_audio_stream_buf_needed(void *opaque)
+{
+ HDAAudioStream *st = opaque;
+ return st->state->use_timer;
+}
+
+static const VMStateDescription vmstate_hda_audio_stream_buf = {
+ .name = "hda-audio-stream/buffer",
+ .version_id = 1,
+ .needed = vmstate_hda_audio_stream_buf_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_BUFFER(buf, HDAAudioStream),
+ VMSTATE_INT64(rpos, HDAAudioStream),
+ VMSTATE_INT64(wpos, HDAAudioStream),
+ VMSTATE_TIMER_PTR(buft, HDAAudioStream),
+ VMSTATE_INT64(buft_start, HDAAudioStream),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_hda_audio_stream = {
.name = "hda-audio-stream",
.version_id = 1,
@@ -710,6 +731,10 @@ static const VMStateDescription vmstate_hda_audio_stream = {
VMSTATE_UINT32(compat_bpos, HDAAudioStream),
VMSTATE_BUFFER(compat_buf, HDAAudioStream),
VMSTATE_END_OF_LIST()
+ },
+ .subsections = (const VMStateDescription * []) {
+ &vmstate_hda_audio_stream_buf,
+ NULL
}
};
@@ -730,6 +755,7 @@ static const VMStateDescription vmstate_hda_audio = {
static Property hda_audio_properties[] = {
DEFINE_PROP_UINT32("debug", HDAAudioState, debug, 0),
DEFINE_PROP_BOOL("mixer", HDAAudioState, mixer, true),
+ DEFINE_PROP_BOOL("use-timer", HDAAudioState, use_timer, true),
DEFINE_PROP_END_OF_LIST(),
};
--
2.9.3
next prev parent reply other threads:[~2017-10-18 6:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-15 18:40 [Qemu-devel] [PATCH v4 0/2] Improve audio output quality Martin Schrodt
2017-10-15 18:40 ` [Qemu-devel] [PATCH v4 1/2] audio/paaudio: remove separate PA feeder threads Martin Schrodt
2017-10-15 18:40 ` [Qemu-devel] [PATCH v4 2/2] audio/hda: create millisecond timers that handle IO Martin Schrodt
2017-10-18 6:48 ` Gerd Hoffmann [this message]
2017-10-18 10:57 ` [Qemu-devel] [PATCH v4 0/2] Improve audio output quality Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508309285.10073.6.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=martin@schrodt.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).