Skip to content

Conversation

@johnylin76
Copy link
Contributor

This patch is currently followed on top of crossover component PR: #2802

This patch supports testbench playback testing for single-input-multi-output component, e.g. crossover. Test playback m4 file (tools/test/topology/test-playback.m4) is extended to generate up to 4 output pipelines test topologies, where argument "TEST_PIPE_AMOUNT" is provided for identifying the number of pipelines.

While building test topologies, 2way, 3way, and 4way crossover playback topology files will be generated under build_tools/test/topology/ with names as follows:
test-playback-ssp5-mclk-0-I2S-2way-crossover-s16le-s16le-48k-24576k-codec.*
test-playback-ssp5-mclk-0-I2S-3way-crossover-s16le-s16le-48k-24576k-codec.*
test-playback-ssp5-mclk-0-I2S-4way-crossover-s16le-s16le-48k-24576k-codec.*
and so on.

Testbench Run
For example of running 4way-crossover playback, the coefficient file with 4-sink crossover should be generated under tools/tune/crossover/ by

octave example_crossover.m

Then after building, run testbench by the following command:

testbench -i input -o output_1,output_2,output_3,output_4 -t test-playback-ssp5-mclk-0-I2S-4way-crossover-s16le-s16le-48k-24576k-codec.tplg -r 48000 -R 48000 -c 1 -b S16_LE -a crossover=libsof_crossover.so

where argument "-o" now accepts specifying up to 4 output file names delimited by comma (in 4way case 4 files should be given), and "-c" specifies channels. The 4way topology file should be specified.

sebcarlucci and others added 6 commits May 7, 2020 11:20
This commit extracts the biquad processing from iir_df2t(). It allows to
reuse the biquad processing code independently of the equalizer
implementation.

Components such as crossover use biquads for processing input.
But it could not do so because iir_df2t() was specific to single output
audio processing.

The motivation behind this change was to reuse the
coefficients of the LR4 biquads for the crossover more freely. An LR4
filter is made of two biquads in series with same coefficients.
Therefore to save memory, we can store one copy of each set of
coefficient, and pass those to the biquad processing function.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
This commit adds Crossover to the list of SOF components. A crossover
filter can be used to split an input to different frequency bands.
The number of outputs should be set statically in the topology. The user
then uses the control bytes to route the frequency bands to different
outputs. (similar to the demux component).

This commit adds support for the following formats:
- S16_LE
- S24_LE
- S32_LE

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
This commit adds the topology files for the crossover component.
The control bytes are generated by the tools in tune/crossover.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
This commit adds the tools to generate the control bytes for the
crossover component. To generate the control bytes, run the
example_crossover.m script.

The parameters of the crossover components are:
- number of outputs
- sink assignments (routing crossover output to different pipelines)
- frequency cutoffs

To tweak the parameters modify the values in example_crossover.m and run
it.

Refer to sof/src/include/user/crossover.h for more information on how
the crossover config is structured and how sink assignments are done.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
The example of error message:

error: taking address of packed member of ‘struct sof_abi_hdr’ may
result in an unaligned pointer value [-Werror=address-of-packed-member]
  477 |   request = (struct sof_crossover_config *)cdata->data->data;
      |                                            ^~~~~

Signed-off-by: Pin-chih Lin <johnylin@google.com>
- Support up to 4 output pipelines for test/topology/test-playback.m4
  Argument TEST_PIPE_AMOUNT is added for identifying the number of
  pipelines while generating test topologies.

- Support multiple output file mode on running testbench.
  Argument "-o" is modified to accept specifying up to 4 filenames
  delimited by comma. e.g. "-o output1,output2,..."

- Crossover component testing is added on testbench.

- Support channel specification by argument "-c" on testbench

- Refine debug messages for tplg_parser/tplg_parser.c

Signed-off-by: Pin-chih Lin <johnylin@google.com>
@cujomalainey
Copy link
Contributor

Mind if we either cherry-pick your changes to a new branch or rebase @sebcarlucci's changes out of your branch so that we only review the related testbench changes in this PR? Just to keep things simple and also so we won't be gated by the UUID PR.

@cujomalainey
Copy link
Contributor

Also, I recommend adding your @google and @chromium emails to your github so the commits are associated to your account so they can be easily related back to you.

@johnylin76
Copy link
Contributor Author

Mind if we either cherry-pick your changes to a new branch or rebase @sebcarlucci's changes out of your branch so that we only review the related testbench changes in this PR? Just to keep things simple and also so we won't be gated by the UUID PR.

I created sebcarlucci#3 rebased on @sebcarlucci's changes. However, I couldn't add any reviewers?

@cujomalainey
Copy link
Contributor

You will need to close that and make the PR in the SOF repo since Seb's fork is essentially archived now

@johnylin76
Copy link
Contributor Author

Got it. I have created #3210 in SOF repo, thanks.

@lgirdwood
Copy link
Member

Thanks @johnylin76 please close the PR you no longer need (since we now have two with the same title).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants