Commit Graph

4563 Commits

Author SHA1 Message Date
Adrian Bonislawski 8d7274e911 probes: Implement injection probe flow
Implement probes injection capability for several probe points

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-26 16:25:02 +00:00
Adrian Bonislawski 9d25e1984a probes: Implement extraction probes flow.
Implement buffer lifecycle callbacks to properly handle extraction
from probe. Implement probe data packet header generation and sending
it along with data from buffer via extraction DMA.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-26 16:25:02 +00:00
ArturX Kloniecki 1ec9b0786b probes: Implement lifecycle functions of probe subsystem.
State of probes subsystem is being updated and properly reported back
via INFO functions. DMA is being set up to perpare for transfer of
probe data.

Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-26 16:25:02 +00:00
Tomasz Lauda 4cf57469b3 ipc: set buffer to inter-core
Sets buffers to inter-core if they are connecting components
from different cores. From now on FW supports pipelines,
where some of the components are offloaded to slave cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda cf6e2cd6a3 component: call copy for own components
Component copy function should be called only if
component is owned by current core.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 46a1db20a8 component: add operations for remote components
Implements remote operations for params, prepare, trigger
and reset calls. If the target component is running on
different core, we should send IDC in order to execute
appropriate operation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda fee7c07ef3 audio: lock buffers where needed
Adds buffer locking and unlocking in audio components
where it's needed. We need to retrieve the latest values
of available and free sizes in copy functions and also
use lock in case of making changes in params and prepare
methods.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 0bd252253e audio: invalidate and writeback buffers where needed
Calls buffer_invalidate and buffer_writeback in audio components
processing functions. It is required to achieve data synchronization
in case buffers are inter-core.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda cf774d14e2 buffer: extract invalidate and writeback functions
Extracts buffer content invalidation and writeback functions.
They are always used for DMA buffers and also need to be used
for inter-core buffers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 6a754bb5da component: change comp_get_copy_limits implementation
Changes implementation of comp_get_copy_limits function.
It now takes source and sink buffers, so they can be
available outside of the function. It will matter with
inter-core buffers, when synchronization will need to be kept.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda e3a6efd8e7 buffer: use locks for inter-core buffers
Implements locking and cache synchronization for buffers,
which are connecting components running on different cores.
We need to explicitly use cache here (if platform supports it),
so the shared API cannot be used in this particular case.
Shared is going through uncached area on cAVS platforms,
but it's too slow in the case of frequent buffer accesses.
Also loop in pipeline_set_params has been changed to avoid
unnecessary cache accesses after unlocking the buffer.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 9200a11baf buffer: add inter_core field
Adds inter_core field to the buffer struct. This property
indicates whether buffer is connecting components from
different cores e.g. high demanding in terms of cycles
processing component running on core 1, but connected to
the rest of the pipeline, which is running on core 0.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 0a4b7b4236 buffer: add locking mechanism
Adds locking mechanism to buffer. It will help with
synchronizing buffer accesses by multiple cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda de0a0b85c5 component: add task when scheduled on different core
Adds separate task to components, which are supposed to be scheduled
on different core than the rest of the pipeline. These are so called
shared components. This way components requiring huge processing power
can be offloaded to slave cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda ec15c0ac38 component: implement component sharing functionality
Implements component reallocation in shared memory. This way
cores can share components, which are part of one core's pipeline,
but runs on other core.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 8b6afc8371 component: add size
Adds component's allocated size to comp_dev structure.
Since most of the components have different sizes, this field
helps with potential reallocation of the component.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda d973410af9 idc: implement messages for controlling components
Implements IDC messages for controlling single components
running on slave cores. It will allow to create topologies,
where the whole pipeline is running on one core and some
processing component is running on other core due to
cycles limitation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 3b3cc2fe4a idc: implement message status retrieval
Implements new IDC functionality to report execution status
of last processed message through payload buffer. Core which
waits for IDC to be finished can retrieve the status from
the beginning of the payload. Message status can only be
obtained in IDC blocking mode.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Tomasz Lauda 4b9cad28bf idc: add possibility of sending payload
Implements IDC message payload functionality. It is now possible
to send additional large data, when sending IDC to other core.
Maximum size of payload has been set to 96 bytes, but can be easily
extended if needed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-26 16:14:28 +00:00
Daniel Baluta 8780a88876 topology: Add topology for i.MX8MP with wm8960 codec
This pipeline adds support for S32_LE, 2 channels, 48KHz
playback/record.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-26 18:11:41 +02:00
Daniel Baluta d4c0a52f15 platform: dai: Use index 3 for SAI3
This is no real requirement from SOF to match the index of DAI
with the "real" index in hardware.

