Capture pipelines must wait for the DAI to fill one period of data
before they can be scheduled. This avoids underruning the pipeline.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The DMA linked list descriptors must be written back from cache so that
the DMA engine can read them.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
pipeline_copy down stream will return 0 instead of the component copy()
return value when an endpoint is reached. Make sure we return the
component value.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Toolchain(xtensa-root) should be installed in the same layer with
the SOF repo, but maybe not in ~/source/reef/ folder.
Here correct it by using relative path.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Host message queue is long sometimes. So when one new IPC message like
DMA trace host offset is pushed into, the previous same type IPC message may
haven't been sent.
For every type of IPC message, there are different comparison conditions.
So need a group of sub-finding functions to do and user also can extend them
easily based on new requirements in the future.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
We only need handle host page tables on platforms that we
program DMA host buffer(addr/size) inside firmware, for
other platforms, host driver will program these settings
and won't pass in page tables.
So here add frag CONFIG_HOST_PTABLE to configure this for
different platforms, on Baytrail, Cherrytrail, we need
CONFIG_HOST_PTABLE to be selected.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
For debug reason, e.g. DMA trace doesn't work or not implemented
yet, we can use --disable-dma-trace in configure command line,
which will unset CONFIG_DMA_TRACE flag, and it will fallback
to use traditional mailbox trace instead.
The flag is set by default, if we don't add '--disable-dma-trace'
to configure command.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This patch prevents SRC to stall due to too demanding criteria of
function comp_buffer_can_copy_bytes. Since the input and output rate and
period length of SRC are different for source and sink both buffers do
not need to meet both criteria.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
When trace_error() is used to save error information into trace buffer,
the firmware may not in normal state and some spin lock be still locked.
So it may cause dead lock if trace_error() still uses non-atomic API
with spin lock.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Cherrytrail SSP settings were the same as Baytrail but the SSP root
clock is different. To use 19.2MHz the Xtal source needs to be selected
Also add definition for SSP @ 25 MHz - even if it's unlikely to ever
be used
Tested on Up board and Cyan Chromebook.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The purpose of checking half fullness is sending trace data as soon as
possible. It will avoid local DMA trace buffer full and unsent trace data
overwritten.
If DMA trace copying is running currently, it is unnecessary to checking
half fullness local DMA trace buffer.
The following is implementation details:
1. Add one flag in DMA trace data strcuture.
2. Set/unset this flag in trace_work() callback.
3. Add checking for this flag in dtrace_event().
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
This patch fixes a regression that caused SRC to try to initialize
for a mode that has been disabled from in/out rates matrix. The feature
exist to save tables RAM with modes those are not required. The bug
caused a divide by zero to happen in src_buffer_lengths() function.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>