Commit graph

19 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
Stephen Just
b6c69d7067 conf/ucm: chtrt5645: Add UCM config for chtrt5645
Add a UCM configuration for the rt5645 codec on Intel's Cherry-Trail
platform. Tested on the Microsoft Surface 3.

Signed-off-by: Stephen Just <stephenjust@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-07-08 15:05:48 +02:00
Heiko Stübner
f449a29943 conf/ucm: ROCKCHIP-I2S: rename to VEYRON-I2S
Commit a192f52fc6 introduced an ucm profile for Rockchip Veyron-
Chromebooks by taking the ucm profile from the ChromeOS userspace.

But similarly to DAISY-I2S, PAZ00 and most other profiles, the audio
setup is pretty specific to a board type, so hogging the Rockchip name
will make it harder for future Rockchip based boards to fit in nicely.

And while Veyron also is a family of boards, all of them share the
same audio setup. The ucm profile was not released with any official
alsa release and the audio setup also isn't in the mainline kernel yet,
so such a rename should be easily possible.

Fixes: a192f52fc6 ("conf/ucm: ROCKCHIP-I2S: add Rockchip I2S UCM config.")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-06-09 08:19:04 +02:00
Enric Balletbo i Serra
a192f52fc6 conf/ucm: ROCKCHIP-I2S: add Rockchip I2S UCM config.
Taken from the ChromeOS sources, this configuration was tested on Veyron
Jerry based Chromebook from Google.

[Added missing Makefile changes by tiwai]

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-05-09 14:58:42 +02:00
Shreyas NC
65b271034a conf: topology: Generate Private data binary blobs
The DSP modules need private data and that is provided as binary
blob. These blobs are compiled from C structures which specify module
configuration.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-04-28 16:15:30 +02:00
Shreyas NC
f5c313eae5 conf: topology: Add Skylake i2s conf
The Skylake topology configuration for simple topology graph is
provided. This exposes the PCM capabilities of the DSP.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-04-28 16:14:39 +02:00
Jaroslav Kysela
6a610e56ae Release v1.1.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2016-03-31 15:10:39 +02:00
Jaroslav Kysela
fe6b51c77a Release v1.1.0
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2015-11-09 08:39:18 +01:00
Mike Frysinger
561df6fda0 support building w/out System V shared memory
Some systems, like Android/Bionic, do not support SysV at all.
Let the configure script detect if the header is available, and
if not, automatically disable the pieces that require it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-11-05 14:37:11 +01:00
Mike Frysinger
99dc70f023 fix _GNU_SOURCE handling & header inclusion
The configure script blindly adds -D_GNU_SOURCE to all build settings,
even on non-GNU systems.  This isn't too much of a big deal (even if
it uses the wrong variable -- CFLAGS instead of CPPFLAGS), except that
the alsa-lib source itself determines whether to use GNU features when
this is defined (such as versionsort).  So when we build on non-glibc
systems, we get build failures like:
src/ucm/parser.c:1268:18: error: 'versionsort' undeclared (first use in this function)
 #define SORTFUNC versionsort
                  ^
src/ucm/parser.c:1272:54: note: in expansion of macro 'SORTFUNC'
  err = scandir(filename, &namelist, filename_filter, SORTFUNC);
                                                      ^

The correct way to add these flags is to use the autoconf helper
AC_USE_SYSTEM_EXTENSIONS.  Unfortunately, that triggers some more
bugs in the alsa build.  This macro adds defines to config.h and
not directly to CPPFLAGS, so it relies on files correctly including
config.h before anything else.  A number of alsa files do not do
this leading to build failures.  The fix there is to shuffle the
includes around so that the local ones come first.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-12 10:36:15 +02:00
Khem Raj
c82417650a build: Do not try to detect cross-compiler
cross compilers are passed via path may not be a gcc based cross
compiler in such cases this check fails and try's to force gcc based
cross compiler detection, This code is a convenience that limits the
build system

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-23 10:39:01 +02:00
Liam Girdwood
00a51b5bac conf: topology: Add topology file for broadwell audio DSP
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 17:10:32 +02:00
Liam Girdwood
fec1e8f253 topology: autotools: Add build support for topology core
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 17:10:14 +02:00
Takashi Iwai
9d649add08 conf/ucm: Add Makefile.am for broadwell-rt286 ucm config
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 11:04:47 +01:00
Jaroslav Kysela
16c956e598 Release v1.0.29
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2015-02-26 13:34:52 +01:00
Tomeu Vizoso
3b5fac6d10 conf/ucm: GoogleNyan: Add configuration
Taken from the ChromeOS sources, this configuration should apply to all
Nyan boards from Google, so far HP Chromebook 14 (nyan-blaze) and Acer
Chromebook 13 (nyan-big).

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-19 10:02:46 +01:00
zombah
24b4e86ddc conf/ucm: PAZ00: add Toshiba AC100/Dynabook AZ new config
Recent mainline kernels threat Toshiba AC100 audio hardware as hw:PAZ00
vs old hw:tegraalc5632.

This patch adds config files for new hw name and include them to
makefiles.

Signed-off-by: zombah <zombah@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-07 18:13:27 +02:00
Jaroslav Kysela
c2f8ef7ab0 Release v1.0.28
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2014-06-17 14:34:19 +02:00
Patrick Welche
b669b50de2 autotools: update style
- rename configure.in to configure.ac
- replace INCLUDES with AM_CPPFLAGS
- modernize AM_INIT_AUTOMAKE invocation

Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-26 08:16:22 +01:00
Renamed from configure.in (Browse further)