Anyhow, it looks like topology concatenates the index to form names
so would be weird to see e.g DAICONFIG.SAI0_data for SAI3.

In order to avoid this confusion we use index 3 for SAI3.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-26 18:11:41 +02:00
Daniel Baluta 86752f6daf CI: travis: add IMX8M build check
Enable imx8m build check in travis.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-26 13:46:16 +00:00
Diana Cretu 9e91739b18 rimage: Fix DRAM_BASE address for i.MX8M
As per xtensa configuration mmap, DRAM_BASE is 0x3b6e8000.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
2020-02-26 15:26:44 +02:00
Daniel Baluta ade9145e7c CI: travis: Add boot test for i.MX8
imx8 is now supported in qemu up to boot. So, add
it to boottest list.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-26 13:11:21 +02:00
Diana Cretu ca352dbfb7 scripts: qemu: Add qemu check for i.MX8 platform
Enable checks to i.MX8 platform of QEMU now.
Check both IPC header regs and memory window IPC message header.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
2020-02-26 13:11:21 +02:00
Bartosz Kokoszko 1966065ae9 dai: ssp: refines ssp get_hw_params functions
FOR ssp channels parameter can be different for
PLAYBACK and CAPTURE and it depends on tx_slots and
rx_slots config variables. This commit utilizes those
variables in get_hw_params() function in order to
return hardware stream parameters correctly.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-26 10:56:42 +00:00
Bartosz Kokoszko d24a703238 comp: add dir arg to dai_get_hw_params function in comp_ops
Hardware stream parameters can be different for
PLAYBACK and CAPTURE direction. dai_get_hw_params()
should return parameters corretly depending on
the stream direction.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-26 10:56:42 +00:00
Bartosz Kokoszko 93df75806f dai: add dir arg to get_hw_params function in dai_ops
Hardware stream parameters can be different for
PLAYBACK and CAPTURE direction. get_hw_params()
should return parameters correctly depending on
the stream direction.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-26 10:56:42 +00:00
Karol Trzcinski a6726cf2d8 dw_dma: Remove redundant write pointer increment
Function dw_dma_increment_pointer is called in each
dw_dma_copy and moves write pointer by number of passed
bytes a priori. Its why this function shouldn't be called
after dma stops before whole transmission ends.
It leads to misalignment in data stored in any queue between
source buffer and output, with data written to this interface
and glitch when first data after release command come.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-02-25 12:22:28 +01:00
Tomasz Lauda 5120b99721 detect_test: guarantee sending detection notification to host
This patch guarantees detection notification message sending
by preallocating message structure and sending this particular
IPC instead of sending first message from the queue.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-25 08:45:11 +01:00
Tomasz Lauda df917e0231 ipc: extract method for message preparation
Extracts method for IPC message preparation.
More granular approach is needed for upcoming changes
regarding detector notification sending.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-25 08:45:11 +01:00
Tomasz Lauda 9e0b2e5726 ipc: extract method for sending chosen message
Extracts ipc method for sending chosen notification message.
Standard function takes first message from the queue,
but we would also like to send notification of our choice.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-25 08:45:11 +01:00
Tomasz Lauda 51bc11090a library: build missing file
Builds spinlock source file for library.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-25 08:45:11 +01:00
Seppo Ingalsuo 8b595069dc Fuzzer: Fix build fail for missing ASRC loader
This patch adds load of ASRC component to successfully build
the Fuzzer. The common topology parser with testbench depends
on load_asrc() function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-24 11:51:10 +00:00
Bartosz Kokoszko 1d273c3a9f eq_iir: add supported formats check in verify function
We should check whether we can support frame_fmt conversion
due to source and sink buffer frame_fmt's. If not, we should
overwrite sink (playback) and source (capture) with pcm
frame_fmt and not make any conversion (sink and source
frame_fmt will be equal).

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-23 21:42:28 +00:00
Bartosz Kokoszko fc8d348589 eq_fir: refine eq_fir_verify_params() function
eq_fir component is not able to change stream format, so we
should invoke comp_verify_function() with flag equal to 0.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-23 21:42:28 +00:00
Bartosz Kokoszko dd09f02cd5 eq_fir: remove unnecessary code in prepare() function
We do not have to rewrite source/sink frame_fmt. It has been
set in eq_fir_verify_params() function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-23 21:42:28 +00:00
Bartosz Kokoszko 9646cdad36 eq_iir: remove unnecessary code in prepare() function
We do not have to rewrite source/sink frame_fmt. It has been set
in eq_iir_verify_params() function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-23 21:42:28 +00:00
Seppo Ingalsuo 7dd11a96c6 Topology: Remove ASRC DMIC capture demo topology
The DMIC capture is added to APL ASRC PCM512x topology so this
topology can be removed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-23 21:34:40 +00:00
Seppo Ingalsuo ac0b79dad9 Topology: Add capture pipelines to APL ASRC PCM512x demo topology
Since the new sof pcm512x machine driver supports the DMIC backend
it's practical to move the ASRC capture pipelines into this topology
to avoid need to change into nocodec mode for ASRC capture tests.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-23 21:34:40 +00:00
Seppo Ingalsuo 327631d089 Topology: ASRC: Fix mistake with source and sink buffers count
This patch fixes the apply of DAI_PERIODS for playback sink
and capture source buffers. Also the comments for components
instantiating are fixed to order sink, source as they are
in the parameters to avoid confusion.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-23 21:34:40 +00:00
Daniel Baluta 569dc48ddf generic: dummy-dma: Fix return value signedness
dumm_dma_copy_crt_elem and dummy_dma_do_copies functions
may return negative values but their definition says the
return value is unsigned.

