Commit Graph

5301 Commits

Author SHA1 Message Date
Pierre-Louis Bossart 08022aae49 Revert "pcm_converter: Convert linear memory regions"
This reverts commit 1f092df401.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-10 15:24:35 +01:00
Karol Trzcinski b7bb801f0e atomic: ll_scheduler: Fix atomic implementation, return old value
Return value should be aligned with compiler builtins implementations,
see https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 12:15:08 +01:00
Karol Trzcinski 1c605d3275 pm_runtime: Log context and index value in verbose traces
It's important to know which pm_runtime_context is related with
given call to pm_runtime* function.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 12:03:42 +01:00
Marc Herbert e9c83cf009 version.cmake: add "--match v*" to fix git describe
Before this fix, any random, later git tag like for instance
"releases/jsl/v3.0-rc1" would be picked up and then immediately
discarded and replaced with v0000 because it didn't start with 'v*'

Also log all the versions always and not just when there is already a
.tarball-version file.

Increase --abbrev=12 because --abbrev=4 doesn't seem to make sense.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-09 10:45:13 +01:00
Karol Trzcinski 447359f16f platform: pm: Add HP_CLK management to pm_runtime
Clock manegement is important part for power consumption optimization,
what is a task of this module.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 10:15:32 +01:00
Karol Trzcinski a2c276e446 clock: Add function to set low power mode
This function will be called from power manager to change current
clock value for sleep time.
Detailed implemnentation may be clock instance dependednt.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 10:15:32 +01:00
Karol Trzcinski 5cd351c82d cpu: Export mask with enabled cores
Core enable/disable is related with power management and maintenance
of clock trees, so such an mask should be possible to read.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 10:15:32 +01:00
Karol Trzcinski ccf6be4c2b platform: intel: cpu: Unify active_cores_mask
Set bit for PLATFORM_MASTER_CORE_ID and remove exception
handlind from arch_cpu_is_core_enabled.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 10:15:32 +01:00
Karol Trzcinski 4e53f78583 platform: intel: clock: Merge clock change to single function call
It was needed to call two functions and update one global variable
to change clock frequency, what is quite error prone solution.
After merging it to one function, it is easier to keep clock description
synchronized.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 10:15:32 +01:00
Karol Trzcinski ef10ecb6c2 platform: intel: clock: Explicit change active frequency index
In situation with two or more active cores, saving active frequency
index in platform_clock_on_waiti suffer from race condition.
Changing state in *set_cpu_freq() method is much more safe.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-09 10:15:32 +01:00
Uday M Bhat d2a75ad038 topology: jsl-rt1015: PLL input at 50fs is no longer supported
The new recommended settings at 48Khz rate are:

PLL input       SSP bclk
------------------------
64fs            3.073Mhz
100fs           4.8Mhz

Modifying topology to 64fs
2020-07-08 14:40:54 +01:00
Marc Herbert 123081c34f xtensa-build-all.sh: log the main cmake and defconfig commands
The main build script has a fairly verbose output by default but not the
most important things it does yet. These commands are useful to "peel"
the layer of indirection and debug cmake issues; either locally or when
wondering what CI does.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-08 13:44:27 +01:00
Marc Herbert a107cfabab dist.cmake: add --prefix to git archive to stop creating a "tarbomb"
A "tarbomb" is an archive file that has more than one directory at the
top level, which is (fortunately) unusual for .tar files. By default,
tar extracts archive members "as is" in the current directory. If the
archive has many top level members then it becomes very hard to make the
difference between what was just extracted versus what was already
there. As extraction is recursive this gets much worse because the
problem can repeat itself in subdirectories. As the last but not least
nail in the coffin, tar silently overwrites existing files by default.

This commit is admittedly an "incompatible build API change" meaning any
higher level build or packaging script that was consuming source release
tarballs (as opposed to git cloning the source) will require a small
change. Consumers of release tarballs must be rare though because the
output of "make dist" has already been broken by commit
c00d39c71b ("Add rimage as a git submodule") anyway yet no one noticed
yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-08 13:40:36 +01:00
Karol Trzcinski adc8cc22cc sof: Unify hex dixplay style
Consistency should be kept so usage the same HEX case throughout the FW
is advised.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-07 15:48:43 +01:00
Karol Trzcinski 40cfa6d5f1 pipeline: Trace used clock frequency in pipeline_complete
In logs, there should be information about used clock frequency,
to better analyze issues related with performance. On pipeline
complete, clock value should already be settled down.
Another reason of location this log in this place is each
pipeline may work on different core.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-07 15:48:43 +01:00
Karol Trzcinski b496df0ea8 lib: clock: Trace clock change
It's nice to know what is current clock frequency, especially when
some troubles with performance occurs.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-07 15:48:43 +01:00
Karol Trzcinski f4982cc84a ipc: Log information about pm gate
Bugs in power managements, may have implications in many places
in code, so each change should be notified.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-07 15:48:43 +01:00
Pierre-Louis Bossart 7ef73131b9 SRC: remove from Baytrail/Cherrytrail configurations
We really don't care about SRC on those platforms and the memory
footprint is too large anyways.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart aef421ac4a topology: cht-max98090: align with byt-nocodec
Only the SSP settings need to be different.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart b51cb9113a topology: remove cht-src-50kHz-pcm512x
No one uses this topology so let's remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart 1a8c123511 topology: cht-rt5682: align with byt-codec topology
Same parameters, so let's use the same template

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart 1a56804ff7 topology: align cht-nocodec and byt-codec topologies
Additional work needed to make the BE name and index configuration, as
well as LBM quirk.
We should be using a single topology here.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart ec47eefa13 topology: sof-byt-codec: connect pipe-host-volume-playback to mixer-dai
remove the low-latency pipeline and pcm-media.

