Commit Graph

5144 Commits

Author SHA1 Message Date
Karol Trzcinski c939302194 trace: Pass trace context to logging function
UUID key is too detailed information for logging function to allow
easy functionality extension in future. Trace context structure is
designed to work directly with logging function, so there is no
reason to unpack values from this struct in trace macro-functions
and pass them as separate arguments to trace_log().

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 17:02:46 +02:00
Karol Trzcinski bcd9628f5e ext_manifest: byt: fix .fw_metadata section alignment
Section of this section should be aligned to EXT_MAN_ALIGN,
proper way of doing this with ALIGN() function inside linker
script didn't work, because of removing READONLY attribute
for this segment, what leads to error in rimage.
This solution introduce changes only for platforms, where problem
exists, so generic tools like rimage are kept clean of such a hacks.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 13:43:25 +01:00
Karol Trzcinski 0596f5b71c logger: Pass input file in -d flag
Such an approach is more logical, user add flag to dump information
and specify what to dump just after it. Using separate argument
with file path and flag to dump is less natural. So after change
`./sof-logger -l file.ldc -d`
will be replaced with
`./sof-logger -d file.ldc`

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 13:24:10 +01:00
Karol Trzcinski 44a25a1a64 logger: Do not open input file for ldc_dump
Input file is not needed for these functionalities, so shouldn't be
opened.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 13:24:10 +01:00
Karol Trzcinski fe3dfe4007 logger: Fix help message consistency
Before this patch output message was misaligned and one flag
description start from small letter:
sof-logger:      -L                     Hide log location in source code
sof-logger:      -f precision                   set timestamp precision
sof-logger:      -d                     Dump ldc information

After change, it's fixed:
sof-logger:      -L                     Hide log location in source code
sof-logger:      -f precision           Set timestamp precision
sof-logger:      -d                     Dump ldc information

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 12:15:29 +01:00
Adrian Bonislawski 9e78fa1569 jsl: HEAP_LP_* cleanup
This will delete unnecessary heap lp defines

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-27 12:09:02 +01:00
Adrian Bonislawski 41f9387630 jsl: add lps vector to linker script
This will specify memory region for section .lps_vector

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-27 12:09:02 +01:00
Adrian Bonislawski da70ee0021 jsl: add prefctl value
This will allow to enable LPS on JSL

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-27 12:09:02 +01:00
Adrian Bonislawski 189282285b jsl: lps restore vector
This patch will place LPS restore vector before heap lp buffer

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-27 12:09:02 +01:00
Seppo Ingalsuo 17399bf80e Audio: EQ FIR: Fix firmware panic in fir_cmd_set_data()
This patch fixes the memcpy_s() assert related panic. The destination
size is computed incorrectly and the bug can trigger with a suitable
size large blob. The blob size after first chunk is no more equals
cdata->num_elems + cdata->elems_remaining. Since the size is available
in cd->config_new->size it can be used for successive chunks to
compute copy destination size.

