Skip to content

Conversation

@singalsu
Copy link
Collaborator

@singalsu singalsu commented Oct 2, 2024

This change fixes for testbench support for topologies where widgets have more than one format. Without this change if not all e.g. count = 8 tokens are found but e.g. count = 7 the tokens are applied to the format array but the index (offset) to next format (of num_sets) is not advanced. So the first entry will be written again for all found formats. The found tokens count can be less than 8 if the optional
SOF_TKN_CAVS_AUDIO_FORMAT_INPUT_PIN_INDEX or
SOF_TKN_CAVS_AUDIO_FORMAT_OUTPUT_PIN_INDEX are not set.

As fix the offset should be advanced when one or more of tokens is found from topology. The total is incremented by count for the loop end condition check.

This change fixes for testbench support for topologies where
widgets have more than one format. Without this change if not
all e.g. count = 8 tokens are found but e.g. count = 7 the
tokens are applied to the format array but the index (offset)
to next format (of num_sets) is not advanced. So the first
entry will be written again for all found formats. The found
tokens count can be less than 8 if the optional
SOF_TKN_CAVS_AUDIO_FORMAT_INPUT_PIN_INDEX or
SOF_TKN_CAVS_AUDIO_FORMAT_OUTPUT_PIN_INDEX are not set.

As fix the offset should be advanced when one or more of tokens
is found from topology. The total is incremented by count for
the loop end condition check.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu singalsu marked this pull request as ready for review October 2, 2024 13:43
@singalsu singalsu requested review from jsarha and ranj063 October 2, 2024 13:44
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.

@ranj063 pls review.


if (found >= count) {
total += found;
if (found > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@singalsu why should we care about found at all then? We should just get rid of it altogether no?

Copy link
Collaborator Author

@singalsu singalsu Oct 3, 2024

Choose a reason for hiding this comment

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

Then none of the parsed tokens would be applied (or like now apply them to 1st format entry only). Please try topologies with multiple format PCMs with SOF plugin to see if you have this issue. I'm running topologies sof-hda-benchmark-comp/wordlength.tplg:

sof-hda-benchmark-eqiir32

Without this I could not load 16 bit topology versions, since the PCM formats are introduced in order s16/s24/s32, so I get only s32 to the formats array. And same with components like SRC with multiple formats, where array of 42 has only 1st set with last format (192 kHz). If I would have pin index tokens set for them then the parsing would work, but they are optional for simple one sink one source components.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: I don't use those HDMI pipelines but there's no simple way to get rid of them in these test toplogies based on hda-generic. I can run these in both a real HDA device and with testbench to run both capture and playback (use -p 1,2,3,4 or - p 1,2 for playback or -p 3,4 for capture as currently there is no automatic discovery for pipelines to enable).

@lgirdwood lgirdwood merged commit 38ec7ba into thesofproject:main Oct 3, 2024
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.

3 participants