Commit Graph

354 Commits

Author SHA1 Message Date
Liam Girdwood 474d6fbf76 bvt: clk: Fix clock lookup table
Baytrail clock lookup has wrong MHz values for XTAL. Fix.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-12-05 20:36:55 +00:00
Liam Girdwood 8ba9ecfd00 uapi: make sure uapi headers are installed.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-30 16:03:46 +00:00
Liam Girdwood 2eab467c16 configure: place AM_CONDITIONAL outside of conditional logic
Always runs AM_CONDITIONAL macros as placing inside conditional logic
can confuse autotools.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-30 16:03:46 +00:00
Liam Girdwood 40bcde3c9e git-version: echo version for AC_INIT
AC_INIT needs version information for building shared libraries.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-30 16:03:46 +00:00
Liam Girdwood 5f5d7c2b93 configure: reset build count every time autogen.sh is run.
autogen.sh rebuilds the build system so also reset any build count to 0.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-30 16:03:46 +00:00
Liam Girdwood d78ff93a78 dma: dw-dma: dont use hard coded transfer size.
Use transfer size in SG config structure instead of hard coded values.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood c3a01f209b comp: use comp_sample_bytes() to set DMA transfer size.
Use comp_sample_bytes() to set DMA transfer size in DAI component and
comment why host always copies using word size transfers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood 094153aece comp: add API to get sample size in bytes
Add an API to get the size of an individual sample in bytes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood e6b9594d79 dma: dw-dma: release spinlock in error path
Currently not released on any configuration errors.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood bb5539bc5f dai: xrun: dont stop and restart DAI on XRUN recovery
In most situations the DAI should not be stopped and the restarted on XRUNs,
e.g. upstream/downstream component XRUNs. This patch will keep the DAI
running in those circumstances.

There will be a subsequent patch that will allow for stopping and
restarting the DAI for XRUN's e.g. SSP XRUNs

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood 4252c49d53 pipeline: Add XRUN state and handler within pipeline.
Add an XRUN handler to notify components that an XRUN has occurred and
to take any remedial action. The pipeline itself will handle an XRUN by
re-preparing the components and then send start again from the pipeline
source component.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood ab505276a5 comp: buffer: Fix xrun reporting
Fix the free/avail buffer calculations to make sure any overrun or underrun
is reported in trace and returned as a negative error in copy().

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood 93a52130c1 pipeline: preloader: simplify preloader by reusing pipeline copy()
Currently the preloader is bespoke and runs in the same context as
the IPC. This means some components may delay IPC and block other
components.

Reuse the existing pipeline copy() infrastructure so that the
preload is done after prepare() but before trigger() using the
same pipeline copy code on the same DSP core and context. i.e.
we preload a host buffer (for playback) and then schedule the
pipeline copy(s) after the preload IPC is done.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood 6f9a43d307 pipeline: Allow pipeline copy to be scheduled when idle for preload.
Use the new idle schedule API to schedule a pipeline copy for preload
after prepare() and before trigger(). This pipeline preload copy will
run within the same context as the regular pipeline copy.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood 88d570de06 scheduler: check for any queued task before making context switch
Minimise any context switches in the scheduler by first checking for
any queued tasks in the task list prior to changing context. If there are
no queued tasks then there is no need to context switch.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Liam Girdwood d1e88b2847 scheduler: Allow tasks to be scheduled when DSP enters idle state
Add an API to allow tasks to be added to the scheduler task list but not
run until the DSP enters an idle state. i.e. we schedule the task as normal
but dont immediately call schedule() to schedule that task for execution
and instead wait until schedule() is next called (at the end of some other
work).

This patch also calls schedule() before entering the idle state in the main
processing loop.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-17 15:57:50 +00:00
Keyon Jie 14b43b369b intel-ipc: fix host ring buffer size not page aligned issue
The host ring buffer size may be not page aligned,
but the last page was utilized by host component
wrongly, which may introduce beating noise.

Here change to correct size for the last element,
which will fix the issue.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-11-16 15:00:30 +00:00
Liam Girdwood 1aded4f4a6 volume: fix frame bytes calculation.
Currently frame bytes is calculated as period bytes. Fix.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-16 10:32:10 +00:00
Liam Girdwood a1e35a2148 lock: debug: Improve and document lock debug trace output.
Make it easy to find deadlocks and lock holders in atomic and non
atomic contexts.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-15 21:15:51 +00:00
Liam Girdwood c43989b95a ipc: buffer: Add HDA stream tag to stream parameters.
Add the HDA stream tag to the IPC stream parameters.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-15 21:15:34 +00:00
Keyon Jie 57be70b31d scheduler: ignore the ignored tasks
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-11-15 20:49:50 +00:00
Seppo Ingalsuo 1b5c3ecce9 Volume: Remove channels mapping via channel map array from volume control
This patch removes the channel map table lookup from all volume control
since it is not used by the SOF 1.0 driver. Instead of enum channel
descriptors the channels are addressed with indices in
0..<number of channels -1> range.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-11-15 20:44:45 +00:00
Pierre-Louis Bossart b8fd49af3a ssp: clean-up register setup
Clean-up register configurations for SSCR0..5, SSPSP, SFIFOTT

