Commit Graph

6805 Commits

Author SHA1 Message Date
Rander Wang 2ebe36aedd topology2: add volume support for ipc4
Volume is supported by gain module in ipc4. We need
to set curve_type, curve_duration and init_val for
this module.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-07-30 22:44:31 +01:00
Rander Wang 884bfdf125 topology2.0: add some basic class definitions
Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
2021-07-30 22:44:31 +01:00
Pierre-Louis Bossart 6daab998e6 Revert "pipeline: trigger START from the task context"
This reverts commit 9a7a5ce17d.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-07-30 15:25:09 -05:00
Pierre-Louis Bossart 158bb9e454 Revert "trace: move CONFIG_TRACEM implementation up a couple levels"
This reverts commit 0def905630.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-07-30 15:25:09 -05:00
Pierre-Louis Bossart 9410e84de2 Revert "trace: add _log_nodict() and enable DMA trace for Zephyr"
This reverts commit 57ee04f2d9.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-07-30 15:25:09 -05:00
Daniel Baluta 53718867df topology: imx8mp: Add compress decoding pipeline for i.MX8MP with aac/mp3 codecs
Add topology to support compress playback for MP3/AAC
on i.MX8MP with wm8960 codec.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-07-29 16:07:28 +03:00
Daniel Baluta 64be6a6578 topology: imx8: Add compress decoding pipeline for i.MX8/i.MX8X with aac/mp3 codecs
Add topology to support compress playback for MP3/AAC on i.MX8/i.MX8X
with wm8960 codec.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-07-29 16:07:28 +03:00
Guennadi Liakhovetski 1e037398a5 zephyr: ll-domain: set .next_tick into the future
.next_tick is updated on each timer run to the time of the next run.
Instead the current version sometimes only updates it to the current
time. Fix the update condition.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-07-28 20:49:48 +01:00
Zhang Peng 45ec1de686 platform: Add build support for i.MX8ULP
This integrates i.MX8ULP build into SOF.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Zhang Peng 324fb772a3 configs: Add default config for i.MX8ULP
This enables i.MX8ULP platform.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Zhang Peng 42716054c3 platform: imx8ulp : Add xtensa headers
This files are provided by Cadence and we use them as they are.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Zhang Peng 1707026ba2 platform: Add support for i.MX8ULP platform
i.MX8ULP platform integrates HIFI4 DSP running at 528MHz.

This patch adds support for platform drivers and general
platforminitialization.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Zhang Peng 8e068225f4 drivers: imx: Add new file interrupt-generic.c
Add the file for the platform without irqsteer. Now if the platform
have irqsteer we choose interrupt-irqsteer.c, if not then we choose
interrupt-generic.c

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Zhang Peng a2cf957af4 drivers: imx: ipc: Make MU support imx8ulp
Make mu implementation generic. imx8ulp platform has a new version
of mu, then update mu for preparing to support imx8ulp.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Guennadi Liakhovetski 9a7a5ce17d pipeline: trigger START from the task context
When the firmware receives a START or RELEASE IPC message, it
immediately triggers all involved components, which starts DMA.
Then it schedules the pipeline task, but since the scheduler can be
already running at that time, the task might be scheduled when DMA
data isn't available yet or has already overflowed. To fix this
change the control flow to also trigger all components from the task
during its first run. Actual data processing then begins with the
next period. Note, that this is currently only possible with
pipelines, using timer-based scheduling. Pipelines, using DMA
interrupts for scheduling are unaffected.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-07-27 14:56:24 +01:00
Guennadi Liakhovetski 886b7ee403 pipeline: (cosmetic) use bool type, adjust line lengths
Use bool type for boolean flags, split some too long lines, merge
some needlessly split lines.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-07-27 14:56:24 +01:00
Guennadi Liakhovetski e879e954ad pipeline: (cosmetic) simplify pipeline_task_init()
pipeline_task_init() is always called with pipeline_task as its last
parameter. Remove the parameter and use the function explicitly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-07-27 14:56:24 +01:00
Iuliana Prodan 6556933e83 xtensa-build-zephyr: add imx8 platform
Add imx8 platform for local testing.

