Commit Graph

6044 Commits

Author SHA1 Message Date
Pin-chih Lin fd10a0728c sof: drc: refine function comments
Refined some function comments to prevent confusion of usage.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-02-22 19:55:41 +00:00
Pin-chih Lin 5f2de711a0 sof: drc: fix drc_pow_fixed function
The proposed calculation doesn't take negative or zero input-x into
consideration, and we also don't need such use cases. Just return 0
for those input-x.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-02-22 19:55:41 +00:00
Pin-chih Lin 90f7ac47b2 sof: drc: fix drc_inv_fixed function
Used ABS(x) instead of x for comparing to ONE_OVERT_SQRT2(~0.707)
because x could be a negative value and here we want to transfrom x
from range (-1, -0.5];[0.5, 1) to (-1, -0.707];[0.707, 1)

And revised code line 233~237 to be easier to understand.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-02-22 19:55:41 +00:00
Seppo Ingalsuo b0facccfc8 Topology: Use pipe-volume-switch-capture in nocodec topologies
This patch replaces use of pipe-volume-capture macro or
pipe-low-latency-capture to pipe-volume-switch-capture in nocodec
topologies for APL, BDW, CHT, CNL, ICL, and TGL based platforms. It
allows to test of volume component mute switch control in SSP loopback
that is used by default in nocodec topologies. The testing of mute
switch feature is simplest to do with loopback topologies. Nocodec
topologies are not in mainstream usage so this is the safest option to
enable testing.

The mute switch add should be possible to all capture topologies but
it can be done later once it is confirmed it is safe to do (avoid
accidental muted audio or problems with UCM).

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-02-18 14:02:21 +00:00
Liam Girdwood e28b6a7cf6 docker: toolchain: update docker to GCC 10.2 and GDB 9.2
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-02-18 13:59:26 +00:00
Karol Trzcinski af3b8b99a2 ipc: debug: Add shared memory heap to memory scan
Newly added heap should be taken into account during memory usage
scanning.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2021-02-18 13:55:47 +00:00
Karol Trzcinski 842cd24bec ipc: debug: Decouple mem_zone from sof_ipc_dbg_mem_zone
Those two enums should not be mixed, because the first one is
only internal enum for FW while the second one is part of ABI.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2021-02-18 13:55:47 +00:00
Bartosz Kokoszko 9ee974559e mux/demux: update mux/demux documentation.
This commit adds description of mux/demux config structure
and format.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-02-18 13:45:43 +00:00
Curtis Malainey 06d785cf7e cppcheck: imx: suppress divide by sizeof
There is a bug in upstream cppcheck where dereferencing a pointer does
not result in a type check in sizeof as far as cppcheck is concerned.
This results in a false divide by sizeof(pointer) error.

See https://trac.cppcheck.net/ticket/10179

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-18 13:28:09 +02:00
Curtis Malainey d698177572 imx: edma: remove unused variable
Cppcheck complaint
Related to #3843

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-18 13:28:09 +02:00
Curtis Malainey 4281ba32af intel: dmic: remove unused struct
cppcheck complaint

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-18 13:28:09 +02:00
Curtis Malainey 5db9cb8f70 smart_amp: remove initial set
Ret is unconditionally set later, so initialization is irrelevant.
Cppcheck find.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-18 13:28:09 +02:00
Curtis Malainey 95261a1ebc smart_amp: clarify order of operations
ternary isn't entirely clear what order happens on the left, add
brackets to clarify. Cppcheck complaint

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-18 13:28:09 +02:00
Bartosz Kokoszko ce4cd06405 demux: fix demux look up table preparation
Array streams represents streams on "many" side i.e. input
for MUX and output for DEMUX.
For DEMUX each stream has masks array - 1 mask per output
channel. Each mask shows, from which input channel data
should be taken.

This commit reverts "demux" part of commit:
"b1b31e7154a5c159d81459634eabd8013b434181"

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-02-17 10:31:55 +00:00
Marc Herbert c6edc5f51e New install/GNUmakefile to gradually replace scripts in sof-bin.git
More specifically replacing sof-bin/go.sh and sof-bin/publish.sh and
also sof/scripts/sof-target-install.sh eventually.