The traces output is also improved to better show the chunks reception
and total size of the configuration blob.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-27 11:51:14 +01:00
Karol Trzcinski ed5ac2ff48 trace: buffer: Use trace context in buffer logs
Each trace function should refer to trace context, where are
stored information like uuid and runtime editable logs level,
to unify trace API and allow trace filtering in future.
Remove buf_cl_* functions, as no longer supported.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 11:53:53 +02:00
Karol Trzcinski 1535738355 logger: Move optstring from getopt function to separate variable
Such a change is provoked by getting close to maximal line length
in line with getopt line call. Moving format string to separate
variable is more logical solution than splitting function arguments
on separate lines.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 11:31:59 +03:00
Tomasz Lauda 90ddae9ebe arch: xtensa: move bootloader to cAVS platform files
Bootloader is something cAVS specific and uses many platform specific
definitions and procedures. With new platform family in the future
it will be hard to maintain it in the architecture directory.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Tomasz Lauda e5c71007d4 pm_runtime: hide platform specific structure
Hides platform specific structure in cAVS platform header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Tomasz Lauda 643c2300a4 arch: xtensa: fix master_core_data initialization
Fixes master_core_data initialization in case PLATFORM_MASTER_CORE_ID
is not zero.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Tomasz Lauda dc8a9feaea arch: xtensa: don't check whether master core id is zero
Checking whether PLATFORM_MASTER_CORE_ID is zero is unnecessary.
We can compare it directly no matter what is the value.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Tomasz Lauda 297aba354d arch: xtensa: configure memory window based on CONFIG_MEM_WND
Uses CONFIG_MEM_WND definition instead of CONFIG_SUECREEK to
decide whether to configure memory window or not.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Tomasz Lauda 7161c66898 arch: xtensa: remove unused macro
Removes macro that is no longer used.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Tomasz Lauda de04a03bbd arch: xtensa: use get_prid macro in boot_entry
Uses get_prid macro in boot_entry instead of classic rsr.prid.
This way it won't fail for cores with XCHAL_HAVE_PRID = 0.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 07:15:11 +02:00
Karol Trzcinski 6cfd3e5a5e logger: Increment uuid name during ldc dump
Name and UUID value of component should be aligned with their address.

Output before change:
           ADDRESS                                    UUID NAME
        0x1FFFA000  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
        0x1FFFA01C  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
        0x1FFFA03C  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
and after:
           ADDRESS                                    UUID NAME
        0x1FFFA000  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
        0x1FFFA01C  <f11818eb-e92e-4082-82a3-dc54c604ebb3> pipe-task
        0x1FFFA03C  <34dc0385-fc2f-4f7f-82d2-6cee444533e0> volume-task
        0x1FFFA05C  <b77e677e-5ff4-4188-af14-fba8bdbf8682> volume

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-26 18:33:53 +03:00
Daniel Baluta f4208d562f drivers: sai: Fix watermark mask size
On i.MX8M watermark can be up to 128 and we must adjust
the T/RFW mask register in order for values greater than 64 to be
correctly set.

Now capture works fine!

Fixes: 29414aa25e ("platform: imx8m: Fix FIFO depth for i.MX8M")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-26 12:13:07 +03:00
Adrian Bonislawski 136b48cea4 lps: make prefctl platfrom specific
This will allow to enable LPS on TGL

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-25 09:53:15 +01:00
Adrian Bonislawski b14e42d48e tgl: add lps vector to linker script
This will specify memory region for section .lps_vector

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-25 09:53:15 +01:00
Adrian Bonislawski dbe657c506 tgl: HEAP_LP_* cleanup
This will delete unnecessary heap lp defines

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-25 09:53:15 +01:00
Adrian Bonislawski 558d9aa24e tgl: lps restore vector
This patch will place LPS restore vector before heap lp buffer

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-25 09:53:15 +01:00
Karol Trzcinski 56a660be28 pcm_converter: HiFi3 implementation of conversion between float and fixed
Used method need floating point unit in DSP core.
Vectorized conversion functions are inaccessible for used cores.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski a264e77011 pcm_converter: Normalize floats value during conversion
Respect fixed point data format as Q1.X instead of QX.
After change values in float will be in range <-1;1)
what will correspnd to fixed point data MAX/MIN value
in Q1.X format.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski b1eb29d62d pcm_converter: Add unit tests for conversion float to fixed
Implement mocks, cmake modification and unit test architecture.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski b8860be215 pcm_converter: Add float support in generic pcm_converter implementation
Implement set of functions to convert any data type with float,
in both directions, in common tool - pcm_converter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski 6fac902478 pcm_converter: Create circular buffer converter working on linear memory
It is easier to implement converter working on linear memory space
instead on circular. Moreover such a solution should be more
effective in comparison with checking for buffer wrap after each sample.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski a03bf08f54 audio_stream: Add function returning number of samples without memory wrap
Such a function will be needed to calculate chunk size during processing
data from circular buffers by functions working on linear memory
regions.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski 86c5075429 pcm_converter: Add single sample converter between fixed and float value
Add core function responsible for conversion between
floating point and fixed point values in generic version
of converter. It is done manually to be sure of IEEE 754-binary32
value format for any used platform and floating point unit
settings.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Karol Trzcinski ac96f2585d pcm_converter: Change order in pcm_func_map array
It is made to make easy adding new supported type.
After changes there is easy to see schema how to add
new data format - start with through converter for new type,
then add conversion in both ways for each previous data type
in same order as they were added.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Janusz Jankowski f83714ed39 xtensa: move -lgcc to sof_options
This flag should be in sof_options as it is needed for
supporting standard C features.

