OSDN Git Service

android-x86/external-alsa-lib.git
7 years agopcm: direct: check state before enter poll on timer
Andreas Pape [Tue, 10 Jan 2017 06:33:54 +0000 (12:03 +0530)]
pcm: direct: check state before enter poll on timer

To avoid the chances of timeout, we need to check the enter poll
in state xrun.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Mounesh Sutar <mounesh_sutar@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: direct: Fix for sync issue on xrun recover
Andreas Pape [Tue, 10 Jan 2017 06:33:36 +0000 (12:03 +0530)]
pcm: direct: Fix for sync issue on xrun recover

If using very short periods, DSHARE/DSNOOP/DMIX may report underruns while in
status 'prepared'. This prohibits correct recovery. Now slave xrun conditions
for DSHARE/DSNOOP/DMIX are being handled properly.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Mounesh Sutar <mounesh_sutar@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: direct: returning semop error code for semaphore up/down failures
Mounesh Sutar [Tue, 10 Jan 2017 06:33:17 +0000 (12:03 +0530)]
pcm: direct: returning semop error code for semaphore up/down failures

Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoseq: improve documentation about new get pid/card functions
Adam Goode [Tue, 3 Jan 2017 13:33:42 +0000 (08:33 -0500)]
seq: improve documentation about new get pid/card functions

Document the technique for determining if the running kernel supports
the new snd_seq_client_info_get_pid and snd_seq_client_info_get_card
functions. Also add a little information about how to use these
functions and add some cross references.

Signed-off-by: Adam Goode <agoode@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: fix unused-const-variable warning
Takashi Sakamoto [Tue, 29 Nov 2016 15:44:32 +0000 (00:44 +0900)]
topology: fix unused-const-variable warning

Last year, unused static const variable was added, then compiler generates
a below warning.