"make install" code has always belonged to source repositories because
developers need to install too and we want everyone to use the same
installers. It's also easier to have all the information in a single
place.

Once the layout in sof-bin mirrors the /lib/firmware/intel layout
exactly, sof-bin does not need any installation code any more.

Mixing source and binaries in the same repo is also a "code smell",
notably because it forces branching them together.

Using a higher level build tool for installation instead of plain
scripts has a few benefits:

- Multiple entry points: easy to invoke (and test) any part of the
  installer individually
- ... while invoking dependencies automatically.
- Other features "for free" like:
  - errexit
  - error messages like "dunno how to build file x"
  - commands are logged by default

- Also gets rid of most of the large code duplication in go.sh and
  publish.sh, so:
  - Enabling or disabling a platform is a 3-character change
  - Allows platform selection in local config file (even just one platform)
  - Much harder to add inconsistencies
  - Much easier to review correctness, for instance no need to
    scrutinize every line to see which platforms are aliased.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-16 11:23:28 +00:00
Marc Herbert 0e60ec8da4 Copy sof-$platform.{ri,ldc} to sof.{ri,ldc}
As reported in #3491, there is confusion between platform names, CPU
names, PCH names, toolchain names, signing schemes and what not. For
instance in "build_apl_gcc/sof-apl.ri", the first "apl" matches the name
of a defconfig file while the second "apl" matches the name of a signing
scheme.

When building out-of-source, there is no reason to vary the filenames of
the output depending on the build configuration, changing the name of
the build directory is enough. This simplifies automation logic
including the next commit that adds a new install/GNUmakefile.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-16 11:23:28 +00:00
Pierre-Louis Bossart 532df2b7e7 topology: fix semi-abandoned Chrome topologies
we have a set of topologies that don't seem aligned with the
mainstream ones.

All these topologies should be given the boot if they are not used.

FIXME: The case of tools/topology/sof-cml-rt5682-kwd.m4 is rather
strange, M4 seems to go in some sort of infinite recursion if
'DMIC16k' is defined.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 8816434ba1 topology: align intel-generic-dmic and dmic-kwd error handling
Add error checks to make sure errors are detected and reported.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 38c6761512 topology: remove commented out code in intel-generic-dmic-kwd.m4
Not sure why this was there in the first place.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Seppo Ingalsuo e8e536bb03 Topology: Fix handling of PCM ID in intel-generic-dmic.m4
The macro used DAI link ID when it should have used PCM ID

Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 155e609ed5 topology: sof-tgl-sdw-max98373-rt5682.m4: fix inclusion
Macro needs to be declared before being used

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 47a9b784e1 topology: dmic-kwd: add macros for DMIC names
Fix macros (capitalized K), use them both for regular and -kpb
capture, fix names

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart bf42529e54 topology: dmic: fix pcm_id/dai_link_id confusion
This problem appeared after renumbering the devices for SoundWire
topologies.

Before this patch, the devices appear as:

pcm=JackIn;id=0;type=playback
pcm=JackOut;id=1;type=capture
pcm=DMIC;id=2;type=capture
pcm=DMIC16kHz;id=3;type=capture
pcm=HDMI 1;id=5;type=playback
pcm=HDMI 2;id=6;type=playback
pcm=HDMI 3;id=7;type=playback

and after:

pcm=JackIn;id=0;type=playback
pcm=JackOut;id=1;type=capture
pcm=HDMI 1;id=5;type=playback
pcm=HDMI 2;id=6;type=playback
pcm=HDMI 3;id=7;type=playback
pcm=DMIC;id=10;type=capture
pcm=DMIC16kHz;id=11;type=capture

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 743d1941ff topology: dmic users: define dailink and pcm ID in caller
The topologies changed in this patch relied on dailink defaults, and
never defined PCM IDs.

We want dailinks to be defined in callers, so let's remove those
defaults from intel-generic-dmic.m4