The results are ok in I2S and LEFT_J 24 bits
Tested with RT5645 and DA7212

TODO:
1. fix 16 bit issue (right channel lost)
2. test DSP modes
3. connect SSP and DMA watermarks

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-11-15 20:35:20 +00:00
Pierre-Louis Bossart f945809917 sof: fix spelling mistakes in comments
M-x ispell-comments-and-strings
:set spell spelllang=en_us

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-11-10 16:45:35 +00:00
Pierre-Louis Bossart 95a7e13fa2 dma: dw: reorder register definitions by sequential address
Cosmetic change, for some reason the register definition was not
sequential as in the data sheet

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-11-10 15:30:24 +00:00
Pierre-Louis Bossart df1de7a0a4 sof: protect macro parameters
Make sure all macro parameters are protected with parentheses to avoid
unintended expansion issues

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-11-10 15:30:24 +00:00
Keyon Jie 69f3029c8a dw-dma: fix element might be used uninitialized issue
The dma_sg_elem might be used uninitialized if the callback
function forget to do that.

Here adding initialization to fix that.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-11-10 15:30:24 +00:00
Yan Wang 9155f50c03 Fix DMA host offset calculation and wrapper condition checking.
1. "size" should not be considered twice.
2. Change host_offset to uint32_t type.
3. size = min(hsize, lsize), so it is unncessary to check ">"
for wrap local and host buffer.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-11-10 15:30:24 +00:00
Yan Wang eb2af44172 Send IPC message of DMA trace host update in DMA complete callback.
It is called every time DMA completes.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-11-10 15:30:24 +00:00
Yan Wang a3c73af857 Add API to send DMA trace host offset.
Fill IPC strucure by current host offset and send it.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-11-10 15:30:24 +00:00
Yan Wang c01584cdba Add IPC new message type and structure for sending DMA trace host offset.
It is used to update DMA trace host offset to kernel for realtime
output DMA trace.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-11-10 15:30:24 +00:00
Liam Girdwood 2a015d0df2 ipc: fix comp variable naming to match use case
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-08 16:26:57 +00:00
Yan Wang da1d49c73c Move DMA tracing intialization calling.
Move it from ipc handler into platform_init().
It should be placed after IPC and DMAC initialization.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-11-08 10:26:18 +00:00
Keyon Jie b791cc96a3 volume: fix 16_to_24 right channel wrong issue
The right channel was set duplicated to the left
channel, here correct it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2017-11-07 08:39:41 +00:00
Ranjani Sridharan caaab6c059 Replace user-defined 32-bit and 16-bit MAX and MIN values
Replace the user-defined MAX and MIN values for 32-bit and 16-bit
with standard INTN_MAX/INTN_MIN macro

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2017-11-06 11:47:45 +00:00
Pierre-Louis Bossart 8b299ceb59 Revert "Move DMA tracing intialization calling."
This reverts commit 97addafa10.

git bisect tells me this is the source of IPC timeouts, 100% reproducible

[  162.496099] sof-audio sof-audio: error: ipc timed out for 0x90010000 size 0x18
[  162.496590] sof-audio sof-audio: error: cant set params for DMA for Trace-110
[  162.496636] sof-audio sof-audio: error: failed to initialize trace -110
[  162.808132] sof-audio sof-audio: error: ipc timed out for 0x30010000 size 0x3c

The same errors were also reported by Sven Schwermer on the mailing list
on a Tangier device, revert until we figure out what's wrong.

Cc: Sven Schwermer <sven@svenschwermer.de>
Cc: Yan Wang <yan.wang@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-11-02 20:03:43 +00:00
Liam Girdwood 2dac794a89 cht: src: use small SRC coefficient set for CHT.
Standard set is too big for CHT memory.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-02 20:03:12 +00:00
Liam Girdwood aa66a3a52e cht: fix SSP IRQ sharing
SSP 0,1,2 on CHT share the same physical IRQ as SSP 3,4,5 respectively.
Fix this so that all SSPs IRQs are supported.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-11-02 19:57:14 +00:00
Seppo Ingalsuo 41075ebdec Volume, FIR EQ, IIR EQ, tone: Fix SOF_CTRL_CMD_SWITCH polarity
This patch inverts the use of switch value. A non-zero value
unmutes the audio path.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-30 16:39:55 +00:00
Seppo Ingalsuo 2b3f0abd15 EQ IIR: Update control IPC
The previous patch for SOF updated component IPC commands and provided an
ABI for configuration and control. This patch updates the IIR equalizer
to use such controls.

