* Use %z specifier for size types to avoid format
specifier warnings on arm32
* in ctl_dump(), size_t n may be used uninitialized
if ctl_data->out_fd > 0 and !ctl_data->binary.
Signed-off-by: Li-Yu Yu <aaronyu@google.com>
sof-ctl assumed the binary control were of size of a
multiple of unsigned integer.
This caused the control byte array to be truncated when the
size of the control was 6 bytes.
This change allow setting any size of control in binary form.
Using CSV will always end up with a number of unsigned integer size.
I tested this change using the Google RTC Audio processing with control
of size:
- 6 bytes,
- 2 bytes
- and 4 bytes.
Signed-off-by: Lionel Koenig <lionelk@google.com>
The previous patch increased the FIR length but it also triggered
a numerical issue in FIR design with long minimum phase filters. The
filter became essentially a band-stop filter and causes difficulties
in test of EQ component. Also the equalizer sounds subjectively
bad. The fix is to change the design to linear phase that always
converges.
Fixes: 0d296ce7d1
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The loudness EQ is changed to 250 taps to create large IPC
message type. It also improves subjective quality of this
effect with better bass response. The earlier version was
made very short to fit the that time IPC size limit.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
These flags are required to prevent unwanted bugs in the ctl tool. They
have been used to detect an undefined behaviour instance which occurred
due to lack of a return value in a non-void function.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Most of the errors are unused variables, plus an unused label. Those are
benign.
One of the errors was the following:
/work/repos/sof/tools/ctl/ctl.c: In function ‘ctl_set_get’:
/work/repos/sof/tools/ctl/ctl.c:497:1: error: control reaches end of
non-void function [-Werror=return-type]
497 | }
| ^
This error had caused an undefined-behaviour-driven bug internally (an
error being displayed with a return code of 0, when it shouldn't have
been possible to display that message if the return code was 0). At line
614 of the old code, the message "Error: could not Set control, ret:0"
was displayed.
The errors only show up when you add -Wall -Werror to the compile
options of ctl, which I will do in the next commit.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
getopt() returns an int, which in our implementation is assigned to a
char type var.
On some platforms char is unsigned thus making getopt() return value
always > 0.
Use int instead of char here to fix the stop condition for parameter
parsing.
This makes sof-ctl work on ARM platforms.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This patch checks for the access type of kcontrol and returns error
only when the access type is not read or write.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
This patch adds for EQ tests and presets switch development a
bundle with five presets: flat, loudness, bass-boost, band-pass,
and high-pass. The m4 file is used by including to topologies. The
text format file is for sof-ctl.
The added code to script example_iir_eq.m is included. The blob is
also useful for testing multi-part IPC for EQ component. The existing
examples were not large enough to exercise the feature.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces in topology sof-hda-generic.m4 the use of macro
pipe-volume-capture.m4 usage with a new macro pipe-highpass-capture.m4.
The used 40 Hz cut-off is sufficient to suppress the DC pulse in the
beginning of capture from headset with minimal impact to other
applications such as recording music.
The capture volume ramp length is changed from 250 ms to 400 ms. The
longer ramp is feasible because the microphone path seems to open
at 500 ms from capture. It helps to attenuate the remaining noises
in the beginning of capture.
The patch also adds additional high-pass responses macros for
topology with different 20-50 Hz cut-off frequencies into
SOF/tools/topology/m4.
The changes for Matlab/Octave script example_iir_eq.m that
generated the filter coefficients are included here as well.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The Xtensa GCC build on APL platform can process about 40 taps
FIR filter so it is useful to have one such configuration. The
eq_fir_mid.txt is be applied with sof-ctl tool.
The patch contains the Octave script modification. The print of final
filter length is added to blob packer script to see the resulting
length when the filter is generated. The small filter spec change
helps the filter tool to achieve result that is close to requested
shape.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds command line option "-g" to generate and with help
of options "-o <file>" to store the current ABI version header data
into file. Use "-b" to change the default CSV format to binary.
It is used by external tools to create configuration data blobs for
SOF audio processing components.
The parameter for size is the configuration data payload size with
the size of sof_abi_hdr struct excluded. It does not impact the
the length of printed header. It just places the length into the
correct location in the header.
This patch also fixes the permissions of file output. The mode
need to be provided for open() to avoid having no access to
created file and allow overwrite of existing file.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
If no control name is passed to sof-ctl, it currently pops an error,
dumps the usage and then segfaults:
root@gr-mrb:~# sof-ctl -D hw:0
Error: No control was requested.
Usage: ...
Segmentation fault (core dumped)
Fix all that by jumping to the right label.
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Move ctl_elem pointers and buffer initialization out of main(), and
replace calling alloca APIs with malloc ones to make they are shareable
between different functions.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Firmware may use different component specified type in abi header, to
support more than one kcontrols for the same component, here add '-t' to
support specifying this component specified type in the abi header.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Split buffer allocating and freeing part from main(), add separated
functions and call them from main().
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Using '-r' with '-s' means no abi header for the input file, and asks
for not dumping abi header when using '-r' without '-s'.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This will be used on large input file scenario, we need to allocate
buffer according to the input file size.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
We might dump kcontrol values in different format, create data_dump()
and csv_data_dump() for that.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add a globle struct which will store params and be shared among
functions in the later commits, to make the code more readable.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Dump the ABI header from source CSV or DSP data. This will make it
obvious if there are any ABI differences.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This tool is generic and can be used with any binary kcontrol to
send data to/from components at runtime.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>