-
Notifications
You must be signed in to change notification settings - Fork 349
topology2: use a macro to config if a sdw amplifier support feedback #6915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I asked this before, but I don't recall what the answer was
Can we really encode this '515' value which is related to ALH channels? this might depend on which link and ALH channel is used for the feedback, no? So if this is in an include file should this be a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I asked this before, but I don't recall what the answer was
Can we really encode this '515' value which is related to ALH channels? this might depend on which link and ALH channel is used for the feedback, no? So if this is in an include file should this be a parameter?
@plbossart The ALH index (515 here) is not related to ALH channels. We get alh_stream_id from sdw_params_stream and set copier_data->gtw_cfg.node_id |= SOF_IPC4_NODE_INDEX(data->dai_data);
The only restriction of ALH index is that we can't have duplicated ALH index in a topology. In other words, we can have ALH.0, ALH.1, ALH.2, ALH.3, ALH.4 if we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, so if this is a convention that's totally arbitrary we should not use 515 which was from another era and tied to a specific link/PDI usage. Should we use the same numbers as for PCM devices then in our ALH. numbering? I mean the speaker could be ALH.2 and mic ALH.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, so if this is a convention that's totally arbitrary we should not use 515 which was from another era and tied to a specific link/PDI usage. Should we use the same numbers as for PCM devices then in our ALH. numbering? I mean the speaker could be ALH.2 and mic ALH.4.
I choose the same ALH. number as for IPC3 ALH number is because that way can guarantee we will not use duplicated ALH. number. A problem of using the same number as for PCM devices is that we need two ALH in an aggregated speaker device. For example, currently we have ALH.258 and ALH.514 for one aggregated speaker device, and we can't use ALH.2-1 and ALH.2-2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ALH number is not fixed for IPC3, it's based on macros. I don't mind if we use the same convention but we don't want to encode the link position in the topology, because we'll have to redo this when we support different hardware layouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ALH number is not fixed for IPC3, it's based on macros. I don't mind if we use the same convention but we don't want to encode the link position in the topology, because we'll have to redo this when we support different hardware layouts.
@plbossart Yeah, I know the ALH number is not fixed for IPC3. I meant in the most common case, we have
SDW0 DP2 for headset playback
SDW0 DP3 for headset capture
SDW1 DP2 for 1st speaker playback
SDW2 DP2 for 2nd speaker playback
SDW3 DP3 for dmic capture
Based on above layout I assigned IPC4 ALH number with the same formula as IPC3. i.e. 0x002 for headset playback, 0x003 for headset capture, 0x102 for 1st speaker, etc.
But we don't really care about the real HW layouts. We can still use ALH.2 for headset playback if the headset codec is not on SDW0.
In other words, the ALH index number doesn't need to be changed when the HW layouts are changed.
And we can use the same convention to add a new ALH dai.
Does it make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I am not following what IPC3 convention you are referring to @bardliao since we don't have one?
Or maybe you are referring to the initial CML designs with 1 and 2 amps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I am not following what IPC3 convention you are referring to @bardliao since we don't have one?
Or maybe you are referring to the initial CML designs with 1 and 2 amps?
@plbossart I was referring to the (link_id * 256 + data port) formula. But I just realize that we can use the same rule as the pipeline id and the route id. I.e. pcm id * 10 ~ pcm id * 10 + 9.
I will update the PR to follow the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is very cryptic, what are you trying to say here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is very cryptic, what are you trying to say here?
That was copy paste mistake. I will remove the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if we want to split the feedback? This is fine for an initial start, but we do know this is going to have to be split between the dai and host parts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if we want to split the feedback? This is fine for an initial start, but we do know this is going to have to be split between the dai and host parts
@plbossart I am not sure if I get your question. The dai and host are in different pipelines now. If we want to add some widgets between dai and host, we can add the widgets in the pipeline and add routes for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add some macro definition like linking HOST_PIPELINE_MODULE to DAI_PIPELINE_MODULE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add some macro definition like linking HOST_PIPELINE_MODULE to DAI_PIPELINE_MODULE
@RanderWang I don't think it is necessary. source "copier.ALH.31.1" and sink "copier.host.30.1" are fixed. The pipelines are defined here in the same .conf file and the index are fixed.
75f1bd5 to
40e0ab2
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topology syntax looks fine, but needs @plbossart approval for sdw.
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks mostly good, just two small opens that should be trivial to fix or confirm as correct. Thanks @bardliao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the 515 here intentional? I thought these were removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the 515 here intentional? I thought these were removed
No. I forgot to change the index in hw_config. However, somehow it still works.
40e0ab2 to
eb35cf6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not completely following the formula.
a) what is the relationship between pcm_id and ALH? there could be M:1 and 1:N topologies.
b) what is a route_id
c) why does the pipeline come into play.
That was a long day, bear with me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not completely following the formula.
@plbossart Please see f554a2f for your reference. I am trying to follow the same customary to assign ALH index.
a) what is the relationship between pcm_id and ALH? there could be M:1 and 1:N topologies.
ALH index = pcm_id * 10 + N, where N could be 0 to 9.
For example, say there is an aggregated speaker device
pcm_id = 2, and the ALH index will be 20, 21.
b) what is a route_id
For example,
route.0 {
source "gain.1.1"
sink "copier.ALH.1.1"
}
The route_id above is 0
c) why does the pipeline come into play.
The pipeline id also follows the same rule.
That was a long day, bear with me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart Are you good with this PR?
eb35cf6 to
3c20b66
Compare
|
@bardliao @lgirdwood Can you please wait before merging this PR? I have a more elegant solution for avoid clashes between included file objects and top-level objects. |
@bardliao this is the change I was talking about. Could you please update your PR based on that one? #7113 |
@ranj063 I updated my PR based on #7113, will push after #7113 is merged. |
3c20b66 to
60b3c5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commit message talks about pipeline ID and route ID but all im seeing is dai_index updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
60b3c5f to
74184ff
Compare
index We use the "pcm id * 10 + N" formula where N is from 0 to 9 to assign pipeline and route id in f0a0100 ("topology2: cavs-sdw: group route and pipeline index"). Now apply to ALH dai index. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Not all amplifiers support feedback. We should not add feedback support on topology to shch amplifiers. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg is the same as sof-tgl-rt711-rt1316-rt714.tplg Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Not all amplifiers support feedback. We should not add feedback support
on topology to shch amplifiers.