ASoC: SOF: Intel: don't check number of sdw links when set dmic_fixup#5287
ASoC: SOF: Intel: don't check number of sdw links when set dmic_fixup#5287bardliao merged 2 commits intothesofproject:topic/sof-devfrom
Conversation
|
@ranj063 Do you see any risk that we merge this PR? |
| if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) | ||
| dmic_fixup = true; | ||
| } | ||
| if (sdw_mach_found || mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) |
There was a problem hiding this comment.
@bardliao can we please fix the typo in commit message "PCH DMI". Also, the last line somehow reads as though the BIOS is going to report differently because of this change. But rather what you're trying to say is that we check for PCM DMIC reported by the BIOS irrespective of whether there are SDW links present or not.
There was a problem hiding this comment.
and also in the case where the SDW and DMIC are pin-muxed, will this change have a detrimental effect on machine driver probe because we ended up choosing the wrong topology name?
There was a problem hiding this comment.
Yes, if the BIOS report PCH DMIC but there is no PCH DMIC, we will choose the wrong topology name. That's why I am not confident with this change. But on the other hand, that is the BIOS's responsibility to report the real HW configuration and kernel should trust the BIOS.
There was a problem hiding this comment.
I think we don't have a choice but to trust the bios @ujfalusi @lgirdwood what do you think?
There was a problem hiding this comment.
I vaguely remember we did this for RVPs. Not sure if it happens in real products. The worst case is that someone reports an issue that no sound card is created, and we may need to fix it with some quirk.
There was a problem hiding this comment.
@bardliao, you are too optimistic ;) We have seen broken BIOS information and I'm sure we are continue to see them.
But imho we still need to trust the information BIOS provides, it is most likely correct..
There was a problem hiding this comment.
I would make any assumption obvious in the logs i.e. if we BIOS says we have DMIC & SDW then we can log this with a if this is wrong pls set "force_fix_something=1" in module command line.
This way it should be obvious to a user on how to remedy if BIOS is reporting incorrect data.
sound/soc/sof/intel/hda.c
Outdated
| dev_info(sdev->dev, "DMICs detected in NHLT tables: %d\n", dmic_num); | ||
| dev_info(sdev->dev, | ||
| "If the DMIC number doesn't match to the real HW design, please overwrite it with \"dmic_num\" kernel param.\n"); |
There was a problem hiding this comment.
I would change this too
dev_info(sdev->dev, "DMICs detected in NHLT tables: %d, can be overidden with \"dmic_num\" kernel param if incorrect\n", dmic_num);and I would move the new larger warning to the code block when we detect both SDW and DMIC
dev_info(sdev->dev, "NHLT reporting both SDW and DMIC endpoints, if incorrect, pls override with .....);There was a problem hiding this comment.
Update: only show the warning when both SDW mic and PCH DMIC are present.
26e48f7 to
d515cbb
Compare
| if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) | ||
| dmic_fixup = true; | ||
| } | ||
| if (sdw_mach_found || mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) |
There was a problem hiding this comment.
@bardliao is the check for sdw_mach_found important? I think we only add the dmic prefix to the tplg name if either the tplg quirk is set or the num_dmics reported is non-zero isnt it?
There was a problem hiding this comment.
Yes, sdw_mach_found is important because we don't add -2ch/-4ch postfix for SSP machines.
lgirdwood
left a comment
There was a problem hiding this comment.
LGTM, just need a string update
sound/soc/intel/boards/sof_sdw.c
Outdated
| for (i = 0; i < num_ends; i++) { | ||
| if (sof_end->dai_info->dai_type == SOC_SDW_DAI_TYPE_MIC) { | ||
| dev_warn(dev, | ||
| "Both SDW DMIC and PCH DMIC are present, if incorrect, please override with kernel params\n"); |
There was a problem hiding this comment.
which params ? lets be more helpful.
| * link 2 and 3, or link 1 and 2, thus we only try to enable dmics | ||
| * if all conditions are true: | ||
| * a) 2 or fewer links are used by SoundWire | ||
| * b) the NHLT table reports the presence of microphones |
There was a problem hiding this comment.
maybe you only need to refine these criteria?
You can have 3 SoundWire links along 1 DMIC link. But I don't think you can have 3 SoundWire links with 2 DMIC links - since in the latter case you need at least 3 wires, 4 if the clock isn't shared.
There was a problem hiding this comment.
@plbossart Hmm, the question is that do DMIC links always share with SoundWire links and will the SoundWire link number increase? Is it possible that someday we have 3 SoundWire links and 2 DMIC links?
Currently, we assume that the PCH DMIC pins are pin-muxed with SoundWire links. However, we do see a HW design that use PCH DMIC along with 3 SoundWire links. Remove the check now. With this change the PCM DMIC will be presented if it is reported by the BIOS irrespective of whether there are SDW links present or not. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Typically, SoundWire MIC and PCH DMIC will not coexist. However, we may want to use both of them in some special cases. Add a warning to let users know that SoundWire MIC and PCH DMIC are both present and they could overwrite it with kernel params. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Currently, we assume that the PCH DMIC pins are pin-muxed with SoundWire links. However, we do see a HW design that use PCH DMIC along with 3 SoundWire links. Remove the check now.
With this change BIOS should only report the presence of PCH DMI when it is truly exist.