Instead, we use 2 two pipe-host-volume-playback with different periods
connected to the same mixer-dai.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart 7189916c53 topology: introduce pipe-host-volume-playback
Add a new pipeline definition to avoid mucking with either
pipe-low-latency or pipe-media.

The code is 90% similar to pipeline-volume-playback but includes a
scheduling component.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart b971f2b753 topology: add pipe-mixer-dai-playback
Add separate pipeline starting with a mixer (similar to Baytrail
switch matrix and SKL closed-source firmware)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Shreeya Patel 8a90be118c scripts: build-tools.sh: Make tools individually buildable
More control over which tools should be built, instead of building
everything every time.

Note: All the build files will be removed every time this script is ran
since tools are not independent of each other.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-07-06 17:19:04 +01:00
Karol Trzcinski 1f092df401 pcm_converter: Convert linear memory regions
Usage of pcm_convert_as_linear() function speed up conversion
and make core convert function easier to implement.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-06 17:15:17 +01:00
Tomasz Lauda cf8e4339fe cavs: shim: make register functions common
Moves register helper functions to common cavs header.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-07-06 17:05:24 +01:00
Seppo Ingalsuo 656b36967a Audio: ASRC: Track skew min/max values and trace them in asrc_reset()
This patch adds useful trace to help solve possible issues with slave
DAI rate stability. If there are quality issues with ASRC, it is
useful to check the reported values. Skew values are Q2.30 fractional
integers.

E.g. at skew of 1073518174 the measured DAI sample rate is
48000*2^30/1073518174 = 48010 Hz when nominal rate is 48 kHz.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-07-06 16:22:20 +01:00
Seppo Ingalsuo f63adb42d9 Audio: ASRC: Get consumed and produced frame counts from filter core
This patch changes the parameter input_num_frames to in/out type
for push mode 16 and 32 bit processing functions. If the processing
core needs to stop due to insufficient number of frames free in the
output buffer the amount of frames can be less than requested. The if
statement for exit from while() loop is simplified. Also the if
statement tests order for ASRC_BM_CIRCULAR is changed.

The changes for pull mode 16 and 32 bit mode are similar. The parameter
out_num_frames is changed to in/out since the frames count could be less
than requested if there is no sufficient amount of input frames
available.

The upper level 16 and 32 bit copy() functions are updated to use the
returned value for SOF buffers consumed/produced.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-07-06 16:22:20 +01:00
Keyon Jie 2bd3026291 detect_test: refine the activation threshold to fix trigger issue
Refine to use the consistent activation threshold for different formats,
use a unified coefficient 0.05, and update the threshold at .params().

These refinement will fix the KWD trigger volume inconsistent for
different sample format issue.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-07-06 16:17:57 +01:00
Marcin Maka 882875fa45 volume: add details to sink size error message
Required sink size and actual size should be available
in the log file.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-07-02 11:26:37 +02:00
Rander Wang 7b532d3712 topology: tgl-sdw-max98373: change DMIC16k format to 32LE
For original DMIC16k only S16_LE is supported in pcm capability.
Now this patch enables S24_LE and S32_LE for applications like
DMIC01.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-07-01 09:56:51 +01:00
Marc Herbert 1c4d14a5fb qemu-check.sh: restore error messages when test fails
Fixes 428804e1c ("scripts/qemu-check.sh: add set -e") which failed to
consider the case of an empty $IPC_REG or $IPC_MSG.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-30 11:30:19 +01:00
Marc Herbert 8ceef9d460 qemu-check.sh: make $ROM a quoted bash array "${ROM[@]}"
Removes shellcheck warning and could allow directory names with
whitespace in a very distant future.

Silence printf "$@" shellcheck warning in die() function.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-30 11:30:19 +01:00
Keyon Jie 77e42657c6 topology: sof-hda-generic-kwd: switch to use vol-kfbm mode
We need PGA to tune the volume for the KWD pipeline, switch to use
vol-kfbm mode to get it done.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-06-30 11:13:48 +01:00
Bartosz Kokoszko b4e7150f42 mn: clear mclk and bclk source clks in MDIVCTRL
We should clear MNDSS and MCDSS bits before setting
new mclk and bclks source clocks. This commit is
going to fix case when driver want to reconfigure
the same SSP (e.g. index = 0).
1. Driver sends ssp_config() and FW configures ssp
   (index = 0) with MCDSS bits set to e.g. 1.
