qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] paaudio race condition on close
Date: Mon, 15 Dec 2014 10:23:53 +0100	[thread overview]
Message-ID: <1418635433.9400.5.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <87fvchffgo.fsf@blackfin.pond.sub.org>

  Hi,

> > Usually this works. Unfortunately if the input thread is in the
> > middle of actually writing to the buffer then things can go pear
> > shaped, because the sample buffer itself is freed earlier, by
> > audio_pcm_hw_gc_in():
> >
> >         glue (s->nb_hw_voices_, TYPE) += 1;
> >         glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
> >         glue (hw->pcm_ops->fini_, TYPE) (hw);
> >
> > So we end up freeing hw resources (like the conv_buf) before we
> > give the pulseaudio backend a chance to actually shut down its
> > helper thread.
> >
> > Does anybody know how this is supposed to work? Is the fix as
> > simple as just moving the free_resources call below the fini?

I suspect the code simply wasn't written with threads in mind and the
fix actually is that simple ...

The submitted patch looks fine to me.  Do you just commit it yourself?
I don't have any other audio stuff pending atm.

cheers,
  Gerd

  reply	other threads:[~2014-12-15  9:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 16:47 [Qemu-devel] paaudio race condition on close Peter Maydell
2014-12-15  9:08 ` Markus Armbruster
2014-12-15  9:23   ` Gerd Hoffmann [this message]
2014-12-15 15:37     ` Peter Maydell
2014-12-16  6:37       ` 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=1418635433.9400.5.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.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).