Also the missing COMP_STATE_READY from method new() is added. Lack of it
caused pipeline prepare fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-20 22:12:00 +01:00
Seppo Ingalsuo 26aa4aec16 EQ FIR: Update control IPC
The previous patch for SOF updated component IPC commands and provided an
ABI for configuration and control. This patch updates the FIR equalizer
to use such controls.

Also the missing COMP_STATE_READY from method new() is added. Lack of it
caused pipeline prepare fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-20 22:12:00 +01:00
Seppo Ingalsuo 7dc4fb1b7c Tone: Fix control ipc and add support for independent tones in channels
The control interface is fixed to follow the component ABI. Separate tone
generator instances are used to feed individual channels. It allows
simultaneous testing of all channels by use of different tone frequencies.
To simplify features there is no mixer so e.g. DTMF telephony UI sounds
generation would need a channel mixer component after a two channel tone
output in the pipeline.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-20 22:12:00 +01:00
Seppo Ingalsuo d7edf1068e Volume: Replace SOF_CTRL_CMD_MUTE/UNMUTE with SOF_CTRL_CMD_SWITCH
Due to previous patch the volume mute is updated to be controlled with
SOF_CTRL_CMD_SWITCH that maps to ALSA switch style control. Mute for a
channel is set with an (unsigned) value larger than zero. Zero value
unmutes the channel.

In both mute and volume set code the if statement to compare component
channel map is changed to compare to chanv[j].channel instead of used
chanv[j].value that looks incorrect.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-20 22:12:00 +01:00
Seppo Ingalsuo b32f643914 IPC: Add new enum commands and an index into control data struct
This patch adds to struct sof_ipc_ctrl_data three new commands
SOF_CTRL_CMD_ENUM, SOF_CTRL_CMD_SWITCH, and SOF_CTRL_CMD_BINARY. In
addition an index parameter is added to address various features or
registers.

Commands SOF_CTRL_CMD_ROUTE, SOF_CTRL_CMD_SRC, SOF_CTRL_CMD_LOOPBACK,
SOF_CTRL_CMD_EQ_SWITCH, SOF_CTRL_CMD_EQ_CONFIG, SOF_CTRL_CMD_MUTE, and
SOF_CTRL_CMD_UNMUTE are removed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-20 22:12:00 +01:00
Seppo Ingalsuo 4b007cb638 SRC: Use a multi-channel FIR core to optimize speed plus other cleanup
This patch changes the sample rate conversion processing to use a single
multi-channel filter instead of per channel called mono filter instances.
The filter output is now rounded with 1/2 LSB add. The polyphase filter
input input block sizes are multiplied in SRC initialization to reach
near to or exacly the period length to reduce polyphase filter call
overhead.

The polyphase filter is now called via function pointer for more
flexibility with audio data formats. Currently S32_LE and S24_4LE are
supported.

Code cleanup includes removal of redundant variables and some debug
print code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2017-10-20 22:08:33 +01:00
Yan Wang 97addafa10 Move DMA tracing intialization calling.
Move it from ipc handler into platform_init().

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-10-20 22:03:47 +01:00
Yan Wang 0156aa6865 Move DMA tracing implementaion from src/audio to src/lib.
1. Move source and header file.
2. Change src/lib/Makefile.am and src/audio/Makefile.am.
3. Chnage header file path.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2017-10-20 22:03:47 +01:00
Ranjani Sridharan 034b06f43a volume: fix for DC offset and handling of sign extension for 24-bit samples
This patch fixes the DC offsets introduced in the volume component
due to shifts and handles sign extension for 24-bit input samples

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2017-10-20 08:54:44 +01:00
Liam Girdwood 7c16d2cd38 comp: remove unused list in struct component.
Not used so remove.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-20 08:40:35 +01:00
Liam Girdwood 8fe770c8dd debug: locking: Add crude deadlock analysis around locks
Add a simple trace method to output lock users and detect any sleeping
during atomic context. The intention is to provide simple trace data
that can be used to pinpoint any deadlocks or attempts to sleep whilst
atomic.

Future: The trace output in that patch can be improved to provide easier
lookup for lock users rather than line numbers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2017-10-19 17:32:42 +01:00