* [Qemu-devel] [PATCH v2] audio: Always call fini on exit
@ 2012-05-24 15:05 Jan Kiszka
2012-05-24 15:36 ` malc
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2012-05-24 15:05 UTC (permalink / raw)
To: qemu-devel, malc; +Cc: Anthony Liguori, Gerd Hoffmann
Not only clean up enabled voices but any registered one. Backends like
pulsaudio rely on unconditional fini handler invocations.
This fixes "Memory pool destroyed but not all memory blocks freed!"
warnings on VM shutdowns when pa is used and lockups of QEMU on shutdown
as it got stuck on some pa-internal synchronization point.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Changes in v2:
- only disable ports that are enabled
audio/audio.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index bd9237e..583ee51 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1775,10 +1775,12 @@ static void audio_atexit (void)
HWVoiceOut *hwo = NULL;
HWVoiceIn *hwi = NULL;
- while ((hwo = audio_pcm_hw_find_any_enabled_out (hwo))) {
+ while ((hwo = audio_pcm_hw_find_any_out (hwo))) {
SWVoiceCap *sc;
- hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE);
+ if (hwo->enabled) {
+ hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE);
+ }
hwo->pcm_ops->fini_out (hwo);
for (sc = hwo->cap_head.lh_first; sc; sc = sc->entries.le_next) {
@@ -1791,8 +1793,10 @@ static void audio_atexit (void)
}
}
- while ((hwi = audio_pcm_hw_find_any_enabled_in (hwi))) {
- hwi->pcm_ops->ctl_in (hwi, VOICE_DISABLE);
+ while ((hwi = audio_pcm_hw_find_any_in (hwi))) {
+ if (hwi->enabled) {
+ hwi->pcm_ops->ctl_in (hwi, VOICE_DISABLE);
+ }
hwi->pcm_ops->fini_in (hwi);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] audio: Always call fini on exit
2012-05-24 15:05 [Qemu-devel] [PATCH v2] audio: Always call fini on exit Jan Kiszka
@ 2012-05-24 15:36 ` malc
0 siblings, 0 replies; 2+ messages in thread
From: malc @ 2012-05-24 15:36 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Anthony Liguori, qemu-devel, Gerd Hoffmann
On Thu, 24 May 2012, Jan Kiszka wrote:
> Not only clean up enabled voices but any registered one. Backends like
> pulsaudio rely on unconditional fini handler invocations.
>
> This fixes "Memory pool destroyed but not all memory blocks freed!"
> warnings on VM shutdowns when pa is used and lockups of QEMU on shutdown
> as it got stuck on some pa-internal synchronization point.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Pushed, thanks to all involved.
[..snip..]
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-24 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 15:05 [Qemu-devel] [PATCH v2] audio: Always call fini on exit Jan Kiszka
2012-05-24 15:36 ` malc
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).