To be backwards 'bug-compatible' the PCM ID remains the same as the
dailink, but this is completely arbitrary and might be modified if
needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 5cc75be44b topology: use fatal_error instead of errprint
errprint does not stop the compilation as intended, it just prints a
message which is removed by the makefile.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Pierre-Louis Bossart 2c46c7a22c topology: use different names for Jack input and output
The topology handling requires names to be unique, regardless of
direction. It's an undocumented 'feature' of the ALSA topology parser.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-13 13:57:45 +00:00
Joseph Burt df899fded0 Use DIV_ROUND_UP() macro
Replace some open coding with the new macro

Signed-off-by: Joseph Burt <caseorum@gmail.com>
2021-02-12 15:57:52 +00:00
Anas Nashif a140f2f4bb trace: fix formatting
Getting formatting warnings when building with Zephyr which prevents
successful build in CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 20:19:15 +00:00
Anas Nashif f4e4ca752a Revert "zephyr: fixed cached rimage path"
This reverts commit f4c9c28bc5.

This is no longer needed as we removed local copy of rimage from
zephyr/ext.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 20:19:15 +00:00
Anas Nashif 206df545c4 trace: do not set trace_ctx section for Zephyr [REVERTME]
This section is generating warnings when build with Zephyr, so remove
for now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 20:19:15 +00:00
Anas Nashif a97d166121 zephyr: reference local Kconfig
Reference Kconfig in zephyr module file which is evaluated by Zephyr
directly. This will eliminate the need for including the SOF Kconfig
directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 20:19:15 +00:00
Curtis Malainey 86e257731d crossover: dont set values where it doesn't matter
if we aren't going to use the value, dont set it.
Cppcheck complaint

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-11 14:34:08 +00:00
Curtis Malainey 87a8dfecb6 codec_adapter: stop leaking memory on prepare
we should free before we clear the pointer

found via cppcheck

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-11 14:34:08 +00:00
Curtis Malainey fd2d94dd79 pipeline: fix data structure linking
cppcheck was being confused as we were passing in hw_param_ctx which has
linking in the following order hw_param_ctx->data->hw_params.

Cppcheck was being confused as it failed to realize that hw_params was a
writeback method and to be honest the way it was written they way the
structures were linked was hard to see as well. Lets do all the linking
upfront so its easier to read. Cppcheck doesn't seem to complain about
this method so lets use it.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-11 14:34:08 +00:00
Curtis Malainey 300f717943 library: edf_schedule: fix naming collision
sch is global and local, rename local, found via cppcheck

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-11 14:34:08 +00:00
Curtis Malainey fa760e7420 smart_amp_test: fix redundent check and double free
not sure how this happened but this check is pointless and also results
in a double free, found by cppcheck

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-11 14:34:08 +00:00
Curtis Malainey 3440c21338 probe: fix ret type
cppcheck points out the uselessness of checking <0 checks on unsigned
types

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-11 14:34:08 +00:00
Pierre-Louis Bossart 980d8804e3 topology: align device names in SoundWire topologies
Align on the following names:

PCM0   playback	Jack
PCM1   capture 	Jack
PCM2   playback	Speaker
PCM3   capture	Amplifier Reference (typically based on I/V feedback)
PCM4   capture 	Microphone
PCM5   playback	HDMI 1
PCM6   playback	HDMI 2
PCM7   playback	HDMI 3
PCM8   playback	HDMI 4
PCM9   RESERVED
PCM10  capture	DMIC
PCM11  capture	DMIC16kHz
PCM12  capture 	BufferedMic (aka KPB)
PCM13  playback Bluetooth
PCM14  capture 	Bluetooth

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-10 10:35:02 +00:00
Pierre-Louis Bossart 8839f8536b topology: align device numbers in SoundWire topologies
This patch follows the suggested layout:

PCM0   playback	Jack
PCM1   capture 	Jack
PCM2   playback	Speaker
PCM3   capture	Amplifier Reference (typically based on I/V feedback)
PCM4   capture 	Microphone
PCM5   playback	HDMI 1
PCM6   playback	HDMI 2
PCM7   playback	HDMI 3
PCM8   playback	HDMI 4
PCM9   RESERVED
PCM10  capture	DMIC
PCM11  capture	DMIC16kHz
PCM12  capture 	BufferedMic (aka KPB)
PCM13  playback Bluetooth
PCM14  capture 	Bluetooth

