-
Notifications
You must be signed in to change notification settings - Fork 133
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
load topology for each device #5209
base: topic/sof-dev
Are you sure you want to change the base?
load topology for each device #5209
Conversation
SOFCI TEST |
7eb5975
to
ffadfbb
Compare
ffadfbb
to
1deb725
Compare
1deb725
to
3264fc3
Compare
sound/soc/sof/topology.c
Outdated
ret = request_firmware(&fw, tplg_files[i].file, scomp->dev); | ||
if (ret < 0) { | ||
if (i == 0) { | ||
dev_dbg(scomp->dev,"Fail back to %s\n", tplg_name); |
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.
If it was a topology w/ DMIC then you have dropped the -2ch in a previous loop, you are not going to load the topology you supposed to be loading.
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.
Yes, you are right. I need to restore the original topology name.
tplg_name = strremove(tplg_name, "-2ch"); | ||
} else if (strstr(file, "-4ch")) { | ||
tplg_device = "dmic-4ch"; | ||
tplg_name = strremove(tplg_name, "-4ch"); |
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.
why are you dropping the 2ch/4ch from the original name?
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.
Because I would like to load the topology without dmic. For example, sof-hda-generic-2ch.tplg -> sof-hda-generic.tplg or similar.
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.
But the tplg_name is used only for loading the fallback, legacy, monolithic topology, in which case the fragments are not loaded. On a machine which have DMIC, you will load the topology w/o DMIC
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 exactly, tplg_name topology will be also loaded if not all dai links are handled. For example, if the monolithic topology is sof-lnl-rt711-4ch
, then sof-lnl-rt711
and sof-lnl-dmic-4ch-id5
will be loaded
sound/soc/sof/topology.c
Outdated
if (strstr(file, "hda-generic")) { | ||
tplg_device = "idisp"; | ||
} else { | ||
tplg_device = "sdca-hdmi"; |
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 is HDMI audio using SDW link or HDMI audio using HDA link, but used with SDW machine?
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 is the HDMI audio used with SDW codecs. I use different name for different codec interfaces is because that the existing topologies use different PCM id for different codec interfaces. For example, the HDMI PCM ids are 5,6,7 for SDW machines and 3,4,5 for HDA machines.
00-00: Jack Out (*) : : playback 1
00-01: Jack In (*) : : capture 1
00-02: Speaker (*) : : playback 1
00-03: Amp feedback (*) : : capture 1
00-04: Microphone (*) : : capture 1
00-05: HDMI1 (*) : : playback 1
00-06: HDMI2 (*) : : playback 1
00-07: HDMI3 (*) : : playback 1
00-31: Deepbuffer Jack Out (*) : : playback 1
00-00: HDA Analog (*) : : playback 1 : capture 1
00-03: HDMI1 (*) : : playback 1
00-04: HDMI2 (*) : : playback 1
00-05: HDMI3 (*) : : playback 1
00-06: DMIC Raw (*) : : capture 1
00-31: Deepbuffer HDA Analog (*) : : playback 1
sound/soc/sof/topology.c
Outdated
} else if (strstr(dai_link->name, "iDisp")) { | ||
tplg_dev = TPLG_DEVICE_HDMI; | ||
if (strstr(file, "hda-generic")) { | ||
tplg_device = "idisp"; |
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.
If I read the function right, this is not going to be used as the hda-generic will fall under load_default_tplg = true
, the HDA dai_link->name is not handled?
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.
load_default_tplg = true
means there are still some remaining pcms that are not loaded in the sparated topologies. And we need to load the renamed topology at line 2620.
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.
but can you load the idisp.tplg and the sof-hda-generic.tplg which also contains idisp definitions?
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.
but can you load the idisp.tplg and the sof-hda-generic.tplg which also contains idisp definitions?
No, so we need to make sure there is no idisp in sof-hda-generic.tplg.
"sdca-%damp", dai_link->num_cpus); | ||
} else if (strstr(dai_link->name, "SmartMic")) { | ||
tplg_dev = TPLG_DEVICE_SDW_MIC; | ||
tplg_device = "sdca-mic"; |
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.
Here and for the other checks: we need to update this match list every time a new component got introduced to products and we have new tplg fragment?
Is it going to scale?
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.
We need to update this match list when a new dai links got introduced. Given that we didn't update dai links in our machine drivers. I think we will only update the match list occasionally.
tplg_files[i].device, | ||
tplg_files[i].be_id); | ||
dev_dbg(scomp->dev, "Requesting %d %s\n", i, tplg_files[i].file); | ||
ret = request_firmware(&fw, tplg_files[i].file, scomp->dev); |
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 sof_create_ipc_file_profile()
will check if the firmware and the topology file (the monolithic one!) is in place.
The means that you always need to have the monolithic tplg and the split components installed, otherwise the profile is rejected and if not fallback IPC version is available then we will fail.
I have a feeling that this split tplg handling has to touch the fw-file-profile.c as well.
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.
Yeah, I am thinking this open, too. My idea is that we don't touch the monolithic topology. I.e. the monolithic topology will coexist with the split topologies. So that sof_create_ipc_file_profile() will still valid.
"%s/sof-%s-%s-id%d.tplg", | ||
sof_pdata->tplg_filename_prefix, platform, | ||
tplg_files[i].device, | ||
tplg_files[i].be_id); |
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.
a clean documentation as commit message and comments to explain clearly the expected file naming and also an update to sof-docs must be done.
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.
Totally agree.
6259f1d
to
78eed41
Compare
Topology PR: thesofproject/sof#9668. I would like to start with SDCA codecs only. SDCA is more urgent than others. If we can create dai links based on the supported SDCA functions, we don't need to use quirks for enabling/disabling specific dai links. |
78eed41
to
95da27b
Compare
The existing code point tuples[*num_copied_tuples].value.s to elem->string which works fine if there is only one topology is handled and all the tuples are handled before the topology fw is released. However, we will handle multiple topologies and the tuples may be used after the topology fw is release. Ues devm_kasprintf to allocate the string for the tuples to avoid invalid access. Signed-off-by: Bard Liao <[email protected]>
No need to convert the return value of snd_soc_tplg_component_load(). Signed-off-by: Bard Liao <[email protected]>
95da27b
to
9641e65
Compare
Get device information from dai links and load topology for each device. This allow user create a topology for single device. The driver will select the needed topologies and we don't need to create topologies for each product. Signed-off-by: Bard Liao <[email protected]>
9641e65
to
788e9bf
Compare
Get device information from dai links. load topology for each device.
This should not impact the existing devices.