Commit Graph

527 Commits

Author SHA1 Message Date
Marcin Maka 36e58d279b alloc: replace r- macros with renamed functions
Once the debug version of allocation functions are removed,
macros may be replaced with functions declared without leading
_ which makes the documentation (and the header) more readable,
the defines section does not need to contain doubled documentation
of alloc api.

bzero macro is not esasily removable due to include deps which
bring earlier declaration of non-inline prototype.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Seppo Ingalsuo 8320376ab4 Testbench: Fix segfault in pipeline_new() in topology parsing
This patch fixes the crash by adding initialize of sof->pipeline_posn
into pipeline initialization code.

Also the in load_pipeline() function the pipeline is initialized
to zeros to prevent random values to be passed in not set
struct fields. It didn't fix anything but makes debugging of crash
easier.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-27 10:40:37 +01:00
Marc Herbert ba38c7d750 Testbench: panic() calls abort()
... as opposed to doing nothing and returning.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-27 10:26:56 +01:00
Marc Herbert 9b1b6158e3 tplg_parser: fix -Werror=maybe-uninitialized source, sink
Fixes:

tplg_parser.c: In function ‘tplg_load_graph’:
tplg_parser.c:979:2: error: ‘sink’ may be used uninitialized
                     in this function [-Werror=maybe-uninitialized]
  979 |  printf("loading route %s -> %s\n", source, sink);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 21:00:19 +00:00
Sebastiano Carlucci 60fc730003 tools: testbench: Include dcblock in testbench
This commit adds support for running test for dc blocker.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci 0cf80e2d32 tools: test: Add DC Block test case to tplg-build
This commit includes a new test case in tplg-build.sh. It also includes
the new simple pipelines pipe-dcblock-capture/playback. Those new
pipelines are used by tplg-build.sh to generate the test pipelines.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci c6f83acd0e tools: tune: Add tools to generate bytes control
This commits adds the scripts to generate the bytes control blob
for the DCB. It also provides some generic scripts to convert
valid binary blob to a csv or binary file (usable by sof-ctl)
or an m4 byte control topology file.

This commit adds two new folders under tools/tune
- dcblock: scripts to generate the blob in Octave
- common: scripts to convert any generic blob to a config file.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci eae636c4ff sof: dcblock: Add DC Blocking Filter Component
This change provides a DC Blocking Filter (DCB) component. A DCB is a
high-pass filter used to remove any DC offset from a signal. The
coefficients for the component can be set individually for each channel.

Currently, only the following formats are supported:

s16_le
s24_le
s32_le

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Fred Oh f734991fbe topology: enable eq pipeline when EQ is enabled in makefile
Instead of making new files for audio equalizer topology, reuse existing
topology and replace only volume pipeline by macro replacement.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-26 10:18:11 +00:00
Marcin Maka 0f88be3e1a mm: separate alloc api and heap mgmt api
All clients that just wants to allocate and free memory
does not need to know all the heap management api
and internals.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Seppo Ingalsuo 3ce54df7b8 Tools: Test: Audio: Add double quotes to shell scripts
This patch adds the double quotes to shell scripts to avoid fails
with arguments or shell variables when there are space characters.

The processing components run scripts are all edited for better
structure with functions usage() and main() and with local variables
within functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-26 10:03:16 +00:00
Karol Trzcinski 7bf879b226 tools: logger: Add clock parameter in help message
help message should explicity show that -c flags needs parameter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski fc84534247 tools: logger: Add LDC dump option
Create dump options for logger to print important information from
LDC file, like DBG_ABI version and UUID with corresponding names.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski ee692abd97 tools: logger: Refactor format_uid()
Split this function to part responsible for pointer calculation
and string formatting. It make possibility to use same
string format with different pointer arithmetic.
Moreover introduce aprintf to make memory allocation for output
string more automated process.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski e087ed7aa4 tools: logger: Align logs header to content
Double space in formatting string led to little mismatch between header
and content in output logger file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Bard Liao ae53aebcff topology: sof-icl-rt711-rt1308-rt715-hdmi: define NO_AGGREGATION mode
We will create individual PCM for each speaker when NO_AGGREGATION
is defined

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-25 13:10:48 -05:00
Bard Liao 2c00080987 Topology: sof-icl-rt711-rt1308-rt715-hdmi: Use demux for platforms with multiple speakers
We only need demux for two speaker dais case.

