Commit Graph

5868 Commits

Author SHA1 Message Date
Ryan Lee 95ee7a8df4 smart amp:use comp_get_state
Use 'comp_get_state' function to read state instead of
doing directly access to state member viariable.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-10-21 12:21:17 +01:00
Ryan Lee 4f1bb0c1ae smart amp:removed references to .avail members of audio_stream
Use 'audio_stream_get_avail_frames' instead of directly accessing .avail

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-10-21 12:21:17 +01:00
Karol Trzcinski 9e131360fc logger: Check for unused arguments
There is no place for unused arguments, their are consequence of invalid
argument list as usual.
Such an situation is highly possible especially during defining trace
filters, eg `-Fv=mux 4.1` instead `-F"v=mux 4.1"` or `-Fv=mux4.1`.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-21 11:48:19 +01:00
Daniel Baluta 7709924f16 drivers: imx: sai: Make sure Tx/Rx is disabled at stop
TE/RE bit will remain set until the end of current frame. So,
for example, even if we set TE to 0 the transmitter will still be
enabled until the end of current frame.

This can have unexpected results when quickly restarting a channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-10-20 15:57:49 +01:00
Pan Xiuli 2fe7c89489 logger: change the usage string for filter
Change the misleading usage info for filter.
Add format as tips for filter string.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-10-20 11:08:20 +01:00
Pan Xiuli b804e1df7e logger: fix opt for filter parameter
The -F filter option has argument, we should use
F: instead of F in the optstring.

Fixes: #3530

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-10-20 11:08:20 +01:00
Karol Trzcinski 1ad0269f5d logger: Fix log_err usage at early stages of sof-logger run
This function could fail when called before convert()

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-20 10:41:17 +01:00
Yong Zhi 2de506025f topology: sdw: Update echo ref channel number on max98373
The topology has two speaker amp configured, with voltage info
feedback-ed to host for each channel in the EchoRef, so update
SMART_REF_CH_NUM accordingly.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-10-20 10:38:06 +01:00
Curtis Malainey 955201897d oss-fuzz: add ipc fuzzer
Add shim to fuzz the full ipc space with

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 8b680d5338 host: enable ipc handler module
The handler is the primary entry point for the fuzzer and therefore
needs to be added to the build.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 3ce2279520 ipc: stub out mailbox write
In a library build we don't care about replies, so lets just no-op this
function

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 54b3245b25 host: add dai to build
this is needed to expose the ipc handler

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey c5a0cf0d27 host: move edf_schedule to platform
move to allow other programs to use the scheduler

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey fa317ffca9 host: disable memory usage scan
don't need initially, will be supported later

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 9b9264d03b host: move sof_get to platform
Move out of testbench so whole system can use as needed

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 538eb6ab34 host: stub about required functions
Many functions are needed for building that are not relevant to the
platform. Stub these out so the system can be fuzzed correctly.

Also fix up a misisng header

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 716206bcd9 host: add DMA definitions
Add dummy definitions to satisfy build requirements

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 177473c386 host: conditionally build trace module
Only build trace when its needed

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey aee69115ba build: allow host build to be static
oss-fuzz does not support dynamic linking, therefore we need to add
support for static builds

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey 149addaef6 host: remove Wl flag as it upsets clang
remove this flag as clang-12 considers it unused

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Bartosz Kokoszko 06cfb2921b perf_cnt: cast timer value to uint32_t type
In order to get proper perf counters peaks values
we should cast arch timer value to uint32_t.