PCM40  playback	Speaker 2 (non-aggregated)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-10 10:35:02 +00:00
Pierre-Louis Bossart 12d5b1358e topology: intel-generic-dmic: add macro for PCM device names
Add macro to allow the use of "BufferedMic" instead of
"DMIC16kHz" in KPB usages.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-10 10:35:02 +00:00
Pierre-Louis Bossart 57d121238f topology: sof-smart-amplifier: fix error message
Confusion between input and output, and PCM name and pipeline ID.

Copy/paste likely here.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-10 10:35:02 +00:00
Pierre-Louis Bossart e24d77aa76 topology: remove sof-tgl-rt5682.m4
This file was used for early enablement of SoundWire on a platform,
before we had support for amplifiers. This is no longer needed, let's
remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-10 10:35:02 +00:00
Pierre-Louis Bossart 9b355efab1 topology: remove sof-tgl-rt711-i2s-rt1308.m4
This topology is no longer used and productized, let's remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-02-10 10:35:02 +00:00
Hans de Goede 86abd07cba topology: Add sof-byt-wm5102-ssp0 topology file
Add a topology file for Bay Trail boards with a WM5102 codec
connected to SSP0.

These setups works with the standard settings from sof-byt-codec.m4.

This has been tested on a Lenovo Yoga Tablet 2 1015L.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-10 10:32:09 +00:00
Bartosz Kokoszko 9a08028a76 timer_domain: set last_tick to ticks_req in order to avoid drift
In the case of scheduling irregularities the drift may accumulate in the
scheduling reference value. By ensuring we always refer to the previous
requested time the drift can be prevented.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2021-02-10 09:49:58 +00:00
Curtis Malainey 10656d614c oss-fuzz: add error for incorrect build env and readme
add proper build instructions

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-09 13:52:30 +00:00
Marc Herbert 419806fb1c xtensa-build-all.sh: add PATH to build log
The script already logs the full CMake command that is re-usable outside
this script... except for the PATH change. Expose that sneaky PATH
change.

Debugging every build issue starts with peeling the too many layers of
indirection.

Also fix some minor issue in the help message.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-09 13:43:54 +00:00
Iuliana Prodan 789a286ace platform: imx: use DMA_DOMAIN in full synchronous mode
Use the full_sync attribute from dma_domain to schedule
tasks based on period ratio between the registrable
task and the current one.
Do not make it time dependent anymore.

Fixes: #3802

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-02-09 08:52:37 +02:00
Iuliana Prodan b732c4fb13 schedule: dma_multi_chan: do not skip tasks for dma_domain scheduler
Add a full_sync attribute to ll_schedule domain.
This is set to true, for a full synchronous dma_domain
scheduler, which is not time dependent.
By default, it is false.

In full_sync case we use the ratio between the task period
and the registrable task period to do the scheduling, not
the task.start time.

We do this because for the DMA_DOMAIN there are no guarantees
for the accuracy of the period of the registrable task
which drives the entire scheduling.

An example is the mixer topology where we have 3 pipelines
for playback scenario:
- 1 pipeline for pcm1.0 (task 0);
- 1 pipeline for pcm1.1 (task 1);
- 1 pipeline for DAI (task 2).
Task 2 is the registrable task and this is always scheduled.
The other tasks (task 0 and task 1) are scheduled based on task->start.

The problem is that, at some point, the DMA transfer from DAI is
finished earlier than task->start for one of the task 0 or task 1
and this is not scheduled anymore.
And, task 2 ends up depleting one of the source buffers,
thus blocking the entire data flow.

Fixes: #3802

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-02-09 08:52:37 +02:00
Jaska Uimonen 9d41d63ac7 mux: enable playback of multiple simultaneous streams
Currently you can't play multiple simultaneous streams at the same time
into mux. Fix this by copying the trigger and reset mechanism from audio
mixer.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-02-05 15:58:03 +00:00