dapm.c:43:30: warning: ‘widget_control_map’ defined but not used [-Wunused-const-variable=]
 static const struct map_elem widget_control_map[] = {
                              ^~~~~~~~~~~~~~~~~~

This commit removes it.

Fixes: 01a0e1a1c219 ("topology: Add DAPM object parser")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agorate: dynamic update avail_min on slave
Andreas Pape [Mon, 19 Dec 2016 03:37:51 +0000 (12:37 +0900)]
rate: dynamic update avail_min on slave

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoplugin: dynamically update avail_min on slave
Andreas Pape [Mon, 19 Dec 2016 03:37:50 +0000 (12:37 +0900)]
plugin: dynamically update avail_min on slave

mmapped capture access on some plugins can fetch data from
slave in the 'background'. A subsequent snd_pcm_wait waits
for too long time to reach avail_min threshold again.
Waiting too long leads to xruns on other devices waiting for
the capture data.
As a fix the avail_min on slave is recalculated dynamically.

V2: updated patch to fix within 80 characters per line

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: rate: fix the hw_ptr update until the boundary available
mahendran.k [Fri, 30 Dec 2016 06:29:27 +0000 (11:59 +0530)]
pcm: rate: fix the hw_ptr update until the boundary available

For long time test case, the slave_hw_ptr will exceed the boundary
and wraparound the slave_hw_ptr. This slave boundary wraparound will
cause the rate->hw_ptr to wraparound irrespective of the
rate->boundary availability and due to that the available size goes
wrong.

Hence, to get the correct available size,
- Its necessary to increment the rate->hw_ptr upto the rate->boundary
and then wraparound the rate->hw_ptr.
- While handling fraction part of slave period, rounded value will be
introduced by input_frames(). To eliminate rounding issue on
rate->hw_ptr, subtract last rounded value from rate->hw_ptr and add
new rounded value of present slave_hw_ptr fraction part to
rate->hw_ptr.

Signed-off-by: mahendran.k <mahendran.kuppusamy@in.bosch.com>
Signed-off-by: Mounesh Sutar <mounesh_sutar@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: dshare: enable silence
Alexander Jahn [Fri, 30 Dec 2016 06:29:11 +0000 (11:59 +0530)]
pcm: dshare: enable silence

This issue depends on system load - if the process using dshare is
scheduled fast enough, then there is no noise. A delay of e.g >~2ms
produces hearable noise.

Reproduction with instrumented aplay(sleep every 100th period for a
given time):
During the sleep time of 2000000us (2s) the hardware plays old samples
in a loop before xrun is detected and recovered after the sleep.
This is resolved by placing it in silence, in case of dshare plugin.

Signed-off-by: Alexander Jahn <ajahn@de.adit-jv.com>
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: direct: allow users to configure different period sizes
Joshua Frkuska [Fri, 30 Dec 2016 06:26:15 +0000 (11:56 +0530)]
pcm: direct: allow users to configure different period sizes

This patch allows the effective period size to be a multiple of the
slave-pcm period size.
Allowing only exact multiple of original period size is achieved by
borrowing code from the kernel hwrules implementation.

This patch is intended to save cpu workload when for example, the
slave operates with very small periods but a user does not need that
small periods.

This feature is enabled by default and can be disabled by adding
config option 'var_periodsize 0'.

Signed-off-by: Alexander Jahn <ajahn@de.adit-jv.com>
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: parser needs limits.h
Gustavo Zacarias [Wed, 21 Dec 2016 22:46:34 +0000 (19:46 -0300)]
ucm: parser needs limits.h

It's using PATH_MAX which is defined there, otherwise the build fails on
musl libc.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: Add ATTRIBUTE_UNUSED for unused parameters of execute_component_seq()
Mengdong Lin [Tue, 27 Dec 2016 10:08:58 +0000 (18:08 +0800)]
ucm: Add ATTRIBUTE_UNUSED for unused parameters of execute_component_seq()

To fix the following warnings:

main.c: In function ‘execute_component_seq’:
main.c:489:24: warning: unused parameter ‘value_list1’ [-Wunused-parameter]
      struct list_head *value_list1,
                        ^
main.c:490:24: warning: unused parameter ‘value_list2’ [-Wunused-parameter]
      struct list_head *value_list2,
                        ^
main.c:491:24: warning: unused parameter ‘value_list3’ [-Wunused-parameter]
      struct list_head *value_list3,
                        ^

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoRelease v1.1.3
Jaroslav Kysela [Tue, 20 Dec 2016 14:43:20 +0000 (15:43 +0100)]
Release v1.1.3

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
7 years agoconf: don't install smixer.conf when python is not available
Jaroslav Kysela [Tue, 20 Dec 2016 14:41:25 +0000 (15:41 +0100)]
conf: don't install smixer.conf when python is not available

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
7 years agopcm: fix get_stop_threshold alsa-lib 0.9 alias
Rene Rebe [Tue, 13 Dec 2016 12:54:26 +0000 (13:54 +0100)]
pcm: fix get_stop_threshold alsa-lib 0.9 alias

resurrecting some decade old code I got some crashes and noticed a typo in
an old 0.9 legacy symver alias.

Signed-off-by: René Rebe <rene@exactcode.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: file: update linked hw_ptr and appl_ptr
Andreas Pape [Fri, 25 Nov 2016 10:25:05 +0000 (15:55 +0530)]
pcm: file: update linked hw_ptr and appl_ptr

Plugin file provides no private hw_ptr and appl_ptr but instead links
them to the slave pcm.  If the slave pcm itself changes its hw_ptr or
app_prt this needs to be done in file plugin, too.

Plugin 'plug' is such a candidate changing the hw_ptr and app_ptr in
hw_params call dependent on the automatically inserted plugins.  ALSA
unfortunately has no support for automatically updating chained
pointers.

A notification on pointer change seems to be prepared inside the
snd_pcm_set_ptr() routine via rbptr->changed(), but it is not (yet)
implemented so that we need to care for it manually.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm_rate: Do not discard slave reported delay in status result.
Alan Young [Tue, 14 Jun 2016 09:15:01 +0000 (10:15 +0100)]
pcm_rate: Do not discard slave reported delay in status result.

snd_pcm_rate_status() gets the underlying status from the slave PCM.
This may contain a delay value that includes elements such as codec and
other transfer delays. Use this as the base for the returned delay
value, adjusted for any frames buffered locally (within the rate
plugin).

Also update snd_pcm_rate_delay() similarly.

[fixed some comments by tiwai]

Signed-off-by: Alan Young <consult.awy@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: fix unused-variable warnings introduced to build_link()
Takashi Sakamoto [Tue, 29 Nov 2016 15:42:01 +0000 (00:42 +0900)]
topology: fix unused-variable warnings introduced to build_link()

A function with unused automatic variables was recently introduced to this
library, then compiler generates below warnings.

pcm.c: In function ‘build_link’:
pcm.c:213:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i, num_hw_configs = 0, err = 0;
      ^
pcm.c:210:43: warning: unused variable ‘cmpnt’ [-Wunused-variable]
  struct snd_soc_tplg_link_cmpnt  *codec, *cmpnt;
                                           ^~~~~
pcm.c:210:35: warning: unused variable ‘codec’ [-Wunused-variable]
  struct snd_soc_tplg_link_cmpnt  *codec, *cmpnt;
                                   ^~~~~
pcm.c:209:20: warning: unused variable ‘ref_elem’ [-Wunused-variable]
  struct tplg_elem *ref_elem = NULL;

This commit removes them.

Fixes: 53f7711769d4("topology: Define a function to build a single physical DAI link")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: fix wrong document references to PCM APIs which perform direct memory access...
Takashi Sakamoto [Sun, 11 Dec 2016 11:31:38 +0000 (20:31 +0900)]
pcm: fix wrong document references to PCM APIs which perform direct memory access with frame copying

In a design of ALSA PCM interface, for PCM frame transmission to/from
kernel space, applications can select from two options; direct memory access
or ioctl(2). Available options are decided depending on device capacity and
machine architecture. Applications can get available options by the first
entry of 'struct snd_pcm_hw_params.masks'.

When the mask includes 'SNDRV_PCM_ACCESS_MMAP_xxx', applications can use
direct memory access. For this use case, userspace library has two types
of PCM API. One is to expose a pointer over the memory to start
reading/writing PCM frames. Another is to copy PCM frames between the
memory and a given buffer.

Current documentation includes wrong references to these APIs to describe
their advantages/disadvantages. This confuses application developers
because the references indicate PCM APIs to execute ioctl(2) operation to
read/write PCM frames.

This commit fixes the bug.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: Execute sequence of component devices
Mengdong Lin [Mon, 28 Nov 2016 05:34:21 +0000 (13:34 +0800)]
ucm: Execute sequence of component devices

A machine device's sequence can enable or disable a component device. So
when executing a machine device's sequence, the enable or disable sequence
of its component devices will also be excecuted.

Components don't define card device cdev in their sequences. So before
executing a component device sequence, UCM manager will
- store cdev defined by the sequence of its parent, the machine device;
- mark itself entering 'component domain'.

Then this cdev will be used to excute the sequence of the component
device.

When UCM manager completes executing the sequence of the component device,
it will leave 'compnent domain' and reset the saved cdev to NULL.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: Parse sequence of component devices
Mengdong Lin [Mon, 28 Nov 2016 05:33:54 +0000 (13:33 +0800)]
ucm: Parse sequence of component devices

A machine device's sequence can enable or disable a component device by
keyword 'enadev' and 'disdev' followed the name of the component device.

UCM sequence parser will find the component device and mark if its enable
or disable sequence is needed by the parent, the machine device.

New element type and struct are defined for the sequence of a component
device. Component devices will be removed from the machine device list
'device_list' of a verb, since we don't want to expose them to audio
servers with original API to list devices for backward compatibility.
A new list 'cmpt_device_list' is used for the component devices of a verb.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: Skip component directories when scanning sound card configuration files
Mengdong Lin [Mon, 28 Nov 2016 05:33:34 +0000 (13:33 +0800)]
ucm: Skip component directories when scanning sound card configuration files

Cards are defined by machines. DSPs embedded in SoC and off-soc codecs
can be taken as components for machines, and can be reused by different
machines/cards. Codec and SoC vendors can define their own UCM config
files. If a codec or DSP is used by a machine, the card configuration file
can include the conf file of the codec and DSP. Later patches will
complete support for this feature.

Two new directories will be used to store the UCM configuration files for
a specific codec or DSP firmware:
- /usr/share/alsa/ucm/dsps ... for DSP embedded in SoC
- /usr/share/alsa/ucm/codecs ... for off-soc codecs

These two directories will be skipped when UCM manager scans the card
directories under /usr/share/alsa/ucm.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: dmix: Do not discard slave reported delay in status result
Takashi Iwai [Tue, 29 Nov 2016 13:53:53 +0000 (14:53 +0100)]
pcm: dmix: Do not discard slave reported delay in status result

Like the change done for dshare plugin, we can calculate the delay
more precisely from the slave PCM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: Add the PCM state checks to plugins
Takashi Iwai [Tue, 29 Nov 2016 13:31:20 +0000 (14:31 +0100)]
pcm: Add the PCM state checks to plugins

I noticed that some plugin codes have no proper PCM state checks and
it results in expected outcomes.  For example, when snd_pcm_drain() is
called for a dmix PCM after calling snd_pcm_drop(), it stalls
unexpectedly.  It's just because its drain callback doesn't expect the
SND_PCM_SETUP state.

We can fix such a bug in each place one by one, but a safer way would
be to filter out all such cases commonly in the PCM API functions
themselves.  This patch adds the PCM state sanity checks to major API
functions so that they return -EBADFD when called in the unexpected
PCM states.

As well as for the thread-safety extension, it'd be a question of the
performance; again at this time, the hw PCM is considered as an
exception, and it has pcm->own_state_check flag set, which means that
the common PCM state checks are skipped.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoRevert "pcm: file: Add htimestamp operation in plugin file"
Takashi Iwai [Tue, 29 Nov 2016 15:19:26 +0000 (16:19 +0100)]
Revert "pcm: file: Add htimestamp operation in plugin file"

This reverts commit f8d07a7354a3fee1e30073aa7ac2efb89ef4e782.

The htimestamp field was already intiailized.  It was just overlooked,
sorry.

Suggested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: file: Add htimestamp operation in plugin file
Andreas Pape [Fri, 25 Nov 2016 11:36:37 +0000 (17:06 +0530)]
pcm: file: Add htimestamp operation in plugin file

PCM operation htimestamp is not implemented in plugin file.
Calling snd_pcm_htimestamp() on a plugin file crashes. This scenario
is considered now.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: dshare: Fix endless playback of buffer
Anant Agrawal [Fri, 25 Nov 2016 11:13:34 +0000 (16:43 +0530)]
pcm: dshare: Fix endless playback of buffer

On snd_pcm_drain() the slave PCM driven via plugin DSHARE is not filled with
silence. Result is endless playback of buffer content until pcm is closed.
In ALSA pcm dshare plugin, called do_silence method to fix the issue.

Signed-off-by: Anant Agrawal <Anant_Agrawal@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: direct: Protect from freeing semaphore when already in use
Joshua Frkuska [Fri, 25 Nov 2016 10:13:40 +0000 (15:43 +0530)]
pcm: direct: Protect from freeing semaphore when already in use

In the case of dshare, dsnoop, and dmix when a device is opened twice
and fails the second time, the semaphore is completely discarded. This
creates dangling semaphore data.

This patch removes the possibility for the semaphore to be destroyed during
a typical open failure by first checking if the shared memory can be destroyed
or not. If the shared memory cannot be released it means both it and the
semaphore are still in use and therefore the semaphore is just released.

Signed-off-by: Joshua Frkuska <joshua_frkuska@mentor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Update physical link configurations in Broadwell text conf file
Mengdong Lin [Fri, 25 Nov 2016 05:20:02 +0000 (13:20 +0800)]
topology: Update physical link configurations in Broadwell text conf file

To make this conf file a better example, add configurations for the
physical link "Codec", same as that defined by Intel Broadwell upstream
machine driver.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Store number of strings of a text section
Mengdong Lin [Thu, 24 Nov 2016 01:34:00 +0000 (09:34 +0800)]
topology: Store number of strings of a text section

Enum controls may use text elements and need the number of strings.

This patch adds a text child object for a generic element. When parsing
a text section from the configuation file, store the text strings and
number of strings (num_items) in the text child object of the element.

Reported-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Merge private data before embedded controls of a widget
Mengdong Lin [Thu, 24 Nov 2016 01:33:52 +0000 (09:33 +0800)]
topology: Merge private data before embedded controls of a widget

For a widget ABI object, its private data sits before the embedded
controls, so we should merge the private data blocks at first, and
then the embedded controls.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Revise document and comments for ABI v5
Mengdong Lin [Wed, 16 Nov 2016 06:43:07 +0000 (14:43 +0800)]
topology: Revise document and comments for ABI v5

Revise the obsolete content in document and comments.

Here are the major changes in implementation from early phase design:
- PCM object is used to configure front end DAI & DAI links, not used by
  physical DAI or DAI links.
- No longer use separate object for backend or codec<->codec links, but
  use physical links to cover them.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: ABI - Add voice wake up flag for DAI links
Mengdong Lin [Wed, 16 Nov 2016 06:42:58 +0000 (14:42 +0800)]
topology: ABI - Add voice wake up flag for DAI links

Add a new flag bit SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP to link flags.
If a link is used for voice wake up, users can set this flag bit and
topology will set the link's 'ignore_suspend' to true.

This ABI update is backward compatible and applied in kernel. We may
rename this flag when we find a better name for this.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Export physical DAIs to the binary for kernel
Guneshwor Singh [Wed, 16 Nov 2016 06:42:49 +0000 (14:42 +0800)]
topology: Export physical DAIs to the binary for kernel

Export the physical DAI objects to the binary output file for kernel.
For physical DAIs defined by the text conf file, find and merge their
stream capablities and private data before exporting.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Support configuring physical DAIs by C API
Guneshwor Singh [Wed, 16 Nov 2016 06:42:41 +0000 (14:42 +0800)]
topology: Support configuring physical DAIs by C API

In addition to text conf file, physical DAIs can also be configured
by C API. This patch defines the template to add physical DAI
configurations from C API.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse physical DAIs in text conf file
Mengdong Lin [Wed, 16 Nov 2016 06:42:33 +0000 (14:42 +0800)]
topology: Parse physical DAIs in text conf file

Add support for parsing physical DAIs in the text configuration file.
The syntax of physical DAIs is described in document in topology.h

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: ABI - Define new types for physical DAI
Guneshwor Singh [Wed, 16 Nov 2016 06:42:25 +0000 (14:42 +0800)]
topology: ABI - Define new types for physical DAI

Define the type and ABI struct for physical DAIs (e.g. backend DAIs).
They are new to ABI and so no backward compatibility risk.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: ABI - Update manifest and pump ABI version to 5
Mengdong Lin [Wed, 16 Nov 2016 06:42:15 +0000 (14:42 +0800)]
topology: ABI - Update manifest and pump ABI version to 5

Pump ABI version to 5.

To support physical DAIs and furture extension, add the following fields
to manifest:
- the count of physical DAIs. Later patches will add new ABI types for
  physical DAIs.
- some reserved fields for new ABI objects in the future.

Kerel will handle this ABI update in a backward compatible way, via patch
'ASoC: topology: Make manifest backward compatible from ABI v4'.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm_dshare: Do not discard slave reported delay in status result.
Alan Young [Wed, 2 Nov 2016 17:40:32 +0000 (17:40 +0000)]
pcm_dshare: Do not discard slave reported delay in status result.

snd_pcm_dshare_status() gets the underlying status from the slave PCM.
This may contain a delay value that includes elements such as codec and
other transfer delays. Use this as the base for the returned delay
value, adjusted for any frames buffered locally (within the dshare
plugin).

Note: snd_pcm_dshare_delay() is not updated.

Signed-off-by: Alan Young <consult.awy@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agomixer: Don't install smixer modules unless python is enabled
Takashi Iwai [Mon, 14 Nov 2016 10:46:05 +0000 (11:46 +0100)]
mixer: Don't install smixer modules unless python is enabled

Currently the whole smixer stuff depends on python, so it doesn't make
sense to install plugins partially when the python support is
disabled.

This patch changes Makefile.am not to install the smixer stuff at all
when the python support is disabled via configure script.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Remove BE or CC in comments of physical links C API template
Mengdong Lin [Sun, 6 Nov 2016 05:14:43 +0000 (13:14 +0800)]
topology: Remove BE or CC in comments of physical links C API template

No longer use BE or CC in comments of C API template for physical links.
This template can be used by Backend or Codec-to-Codec DAI links but not
only for them.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse name and stream name of physical DAI links
Mengdong Lin [Sun, 6 Nov 2016 05:14:34 +0000 (13:14 +0800)]
topology: Parse name and stream name of physical DAI links

Parse name and stream name of physical links defined by text conf file
or C API. Add name and stream name to C API template of physical DAI
links.

These two fields will help topology kernel driver to find an existing
physical link to configure, since the id of links are often the default
value ZERO and useless for match.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse and build private data of physical links
Mengdong Lin [Sun, 6 Nov 2016 05:14:25 +0000 (13:14 +0800)]
topology: Parse and build private data of physical links

Users can define private data for physical links by C API or text conf
file. Private data pointer is added to C API template for physical links.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse link flags of physical DAI links
Mengdong Lin [Sun, 6 Nov 2016 05:14:15 +0000 (13:14 +0800)]
topology: Parse link flags of physical DAI links

Parse physical DAI link flags defined by text conf file or C API.
The flag mask and flags are added to C API template for physical DAI
links.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse HW configurations of physical DAI links in text conf file
Mengdong Lin [Sun, 6 Nov 2016 05:14:04 +0000 (13:14 +0800)]
topology: Parse HW configurations of physical DAI links in text conf file

Users can configure the runtime supported HW configurations of a physical
link by SectionHWConfig. A physical link can refer multiple HW config
sections in SectionLink.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse HW configurations of physical DAI links defined by C API
Mengdong Lin [Sun, 6 Nov 2016 05:13:46 +0000 (13:13 +0800)]
topology: Parse HW configurations of physical DAI links defined by C API

Add HW configurations to C API template of physical link configuration.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Define new type and section name to configure physical links
Mengdong Lin [Sun, 6 Nov 2016 05:13:36 +0000 (13:13 +0800)]
topology: Define new type and section name to configure physical links

Users may not use DPCM but still need to configure the physical links.
So we should not only consider backend links for DPCM.

- SND_TPLG_TYPE_LINK is defined to configure physical links by C API.
  And SND_TPLG_TYPE_BE is still supported to configure Backend links for
  DPCM cases.

- SectionLink can be used to configure physical links in text conf file.
  And SectionBE is still supported to config Backend links for DPCM cases.

Actually, users can use SND_TPLG_TYPE_LINK and SectionLink to configure
backend links for DPCM cases, because BE links are also physical links.
The parsing is same and we rename the function from tplg_parse_be to
tplg_parse_link.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Rename varaibles for add physical links by C API
Mengdong Lin [Sun, 6 Nov 2016 05:13:19 +0000 (13:13 +0800)]
topology: Rename varaibles for add physical links by C API

Code refactoring. When adding a physical link element from C API:
- Rename "link" to "link_tpl" for physical link config template for
  C API users.
- Rename "lk" to "link" for physical link elements created by topology
  internally.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: ABI - Update physical DAI link configurations to ABI v5
Mengdong Lin [Sun, 6 Nov 2016 05:13:08 +0000 (13:13 +0800)]
topology: ABI - Update physical DAI link configurations to ABI v5

This patch update physicals DAI link config to ABI v5:

- Define the types and ABI struct for runtime supported hardware configs
  e.g. audio hardware formats. The default HW config ID will help topology
  to find the DAI format to set on init. Topology provides this as a
  fallback if such HW settings are not available in ACPI or device tree,
  to avoid hard code in drivers. It's only for config items that can be
  programmed by SW or FW, not for physical things like link connections
  or GPIO used for HP etc.

- Add flags. The flags will be used to configure an existing physical
  links.

- Add private data. The private data is reserved for future extension.

- Add name and stream name to physical DAI links. Kernel can also use name
  and stream name to find an existing physical link and configure it.

Kernel can handle the ABI update in a backward compatible way via patch
'ASoC: topology: Add support to configure existing physical DAI links'.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: ABI - Define DAI physical PCM data formats
Mengdong Lin [Sun, 6 Nov 2016 05:12:57 +0000 (13:12 +0800)]
topology: ABI - Define DAI physical PCM data formats

Define DAI physical PCM data formats for user space, so users can specify
the formats of backends by topology (e.g. the DAI format to set on backend
link init).

The kernel will also refer to these formats.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Define a function to build a single physical DAI link
Mengdong Lin [Sun, 6 Nov 2016 05:12:40 +0000 (13:12 +0800)]
topology: Define a function to build a single physical DAI link

Code refactoring. Rename the function to build all physical links from
tplg_build_link_config() to tplg_build_links(). And define a new function
build_link() to build a single physical DAI link element.

The function build_link() will be extended to handle more properties
of a physical DAI link (e.g. backend or codec-codec link).

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Merge an element's be & cc pointer to one link pointer
Mengdong Lin [Sun, 6 Nov 2016 05:11:49 +0000 (13:11 +0800)]
topology: Merge an element's be & cc pointer to one link pointer

Code refactoring. Previously an element has two pointers, 'be' and 'cc',
for BE (Back End) and CC (Codec-Codec) link respectively. But actually
the topology tool processes BE and CC links in the same way, so these
two pointers can be merged into one 'link' pointer, which can be used
configure any physical links.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Use snd_config_get_bool to simplify boolean flag parsing
Mengdong Lin [Sun, 6 Nov 2016 05:11:04 +0000 (13:11 +0800)]
topology: Use snd_config_get_bool to simplify boolean flag parsing

The link flags in the text conf file are boolean, so this patch uses
snd_config_get_bool() to simplify the code.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: tplg_elem_lookup() checks parameter before searching
Mengdong Lin [Thu, 3 Nov 2016 23:08:27 +0000 (07:08 +0800)]
topology: tplg_elem_lookup() checks parameter before searching

Check the parameters at first in case of misuse.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse and build private data for PCM
Mengdong Lin [Thu, 3 Nov 2016 23:08:12 +0000 (07:08 +0800)]
topology: Parse and build private data for PCM

Users can define private for PCM (FE DAI & DAI links) elements by both
text conf file and C API:

- Text conf file may define multiple data blocks for a PCM and they will
  be merged in building phase;

- Add private data to C API template of PCM object.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Define a function to build a single PCM element
Mengdong Lin [Thu, 3 Nov 2016 23:07:58 +0000 (07:07 +0800)]
topology: Define a function to build a single PCM element

Code refactoring. Rename tplg_build_pcm() to tplg_build_pcms() to build
all PCM (FE DAI & DAI link) elements. It will call a new function
build_pcm() to build a single PCM elemement.

build_pcm() will be extended to handle more properties of a PCM.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse flags for PCM
Mengdong Lin [Thu, 3 Nov 2016 23:07:06 +0000 (07:07 +0800)]
topology: Parse flags for PCM

Users can define flags by both text conf file and C API.
Add flags and flag_mask to C API template of PCM object.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Parse sig_bits of stream caps
Mengdong Lin [Thu, 3 Nov 2016 23:06:53 +0000 (07:06 +0800)]
topology: Parse sig_bits of stream caps

Add sig_bits to stream caps template of C API and parse it.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: ABI - Update stream caps and PCM objects to ABI v5
Mengdong Lin [Thu, 3 Nov 2016 23:05:53 +0000 (07:05 +0800)]
topology: ABI - Update stream caps and PCM objects to ABI v5

Here are the ABI updates for PCM (Front DAI & DAI link) objects:

- add sig_bits to stream caps.
- add flags and private data to PCM.

The kernel can handle the ABI update in a backward compatible way with
the patch "ASoC: topology: Make PCM backward compatible from ABI v4".

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Add doc for including other files in the text conf file
Mengdong Lin [Mon, 24 Oct 2016 13:22:19 +0000 (21:22 +0800)]
topology: Add doc for including other files in the text conf file

This patch adds document about how to include other files in the text
configuration files, by alsaconf syntax <xxx> and <searchdir:xxx>.

Users may define common info in separate files (e.g. vendor tokens,
tuples) and share them for different platforms, by including them via
syntax <path/to/configuration-file>. This can save the total size of
files. Users can also specifiy additional configuraiton directories
relative to "/usr/share/alsa/" to search the included files, via syntax
<searchdir:relative-path/to/usr/share/alsa>.

The alsaconf will search and open an included file in the following order
of priority:
1. directly open the file by its name;
2. search for the file name in "/usr/share/alsa";
3. search for the file name in user specified subdirectories under
   "/usr/share/alsa".

The order of the included files need not to be same as their dependencies,
because the toplogy library will load all of them before parsing their
dependencies.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoconf: Search included files under user specified configuration directories
Mengdong Lin [Mon, 24 Oct 2016 13:22:11 +0000 (21:22 +0800)]
conf: Search included files under user specified configuration directories

Users can include file by giving a relative path or just a file name via
alsaconf syntax <xxx>. ALSA conf will search the file in top configuration
directory and additional configuration directories defined by users via
alsaconf syntax <searchdir:xxx>.

ALSA conf will search and open an included file in the following order
of priority:

1. directly open the file by its name;
2. search for the file name in top config direcotry "/usr/share/alsa/";
3. search for the file name in additional configuration directories
   specified by users, via alsaconf syntax
   <searchdir:relative-path/to/user/share/alsa>;
   These directories will be searched in the same order as their
   definition.

The configuration directories defined by a file will only be used to
search the files included by this file.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotopology: Fix missing stream name of widgets in text conf file
Mengdong Lin [Mon, 24 Oct 2016 13:22:02 +0000 (21:22 +0800)]
topology: Fix missing stream name of widgets in text conf file

User can define the stream name of an input/output widget in the text conf
file, by setting "stream_name" of a SectionWidget.

Topology C API and kernel already have support for configuring a widget's
stream name. This patch just adds the missing part of the text conf file.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm_plug: Clear plugins on all error conditions
Michael Forney [Thu, 20 Oct 2016 01:22:56 +0000 (18:22 -0700)]
pcm_plug: Clear plugins on all error conditions

Otherwise, they will linger after the error is returned (but pcm->setup == 0).
Then, if the caller tries to clean up and call snd_pcm_close(), the assertion
plug->gen.slave == plug->req_slave will fail.

Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoconf/ucm: skylake: add skylake-rt286 conf files
Vinod Koul [Fri, 7 Oct 2016 10:58:23 +0000 (16:28 +0530)]
conf/ucm: skylake: add skylake-rt286 conf files

This add the UCM conf files for skylake enabling I2S audio, HDMI and DMIC
ports.

Signed-off-by: Karthik D M <karthik.d.m@intel.com>
Signed-off-by: Nishit Sharma <nishitx.sharma@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoctl: correct documentation about TLV feature
Takashi Sakamoto [Wed, 28 Sep 2016 23:57:24 +0000 (08:57 +0900)]
ctl: correct documentation about TLV feature

From my misunderstanding, some explanations are wrong. This commit
corrects them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoctl: improve documentation about TLV-related APIs
Takashi Sakamoto [Wed, 28 Sep 2016 23:57:23 +0000 (08:57 +0900)]
ctl: improve documentation about TLV-related APIs

The documentation gives no hints to users about format of TLV data.

This commit add hints to construct/parse the information.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoctl: improve API documentation for TLV operation
Takashi Sakamoto [Wed, 28 Sep 2016 23:57:22 +0000 (08:57 +0900)]
ctl: improve API documentation for TLV operation

A commit fe1b08803db6 ("ctl: improve API documentation for threshold level
operations") changes documentations for some TLV-related APIs with wrong
explanations.

This commit fix it with better explanations.

Fixes: fe1b08803db6 ("ctl: improve API documentation for threshold level operations")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agotest: use actual information for TLV operation
Takashi Sakamoto [Wed, 28 Sep 2016 23:57:21 +0000 (08:57 +0900)]
test: use actual information for TLV operation

Currently, this test program uses undefined type of TLV data. This can
bring confusions to userspace applications.

This commit replaces the array with valid information, constructed by newly
exported TLV macros from kernel land.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoUpdate include/sound/tlv.h from 4.9-pre kernel uapi
Takashi Sakamoto [Wed, 28 Sep 2016 23:57:20 +0000 (08:57 +0900)]
Update include/sound/tlv.h from 4.9-pre kernel uapi

The UAPI header in 4.9-pre kernel newly includes existent macros related
to tlv operation, mainly for layout of TLV packet payload.

This commit updates corresponding backport header in this library.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: docs: typeset lists of identifiers explicitly
Antonio Ospite [Fri, 23 Sep 2016 16:18:57 +0000 (18:18 +0200)]
ucm: docs: typeset lists of identifiers explicitly

Doxygen doesn't preserve formatting that relies only on indentation,
typeset lists of identifiers explicitly.

This makes the HTML docs a lot more readable.

This change comes along the lines of commit 72aa0f8332fb ("ucm: reformat
snd_use_case_get() doc").

Some TABs has been added too in order to preserve the aligned look when
reading the source code.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: fix crash when calling snd_use_case_geti() with no device or modifier
Antonio Ospite [Fri, 23 Sep 2016 16:11:16 +0000 (18:11 +0200)]
ucm: fix crash when calling snd_use_case_geti() with no device or modifier

When calling snd_use_case_geti(uc_mgr, "_devstatus", &lvalue) the code
ends up calling device_status(uc_mgr, NULL), which result in a crash in
strcmp(dev->name, NULL), when there are enabled devices.

This happens because snd_use_case_geti() allows a "_devstatus"
identifier even if it's only supposed to allow the form
"_devstatus/{device}".

So check that the device name is not null.

The same issue occurs with "_modstatus", this change fixes that as well.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agopcm: Better understandable locking code
Takashi Iwai [Thu, 1 Sep 2016 12:05:00 +0000 (14:05 +0200)]
pcm: Better understandable locking code

The newly added locking code seems to have confused quite a few
people, as "thread_safe=1" may be considered as if the thread-safety
lock has to be turned on.  (It meant that the plugin _is_ thread-safe,
i.e. it needs no extra locking.)

For avoiding such a misunderstanding, this commit renames the relevant
pcm fields and give more comments to explain what is for what.
The former single pcm->thread_safe flag is now split to two boolean
flags, pcm->need_lock and pcm->lock_enabled.  It consumes a few more
bytes, but this would be (hopefully) better understandable.

No functional change by this commit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoconf: bxtrt298: Add topology conf file for bxt
Shreyas NC [Tue, 23 Aug 2016 04:08:36 +0000 (09:38 +0530)]
conf: bxtrt298: Add topology conf file for bxt

Add the conf file for bxt platform as well to define module
private data.

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>
7 years agoconf: sklrt286: Remove tool to generate private data blobs
Shreyas NC [Tue, 23 Aug 2016 04:08:35 +0000 (09:38 +0530)]
conf: sklrt286: Remove tool to generate private data blobs

Since tuples are used to define driver private data, the private data
blobs are no longer required.

So, remove the source files required to generate the private
data blobs and the private data blobs.

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>
7 years agoconf: sklrt286: define module private data through tuples in skylake
Shreyas NC [Tue, 23 Aug 2016 04:08:34 +0000 (09:38 +0530)]
conf: sklrt286: define module private data through tuples in skylake

In the conf file, module private data can be described through
tuples instead of blobs defined by vendor defined structures.

This patch defines the tuple section and the token list. The
tokens are then used to build the tuple array.

The module data may have both driver data and firmware data. The
driver data is passed using the tuple array and the firmware data
using byte data. A descriptor tuple array is defined to describe
the succeeding data block.

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>
7 years agopcm: Fix shm initialization race-condition
Ismael Luceno [Mon, 22 Aug 2016 16:04:33 +0000 (13:04 -0300)]
pcm: Fix shm initialization race-condition

Easily seen when two threads try at the same time, one of them will fail.

The bug was identified by using apulse with Skype.

Fixes: dec428c35221 ("pcm: fix 'unable to create IPC shm instance' caused by fork from a thread")
Fixes: https://github.com/i-rinat/apulse/issues/38
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agomixer: Fix rounding mode documentation
David Henningsson [Sun, 14 Aug 2016 07:31:25 +0000 (09:31 +0200)]
mixer: Fix rounding mode documentation

The documentation specifies three different rounding modes, but this
is wrong, because they all end up calling snd_tlv_convert_from_dB,
which only has two rounding modes.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoucm: Add ucm files for DB410c board.
Srinivas Kandagatla [Mon, 8 Aug 2016 13:23:10 +0000 (16:23 +0300)]
ucm: Add ucm files for DB410c board.

DB410c board has support for both Digital and Analog audio. Digital
audio is over HDMI and analog is over codec chip integrated inside the
APQ8016 SOC.

It can support:
 -  3 Microphones: Primary Mic(Handset mic), Headset Mic and Secondary
 - 2 Digital Microphones.
 - Earpiece.
 - Headset.
 - Loud Speaker.
 - HDMI.

[Riku: squashed Srinivas's patches together and converted spaces to tabs]

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Cc: nicolas.dechesne@linaro.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoRelease v1.1.2
Jaroslav Kysela [Tue, 2 Aug 2016 17:48:38 +0000 (19:48 +0200)]
Release v1.1.2

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
7 years agoMakefile: fix sklrt286 dist files
Jaroslav Kysela [Tue, 2 Aug 2016 17:47:48 +0000 (19:47 +0200)]
Makefile: fix sklrt286 dist files

8 years agotopology: Fix the missing referenced elem ptr when merging private data
Mengdong Lin [Fri, 22 Jul 2016 05:12:54 +0000 (13:12 +0800)]
topology: Fix the missing referenced elem ptr when merging private data

tplg_copy_data() should set the valid referenced data element pointer
on success. The caller will double check this pointer for all kinds of
references, including controls and data.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Fix inaccurate message on failure to find a widgets's reference
Mengdong Lin [Fri, 22 Jul 2016 05:12:45 +0000 (13:12 +0800)]
topology: Fix inaccurate message on failure to find a widgets's reference

A widget may have references to control or data elements. So the message
should not only use "control" here.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoctl: use condition statements instead of assert() for new APIs to add an element set
Takashi Sakamoto [Wed, 20 Jul 2016 09:58:52 +0000 (18:58 +0900)]
ctl: use condition statements instead of assert() for new APIs to add an element set

Usage of assert() is not better practice of programming as shared library
APIs. They should return appropriate error code to promote applications to
handle error state.

This commit applies condition statements with return value of -EINVAL,
instead of assert(). As a backward compatibility for existent applications,
old APIs still call assert().

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Check address and length before string copy
Mengdong Lin [Wed, 20 Jul 2016 01:53:12 +0000 (09:53 +0800)]
topology: Check address and length before string copy

elem_copy_text() is widely used for string copy in topology. Because some
name fields are not mandatory for users, sometimes the source can be
invalid and we should not do the copy. So we add check here.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Add ATTRIBUTE_UNUSED for unused parameters to fix compiler warning
Mengdong Lin [Wed, 20 Jul 2016 01:53:03 +0000 (09:53 +0800)]
topology: Add ATTRIBUTE_UNUSED for unused parameters to fix compiler warning

This commit adds ATTRIBUTE_UNUSED to the unused parameter 'tplg' for
function tplg_parse_streams() and tplg_parse_fe_dai(). These two functions
need to keep 'tplg' as ops for tplg_parse_compound().

The compiler warnings below are fixed:

pcm.c: In function 'tplg_parse_streams':
pcm.c:262:43: warning: unused parameter 'tplg' [-Wunused-parameter]
 static int tplg_parse_streams(snd_tplg_t *tplg, snd_config_t *cfg,
                                           ^
pcm.c: In function 'tplg_parse_fe_dai':
pcm.c:324:42: warning: unused parameter 'tplg' [-Wunused-parameter]
 static int tplg_parse_fe_dai(snd_tplg_t *tplg, snd_config_t *cfg,

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Remove support for control flag SNDRV_CTL_ELEM_ACCESS_USER
Mengdong Lin [Wed, 20 Jul 2016 01:52:52 +0000 (09:52 +0800)]
topology: Remove support for control flag SNDRV_CTL_ELEM_ACCESS_USER

This access flag is used to add controls from user space by ioctl.
But topology only configures controls in user space and these controls
will eventually be created by ASoC in kernel, so topology should not
support this flag.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agoctl: rename APIs to add an element set so that their names are appropriate
Takashi Sakamoto [Sat, 16 Jul 2016 13:20:01 +0000 (22:20 +0900)]
ctl: rename APIs to add an element set so that their names are appropriate

In this development period, some APIs have already been added. Most of
them are to add an element set, while their names are not so appropriate
against their feature. This is due to following to names of old APIs.

This commit renames them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Tuple type can have an extenstion
Mengdong Lin [Fri, 15 Jul 2016 12:19:58 +0000 (20:19 +0800)]
topology: Tuple type can have an extenstion

After the type specific string ("uuid", "string", "byte", "short" and
"word"), users may append a string, like  "uuidxxx". The topology parser
will check the first few characters to get the tuple type.

This can allow users to put multiple tuples of the same type into one
vendor tuple section (SectionVendorTuples), e.g. parameters of multiple
firmware modules.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Parse vendor private data for manifest
Mengdong Lin [Fri, 15 Jul 2016 12:19:41 +0000 (20:19 +0800)]
topology: Parse vendor private data for manifest

In text conf file, user can define a manifest section and let it refer
to private data sections, in the same syntax as other element types.

The text conf file can have at most 1 manifest section.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Change uuid value to 16 separate characters in text conf file
Mengdong Lin [Fri, 15 Jul 2016 12:18:59 +0000 (20:18 +0800)]
topology: Change uuid value to 16 separate characters in text conf file

Previously in text conf file, the uuid value of vendor tuples is a
16-characer string. Now change it to 16 characters separated by commas,
easier for users to edit it manually.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: Merge lookup for data reference into tplg_copy_data()
Mengdong Lin [Fri, 15 Jul 2016 12:18:11 +0000 (20:18 +0800)]
topology: Merge lookup for data reference into tplg_copy_data()

Code refactor to reduce function calls. Now tplg_copy_data() can look up
a referenced data element and merge its data.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agotopology: An element can refer to multipe data sections in text conf file
Mengdong Lin [Fri, 15 Jul 2016 12:17:43 +0000 (20:17 +0800)]
topology: An element can refer to multipe data sections in text conf file

Previously in text conf file, an element can only refer to one data
section (SectionData). Now it can also refer to a list of data sections.
Thus users can split groups of firmware parameters to multiple data
sections, and put them all in the reference list.

Finally, data of these data sections will be merged, in the same order as
they are in the reference list, as the element's private data for kernel.

We still support the original syntax of reference to a single data
section. The doc is updated for the syntax extension.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: remove alloca() from simple_event_add()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:33 +0000 (09:23 +0900)]
mixer: remove alloca() from simple_event_add()

Both of alloca() and automatic variables keep storages on stack, while
the former generates more instructions than the latter. It's better to use
the latter if the size of storage is computable at pre-compile or compile
time; i.e. just for structures.

This commit obsolete usages of alloca() with automatic variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: change code formatting for simple_event_add()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:32 +0000 (09:23 +0900)]
mixer: change code formatting for simple_event_add()

This commit applies code format according to typical and moderate rule.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: remove alloca() from simple_add1()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:31 +0000 (09:23 +0900)]
mixer: remove alloca() from simple_add1()

Both of alloca() and automatic variables keep storages on stack, while
the former generates more instructions than the latter. It's better to use
the latter if the size of storage is computable at pre-compile or compile
time; i.e. just for structures.

This commit obsolete usages of alloca() with automatic variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: change code formatting for simple_add1()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:30 +0000 (09:23 +0900)]
mixer: change code formatting for simple_add1()

This commit applies code format according to typical and moderate rule.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: remove alloca() from set_enum_item_ops()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:29 +0000 (09:23 +0900)]
mixer: remove alloca() from set_enum_item_ops()

Both of alloca() and automatic variables keep storages on stack, while
the former generates more instructions than the latter. It's better to use
the latter if the size of storage is computable at pre-compile or compile
time; i.e. just for structures.

This commit obsolete usages of alloca() with automatic variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: remove alloca() from get_enum_item_ops()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:28 +0000 (09:23 +0900)]
mixer: remove alloca() from get_enum_item_ops()

Both of alloca() and automatic variables keep storages on stack, while
the former generates more instructions than the latter. It's better to use
the latter if the size of storage is computable at pre-compile or compile
time; i.e. just for structures.

This commit obsolete usages of alloca() with automatic variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: remove alloca() from enum_item_name_ops()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:27 +0000 (09:23 +0900)]
mixer: remove alloca() from enum_item_name_ops()

Both of alloca() and automatic variables keep storages on stack, while
the former generates more instructions than the latter. It's better to use
the latter if the size of storage is computable at pre-compile or compile
time; i.e. just for structures.

This commit obsolete usages of alloca() with automatic variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8 years agomixer: remove alloca() from init_db_range()
Takashi Sakamoto [Fri, 15 Jul 2016 00:23:26 +0000 (09:23 +0900)]
mixer: remove alloca() from init_db_range()

Both of alloca() and automatic variables keep storages on stack, while
the former generates more instructions than the latter. It's better to use
the latter if the size of storage is computable at pre-compile or compile
time; i.e. just for structures.

This commit obsolete usages of alloca() with automatic variables.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>