Commit graph

948 commits

Author SHA1 Message Date
Liam Girdwood
ab9633d581 core: add convenience macros to local.h
Move ARRAY_SIZE() from tplg_local.h to local.h and add container_of()
macro to local.h. Both macros are generic but are initially used by
topology.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-12 16:39:27 +02:00
Mengdong Lin
80a8283d17 topology: Add ops support to byte control objects.
Rename the control ops structure to make it more generic so we can use it
with other objects like bytes controls. Add this structure to the byte
control structure.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-07 17:52:41 +02:00
Mengdong Lin
8c8372cc06 topology: update ABI to improve support for different TLV object types.
Currently the TLV topology structure is targeted at only supporting the
DB scale data. This patch extends support for the other TLV types so they
can be easily added at a later stage.

TLV structure is moved to common topology control header since it's a
common field for controls and can be processed in a general way.

Users must set a proper access flag for a control since it's used to decide
if the TLV field is valid and if a TLV callback is needed.

Removed the following fields from topology TLV struct:
 - size/count: type can decide the size.
 - numid: not needed to initialize TLV for kcontrol.
 - data: replaced by the type specific struct.

Added TLV structure to generic control header and removed TLV structure from
mixer control.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-07 17:52:27 +02:00
Takashi Iwai
66ce9f9a11 topology: Fix typos
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 17:10:42 +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
Liam Girdwood
37692bb985 topology: Add topology core parser.
The topology core parses the high level topology file and calls the
individual object parsers when any new object element is detected at
the high level.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 16:21:48 +02:00
Liam Girdwood
227c790c16 topology: uapi: Add UAPI headers for topology ABI
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-30 16:21:47 +02:00
Takashi Iwai
d0e13f8774 Replace list.h with its own version
We copied include/list.h from Linux kernel, and it's of course in
GPLv2.  This has raised concerns to many people, as it's not clear
whether such a code is considered to be completely trivial, thus it
might be seen as a derivative work, which takes effect in GPL, as
suggested by Clemens.

For clearing the situation, this patch replaces the existing list.h
implementation from a new version.  The API is kept to be compatible,
but the codes were written from full scratch under LGPL, to be aligned
with other alsa-lib codes.

Reported-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-27 12:39:54 +02:00
Pierre-Louis Bossart
6ec2464f39 pcm: add support for get/set_audio_htstamp_config
Enable kernel-side functionality by letting user select what sort of
timestamp it desires

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-02 17:02:03 +02:00
Pierre-Louis Bossart
6cb31b4444 pcm: add helper functions to query timestamping capabilities
extend support to link, link_estimated and link_synchronized
timestamp. wall-clock is deprecated

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-02 17:02:03 +02:00
Alexander E. Patrakov
4dc44bb34a Replace unsafe characters with _ in card name
Otherwise, they get misinterpreted as argument separators
in USB-Audio PCM definitions, and thus prevent SPDIF blacklist entries
from working.

While at it, add my Logitec C910 webcam to the SPDIF blacklist.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 20:33:26 +02:00
Liam Girdwood
bb92545e06 ucm: docs: Fix doxygen formatting for UCM main page.
Make sure group is defined and lists dipplayed correctly.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 17:44:00 +02:00
Tanu Kaskinen
b4222f3fdc ucm: allow multiple devices in JackHWMute
One jack may mute multiple devices, so let's make JackHWMute a list of
device names instead of just a single device name.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-18 10:44:24 +02:00
Takashi Iwai
7d9972c6ad Allow hint for ctl, hwdep, timer and seq
Like pcm and rawmidi, each object parser needs to accept the hint
component.  Now a new local function _snd_conf_generic_id() was
introduced to replace each call of "comment" and "type" field checks.

Also, the two existing identical functions for pcm and rawmidi are
removed and the new function is used commonly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30 14:52:35 +02:00
Takashi Iwai
b07de7c26b Sync include/sound/asound.h with 4.1 kernel
This adds the new ABI for timestamp stuff and minor fixes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-21 12:49:29 +02:00
Tanu Kaskinen
ecb38d2bec ucm: improve jack configuration documentation
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 14:24:10 +01:00
Tanu Kaskinen
72aa0f8332 ucm: reformat snd_use_case_get() doc
Doxygen doesn't preserve formatting that relies only on indentation.
This fixes it by using lists more liberally.

There are probably more places to fix than just
snd_use_case_get_list(), but I only have motivation for fixing this
function's documentation formatting (the next patch will add some more
content to the function's documentation).

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 14:24:04 +01:00
Lu, Han
c56064e135 ucm: document some standard values
add standard value JackDev, JackControl and JackHWMute for speaker
mute control on jack insertion. These values will be applied on
pulseaudio.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-05 10:58:46 +01:00
Tanu Kaskinen
567c831e69 ucm: fix some variable constness issues
I submitted earlier a patch that made the value parameter of
snd_use_case_get() non-const, but as that changed the public API, the
patch couldn't be accepted. This is the same patch, modifying the
internal code so that there are fewer issues with constness, but the
public API is left alone (a comment was added to the function
documentation, though, so that hopefully nobody else will try to fix
the same unfixable problem).

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-17 22:16:00 +01:00
Takashi Iwai
dbb7eca655 Remove unused hostname resolution in shm plugins and aserver
PCM and control shm plugins and aserver have some codes to resolve the
host address and check whether it's a local host although the given
address is never used.  In addition, the code contains gethostbyname()
that is known to be obsoleted.  So, let's get rid of all these unused
codes.

