Commit Graph

15 Commits

Author SHA1 Message Date
Takashi Iwai
54931e5a54 pcm: Add thread-safety to PCM API
Traditionally, many of ALSA library functions are supposed to be
thread-unsafe, and applications are required to take care of thread
safety by themselves.  However, people never be careful enough, and
almost all applications fail in this regard.

This patch is an attempt to harden the thread safety in exported PCM
functions in a simplistic way: just wrap some of exported functions
with the pthread mutex of each PCM object.  Not all API functions are
wrapped by the mutex since it doesn't make sense.  Instead, the
patchset covers only the functions that may be likely called
concurrently.  The supposedly thread-safe API functions are marked in
the document.

For achieving the feature, two new fields are added snd_pcm_t when the
option is enabled: thread_safe and lock.  The former indicates that
the plugin is thread-safe that doesn't need this workaround and the
latter is the pthread mutex.  Currently only hw plugin have
thread_safe=1.  So, the most of real-time sensitive apps won't be
influenced by this patchset.

Although the patch covers most of PCM ops, a few snd_pcm_fast_ops are
left without the extra mutex locking: namely, the ones that may have
blocking behavior, i.e. resume, drain, readi, writei, readn and
writen.  These are supposed to handle own locking in the callbacks.

Also, if anyone wants to disable this new thread-safe API feature, it
can be still turned off via --disable-thread-safety configure option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-07-11 15:25:30 +02:00
Henrik Austad
e63ec94890 INSTALL: update text and drop reference to Hg
This is really just nitpick, but it annoyed me for a few seconds, so I thought
I'd just fix it.

In d7534b2cee (hgcompile -> gitcompile) the filename was updated but
INSTALL was not, leaving outdated docs.

Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-06-21 14:29:29 +02:00
Dmitry Voytik
5f1960e3d8 doc: fix cross-compiling example
Simplest way to configure cross-compilation with configure
script is to pass '--host' option.
Passing just '--target' doesn't work.

Signed-off-by: Dmitry Voytik <voytikd@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-25 14:12:38 +02:00
Takashi Iwai
8a347e4267 Add hgcompile script and fix INSTALL document
Added hgcompile script (just a copy of cvscompile), and
fixed INSTALL document about HG.
2006-05-12 15:33:44 +02:00
Takashi Iwai
aaeb6659c0 Add description for new configure options
Add description for new configure options.
Also fixed some typos.
2005-11-30 12:07:06 +00:00
Takashi Iwai
6f918dfac4 Add a note on FC3
Added a note on installation on FC3.
2005-02-24 10:20:44 +00:00
Takashi Iwai
7e5a7fbdbf Remove JACK plugin
Removed JACK plugin.  It's in alsa-plugins now.
2005-02-24 10:16:51 +00:00
Jaroslav Kysela
915de60abf Added note about jack plugin 2003-03-10 12:55:43 +00:00
Takashi Iwai
163ae5738d duplicated the required alsa-kernel header files into the local
include/sound directory, so that alsa-lib can be compiled without
alsa-driver.

with this addition, --with-kernel and --with-soundbase options are
removed from configure.  they are obviously unnecessary.

the relevant parts in INSTALL are removed/modified.
2002-10-09 13:43:35 +00:00
Jaroslav Kysela
f23813b7e9 Added HAVE_SOFT_FLOAT (--with-softfloat) 2002-04-24 14:41:55 +00:00
Jaroslav Kysela
eb267ade29 Added support for --with-host 2002-03-03 09:25:02 +00:00
Jaroslav Kysela
1e2b37dd4e Added section for installation using Linux kernel sources 2002-02-17 08:58:54 +00:00
Jaroslav Kysela
4efc53523a A bit updated 2001-11-26 18:33:40 +00:00
Jaroslav Kysela
27472b56a6 Changes for static build. 2001-10-24 14:14:11 +00:00
Jaroslav Kysela
741a333e90 First version... 1998-12-30 17:11:25 +00:00