TODO: Update xtensa-build-zephyr.sh when Zephyr repo
is updated with imx8 support.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Iuliana Prodan 214518edea zephyr: wrapper: add notifier_register(ipc_send_queued_msg) for SOF_SCHEDULE_LL_DMA
In XTOS SOF, ipc_send_queued_msg() is run by task_main_primary_core().
In Zephyr we need to schedule ipc_send_queued_msg() using a notifier
triggered by the periodic ll_scheduler.
This is similar to commit c194125b83 ("zephyr:
add notifier_register(ipc_send_queued_msg) in task_main_start()")

For i.MX we need to use this temporary fix for SOF_SCHEDULE_LL_DMA, also.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Iuliana Prodan 65a33a537c zephyr: imx: enable second level interrupts handling
On i.MX the DMA interrupts are routed via IRQ_STEER.
In order for this to work we need to:
- make any second level interrupts handling go
through interrupt-irqsteer.c;
- use first level interrupt handling from
wrapper.c.

TODO: Implement a driver for the IRQ_STEER in Zephyr,
to replace the legacy code (interrupt-irqsteer.c).

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Iuliana Prodan daa122f7c2 zephyr: imx: use ll_schedule instead of zephyr_ll
For now, zephyr_ll is limited to timer_domain.

For i.MX we use dma_domain, so keep the ll_schedule
from SOF, until we extend the zephyr_ll for DMA_IRQ.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Iuliana Prodan b96077cde0 zephyr: intel: remove zephyr_ll from mandatory files
Remove zephyr_ll.c from mandatory files for building
SOF with Zephyr and include it where necessary: in CAVS 1.5,
CAVS 1.8, CAVS 2.0 and CAVS 2.5.

While here, add ll_schedule for BROADWELL and BAYTRAIL
when building SOF with Zephyr.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Marc Herbert 57ee04f2d9 trace: add _log_nodict() and enable DMA trace for Zephyr
As of July 2021 we support (too) many tracing options and this
duplication is unfortunately the only way I found to support them all
while giving the compiler the opportunity to optimize away as many
strings as possible.

Supported configurations:

- Systems with limited memory and zero space for full strings, must use
  SOF dictionary only.
- Systems with enough space for all strings to be in memory.
- Anything in between

- Support to duplicate only important message to both the DMA and the
  mailbox (the default)
- CONFIG_TRACEM: supports duplicating ALL messages to both the DMA and
  the mailbox
- CONFIG_TRACEV: supports deleting verbose statements at compile time to
  save space
- CONFIG_TRACE: support turning off all traces at compile-time

- SOF dict trace de-duplication a.k.a. "adaptive filtering"

- Dynamic log levels per component

- Redirection to Zephyr's shared memory tracing that requires full strings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 19:41:55 +01:00
Marc Herbert 0def905630 trace: move CONFIG_TRACEM implementation up a couple levels
From deep down trace.c:va_tracelog() up to the _log_message() level.

Also rename va_tracelog() to the more specific dma_tracelog()

Preparation to support the DMA trace in Zephyr.

The only functional change in this commit is that DMA messages copied to
the shared memory are not de-duplicated any more (a.k.a "adaptive rate
limiting" or CONFIG_TRACE_FILTERING_ADAPTIVE). These are generally
supposed to be high level hence rare enough; otherwise there is probably
a "bigger problem".

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 19:41:55 +01:00
Marc Herbert e1aa806d5c trace: add 'atomic' argument to mtrace_dict_entry()
Preparation to use mtrace_dict_entry() also the _log_message() level too
and not just for very early mtrace_printf() tracing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 19:41:55 +01:00
Marc Herbert b18ec17fc3 ipc3/handler.c: re-enable DMA trace for Zephyr
Reverts commit 74cacc3138 ("zephyr: ipc: dont enable DMA trace
transport.") modified by commit d7282762bc ("ipc3: don't declare unused
variables")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 19:41:55 +01:00
Marc Herbert a7abc03523 cavs/platform.c: don't guard trace initialization with #ifdef ZEPHYR
Because it's mostly working now and avoids macro nesting complexity;
there is already #ifdef CONFIG_DW_SPI #elif CONFIG_TRACE

Just for the record this is reverting a very tiny part of
commit cf8e35f860 ("zephyr: init: create a zephyr entry point in SOF.")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 19:41:55 +01:00
Marc Herbert b1c9e85896 zephyr_ll.c: declare missing ll_tr trace context
Commit a439ea93f6 ("zephyr: ll-schedule: switch over to a simplified
implementation") replaced ll_schedule.c with zephyr_ll.c when compiling
with Zephyr. So the struct tr_ctx named "ll_tr" is now missing. Declare
it in ll_schedule.c too.

No one noticed that ll_tr was missing because the DMA trace does not
work in Zephyr and the main branch yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 19:41:55 +01:00
Guennadi Liakhovetski 98e8016de0 ipc: let secondary cores acknowledge IPC messages
Currently when an IPC message arrives, the primary core receives the
interrupt, schedules a task and begins processing the message. If it
identifies, that the message is for another core, it sends an IDC
message to it and waits in a busy loop until the other core completes
processing the message and writes a response into the mailbox. After
that the primary core notifies the host about completing the
processing. This patch lets the processing secondary core notify the
host directly, which also frees the primary core to handle other
tasks instead of waiting in a busy loop.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-07-26 19:13:48 +01:00
Pin-chih Lin 6af9fc5cfe multiband_drc: Clean up source_format on component reset
Clean up all contents in component data on reset().

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-07-26 11:03:13 +01:00
Pin-chih Lin c9bed91e6d drc: Clean up source_format on component reset
Clean up all contents in component data on reset().

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-07-26 11:03:13 +01:00
Marc Herbert b63b8e992b .github: run unit tests with -DBUILD_UNIT_TESTS_HOST=ON
Because we can.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert 3ac8906097 unit tests: skip 'alloc' test when compiled on host
It is failing and skipped only when compiled on the host, runs fine with
xt-run.

This is temporarily needed to add host-based unit tests to CI now and
catch any regression in any other test now.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert a7c1c52420 scripts/run-mocks.sh: major refactor
Adds --error-exitcode=1 to valgrind options (otherwise what's the point
of using valgrind?)

Skip alloc test that does not pass on HOST (passes with xt-run)

Add help message.

Runnable from anywhere.

Use shell functions
https://github.com/thesofproject/sof-test/issues/740

Fix all quoting issues and other shellcheck warnings.

Add comments.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert c8b226b86f cmocka/cmake: add $SIMULATOR to fix "make test" on host
Before this it was required to find and run the executables one by one

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert f51a95b90d xtensa-build-all.sh: link to cmake docs on sof-docs
Link to the CMake section in sof-docs which documents a lot of what this
script does and is probably out of date now. It would be less out of
date if this link had been there and more people had been aware that
this documentation even existed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert c14a01e26d suecreek_gcc_defconfig: CONFIG_TRACE=n
This has been finding several pre-processing bugs already. Short of
randconfig some variety is the best we have.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert 589f035ad4 common_mocks.c: fix !CONFIG_TRACE build
Fixes 'no previous prototype for trace_log_filtered' -Werr and
redefinition of ‘trace_flush_dma_to_mbox’ error.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert 0ea32291ae qemu-check: document magic values, better logging and err. handling
Thanks Ranjani for finding most of these magic values.

Also move READY_MSG closer to the only place where it's used so it does
not look like a "global" anymore.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:17:46 +01:00
Keyon Jie 9648fb65a5 alloc: fix heap_trace() block start index
Fix and log the information of block 0 also.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-07-24 11:13:46 +03:00
Keyon Jie 3b81d513c4 pipeline-params: add heap debug support.
Show heap status update with every pipeline going to be run, when
CONFIG_DEBUG_HEAP is enabled. This will help to monitor the heap memory
usage status.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-07-24 11:13:46 +03:00
Kai Vehmanen 6328ec5000 zephyr: add tracing of ll-scheduler execution time
Add tracing of ll-scheduler execution time. Use k_cycle_get_32()
timestamps for minimal overhead. A trace is printed with a period size
of 2^10 scheduler executions (roughly once per second in typical
configuration with 1ms timer tick). Average and maximum observed
execution time is printed out for each task.

Additionally k_timer_status_get() is used to observe instances of
overruns. If the timer irq is fired before previous timer thread
invocation completes, overrun of the ll scheduling slice has occurred
and this is recorded. Number of overruns is printed for each measurement
window.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-07-23 16:33:04 +01:00
Seppo Ingalsuo e82392e246 Audio: Volume: Add state clear to reset() operation
This patch adds clear of all component data in reset() component
operation except state variables those are set by control
commands.

Note: If a new stream starts after reset() without free() and
new(), the clear of all component data would result to wrong
gain and wrong mute state. The driver commands are not re-sent
in such case.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-07-23 11:22:28 +01:00
Kai Vehmanen 93ea223a89 zephyr: add per-ll-task tracking of execution time
Add a lightweight layer to track execution time of ll tasks to the
zephyr-ll scheduler. Use k_cycle_get_32() timestamps for minimal
overhead. A trace is printed with a period size of 2^10 task executions
(roughly once per second in typical configuration with 1ms timer tick).
Average and maximum observed execution time is printed out for each
task.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-07-23 08:38:04 +01:00
Ranjani Sridharan 764a065193 topology1: sof-cavs-nocodec: Add deep buffer playback pipeline
on SSP5 for BXT and SSP0 for all others.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-07-23 08:34:36 +01:00
Ranjani Sridharan 56d1fe652c topology1: sof-cavs-nocodec: convert all playback pipelines to mixer-based pipelines
Convert all playback pipelines to have a mixer so adding a deep-buffer
pipeline will be simpler.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-07-23 08:34:36 +01:00
Ranjani Sridharan 808c4512c5 Revert "topology: cavs-nocodec: Add deepbuffer pipeline to SSP0 and SSP2"
This reverts commit a10b5dcf85.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-07-23 08:34:36 +01:00
Ranjani Sridharan 463c4afd10 Revert "topology1: sof-cavs-nocodec: Add the deep buffer PCMs"
This reverts commit 6516a8c89b.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-07-23 08:34:36 +01:00
Rander Wang 8ccfe50ab3 pcm_converter: add ipc4 converter support
Ipc4 pcm converter will check container size and valid sample
size to do format conversion. This patch add general support for
valid sample / container size s16c16 <-> s16c32, s32c32 <-> s16c32
s16c32 <-> s24c32 s24c32 <->s16c32, which are not supported
by sof now.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-07-23 08:26:11 +01:00
Daniel Baluta 52bc39fe73 topology: i.MX: Add topology to demonstrate EQ component
This enables EQ component with IIR filter for i.MX8QM/i.MX8QXP/i.MX8MP
with wm8960 codec.

Users can try various configurations for EQ parameters using sof-ctl tool:

$  amixer -Dhw:1 controls | grep EQ
numid=44,iface=MIXER,name='EQIIR1.0 eqiir_coef_1'

$ ./sof-ctl -Dhw:1 -n 44 -s sof/tools/ctl/eq_iir_bassboost.txt

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-07-22 17:07:23 +01:00