The function getpid() is only available in Octave. Instead use
a random integer number as identification to avoid conflict with
possible several simultaneous simulations with temporary files.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The case where blob decoding is requested for single frequency,
e.g. 1 kHz the magnitude and group delay vectors did not have
size of one frequency. This patch fixes the issue.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the response for both EQ types into loudness
shape (bass boost, mid attenuate, high boost) that is a useful
in validating EQs functionality. The previous flat response does
not exercise thoroughly the processing functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds for SRC component rate conversion filters coefficients
set selection to Kconfig. The menu entry allows to select a 16 bit or
32 bit set.
The default for Apollolake is changed to 16 bits to free up .bss for
other development. There's no known critical usage for SRC so the
lower quality and less conversions available should be acceptable.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Both SDMA2/SDMA3 can move data from SDRAM to Peripherals. Anyhow, SDMA2
is traditionally used by non-DSP use case, so switch to SDMA3 to allow
for future use cases where we could have a scenario with multiple Audio
perhipherals running in parallel.
This also aligns the code with legacy firmware.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
All trace entries are identified by uuids only now.
Previous TRACE_CLASS_ identification removed completely.
UUIDs are passed to the tracing subsystem inside a trace
context. Each trace context defines run-time log level.
The level is initialized to LOG_LEVEL_INFO (this may be
change per instance is needed) and may be re-configured
at run-time.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Define missing uuid for mux comp driver.
There are two component types, so two different uuids must
be defined.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
We should not explicitly cancel pipeline task on xrun.
Xrun is handled by different functions and task state
flow will be handled by START and STOP commands.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
We should not be scheduling ramping as a separate task.
This patch makes it a part of copy function, which allows
for removal of entire schedule related code.
Ramping is done in maximum of 1 ms chunks by using functions
for retrieval of nearest zero crossing frame.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements functions for getting nearest zero crossing frame.
They will be used to reduce zipper noise during volume ramping
by updating ramp only on such frames. In the current implementation
average value of all channels is used to check sample sign change.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
With define for W_PCM_CAPTURE only need 5 arguments
W_PCM_CAPTURE(pcm, stream, periods_sink, periods_source, core)
Fix the wrong parameter in pipe-kfbm-capture.m4
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
We need to make sure that backend memory is updated for
desc/ccb/ctx because they are modified in sdma_prep_desc.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This logs are not very useful as SOF core calls this function
for all 32 channels, thus not providing much information.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Desired design of data copy uses 2 BD linked in a cyclic way.
This 2 BDs will act as a ping-pong buffer.
When a DMA channel is active the SDMA script will run and will look
for a BD with BD_DONE bit set. This means that BD is ready for transfer.
When SDMA transfer the current BD, pipeline works on filling the next
BD.
In order to implement this, we introduce next_bd which keeps track
which is the next BD to be made ready for SDMA.
Also, signal DMA_COPY notifier to prepare next BD for transfer.
Because, now only one BD is ready for transmit notice that in sdma_copy
function we get rid of the loop iterating over all BDs and just set
BD_DONE flag only to next_bd ready to be run.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This is part of the initialization process, where
we make sure no channel is ready to run until all
configuration is done.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
MC0PTR is the address of the first control block. Keep this
0 until everything is configured properly.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
sdma channel type can also be _MCU2SHP/_SHP2MCU but this
case was missed from sdma_status.
Fix it now.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
For i.MX8MP the MCLK that enters codec is generated by SAI MCLK pin.
To allow this we need to configure MCLK pin as output.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
If the channel is enabled before data is pushed to FIFOs, there is a small
chance to race here causing an underrun for Tx.
So, in order to avoid this add zeroes to FIFOs before actually enabling
the channels.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
CHMOD configures transmit data pins for:
- 0b, TDM mode transmit data pins are tri-stated when slots are
masked or channels are disabled.
- 1b, Output mode, transmit data pins are never tri-stated and
will output zero when slots are masked or channels are disabled.
We noticed that when data pins are tri-stated, there is noise on
some channels when FS clock value is high and data is read while
fsclk is transitioning from high to low.
So, select CHMOD to output mode so that pins will output 0.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This patch limits number of bytes copied from DMA source
to maximum of one period size per one copy. This does not
change anything for DMA driven pipelines, but only for
timer driven. This limitation is to avoid high peak of MCPS
during copy, especially first one, where we usually have
two periods of data ready. Having some demanding processing
component on the pipe can end up in xrun if the MCPS limit
is exceeded.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Increases number of linked list items for platforms supporting
hardware linked list. For timer based scheduling and multiple
pause/release sequences there could be such situation, where
three linked list items are not enough.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This is information is known during compilation time,
so it should be passed by extended manifest.
Reuse sof_ipc_probe_support struct to make parsing function
from host side as much universal as possible.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This information is known at build time so should
be passed by extended manifest.
Introduced structure is designed to be fully compatible
with information provided through mailbox to make
parsing code on host side as much reusable as possible.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Include such an information in extended manifest, to make it accessible
from host side before firmware load and run.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Extended manifest is a place to store build time known firmware
metadata, for example firmware version or used compiler description.
Given information is read on host side before firmware startup.
This part of output binary is located as a first structure in binary
file.
Extended manifest should be skipped in firmware loading routine.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This section will be used to store information about firmware known
during compilation time.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Implements multicore synchronization mechanism for Host DMA L1 Exit.
Simple reference counter is added to avoid a situation, where shorter
processing on one core forces Host DMA bus to exit L1, when there is
still transfer happening on other core. PM_RUNTIME_HOST_DMA_L1 with get
is called in new NOTIFIER_ID_LL_PRE_RUN notification event.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Improves host component performance by extracting DMA L1 exit
to be executed commonly for all active DMA channels as registered
callback in low latency scheduler for timer domain. There is no
need to wait so many cycles for every channel separately.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds irq_local_disable/enable during notifier_register
and notifier_unregister calls to protect notify list
from preemption.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements handling of new notifier aggregate flag.
With this flag set the notifier will automatically use
existing handle instead of creating a new one. It's helpful
when we want to register only once for an event, but it's
very hard to explicitly keep track of number of registrations.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
For running channel0 we only need 1 BD so remove BD_CONT flag.
Also, interacting with channel0 is done through polling so remove
BD_INT flag.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
When the direction is DMA_DIR_MEM_TO_DEV it means that
we just got rid of some bytes so *free must be reported.
When the direction is DMA_DIR_DEV_TO_MEM it means that
we just received some bytes so *avail must be reported.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We extract this information from config->direction. This makes
code easier to understand.
Notice here that we add BD_DONE for all cases, and remove BD_EXTD
as it doesn't make sense for device2memory and memory2device.
Will have m2m case later, it is not yet supported.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Save earlier fifo_paddr thus to reduce one level of indentation.
Also, get rid of src_may_change and dst_may change as we can
use config->direction instead.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
sdma_set_config is a very long function and hard to read
and understand.
In order to make this easier to understand we factor some code
into proper functions.
So, we introduce:
* sdma_read_config, reads and verifies config received from SOF
core
* sdma_prep_desc to prepare sdma descriptor.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Disables panic emitted by system agent on timer delay, when there
are DMA driven pipelines scheduled on the DSP. With such pipelines
running, timer interrupts can be delayed pretty often, so just
emit warning instead of full panic.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds additional functionality to system agent that allows
to enable and disable panic on delay when necessary.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch enables a single 1 - 2 kB allocation for component
runtime. The disabled 2 kB pool entry caused ASRC component
to fail in some cases.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the race condition in the draining
task in which KPB was waiting for sink component to
free space in its input buffer while this component
was waiting for KPB to call its .copy() method
again. This problem has deeper underlying cause,
namely the lack of DMA IRQ which should signal the
end of transaction.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This tool must be able to read extended manifest content
and move to next manifest in proper way.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>