2. Driver wants to reconfigure the same ssp (index = 0)
   by sending new ssp_config() and FW tries to configure
   ssp 0 once again, but firstly it reads MDIVCTRL
   register:
	mdivc = mn_reg_read(MN_MDIVCTRL, mclk_id)
   and then tries to set MCDSS(0):
	mdivc |= MCDSS(0);
   , but there is "or" function here - after it MCDSS bits
   still will be set to 1. That's why we should clear this
   bits earlier.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-30 10:34:11 +01:00
Marcin Maka 461f7d552c kpb: add detailed info to error messages
Parameter validation should give detailed information about wrong
settings to speed up the troubleshooting.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-06-29 21:58:08 +01:00
Seppo Ingalsuo 6bae1569a2 Audio: Make volume gain ramp update rate variable
This patch adds to volume component capability to use one of
four ramp update rate presets 125 to 1000 us depending on topology
defined ramp length that is typically between 20 to 250 ms. The
rate needs to be higher for faster ramps to avoid zipper noise.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-29 21:55:44 +01:00
Seppo Ingalsuo 3dc0ae97ac Audio: Improve volume ramp time calculation precision
This patch changes the ramp time (from ramp start) calculation
unit from millisecond to Q29.3 milliseconds. It changes the smallest
time difference and therefore ramp slop point value down to 125 us
so finer than 1000 us volume update rate can be used. E.g. update
rates 125/250/500 us are good choices for high update rate.

The higher ramp update rates can be defined in volume.h if the volume
ramp need to be much shorter than currently while avoiding
audible zipper noise.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-29 21:55:44 +01:00
Seppo Ingalsuo 673e335a7a Tools: Topology: Change playback volume ramp duration to 20 ms
This patch shortens the ramp duration to 20 ms from 250 ms in all
topologies with volume playback. In addition the zero crossings detector
mode is enabled to mitigate zipper noise.

The change includes for the not yet updated pipeline macros a rename
of macro for tokens data with pipeline number suffix to ensure no
undesired volume instances are impacted by this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-29 21:55:44 +01:00
Daniel Baluta 259a98ed4c scripts: checkpatch: deprecate 80-column warning
Yes, staying withing 80 columns is certainly still _preferred_.  But
it's not the hard limit that the checkpatch warnings imply, and other
concerns can most certainly dominate.

Increase the default limit to 100 characters.  Not because 100
characters is some hard limit either, but that's certainly a "what are
you doing" kind of value and less likely to be about the occasional
slightly longer lines.

Miscellanea:

 - to avoid unnecessary whitespace changes in files, checkpatch will no
   longer emit a warning about line length when scanning files unless
   --strict is also used

 - Add a bit to coding-style about alignment to open parenthesis

dbaluta: This patch is taken and manually applied from Linux kernel
tree. See commit, in Linux kernel tree:

bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-29 20:57:55 +01:00
Adrian Bonislawski eaf49e26b4 mailbox: unify sram fw regs
This patch will move all sram fw regs offsets (only offsets) to a commpon
mailbox.h

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-29 20:11:06 +01:00
Tomasz Lauda b49080c784 mixer: reset additional check is only needed for playback
Limits additional check in mixer_reset to playback streams only.
For mixer in capture streams the request will always come from downstream,
which means that source components will always be in state >
COMP_STATE_READY. Checking sink component also doesn't make,
because it's the source of the request. The logic is now similar
to the mixer_trigger, where for capture streams we also don't require
additional checks.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-26 21:23:04 +01:00
Karol Trzcinski e9d274529e buffer: Describe buffer flags in init log
Buffer flags is important field and should be accessible in logs
output.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-26 10:08:24 +01:00
Karol Trzcinski ebd2b1869e smart_amp: Merge dbg logs from copy function
Number of available frames from feedback and passthrough buffers
should be in the same format and close together for easily compare.
Moreover reducing number of logs, especially from copy function is
important in terms of logs readability and FW performance - adding
one more parameter have much less impact on FW than adding one more
log message.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-25 14:32:18 +01:00
Bartosz Kokoszko dcb185a78c comp: return 0 in data size 0 case in comp_set_model
In comp_set_model() function, when required size is equal to 0,
we should not allocate memory and just return 0.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-25 14:31:37 +01:00
Bartosz Kokoszko 998f0a422d comp: return warning instead of error in comp_get_model()
In comp_get_model() function we should return warning in
case not allocated model->data.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-25 14:31:37 +01:00
Karol Trzcinski 6a23e48e15 perf_cnt: Add simple tic-toc api
For simple performance measurement and optimization in development stage,
tic-toc api is provided. Performance data are traced at each tok call,
to allow fast clocks usage deviation estimation.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-25 14:28:55 +01:00
Marcin Maka 96b303ea6a gitignore: add Eclipse project metadata
When sof source code is edited in Eclipse, the project
metadata files should be ignored by git.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-06-25 14:28:12 +01:00