Skip to content

Conversation

@ranj063
Copy link
Collaborator

@ranj063 ranj063 commented Nov 17, 2022

This is rebased on top of #6592 and should be merged only after that one is merged

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

thanks for starting this @ranj063. These days all I do is review your PRs :-)

Couple of suggestions below

Copy link
Member

Choose a reason for hiding this comment

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

i find it hard to review this.

dai_index = 2 is seen on both line 123 and 140. is this a bug or a feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

its a feature. This one is FE DAI index 2 and the other one is BE DAI index 2

Copy link
Member

Choose a reason for hiding this comment

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

dai_index always before stream name?

Copy link
Member

Choose a reason for hiding this comment

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

them why not use the same value to FE DAI index and PCM ID with a macro or something that enforces this rule?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I think I should do that for my own sanity and others' as well

Copy link
Member

Choose a reason for hiding this comment

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

do we ever have a case where dai_type and copier_type are different

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

copier_type is applicable to all copiers (host, module, DAI copiers) whereas dai_type is only applicable for the DAI copiers. When set, the dai_type and copier_type must match. But we need 2 attributes because the dai_type is added as a token whereas copier_type is purely for the use of naming the copier

Copy link
Member

Choose a reason for hiding this comment

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

For ALH I am not sure if the dai_index has any meaning. It's my understanding that the same copier or gateway will manage streaming over multiple links.

@bardliao need your help here.

Copy link
Member

Choose a reason for hiding this comment

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

do we need to add the pipeline ID? It's used for topology1 and helps visualize the pipeline boundaries.

The position in the pipeline could also be useful for controls.

Maybe we need

<pipeline> <position in pipeline> 

for all modules, and

<dai_index>

in addition as a suffix for copiers only? (with the caveat on dai_id for ALH above)

It is not used at all.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/cavs_tplgs_part2 branch from 4fd7a25 to d5ce924 Compare January 19, 2023 18:38
@ranj063 ranj063 changed the title [DO NOT MERGE] Topology clean ups - Part 2 Topology clean ups - Part 2 Jan 19, 2023
@ranj063 ranj063 marked this pull request as ready for review January 19, 2023 18:38
@ranj063 ranj063 force-pushed the fix/cavs_tplgs_part2 branch from d5ce924 to b56a22e Compare January 19, 2023 19:51
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Changes look good, but the motivation/background would be nice to have (maybe link to some kernel/FW PR and/or discussion).

Object.Dai {
HDA.0 {
name $HDA_ANALOG_DAI_NAME
dai_index 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

The commit leaves me a bit hanging on why these changes are made. The "This is in preparation" is information, but at least for me, this still opens questions. What it is the "instance" id, why we are adding one, how should I set it, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1, changes "in preparation for something in the future" are always difficult, if possible, such changes are easier to understand when submitted together with the actual use-case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kv2019i @lyakh hopefully the commit messages give you more context now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BTW I want to make this a rule in tplg2 to have an instance for every object. will be adding that in the compiler soon.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks @ranj063 the expanded description is very helpful.

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.

@jsarha pls review

Add an instance attribute that will be used to instantiate DAI objects
and make dai_index a mandatory attribute for all DAI objects types. This
is in preparation to make the instance attribute default for all objects
with topology2. This is required because the topology2 compiler allows
for expansion of string values with variable definitions. So, if we
wanted to expand the value of dai_index from a variable definition(shown
as below), it is only possible if it were a normal attribute instead of
the node ID as it is currently.

Define {
	SSP_DAI_INDEX	3
}

Object.Dai.SSP.1 {
	dai_index	$SSP_DAI_INDEX
}

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add an instance attribute and make the name attribute mandatory for the
hw_config objects. This is required because the topology2 compiler allows
for expansion of string values with variable definitions. So, if we
wanted to expand the name from a variable definition(as shown below), it
is only possible if it were a normal attribute instead of the node ID as
it is currently.

Define {
	SSP0_HW_CONFIG_NAME	"SSP0"
}
Object.DAI.SSP.1 {
	dai_index 0
	Object.Base.hw_config.1 {
		name $SSP0_HW_CONFIG_NAME
	}
}

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/cavs_tplgs_part2 branch from 98f2137 to 476eabd Compare January 20, 2023 15:53

Object.Dai {
HDA.0 {
name $HDA_ANALOG_DAI_NAME
Copy link
Collaborator

Choose a reason for hiding this comment

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

"This is required because the topology2 compiler allows for expansion of string values with variable definitions." - did you mean "doesn't allow?" Same in the next commit. But how does it help to solve the issue with included topology2 files? You still need to use unique module / component names in them, don't you? And since you don't know where it's included from and what numbers are already taken you end up trying to guess some "really large number that nobody hopefully has taken yet"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lyakh no I meant "allow". This PR is not meant to solve the issue with topology2 files but rather only amined at being able to allow substituting the dai_index for DAI objects and name for hw_config objects

@ranj063
Copy link
Collaborator Author

ranj063 commented Jan 23, 2023

SOFCI TEST

@kv2019i kv2019i merged commit 97374b6 into thesofproject:main Jan 23, 2023
@ranj063 ranj063 deleted the fix/cavs_tplgs_part2 branch January 23, 2023 19:47
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.

7 participants