All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: John Lindgren <john.lindgren@tds.net>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] alsa-lib: snd_pcm_delay and friends do not account for a write being currently in progress
Date: Thu, 03 Jun 2010 16:48:29 +0200	[thread overview]
Message-ID: <4C07C0BD.8000009@ladisch.de> (raw)
In-Reply-To: <1275573648.1415.6.camel@satellite>

John Lindgren wrote:
> On Thu, 2010-06-03 at 08:40 +0200, Clemens Ladisch wrote:
> > Alsa-lib is not thread safe.
> 
> From http://alsa-project.org/main/index.php/Main_Page:
> 
>         ALSA has the following significant features:
>         ...
>         SMP and thread-safe design.
> 
> So, that's a big lie?

That applies to the kernel code.

Most functions in alsa-lib must not be called at the same time on the
same device handle.  (Don't ask me where this is documented.)

> > ... poll()
> 
> Would it work to simply call snd_pcm_wait?

Yes.  (I usually suggest poll because the code that writes audio data
often wants to be informed of some other event.  If your writing loop
doesn't need to be interrupted, snd_pcm_wait works just fine.)


Regards,
Clemens

  reply	other threads:[~2010-06-03 14:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-02 21:29 [PATCH] alsa-lib: snd_pcm_delay and friends do not account for a write being currently in progress John Lindgren
2010-06-03  6:40 ` Clemens Ladisch
2010-06-03 14:00   ` John Lindgren
2010-06-03 14:48     ` Clemens Ladisch [this message]
2010-06-03 16:16       ` John Lindgren
2010-06-03 17:03         ` Clemens Ladisch
2010-06-03 17:51           ` John Lindgren
2010-06-03 14:40 ` [PATCH] " James Courtier-Dutton
2010-06-03 16:10   ` John Lindgren
2010-06-03 16:34     ` James Courtier-Dutton
2010-06-03 18:06       ` John Lindgren
2010-06-03 17:40 ` VDR User
2010-06-03 18:08   ` John Lindgren
2010-06-04  6:50   ` Clemens Ladisch

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=4C07C0BD.8000009@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=john.lindgren@tds.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.