Arch timers API allows user to get uint64_t value.
In fact arch timer consits two parts. 32 bits (MSB)
software part and 32 bits (LSB) hardware timer.
The 32 bits (MSB) software part is incremented only
during hardware timer rollover when timer interrupts
are enabled. If interrupts are not enabled (perf_cnt
case), incrementation will never appear.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-10-19 16:27:41 +01:00
Marc Herbert ec3ccab1b0 xtensa-build-all: document PRIVATE_KEY_OPTION and deprecate -k
Following commit 88b69cc2e5 ("scripts: xtensa-build-all: Add support
for building TGL and signing with MEU") we now have an unified and
flexible PRIVATE_KEY_OPTION that can do anything with very little code.

The -k option was never a good idea in the first place because it
already required an environment variable anyway (RIMAGE_PRIVATE_KEY)
instead of a command line argument so the code should have just checked
whether RIMAGE_PRIVATE_KEY was defined, that would have been
enough. Requiring the user to "double-confirm" with -k has been adding
extra complication for both the user interface and the implementation.

xtensa-build-all is effectively a "CMake configuration convenience"
script, however it shouldn't become an additional layer of indirection
and complexity and its interface should expose CMake (which is already a
layer of indirection!) as directly as possible.

See longer discussion in PR #3187

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-10-19 15:15:52 +01:00
Bartosz Kokoszko 53202aaf18 arch_timer: check for rollover in arch_timer_set
In case when new timeout requires timer rollover
we should set ccompare value to 1 in order to
increment timer->hitime properly in timer_64_handler().

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-10-19 14:36:07 +01:00
Karol Trzcinski efc6f2312c trace: Compare pointer with NULL before use
Possible null pointer dereference was possible here.
There is no need to log error message here, it's done
from trace_filter_ipc_comp_context() and ipc_trace_filter_update().

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-19 14:35:46 +01:00
Curtis Malainey 1512a49bfa component: initialize new devices to INIT state
As per component graph we start devices in INIT state. Since most
components don't use this state anyways lets just init the struct to
this state and remove it where it is used correctly.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-19 14:34:31 +01:00
Guennadi Liakhovetski 8a5059a8c0 xtensa: global default core count
Instead of specifying the default core count for each Xtensa DSP
architecture set it globally to the available maximum core count.
The user can still reduce the number to save power.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-14 22:14:01 +01:00
Karol Trzcinski 6e8515216d trace: dai: Make dai type and index more descriptive in traces
Form %d.%d may be easily paired with pipeline and component id,
whats not correct.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 19:19:28 +01:00
Karol Trzcinski b1d0fd7e64 trace: ipc: pipeline: Make error logs more detailed in ipc_pipeline_new()
It's not obvious that icd refers to pipeline scheduling component,
so added this information to log message. By the way, scheduling
component id has been printed.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 19:19:28 +01:00
Jaska Uimonen 0ed7023861 topology: add dmic channel maps for different channel counts
Volume and switch controls in the dmic pipeline need different channel
maps based on dmic channel count. This will enable the control of all
channel volumes and mutes from user space.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-10-12 16:09:44 +01:00
Guennadi Liakhovetski 256c934375 smp: make MAX_CORE_COUNT an automatic Kconfig parameter
Add a new CONFIG_MAX_CORE_COUNT, set it automatically, depending on
the platform and use it to limit CONFIG_CORE_COUNT.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-12 11:42:51 +01:00
Guennadi Liakhovetski 265fb6ce0f smp: replace PLATFORM_CORE_COUNT with CONFIG_CORE_COUNT
PLATFORM_CORE_COUNT is always defined to be equal to
CONFIG_CORE_COUNT except when CONFIG_LIBRARY is set. This patch
removes this redundancy, uses CONFIG_CORE_COUNT directly everywhere
and limits it to 1 for CONFIG_LIBRARY and for Zephyr builds.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-12 11:42:51 +01:00
Karol Trzcinski f97e9f0de6 ipc: Remove user_abi_version from mailbox
This information is already provided by extended manifest,
so there is no need to double it in runtime code.
It allows to save 16 bytes from .DATA and 128 bytes from .TEXT
for cnl platform.
`data_structs` library from src/ipc/CMakeLists.txt is no longer
needed. Moreover empty library may lead to cmake fail.
SMEX needs little update, to read DBG_ABI from .fw_metadata section
instead of .fw_ready.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 11:41:11 +01:00
Karol Trzcinski c037800d7a ipc: Remove sram_window from mailbox
This information is already provided by extended manifest,
so there is no need to double it in runtime code.
It allows to save 400 bytes from data .DATA and 64 bytes from .TEXT
for cnl platform.
EXT_MAP_PORT() macro is no longer needed.
Created __unused macro in compiler_attributes.h as compiler
attributes shouldn't be used directly, to allow easy compiler change.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 11:41:11 +01:00
Karol Trzcinski 095e3ac8ae ipc: Remove probe_support from mailbox
This information is already provided by extended manifest,
so there is no need to double it in runtime code.
It allows to save 28 bytes from .DATA and  128 bytes from .TEXT
for cnl platform.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 11:41:11 +01:00
Karol Trzcinski 737bdb877f ipc: Remove cc_version from mailbox
This information is already provided by extended manifest,
so there is no need to double it in runtime code.
It allows to save 92 bytes from .DATA and 128 bytes from .TEXT
for cnl platform.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 11:41:11 +01:00
Yong Zhi e5d17f3c10 Topology: intel-generic-dmic-kwd Add DMIC PROC option
Add DMICPROC option so that DMIC01 can use EQ IIR etc.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-10-08 11:53:24 +01:00
Pin-chih Lin cdf734bd2b sof: drc: Implement delay only when DRC disabled
Delay the input sample only and don't do other processing. This is used when
the DRC is disabled. We want to do this to match the processing delay of other
bands in multi-band DRC kernel case.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Pin-chih Lin d32ec2caeb tools: testbench: Add DRC component test
Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Pin-chih Lin 68553688f7 tools: tune: Add tools to generate ctrl bytes for DRC
This commit adds the tools to generate the control bytes for the
drc component. To generate the control bytes, run the example_drc.m
script.

To tweak the parameters modify the values in example_drc.m and run it.

This is still WIP. A fixed set of coefficients is temporarily used in
drc_generate_config.m

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Pin-chih Lin 80ef3cf95e tools: topology: Add DRC topology files
This commit adds the topology files for the drc component.
The control bytes are generated by the tools in tune/drc.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Pin-chih Lin 568f184b49 sof: drc: Add DRC component with floating-point calculations
This commit adds Dynamic Range Compression (DRC) to the list of SOF
components. DRC in audio processing is intentional to reduce the
volume of loud sounds and amplify the silent sounds as compressing an
audio signal's dynamic range.

This is the intermediate implementation with floating-point calculations.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Curtis Malainey 1b17974b3b dai: include list header
dai header uses lists, lets make sure the header is properly included

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-07 11:18:23 +01:00
Curtis Malainey 69bded9e30 haswell: add missing header
stdbool is need to define bool types (as used in this header)

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-07 11:18:23 +01:00
Guennadi Liakhovetski 9e9aeadd7f compile: fix reporting compiler version when built with gcc
Properly retrieve gcc version values and unify the optimisation flag
with Zephyr to always include a '-' in the string. Before this patch
the kernel reports the firmware, built with gcc as

Firmware info: used compiler XCC 12:0:8 xtensa-cnl-elf used optimization flags O2

With this patch it reports

Firmware info: used compiler GCC 8:1:0 xtensa-cnl-elf used optimization flags -O2

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-06 15:01:00 +01:00
Karol Trzcinski b119fe2c8b ext_man: Add information about runtime memory scan possibility
This component is conditionally compiled, so passing such an
information to driver, allows to check possible scanning failure
reason.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 0aa3e4b4ca ipc: debug: Add KConfig to conditionally compile memory scan feature
This feature is not needed to get functional firmware,
so may be disabled for platforms with low memory space,
like baytrail and cherrytrail.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 64a7d67b3e ipc: debug: Add memory usage probing possibility
This feature will be needed to monitor memory utilization and
memory leaks. It may be usable also in realese builds, so removed
conditional ipc_glb_test_message compilation.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 897152daca ipc: Rename function handling SOF_IPC_GLB_TRACE_MSG
Function name should correspond IPC name.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski c4c177069e alloc: Add possibility to read memory usage in runtime
Such a function may be used to monitor memory leaks and system
utilization.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 7c4c3c86e1 ext_manifest: Use ext manifest by default in output image
Add extended manifest at the begin of firmware image,
as a firmware metadata description.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:12:35 +01:00