The host configuration item is still accepted (but just ignored) for
keeping the compatibility.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28 16:23:06 +01:00
Matthieu Crapet
187ba1d8cd autotools: fix ucm partial build
When --disable-ucm configure option is specified,
don't install related include file.

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-14 16:07:55 +01:00
Takashi Sakamoto
93b0e9ca85 hwdep: add OXFW driver support
Linux 3.19 newly support this driver. By hardware dependent interface,
userspace applications can get hardware information, lock/unlock kernel
streaming and receive lock status event.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-10 11:56:03 +01:00
Jussi Laako
b14c49ab3d pcm: Fix DSD sample format endianess and add big-endian format
This patch adds big-endian DSD sample format and fixes return value of DSD
formats for snd_pcm_format_little_endian().

Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:11:05 +01:00
Takashi Sakamoto
9ab3c4a669 hwdep: add missing declaration for snd_hwdep_poll_descriptors_count()
The alsa-lib has 'snd_hwdep_poll_descriptors_count()' but hwdep.h has no
declaration for the function. No applications can call the function just
by including the header.

This commit adds a line to the file for this function.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-17 07:54:43 +02:00
Jurgen Kramer
e59ffbf30e pcm: add new 32-bit DSD sample format
Add the new DSD_U32_LE sample format to alsa-lib.

NB include/pcm.h and include/sound/asound.h are updated so a new sync with the
kernel headers is not needed

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-10 09:10:50 +02:00
Takashi Sakamoto
dfc3bf97bf Sync enum snd_hwdep_iface_t with include/asound/asound.h
Some members in this enumerated type has not updated for 9 years, although
kernel-drivers added them during this period. This commit adds them following
to a commit 87df9f3 'sync include/asound/asound.h with 3.17-rc1 kernel'.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-18 12:55:42 +02:00
Takashi Iwai
717ae3dd90 Sync include/sound/asound.h with 3.17-rc1 kernel
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-11 11:51:29 +02:00
Jurgen Kramer
87df9f3b7a pcm: Fix DSD formats userland usability
Support for DSD sample formats has been added a while ago. This patch makes
those sample formats beter usable from userland (e.g. aplay).

[These implementation details have been forgotten in the previous DSD
 support patch -- tiwai]

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-11 11:51:04 +02:00
Takashi Iwai
55c5362521 pcm: Fill sw_params proto field
Fill the new proto field introduced to sw_params with the current PCM
protocol version.  This makes tstamp_type evaluated properly in the
kernel.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22 12:14:49 +02:00
Takashi Iwai
0d393c29a2 pcm: Add sw_params API functions to get/set timestamp type
For obtaining / changing the timestamp type, add the corresponding
sw_params accessor API functions together with the public definitions
of timestamp types.

This patch only adds the functions and defines but doesn't bring the
functional changes yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-14 18:12:21 +02:00
Takashi Iwai
5250a8e212 Add timestamp type to sw_params (internal only)
This patch is just the udpate of sound/asound.h taken from the kernel
commit.  The API changes and PCM structure changes will follow after
this.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-14 17:35:07 +02:00
Mark Brown
85e4704151 pcm: Provide a CLOCK_MONOTONIC_RAW timestamp type
For applications which need to synchronise with external timebases such
as broadcast TV applications the kernel monotonic time is not optimal as
it includes adjustments from NTP and so may still include discontinuities
due to that. A raw monotonic time which does not include any adjustments
is available in the kernel from getrawmonotonic() so provide userspace with
a new timestamp type SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW which provides
timestamps based on this as an option.

Reported-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-14 17:35:07 +02:00
Tanu Kaskinen
7a748af4db ucm: Document PlaybackPCMIsDummy and CapturePCMIsDummy values
At least PulseAudio needs special handling for dummy devices. To allow
that to happen automatically, the UCM configuration should contain the
information about which PCMs are dummy.

Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-27 14:22:28 +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
Patrick Welche
7a6e8ca348 Portability fix: look for sys/endian.h as well as endian.h
- define __BYTE_ORDER and friends.
- adjust asoundlib.h accordingly.

Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-24 11:00:53 +01:00
Riku Voipio
326c6802e4 alsa-lib: heavy pcm atomics cleanup
The following patch comes from the realization that at least ARM code
for atomics is quite broken and nobody has cared for a decade.

A quick dive shows that only snd_atomic_{read,write}_{begin,end}
appear to be used widely. These are implemented using wmb/rmb.