Thanks to this symbols needed for supporting features
guaranteed by C standard, but not directly supported by platform
ASM will be available in static libraries, without explicitly
specifying -lgcc dependency.

Most of people don't know that they may need this dependency to
support f.e. for float to int conversion on Xtensa.
They expect it to work because it's part of basic C syntax and
they will complain, that they have undefined references to __* symbols.
This patch helps preventing problems like these.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-05-21 18:39:32 +03:00
Daniel Baluta 472b82bc1c README: Add IRC badge
This will help people reach #sof IRC channel easier.
Clicking on the badge will allow people to join IRC
chat via irccloud webclient or prompt for their local
IRC client.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-21 14:08:05 +01:00
Seppo Ingalsuo 66a78a2d8c Topology: HDA-generic: Use +20 dB EQ gain for 16 kHz DMIC capture
This patch replaces the default 0 dB gain with +20 dB gain in 16 kHz
DMIC pipelines in hda-generic based topologies. It is done to have
same capture sensitivity in both 16 kHz and 48 kHz capture pipelines.

The impacted topologies are:

sof-hda-generic-2ch.tplg
sof-hda-generic-4ch.tplg
sof-hda-generic-eq-2ch.tplg
sof-hda-generic-eq-4ch.tplg
sof-hda-generic-idisp-2ch.tplg
sof-hda-generic-idisp-4ch.tplg

Note: The 0 dB high-pass version is preferred after all the needed
development is available.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-21 10:01:37 +01:00
Curtis Malainey 960a2242a1 Readme: add gitter badge
Add badge to make finding the chat room a bit easier

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-05-21 10:00:10 +01:00
Seppo Ingalsuo 16236c0bf6 Audio: Add intermediate size SRC coefficients set
This patch adds a new small 32 bits SRC coefficients set. The conversions
quality is the same as in earlier 32 bit set but the support for high and
less common sample rates is removed. It saves RAM vs. the full set. By
default HiFi EP platforms use tiny set, APL uses small set, and other
platforms use std.

To avoid confusion the Kconfig option for 16 bit coefficients is renamed
to tiny. The kconfig option for 32 bit coefficients is renamed to std.
This gives three different choices for SRC coefficients size and
conversion quality.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-21 09:37:36 +01:00
Seppo Ingalsuo efbfa2c4dd Tools: Tune: Add generation for SRC profile small int32
This patch adds script src_small_int32.m to generate the intermediate
size SRC coefficients set. The export functions are updated for
short BSD copyright and to output licence text and needed header
files inclusions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-21 09:37:36 +01:00
Marc Herbert 11ee3b872b tplg-build.sh: invoke m4 with --fatal-warnings
Also use || exit 255 to stop xargs from burying the error message(s).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-20 22:16:52 +01:00
Marc Herbert cff1bb62b0 tplg-build.sh: add NO_PROCESSORS, use VERBOSE more.
Zero functional change and 100% identical outputs.

Also add some comments.

Interestingly, -P$(nproc) is a tiny bit faster than -P0 on my
system. Thrashing?

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-20 22:16:52 +01:00
Marc Herbert d4e508cf86 topology: invoke with m4 --fatal-warnings
As seen in PR #2954, no one ever notices m4 warnings. As PR #2954 will
remove sof-tgl-rt711-i2s-rt1308-nohdmi.conf and the only m4 warning
currently, this is a great opportunity to upgrade m4 warnings to
errors.

Note neither Travis nor github have the concept of a "warning", they can
only report success or failure.

