OSDN Git Service
Mengdong Lin [Thu, 5 Nov 2015 12:49:10 +0000 (20:49 +0800)]
topology: ABI - Rename dai_elems to pcm_elems in manifest
This field is the number of PCM objects (a pair of FE DAI and DAI link).
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Mengdong Lin [Thu, 5 Nov 2015 12:49:02 +0000 (20:49 +0800)]
topology: ABI - Change stream formats to a bitwise flag
The toplogy user space tool will generate this bitwise flag by using
SNDRV_PCM_FORMAT_* exposed by asound.h, and the topology core will copy
this flag when generating DAI streams.
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Vedang Patel [Thu, 5 Nov 2015 12:48:54 +0000 (20:48 +0800)]
topology: ABI - Use __le32 instead of __u32 in snd_soc_tplg_dapm_widget
This fixes the endianness of the ABI parameters in the struct.
The field 'num_kcontrols' is also extended from 16 bits to 32 bits.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Vedang Patel [Thu, 5 Nov 2015 12:48:46 +0000 (20:48 +0800)]
topology: ABI - Remove unused struct snd_soc_tplg_stream_config
The struct snd_soc_tplg_stream_config is no longer used in the ABI.
We are using snd_soc_tplg_stream instead.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Mengdong Lin [Thu, 5 Nov 2015 12:48:38 +0000 (20:48 +0800)]
topology: ABI - Remove tdm_slot & dai_fmt from snd_soc_tplg_stream
These two fields are line parameters for BE/CC links and
should not be from toplogy but from ACPI.
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Vedang Patel [Thu, 5 Nov 2015 12:48:30 +0000 (20:48 +0800)]
topology: ABI - Separate PCM & BE/CC link support and bump ABI version to 4
The struct snd_soc_tplg_pcm_dai is renamed to snd_soc_tplg_pcm.
This struct will now be used to handle data related to PCMs
(FE DAI & DAI links). It's not for BE, because BE DAI mappings will be
provided by ACPI/FDT data.
Remove the unused struct snd_soc_tplg_pcm_cfg_caps. We are using
snd_soc_tplg_stream and snd_soc_stream_caps instead.
Define the topology type for BE DAI link: SND_SOC_TPLG_TYPE_BACKEND_LINK.
Define struct snd_soc_tplg_link_config to configure BE & CC links.
Bump ABI version to 4.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Vedang Patel [Thu, 5 Nov 2015 12:48:18 +0000 (20:48 +0800)]
topology: ABI - Add name element to snd_soc_tplg_stream
For codec-codec links, this struct will be mapped to the DAI links's
params, which is struct snd_soc_pcm_stream and it needs a stream name.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Mike Frysinger [Tue, 27 Oct 2015 21:28:04 +0000 (17:28 -0400)]
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>
Mike Frysinger [Tue, 27 Oct 2015 21:28:03 +0000 (17:28 -0400)]
pcm: drop unused sys/shm.h inclusion
This header isn't used in these files, so stop trying to include it.
This helps builds on systems that don't provide the header (such as
Android/Bionic).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mike Frysinger [Tue, 27 Oct 2015 21:27:55 +0000 (17:27 -0400)]
move page helpers to common code
If you build with --disable-pcm, the rawmidi code fails to link because
it uses the page_size helper declared in local.h, but the page_* funcs
are in the pcm mmap module. Move these funcs into conf.c so that they
are always available to the rest of the system.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Fri, 30 Oct 2015 16:13:50 +0000 (17:13 +0100)]
pcm: dmix: Handle slave PCM xrun and unexpected states properly
Currently, dmix & co plugins ignore the XRUN state of the slave PCM.
It's (supposedly) because dmix deals with the PCM in a free-wheel
mode, which is equivalent with XRUN. But, this difference (whether
the correct freewheel or XRUN) should be done by the kernel, and we
may have an XRUN state indeed (e.g. via xrun injection).
This patch fixes this lack of behavior, to handle PCM xrun and does
prepare when the slave PCM is in such a state.
Also, the patch consolidates the prepare callback for all dmix, dsnoop
and dshare plugins, and fix/cleanup a bit for dshare/dsnoop codes to
align with dsnoop code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mike Frysinger [Fri, 9 Oct 2015 21:47:40 +0000 (17:47 -0400)]
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>
Takashi Sakamoto [Mon, 5 Oct 2015 16:08:59 +0000 (01:08 +0900)]
hwdep: add FireWire digi00x/tascam driver support
Linux 4.4 newly support these drivers. Their hardware dependent interfaces
give functionalities to get hardware information, to lock/unlock kernel
streaming and to receive lock status event.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Fri, 2 Oct 2015 09:55:36 +0000 (11:55 +0200)]
pcm: ladspa: Fix segfault due to a wrong channel reference
Because of a typo in referencing the input array in
snd_pcm_ladspa_allocate_memory(), ladpsa PCM plugin may cause a
segfault at prepare when input and and output channels are different:
#0 0x00007ffff78623ef in snd_pcm_ladspa_allocate_memory (pcm=0x626fa0, pcm=0x626fa0, pcm=0x626fa0, ladspa=0x621ad0) at pcm_ladspa.c:753
#1 snd_pcm_ladspa_init (pcm=0x626fa0) at pcm_ladspa.c:834
#2 0x00007ffff7842946 in snd_pcm_plugin_prepare (pcm=0x626fa0) at pcm_plugin.c:171
#3 0x00007ffff784290f in snd_pcm_plugin_prepare (pcm=0x62c760) at pcm_plugin.c:162
#4 0x000000000040256a in ?? ()
#5 0x00007ffff7222ec5 in __libc_start_main (main=0x401d80,a argc=4, argv=0x7fffffffde28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffde18) at libc-start.c:287
#6 0x0000000000402fdd in ?? ()
This patch corrects the wrong reference.
Reported-and-tested-by: Andreas Hartmann <mail@andreashartmann.eu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mengdong Lin [Wed, 16 Sep 2015 09:07:13 +0000 (17:07 +0800)]
topology: Add API to set a vendor specific version number
This vendor-specific version number is optional. It will be written to
the 'version' field of each block header of the binary toplogy data file.
The vendor driver can check this number for further processing in kernel.
The topology ABI version number is still stored in the 'abi' field of
block headers.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Khem Raj [Tue, 15 Sep 2015 15:48:02 +0000 (18:48 +0300)]
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>
Takashi Iwai [Tue, 8 Sep 2015 20:15:02 +0000 (22:15 +0200)]
topology: pcm: Remove unused variables
Fix gcc warnings:
pcm.c: In function ‘tplg_parse_stream_cfg’:
pcm.c:160:6: warning: unused variable ‘ret’ [-Wunused-variable]
int ret;
^
pcm.c: In function ‘split_format’:
pcm.c:267:13: warning: unused variable ‘ret’ [-Wunused-variable]
int i = 0, ret;
^
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 8 Sep 2015 20:13:50 +0000 (22:13 +0200)]
topology: parser: Add missing return value to snd_tplg_set_manifest_data()
Spotted by gcc warning:
parser.c: In function ‘snd_tplg_set_manifest_data’:
parser.c:361:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 8 Sep 2015 20:11:48 +0000 (22:11 +0200)]
topology: data: Fix wrong size check in tplg_parse_data_hex()
A wrong, uninitialized variable is referred as the size to check in
tplg_parse_data_hex(). Spotted by gcc warning:
data.c: In function ‘tplg_parse_data_hex’:
data.c:228:5: warning: ‘esize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (esize > TPLG_MAX_PRIV_SIZE) {
^
data.c:211:12: note: ‘esize’ was declared here
int size, esize, off, num;
^
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 8 Sep 2015 20:09:44 +0000 (22:09 +0200)]
topology: ctl: Fix access type checks
Fix the wrong bit-and check by adding parentheses properly:
ctl.c: In function ‘tplg_add_bytes’:
ctl.c:868:22: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
if (be->hdr.access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE
^
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 8 Sep 2015 20:04:48 +0000 (22:04 +0200)]
topology: builder: Fix possibly uninitialized variable in write_elem_block()
When an empty list is passed to write_elem_block(), it may leave
vendor_type uninitialized.
builder.c: In function ‘write_elem_block’:
builder.c:127:8: warning: ‘vendor_type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ret = write_block_header(tplg, tplg_type, vendor_type,
^
builder.c:114:33: note: ‘vendor_type’ was declared here
int ret, wsize = 0, count = 0, vendor_type;
^
Add an immediate return for count = 0 for avoiding it, and simplify
the code initializing vendor_type without using a one-shot loop.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 8 Sep 2015 19:48:17 +0000 (21:48 +0200)]
pcm: route: Remove bogus ! in snd_config_get_id() checks
There are strange "!" added before snd_config_get_id() return value
checks in a couple of places in pcm_route.c. This essentially makes
the result always positive, making checks bogus.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 8 Sep 2015 18:57:47 +0000 (20:57 +0200)]
pcm: ioplug,extplug: Fix logic errors in type checks
A few error checks are wrongly performed with logical and (&&) instead
of logical or (||), which condition never met.
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Mon, 24 Aug 2015 18:37:29 +0000 (20:37 +0200)]
pcm: Fix doxygen for two enums
The doxygen comments were wrong, making doxygen output weird.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mengdong Lin [Tue, 11 Aug 2015 17:23:17 +0000 (18:23 +0100)]
topology: A API calls to directly build topology data from templates
Add some new API calls so that applications can directly build topology data
using template structures.
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>
Mengdong Lin [Tue, 11 Aug 2015 17:23:16 +0000 (18:23 +0100)]
topology: Add C templates structure for building topology from C programs
Define structures that can be used by applications to directly build topology
data instead of using text files. The application will build up the topology
data by populating the template structures for each object type and then
registering the template with the topology core.
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>
Liam Girdwood [Tue, 11 Aug 2015 17:23:15 +0000 (18:23 +0100)]
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>
Liam Girdwood [Mon, 10 Aug 2015 18:13:47 +0000 (19:13 +0100)]
topology: rename OBJECT_TYPE_ to SND_TPLG_TYPE_
rename OBJECT_TYPE_ to SND_TPLG_TYPE_ in preparation for exporting via
a new public API.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Fri, 7 Aug 2015 15:39:16 +0000 (16:39 +0100)]
topology: print error prefix on error message.
Let the user know it's an error.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mengdong Lin [Fri, 7 Aug 2015 15:39:15 +0000 (16:39 +0100)]
topology: treat all DAPM controls types the same when copying
Copy all DAPM controls types using the same method.
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>
Mengdong Lin [Wed, 5 Aug 2015 13:41:51 +0000 (14:41 +0100)]
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>
Mengdong Lin [Wed, 5 Aug 2015 13:41:50 +0000 (14:41 +0100)]
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>
Mengdong Lin [Tue, 4 Aug 2015 17:09:46 +0000 (18:09 +0100)]
topology: Add support for writing manifest private data.
Allow manifest to contain private data and write this data to file.
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>
Jin Yao [Tue, 4 Aug 2015 17:09:12 +0000 (18:09 +0100)]
topology: Add element ID so we can look up references by name.
Add support to lookup elements by name. This is in preparation for adding
some new API calls that will allow building topology data using a C API. This
will allow applications to build their own topology data directly.
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Tue, 4 Aug 2015 17:06:55 +0000 (18:06 +0100)]
topology: fix element object type is switch()
Use the correct type for this object.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 30 Jul 2015 14:43:19 +0000 (16:43 +0200)]
topology: Fix typos
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 30 Jul 2015 14:34:50 +0000 (16:34 +0200)]
topology: Fix missing inclusion of ctype.h
Fix a compile warning:
data.c:116:7: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:25 +0000 (17:45 +0100)]
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>
Liam Girdwood [Wed, 29 Jul 2015 16:45:24 +0000 (17:45 +0100)]
topology: doxygen: Add doxygen support for topology core.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:23 +0000 (17:45 +0100)]
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>
Liam Girdwood [Wed, 29 Jul 2015 16:45:22 +0000 (17:45 +0100)]
topology: Add binary file builder.
Build the binary output file from all the locally parsed objects and elements.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:21 +0000 (17:45 +0100)]
topology: Add Channel map parser.
Add support for parsing channel map to control registers.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:20 +0000 (17:45 +0100)]
topology: Add CTL parser
Add support to parse mixers, enums and byte controls.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:19 +0000 (17:45 +0100)]
topology: Add DAPM object parser
Parse DAPM objects including widgets and graph elements.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:18 +0000 (17:45 +0100)]
topology: Add private data parser
Parse private data and store for attachment to other objects. Data can come
file or be locally defined as bytes, shorts or words.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:17 +0000 (17:45 +0100)]
topology: Add operations parser
Parse operations so we can bind them to kcontrols in the kernel.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:16 +0000 (17:45 +0100)]
topology: Add PCM parser.
Parse PCM configurations and capabilities. These can then be used to define
the capabilities and config for FE DAI links, PCM devices and
codec <-> codec style links.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:15 +0000 (17:45 +0100)]
topology: Add text section parser.
Parse text lists (like enum values) and store for later attachment
to other objects.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Wed, 29 Jul 2015 16:45:14 +0000 (17:45 +0100)]
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>
Liam Girdwood [Wed, 29 Jul 2015 16:45:13 +0000 (17:45 +0100)]
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>
Takashi Iwai [Mon, 27 Jul 2015 10:32:37 +0000 (12:32 +0200)]
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>
Martin Geier [Fri, 24 Jul 2015 07:30:57 +0000 (09:30 +0200)]
pcm: restore hw params on set latency failed
When method snd_pcm_set_params sets sample rate to 22050 and latency to 50000
to davinci soc driver method snd_pcm_hw_params_set_buffer_time_near fails
and variable params is already changed in the method so the next method
snd_pcm_hw_params_set_period_time_near fails also.
Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Pierre-Louis Bossart [Wed, 1 Jul 2015 20:40:58 +0000 (15:40 -0500)]
test: audio_time: show report validity and accuracy
Add checks to show if driver reports valid report and resolution
information. disabled by default
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Pierre-Louis Bossart [Wed, 1 Jul 2015 20:40:57 +0000 (15:40 -0500)]
test: fix audio_time with new get/set audio_tstamp_config
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Pierre-Louis Bossart [Wed, 1 Jul 2015 20:40:56 +0000 (15:40 -0500)]
pcm: add support for new STATUS_EXT ioctl
use STATUS_EXT ioctl if PCM protocol is > 2.0.12
All audio timestamp configuration will be ignored with an
older protocol.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Pierre-Louis Bossart [Wed, 1 Jul 2015 20:40:55 +0000 (15:40 -0500)]
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>
Pierre-Louis Bossart [Wed, 1 Jul 2015 20:40:54 +0000 (15:40 -0500)]
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>
Alexander E. Patrakov [Mon, 29 Jun 2015 17:53:53 +0000 (22:53 +0500)]
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>
Liam Girdwood [Mon, 29 Jun 2015 15:25:59 +0000 (16:25 +0100)]
docs: Add UCM link to main doxygen page.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Liam Girdwood [Mon, 29 Jun 2015 15:25:58 +0000 (16:25 +0100)]
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>
Liam Girdwood [Mon, 29 Jun 2015 15:25:57 +0000 (16:25 +0100)]
ucm: docs: fix doxygen exclude patch for UCM local header
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
David Henningsson [Thu, 18 Jun 2015 08:47:59 +0000 (10:47 +0200)]
surround41/50.conf: Use chmap syntax for better flexibility
In case the hardware only supports a specific channel map,
this change would allow surround41/50 to select the correct
channel map and channel count in this situation.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Shengjiu Wang [Fri, 12 Jun 2015 08:15:08 +0000 (16:15 +0800)]
PCM: snd_pcm_xxxx_drain() maybe blocked after suspend and resume
After suspend and resume, the alsa driver is stopped. But if alsa-lib run
into snd_pcm_xxxx_drain(), it need to wait avail >= pcm->stop_threshold,
otherwise, it will not exit the loop, so finally it is blocked at poll() of
snd_pcm_wait_nocheck(pcm, -1).
This patch is to add state check after snd_pcm_wait_nocheck(pcm, -1), if
the state is SND_PCM_STATE_SUSPENDED, then return error.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 10 Jun 2015 09:56:23 +0000 (11:56 +0200)]
control: Allow cset'ing specific values in the multi-value case
Improve the parser to allow empty elements followed by a comma.
Now amixer works like below for setting only the third element.
% amixer cset 'IIR1 Band1' ,,200
Reported-and-tested-by: Arun Raghavan <arun@accosted.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 2 Jun 2015 14:47:50 +0000 (16:47 +0200)]
pcm: Fix snd_pcm_status() for dmix & co
Fetch the timestamp and other status fields by issuing
snd_pcm_status() for the slave PCM. Also, fill the delay field
properly. This should fix longstanding PA's complaints.
Reported-by: Dan Hordern <danhordern@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 1 Jun 2015 11:45:01 +0000 (13:45 +0200)]
pcm: Don't assert in _snd_pcm_hw_params_internal()
It's no fatal error from sw params, and it's really bad habit to use
assert() and abort the operation as a system library.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Christophe Lohr [Mon, 1 Jun 2015 11:43:36 +0000 (13:43 +0200)]
test/pcm_min: Fix error messages
Fix the wrongly referred error code for error messages from
snd_pcm_writei() and other calls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Christophe Lohr [Mon, 1 Jun 2015 11:41:49 +0000 (13:41 +0200)]
test/pcm: Fix generated values with float PCM format
The float format should be generated [-1.0..1.0].
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 21 May 2015 05:26:39 +0000 (07:26 +0200)]
pcm: Remove assert() from snd_pcm_hw_params_slave()
Using assert() for non-fatal error checks is really brain-dead.
These are especially bad, as it hits even in the normal operation with
plugins and some h/w constraints.
Reported-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Mon, 4 May 2015 16:10:38 +0000 (19:10 +0300)]
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>
Jie Yang [Fri, 8 May 2015 07:18:47 +0000 (15:18 +0800)]
conf/ucm: broadwell-rt286: change to set capture volume and capture device
Set 'Mic Capture Volume' in capture device EnableSequence, to fix
capture no volume by default issue.
Also add JackHWMute Value item to mute onboard dmic while headset
mic is plugged in.
Signed-off-by: Jie Yang <yang.jie@intel.com>
Tested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 30 Apr 2015 13:02:04 +0000 (15:02 +0200)]
conf: Add hint descriptions to ctl, hwdep, seq and timer devices
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 30 Apr 2015 12:52:35 +0000 (14:52 +0200)]
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>
Takashi Iwai [Thu, 30 Apr 2015 12:38:25 +0000 (14:38 +0200)]
namehint: Fix bad free with invalid iface name
Due to the uninitialized field before the error path, passing an
invalid iface argument may result in a bad free() call. Initialize
the fields properly beforehand.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 30 Apr 2015 12:32:49 +0000 (14:32 +0200)]
namehint: Fix the listing without device number
The current code of snd_device_name_hint() has a bug when listing up
devices without the device index (e.g. ctl). Because it assigns the
default device index 0 unconditionally and it has a check at the later
point to filter entries with dev >= 0, it ended up with empty
outputs.
The fix is simply to remove the bogus assignment of dev = 0.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 30 Apr 2015 10:26:43 +0000 (12:26 +0200)]
namehint: Fix invalid list access in snd_device_name_hint()
snd_device_name_hint() tries to free the allocated list at the error
path via snd_device_name_free_hint(). But snd_device_name_free_hint()
expects a list terminated by NULL while snd_device_name_hint() doesn't
add it. Adding it may again result in an error and thus isn't
guaranteed to work. Hence we can't add NULL at the error path.
Instead, now the code always allocates one entry more, and zero-clears
the newly allocated beforehand to guarantee the NULL termination.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jie Yang [Tue, 28 Apr 2015 07:40:22 +0000 (15:40 +0800)]
conf/ucm: broadwell-rt286: change to use the correct jack kcontrol name
The headset jack has two kctls: "Headphone Jack" and "Mic Jack",
we need switch speaker output according to the former JackControl.
Here correct it.
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 21 Apr 2015 10:49:29 +0000 (12:49 +0200)]
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>
Richard Körber [Wed, 21 Jan 2015 21:50:27 +0000 (22:50 +0100)]
USB-audio: Sound Blaster HD iec958 is on device 1
Creative Sound Blaster X-Fi HD uses device 1 for iec958 output.
Signed-off-by: Richard Körber <dev@shredzone.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Thu, 5 Mar 2015 12:51:58 +0000 (14:51 +0200)]
ucm: improve jack configuration documentation
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Thu, 5 Mar 2015 12:51:57 +0000 (14:51 +0200)]
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>
Takashi Iwai [Thu, 5 Mar 2015 10:03:56 +0000 (11:03 +0100)]
conf/ucm: Add Makefile.am for broadwell-rt286 ucm config
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Bard Liao [Thu, 5 Mar 2015 00:38:55 +0000 (08:38 +0800)]
conf/ucm: broadwell-rt286: add ucm config
The configure should apply to all Broadwell-rt286 boards from Intel,
like Wilson Beach SDS Ultrabook.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Lu, Han [Thu, 5 Mar 2015 00:38:54 +0000 (08:38 +0800)]
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>
Jaroslav Kysela [Thu, 26 Feb 2015 12:34:52 +0000 (13:34 +0100)]
Release v1.0.29
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tanu Kaskinen [Tue, 17 Feb 2015 19:15:23 +0000 (21:15 +0200)]
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>
Tanu Kaskinen [Tue, 17 Feb 2015 19:15:22 +0000 (21:15 +0200)]
ucm: fix the logic of choosing the default cdev
If the cdev has not been configured explicitly, use the PlaybackCTL
or CaptureCTL value if one of them is set. If neither are set, or if
both are set to different values, then there's no sensible default, so
executing the sequence should fail. The previous code probably tried
to implement this logic, but it was buggy.
Also use more descriptive variable names than "cdev1" and "cdev2".
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Tue, 17 Feb 2015 19:15:21 +0000 (21:15 +0200)]
ucm: fix incorrect error code sign
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Mon, 16 Feb 2015 19:47:58 +0000 (21:47 +0200)]
.gitignore: add test-driver
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tanu Kaskinen [Tue, 10 Feb 2015 20:42:32 +0000 (22:42 +0200)]
ucm: fix variable mixup
I assume the intention was to use cdev1 for PlaybackCTL and cdev2 for
CaptureCTL, but cdev1 was being used for both and cdev2 was not used
for anything.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 Feb 2015 15:27:19 +0000 (00:27 +0900)]
control: complement comment for subscribe API
When minus value is given as a parameter, the API returns whether
the caller has already subscribed or not.
This commit adds a comment about this so as better documentation.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Alexander E. Patrakov [Sat, 31 Jan 2015 18:26:07 +0000 (23:26 +0500)]
conf: add support for USB AudioSport Quattro (tm)
This patch resulted from discussion with redlion_ on #alsa IRC channel
on Freenode. 4-channel playback now works. 4-channel capture works too,
but not simultaneously with playback (hardware limitation).
Alsa-info before the fix:
http://www.alsa-project.org/db/?f=
a3673622074b88a1abf4ccc6e7f37d0b5b72f34a
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 28 Jan 2015 15:21:14 +0000 (16:21 +0100)]
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>
Lu, Han [Thu, 22 Jan 2015 01:32:47 +0000 (09:32 +0800)]
ucm: add binary configure file parse
with cset command, UCM set kcontrol parameters directly:
cset "name='<KCONTROL_NAME>' 1<,2,3,...>"
This patch enables UCM to set kcontrol with parameters from
configure file:
cset-bin-file "name='<KCONTROL_NAME>' <path/to/file>"
where "cset-bin-file" is a newly added keyword alongside of "cset",
to indicate cset with binary data in file.
The binary data in file is parameter for audio DSPs, and it's just
passed by UCM/ALSA as raw data. The data type of parameter elements
must be byte, and the count must matches driver definition.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tomeu Vizoso [Thu, 15 Jan 2015 16:27:29 +0000 (17:27 +0100)]
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>
Matthieu Crapet [Wed, 14 Jan 2015 14:42:45 +0000 (15:42 +0100)]
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>
Lu, Han [Wed, 14 Jan 2015 01:08:30 +0000 (09:08 +0800)]
control: enable octal and hexadecimal parse
Use zero-base for strtol(), so get_integer() and get_integer64()
can parse decimal, octal and hexadecimal data from input string.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Anssi Hannula [Tue, 30 Dec 2014 18:46:11 +0000 (20:46 +0200)]
pcm: fix buffer overflow in snd_pcm_chmap_print()
The size argument is wrong for one of the snprintf() calls in
snd_pcm_chmap_print(), allowing an overflow to happen (the user-provided
buffer may be written data up to 2x its actual size).
Seen in an user report here: http://trac.kodi.tv/ticket/15641
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Fri, 28 Nov 2014 16:03:34 +0000 (01:03 +0900)]
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>
Tim Cussins [Tue, 25 Nov 2014 14:44:54 +0000 (14:44 +0000)]
pcm: Fix assorted tstamp_type bugs/omissions.
Just a couple of quick fixes related to tstamp_type.
- snd_pcm_sw_params(): copy tstamp_type field
- snd_pcm_tstamp_type_name(): fix argument type
- snd_pcm_dump_sw_setup(): fix dumping of tstamp_type field
Signed-off-by: Takashi Iwai <tiwai@suse.de>