Fixes: 5e8de9fd52 "topology: sof-icl-rt711-rt1308-rt715-hdmi: Merge
two pipeline with demux"

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-25 13:10:48 -05:00
Payal Kshirsagar 7a646c9dbd testbench: remove unneeded variable
Remove unneeded temporary local variable, its declaration and newlines.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-25 15:22:09 +01:00
Pan Xiuli 2978741118 topology: fix apl-demux-pcm512x HDMI dai id
The HDMI DAI id changed, update the demux topology.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-03-25 14:55:49 +01:00
Guennadi Liakhovetski 4722cf9314 topology: remove an unused parameter from dai.m4
The N_DAI_OUT and N_DAI_IN pacros, defined in dai.m4, don't take
parameters, fix their usage.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-03-25 13:12:14 +00:00
Guennadi Liakhovetski 3bccc18036 topology: fix a copy-paste error in comments
Replace multiple occurrences of a copy-paste error in comments in
bytecontrol.m4: CONTROLMIXER should actually be CONTROLBYTES.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-03-25 13:12:14 +00:00
Bard Liao 40454099b0 topology: pipe-volume-demux-playback: Move demux after volume
So the volume control will apply to both pipelines.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-25 13:00:12 +00:00
Karol Trzcinski b5bb895e57 tools: logger: Add 'error: ' prefix to messages in log_err function
After change error messages will be more consistent and easy to grep.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-25 13:59:45 +01:00
Karol Trzcinski 354ff5ccf9 tools: logger: Skip double error logs to stdout
When out_fd points standard output then error message shouldn't be
duplicated - duplicated messages only make logger output more messy.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-25 13:59:45 +01:00
Libin Yang f755277000 topology: sof-icl-rt711-rt1308-rt715 add MIC MUTE LED support
Add support of MIC Mute LED for capture on
sof-icl-rt711-rt1308-rt715 platform.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
2020-03-25 12:24:25 +00:00
Libin Yang 74e626a7be topology: add pipe-highpass-switch-capture pipeline
This patch adds the highpass capture pipeline which enables the volume
and switch controls. In the switch control, it enables capture LED
controlling.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
2020-03-25 12:24:25 +00:00
Libin Yang 870448d374 topology: add pipe-volume-switch-capture pipeline
This patch adds the capture pipeline which enables the volume and switch
controls. In the switch control, it enables capture LED controlling.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
2020-03-25 12:24:25 +00:00
Marcin Maka 23d0eae9e2 comp: ops: rename new as create
New is c++ keyword which causes errors while generating
the documentation for component api with sphinx and breathe.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-25 11:04:15 +01:00
Fred Oh 3b66418a0e topology: move byt/cht platform specific settings
Move byt/cht platform specific ifelse to platform files.
And byt/cht have codec and nocodec differences, which need to have
PLATFORM-codec and PLATFORM-nocodec files.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-24 11:42:26 +00:00
Fred Oh 1040c35d23 topology: move ifelse conditions to platform files
Move platform specific conditions to each platform file.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-24 11:42:26 +00:00
Seppo Ingalsuo 26ea50ecd0 Topology: Fix in EQ only pipelines with macro PIPELINE_SINK
This patch fixes the buffer to define as PIPELINE_SINK. The
upper level topologies do not use these topologies so there has
not been related errors. However test pipelines were impacted.

Also the PIPELINE_PCM defined name is made more generic. It can
be whatever and not just high-pass type.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo ce1401f62a Tools: Test: Cleanup component run scripts
The src_run.sh is converted into a generic component run script
that is called by new simple component specific scripts asrc_run.sh,
eqfir_run.sh, eqiir_run.sh, src_run.sh, and volume_run.sh.

Note: The testbench does not yet have fully working capture support
so the direction is not exposed yet.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo 0c35f1efde Testbench: Build topology parser with debug symbols
This patch adds compilation with -g. Optimization -O was added to get
optimization that preserves sane debugging with gdb. This component
is not critical for speed in simulation.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo dc44384ea0 Testbench: Fix possible uninitialized use of variable ret
This patch fixes the read_samples_32() function in file component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo 0eeda80bdf Testbench: Add processing component load
This patch adds to testbench capability to run pipelines with EQ_IIR
and EQ_FIR components. The component is configured with the topology
embedded configuration blob when instantiated with new().