Fix function definition to account for negative values.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-23 21:13:28 +00:00
Daniel Baluta 865f964b28 generic: dummy-dma: Remove commented code
This is a relict of an older implementation, remove it
to make code easier to read.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-23 21:13:28 +00:00
Daniel Baluta c35e1aa674 host: Fix compilation error with verbose traces enabled
src/audio/host.c: In function 'host_dma_cb':
src/audio/host.c:210:46: error: initialization of
'unsigned int' from 'const struct comp_driver *' makes integer from
pointer without a cast [-Werror=int-conversion]
  comp_cl_dbg(&comp_host, "host_dma_cb() %p", &comp_host);

This happens because our tracing system is limited to integer types
for parameters.

Fixes: a87b908505 ("trace: component: use err,info,dbg macros")
Suggested-by: Paul Olaru <paul.olaru@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-20 21:55:21 +00:00
Daniel Baluta 22de787f1f scripts: update sof_builder docker with imx8m support
Add imx8m cross compiler in sof_builder docker build file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-20 21:45:59 +00:00
Paul Olaru 135cace39a platform: imx: Add Kconfig option for i.MX EDMA driver
Not all i.MX platforms have EDMA for DMA controller. So make it a
Kconfig option.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-02-20 11:38:28 +00:00
Marcin Maka 247af133b8 comp: init back ptr to driver early in new
Back pointer must be initialized before any instance
level logging is performed by the new() operation since
the instance identification requires access to the uuid
that will be implemented on the component driver level.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 20:51:58 +00:00
Marcin Maka b1dd2a289d kpb: fix trace call
Missed drv pointer as the first parameter

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 20:51:58 +00:00
Marcin Maka 11de89f0f9 asrc: fix trace call
Missed drv pointer as the first parameter

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 20:51:58 +00:00
Mohana Datta Yelugoti 85a7e1883f include: ipc: control: Remove trailing whitespace
This patch fixes "ERROR: trailing whitespace" generated
by checkpatch.pl by removing trailing whitespace in the
file.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-02-19 21:18:03 +02:00