Only other use of atomic functions is in pcm_meter.c.
The #SND_PCM_TYPE_METER plugin type appears rarely, if ever, used.
I presume these days anyone who wants a meter/scope will do in pulseaudio
layer instead of alsa.

It would seem better fit to have pcm_meter in alsa-plugins instead
of alsa-lib, but I guess that would be an ABI break...

So instead, I'm proposing here

1. Removal of all hand-crafted atomics from iatomic.h apart from barriers,
   which are used in snd_atomic_{read,write}_{begin,end}.

2. Using __sync_synchronize as the default fallback for barriers. This
   has been available since gcc 4.1, so it shouldn't be a problem.

3. Defining the few atomics used by pcm_meter.c withing pcm_meter.c
   itself, using gcc atomic builtins[1].

4. Since gcc atomic builtins are available only since gcc 4.7, add a check for
   that in gcc configure.in, and don't build pcm meter plugin if using
   older gcc.

The last point has the impact, that if there actually is someone who 1)
uses the meter plugin 2) wants to upgrade to 2014 alsa-lib 3) but
does not want to use a 2012+ gcc - that someone will be inconvenienced.

Finally remove the unneeded configure check for cpu type. We can
trust the gcc to set right flags for us.

[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-11 13:45:16 +01:00
Jaroslav Kysela
7d06b3ed9f include/global.h - don't define timeval and timespec structures for !glibc
On request from John Spencer <maillist-alsa@barfooze.de> .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-11-08 12:34:44 +01:00
John Spencer
10ecf963ca local.h: include sys/types.h to fix issues with pcm.h
sys/types.h is required for the u_int_XX types used by pcm.h.
since a change in pcm.h is not desired, we add the inclusion
to the header that includes pcm.h during build.

Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-11 09:29:05 +02:00
Kai Kang
f21f48a70f Update iatomic.h functions definitions for mips
Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
__inline__' that may cause compile fails when cross compile for mips.
The error message looks like:

| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
| .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'

Replace the 'extern __inline__' with 'static __inline__' to fix this
issue.

Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-22 10:40:32 +02:00
Adrian Knoth
4b169b05b4 hdspm.h: Update LTC ioctl to use struct hdspm_ltc
Use struct hdspm_ltc to query the LTC, using a mixer struct was just
plain wrong.

Due to the wrong struct, this ioctl was never working, so we're free to
fix it without breaking userspace compatibility.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-19 20:13:55 +02:00
Arun Raghavan
36bc577040 UCM: Document some standard values
Playback/CaptureChannels has been around for a bit. Playback/CaptureRate
is new and is intended to be used to specify the sample rate at which
the Playback/CapturePCM should be opened.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-08 12:31:05 +02:00
Jaroslav Kysela
b3b53a1bec local.h: use __kernel_off_t from <linux/types.h>
Also, make the empty definitions __user and __force conditional.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-07-23 14:50:41 +02:00
Takashi Iwai
a8f405b8f9 Add definition of __inline__ for non-GCC
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 09:55:49 +02:00
Takashi Iwai
30122df4fa Use __inline__ for exported headers
Some programs are still using C90.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=817077
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 09:52:33 +02:00
Daniel Mack
886f0cc3c2 bring pcm.h and pcm.c in sync with the kernel list
In particular, this adds definitions and descriptions for G.723 and
DSD types.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 11:45:11 +02:00
Jaroslav Kysela
b6eb0f9bfd all places: doxygen cleanups
I see no errors with these changes using doxygen 1.8.1.1 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 16:42:24 +02:00
Jaroslav Kysela
e23fb2c4de control, pcm: implement snd_ctl_abort() and snd_pcm_abort() functions
Upon an interrupt, it is necessary to abort the wait loops with the EINTR
error code. Introduce snd_*_abort() functions to handle this case.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 13:28:03 +02:00
David Henningsson
3e7dc283ed Add sys/types.h to include list
This is needed by snd_pcm_format_silence* functions which
return u_int*_t. It was discovered while trying to compile ALSA
programs with eglibc 2.17.

Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
 Adam Conrad for this fix.

BugLink: https://bugs.launchpad.net/bugs/1109298
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 11:18:08 +01:00
Jerome Forissier
44c1a623dd Add snd_lib_error_set_local() to install a thread-local error handler.
This is required so we can make other functions reentrant (such as
snd_device_name_hint()).
The default error handling function snd_lib_error_default() now checks
if a local handler exists, and if so, calls it. Otherwise, the previous
behavior is unchanged.

Signed-off-by: Jerome Forissier <jerome@taodyne.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-31 16:28:14 +01:00
Takashi Iwai
72bbf96e1f Fix endian check in local.h
SNDRV_LITTLE_ENDIAN and SNDRV_BIG_ENDIAN checks have been removed from
sound/asound.h during UAPI header move, and this resulted in a wrong
detected endian.

Move together with the similar check for SND_*_ENDIAN at the earlier
place in local.h.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-13 09:55:44 +01:00