Skip to content

Conversation

@johnylin76
Copy link
Contributor

Note: 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.

Copy link
Contributor

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are definitely getting close, i think we can take this out of draft now

@cujomalainey
Copy link
Contributor

Also looks like CI is breaking on Seb's crossover changes that need to be removed

@johnylin76 johnylin76 marked this pull request as ready for review July 22, 2020 01:30
@johnylin76 johnylin76 force-pushed the crossover branch 2 times, most recently from a376786 to 888e6e9 Compare July 22, 2020 07:22
@johnylin76
Copy link
Contributor Author

I removed the dependency of crossover library and PR #2802 for this PR. Then it could be merged on its own. Thanks.

@cujomalainey
Copy link
Contributor

@lgirdwood how best should we format this? Also will it need a kernel change?

WARNING: Please update ABI in accordance with http://semver.org
#31: FILE: src/include/kernel/header.h:37:
 	uint32_t data[0];	/**< Component data - opaque to core */
+} __attribute__((packed, aligned(4)));

WARNING: __packed is preferred over __attribute__((packed))
#31: FILE: src/include/kernel/header.h:37:
+} __attribute__((packed, aligned(4)));

WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
#31: FILE: src/include/kernel/header.h:37:
+} __attribute__((packed, aligned(4)));

WARNING: Please update ABI in accordance with http://semver.org
#43: FILE: src/include/user/eq.h:154:
 	int32_t output_gain;  /* Q2.14 */
+} __attribute__((packed, aligned(4)));

WARNING: __packed is preferred over __attribute__((packed))
#43: FILE: src/include/user/eq.h:154:
+} __attribute__((packed, aligned(4)));

WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
#43: FILE: src/include/user/eq.h:154:
+} __attribute__((packed, aligned(4)));

@cujomalainey cujomalainey added the ABI ABI change involved label Jul 22, 2020
@johnylin76
Copy link
Contributor Author

Those WARNINGs are brought by one of my commit: fa82026
to clean up GCC errors.

However, I wonder if GCC errors happened on my env only? Otherwise there should be others hitting such errors already.

@johnylin76
Copy link
Contributor Author

Those WARNINGs are brought by one of my commit: fa82026
to clean up GCC errors.

However, I wonder if GCC errors happened on my env only? Otherwise there should be others hitting such errors already.

And FYI, GCC errors appeared only with Seb's Crossover component commits.
Hmm, then my GCC-error commit actually should not be here... Because this PR is independent of Seb's.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you split the PR into patches per feature with the dependencies first.

Support up to 4 output pipelines for test/topology/test-playback.m4, where
argument TEST_PIPE_AMOUNT is added for identifying the number of pipelines
while generating test topologies.

Multi-output component should be added in ALG_MULTI_MODE_TESTS and
ALG_MULTI_SIMPLE_TESTS to generate test topologies with multiple output
pipelines in the future.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
In order to run multi-output component playback by testbench, this patch
supports 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,..."

Moreover, debug messages in tplg_parser/tplg_parser.c is refined for
demonstrating multiple pipelines better.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
Support channel specification by argument "-c" on testbench

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

Just split into patches, thanks.

Copy link
Contributor

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one optimization that I am not even sure is worth having tbh, I will let others decide if the effort is worth it.


ifdef(`TEST_HAS_PIPE4',
`
# Playback pipeline 4 on PCM 3 using max 2 channels of s32le.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this section could be extracted out to a macro call and the index is just subbed in, thoughts?


# playback DAI is SSP TEST_DAI2_PORT using 2 periods
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same goes for this section

@cujomalainey cujomalainey requested a review from lgirdwood July 29, 2020 01:35
@cujomalainey
Copy link
Contributor

@lgirdwood PTAL as this is blocking the rest of the crossover series

@lgirdwood
Copy link
Member

CI unrelated issues.

@lgirdwood
Copy link
Member

@singalsu any comments ?

@johnylin76
Copy link
Contributor Author

@lgirdwood how best should we format this? Also will it need a kernel change?

WARNING: Please update ABI in accordance with http://semver.org
#31: FILE: src/include/kernel/header.h:37:
 	uint32_t data[0];	/**< Component data - opaque to core */
+} __attribute__((packed, aligned(4)));

WARNING: __packed is preferred over __attribute__((packed))
#31: FILE: src/include/kernel/header.h:37:
+} __attribute__((packed, aligned(4)));

WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
#31: FILE: src/include/kernel/header.h:37:
+} __attribute__((packed, aligned(4)));

WARNING: Please update ABI in accordance with http://semver.org
#43: FILE: src/include/user/eq.h:154:
 	int32_t output_gain;  /* Q2.14 */
+} __attribute__((packed, aligned(4)));

WARNING: __packed is preferred over __attribute__((packed))
#43: FILE: src/include/user/eq.h:154:
+} __attribute__((packed, aligned(4)));

WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
#43: FILE: src/include/user/eq.h:154:
+} __attribute__((packed, aligned(4)));

This is actually not related to this PR, and the alternative solution is provided at b041b42
So we may probably remove the ABI tag?

@johnylin76 johnylin76 removed the ABI ABI change involved label Aug 4, 2020
@cujomalainey
Copy link
Contributor

Agreed, ABI label does not apply to current solution

@lgirdwood
Copy link
Member

@johnylin76 the GCC warnings only come about with more recent versions (and this is being updated now in the CI container to catch any problems). We are currently resolving then when accessed via ASSUME_ALIGNED() CC attribute, but I also think the alignment attribute on the structure definition is needed too. @plbossart any issues adding this attribute to the kernel user/ipc headers ?

@johnylin76
Copy link
Contributor Author

@lgirdwood Thanks for the information I have already done via ASSUME_ALIGNED() in commit b041b42
So this should be no longer an issue now. No need to modify kernel headers.

@lgirdwood
Copy link
Member

@cujomalainey are you OK with changes to merge ?

Copy link
Contributor

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood Yep, only optimizations left that can be done later if needed

@lgirdwood
Copy link
Member

Unrelated failure on Jenkins as this is testbench.

@lgirdwood lgirdwood merged commit b63c3a3 into master Aug 6, 2020
@lgirdwood lgirdwood deleted the crossover branch January 27, 2021 09:24
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.

4 participants