This fix can be considered part of the "green failures" family.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-20 22:16:27 +01:00
Pierre-Louis Bossart 96623e6038 topology: remove sof-tgl-rt711-i2s-rt1308-nohdmi.conf
No one seems to be using this topology or they would have seen the
error below that DMICs are required on this platform.

[  8%] Generating sof-tgl-rt711-i2s-rt1308-nohdmi.conf

m4:tools/topology/sof/pipe-volume-capture-16khz.m4:54: bad expression
in eval (bad input): 2 * 2 * CHANNELS * 16
m4:tools/topology/sof/pipe-volume-capture-16khz.m4:57: bad expression
in eval (bad input): 2 * 2 * CHANNELS * 16

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-05-20 14:08:19 +01:00
Seppo Ingalsuo 68da4d7024 Topology: HDA-generic: Use +20 dB EQ gain for DMIC capture pipelines
This patch replaces the default EQ 0 dB gain with +20 dB gain in
DMIC pipelines in hda-generic based topologies. It fixes the issues with
too silent capture level.

The gain was changed to 0 dB in a recent change to let UCM set it.
However this change remains needed for a while since the UCM initial gain
patch and remaining development of ALSA/ASoC 4ch capture for devices with
more than two microphones will take longer time to become available.

The impacted topologies are:

sof-hda-generic-2ch.tplg
sof-hda-generic-4ch.tplg
sof-hda-generic-eq-2ch.tplg
sof-hda-generic-eq-4ch.tplg
sof-hda-generic-idisp-2ch.tplg
sof-hda-generic-idisp-4ch.tplg

Note: The 0 dB high-pass version is preferred after all the needed
development is available.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-20 14:05:14 +01:00
Adrian Bonislawski d9e3d4d49b cavs: add probes to TGL chrome build
This will enable probes for chrome build

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-19 19:35:58 +01:00
Adrian Bonislawski 48ac11d769 Kconfig: adjust default probe config
Adjust default probe config to align with security requirements

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-19 19:35:58 +01:00
Pierre-Louis Bossart e1876f35b4 topology: add support for rt5682 on link2 in SoundWire mode
The UpExtreme provides access to link2 in 2 of the 3 modes. This is
useful to test rt5682 configurations.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-05-19 09:08:24 +01:00
Daniel Baluta 12107e56db drivers: imx: sai: Fix standalone capture
We run TX in asynchronous mode and RX in synchronous mode with
transmitter. Anyhow, in this mode when starting RX we also need
to enable TX (if it wasn't previously enabled).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-19 09:17:15 +03:00
Bartosz Kokoszko 8a4ec5643f topology: add sof_ipc_comp_smart_amp struct
Add SOF_COMP_SMART_AMP type for smart amp component.
Basic topology using smart amplifier component
could be as follows:

                +------------------------------------------+
    +------+    | +---+  +-------------+  +---+  +-------+ |
    | Host |----->|Buf|->|  Smart Amp  |->|Buf|->|SSP Dai|-----------+
    +------+    | +---+  +-------------+  +---+  +-------+ |         |
                +-----------------^------------------------+         |
                                  |                                  |
                                +---+                                |
                                |Buf|                                |
                                +---+                                |
                                  ^                                  |
                +-----------------|--------------------------+       |
    +------+    | +---+  +--------|------+  +---+  +-------+ |       |
    | Host |<-----|Buf|<-|     Demux     |<-|Buf|<-|SSP Dai|<--------+
    +------+    | +---+  +---------------+  +---+  +-------+ |
                +--------------------------------------------+

Basic topology contains Smart Amp component in playback pipeline and Demux
component in capture pipeline. There is a additional buffer (feedback)
between them in order to process "feedback".

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-05-18 15:18:03 +01:00
Artur Kloniecki 8ae0aff2c5 pipeline: return -ENODATA on trigger for PCM pipelines with no data.
As part of dependent PCMs feature we need to properly inform userspace
when trigger start/release is called on a pipeline, that depends on
another to provide that data, as in Echo Reference usecase.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-05-18 15:07:45 +01:00