The load of volume component has been enhanced to parse volume tokens and
compute the min and max volume parameters.

The topology parsing and component library load has been changed to
support processing component load and extracting of control private
data. The testbench build has been changed to create libraries
for EQ components.

The testbench command line parsing has been improved to return
error for invalid library request.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 13:29:00 +00:00
Seppo Ingalsuo 25c1d0fef7 Topology: BDW, BYT, CHT: Reduce buffer size max for media PCM
This change prevents the IPC error that happens if aplay or
speaker-test uses larger than 64 kB buffer size. The buffer
setting in PCM_CAPABILITIES() is now the same as for low latency
PCM.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-20 11:56:56 +00:00
Jairaj Arava 35e5b23f7f topology: add TGL tplg for Max98373 amp and ALC5682 Headset codec
This patch adds TGL topology for the DUT which has the
following audio configuration:
	Max98373 speaker (I2S), ALC5682 headset codec (I2S),
	DMIC, 4 HDMI devices.

Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
2020-03-20 11:30:40 +00:00
Karol Trzcinski 74fa3c0a09 tools: logger: Create log_err function
Error during conversion should be logged to stderr and to
output file by default. Such a approach will speed up debugging
process when some error with conversion occur in CI.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-20 11:16:54 +00:00
Karol Trzcinski 0f3d84ecea tools: logger: Align indentation in convert function
Content inside if statement should be indented with only one
tab more that if keyword.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-20 11:16:54 +00:00
Adrian Bonislawski f1fa3be980 probes-app: add allocation check
This will check if the allocation succeeded

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-18 21:58:03 +00:00
Adrian Bonislawski 2765b22049 probe-app: assume probe packet aligned
Thats because probe packet struct is packed and aligned to 1
which will generate a warning (error) with pointer assigning

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-18 21:58:03 +00:00
Bard Liao 5e8de9fd52 topology: sof-icl-rt711-rt1308-rt715-hdmi: Merge two pipeline with demux
Now kernel expots one PCM with two CPU dais. So use demux to play
with two DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Bard Liao 0a52c2e319 topology: add pipe-dai-endpoint
This will create a basic pipeline with a buffer only. Note that
we don't implement a SectionGraph to connect the buffer to its
starting component, we should define it manually.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Bard Liao da8ac71a29 topology: add pipe-dai-sched-playback
This is basically the same as pipe-dai-playback.m4, but use SCHED_COMP
instead of N_DAI_OUT.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Bard Liao 3ae3beffbc topology: dai: add DAI_ADD_SCHED to set scheduling component
So we can set scheduling component when adding a DAI.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-17 16:43:06 +00:00
Marcin Maka ac01040efe comp: api: advanced and internal functions separated
The current content of component.h is a mix of basic api, common
basic helpers for every component developers as well as advanced
functions and macros used by infrastructure and very specialized
components like host, dai, kpb etc.

This patch moves the advanced part to component_ext.h and keeps
only basic part in component.h to avoid overloading effects
component developers with declarations and code they do not use.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 16:13:29 +01:00
Marcin Maka 0529c141f4 tasks: add uuid based identification for tasks
Tasks activities may be traced and analysed easier if they
are identified by uuids and named.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 15:11:42 +02:00
Seppo Ingalsuo df6c637e8f Topology: BYT: Adjust SRC pipeline for lower RAM consumption
This patch removes support for over 48 kHz sample rates and changes
scheduling to every 1 ms to save in buffers sizes. In pipe-pcm-media.m4
the buffers in the pipeline are reduced from 4 to 2 or 3 periods.
These changes should allow the media PCM to work in BYT platform.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-16 19:43:44 +00:00
Adrian Bonislawski 496845984f probes-app: build the app with sof tools
this will allow to build probe app from scripts/build-tools.sh

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-03-13 16:26:16 +00:00
Marcin Maka 93cf630d9d logger: support for uuid address as entry parameter
Log entry format is scanned by the logger and if %s is found,
then corresponding parameter is interpreted as address
of static uuid entry. The original address is replaced by
formatted uuid namen and value, painted in blue, before
fprintf() is called.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-06 10:15:04 +01:00