Commit Graph

23 Commits

Author SHA1 Message Date
Seppo Ingalsuo e0a9afe6a7 Topology: Apply high-pass for HDA capture streams
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>
2020-01-16 19:48:33 +00:00
Seppo Ingalsuo f7b9e6270f Tools: EQ: Make a light FIR configuration to test with GCC build
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>
2019-12-20 13:47:18 +00:00
Seppo Ingalsuo d013fbc6d7 Tools: Add current sof_abi_hdr struct print capability to sof-ctl
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>
2019-09-13 10:25:58 +01:00
Dragos Tarcatu 90873c5d35 sof-ctl: fix segfault when no ctl name given
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>
2019-09-02 21:27:37 +02:00
Keyon Jie 720cdcda67 sof-ctl: fix ABI dumping doesn't work issue
For dumping to output file without '-r', we need to dump ABI header,
here fix it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-17 12:00:54 +02:00
Keyon Jie d2e5c6a78a sof-ctl: split and move ctl_setup out of main()
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>
2019-07-03 15:29:59 +01:00
Keyon Jie d5f359c0f4 sof-ctl: add '-t' to support specifying the component type
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>
2019-07-03 15:29:59 +01:00
Keyon Jie a29032420b sof-ctl: add labels to handle failure paths
Add labels in main() to handle kinds of failure cases, with the code
cleanup together.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie e86ba1dcbf sof-ctl: add '-o' support to dump ctl data to a specified file
Here add '-o' to support output control data to the specified file, in
binary format.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie cc717a539e sof-ctl: add separated function for control set/get
Add a separated function ctl_set_get() for tlv set/get, and call it from
main().

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 5de89ad8c1 sof-ctl: add functions for buffer allocate and free
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>
2019-07-03 15:29:59 +01:00
Keyon Jie f3bc979112 sof-ctl: add macros for buffer offsets
Add macros for offsets in the ctl_data buffer, and switch to use them.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie fe28746bba sof-ctl: add '-r' to support raw data mode
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>
2019-07-03 15:29:59 +01:00
Keyon Jie 0c2f1a6cdc sof-ctl: add header_init() for abi header initialization
This will be needed for raw data(without abi header) input file.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 89b4df8c6c sof-ctl: add support to dump kcontrol in binary mode
When specified with '-b', let's dump out kcontrol value in 16bit hex
format.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 32b1021080 sof-ctl: add '-b' mode to support binary format input file
Adding support to binary input file, using '-b' to indicate that.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 98794eef79 sof-ctl: add function to get file size
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>
2019-07-03 15:29:59 +01:00
Keyon Jie 985f49a786 sof-ctl: create functions for data dumping
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>
2019-07-03 15:29:59 +01:00
Keyon Jie 49c0f91a75 sof-ctl: allocate ctl_data struct and switch to use it
Allocate ctl_data struct, initialize it and switch to use it to replace
the local variables.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie efcda78053 sof-ctl: add ctl_data struct for params sharing between functions
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>
2019-07-03 15:29:59 +01:00
Keyon Jie e5096aeb85 sof-ctl: fix a print out format
Adding '\n' after "hdr: type" output to make the header dumping more
easier to be read.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Liam Girdwood 1782676acf tools: ctl: dump header information from CSV and DSP data
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>
2019-06-05 10:04:39 +01:00
Liam Girdwood 2bb9ebe20d ctl: rename sof-eqctl to sof-ctl
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>
2019-06-05 10:04:39 +01:00