Closed cujomalainey closed 4 months ago
An alternative fix would be to manually set the ssp in sof_rt5682.c but that is not portable, but would avoid the issue issue with the tplg.
An alternative fix would be to manually set the ssp in sof_rt5682.c but that is not portable, but would avoid the issue issue with the tplg.
Or to add a check if CODEC == ALC5650 then also set the amp pin in soc-acpi-intel-ssp-common.c
. I'll let you guys decide what you want.
Patch tested on Anraggar: https://github.com/thesofproject/linux/pull/5101
Sorry the SSP port number of ALC5650's speaker path is not handled well.
@brentlu @cujomalainey People might use rt5650 + external amp. In that case, ctx->amp_type will be the external amp. IOW, we should set ctx->amp_type = CODEC_RT5650;
only when there is no other amp present. So, we could add rt5650 at the last item of the amps[] array. And add a comment before the rt5650 item to describe why we need to add it last. And we could add other similar codecs in the future. Does it make sense?
@brentlu @cujomalainey People might use rt5650 + external amp. In that case, ctx->amp_type will be the external amp. IOW, we should set
ctx->amp_type = CODEC_RT5650;
only when there is no other amp present. So, we could add rt5650 at the last item of the amps[] array. And add a comment before the rt5650 item to describe why we need to add it last. And we could add other similar codecs in the future. Does it make sense?
If we add rt5650 to amplifier list, the topology name composed in hda_machine_select() will become something like "sof-rt5650-rt5650.tplg"
@brentlu @cujomalainey People might use rt5650 + external amp. In that case, ctx->amp_type will be the external amp. IOW, we should set
ctx->amp_type = CODEC_RT5650;
only when there is no other amp present. So, we could add rt5650 at the last item of the amps[] array. And add a comment before the rt5650 item to describe why we need to add it last. And we could add other similar codecs in the future. Does it make sense?If we add rt5650 to amplifier list, the topology name composed in hda_machine_select() will become something like "sof-rt5650-rt5650.tplg"
Yes this issue is mentioned in my commit message.
@brentlu @cujomalainey People might use rt5650 + external amp. In that case, ctx->amp_type will be the external amp. IOW, we should set
ctx->amp_type = CODEC_RT5650;
only when there is no other amp present. So, we could add rt5650 at the last item of the amps[] array. And add a comment before the rt5650 item to describe why we need to add it last. And we could add other similar codecs in the future. Does it make sense?If we add rt5650 to amplifier list, the topology name composed in hda_machine_select() will become something like "sof-rt5650-rt5650.tplg"
Yes this issue is mentioned in my commit message.
I might be able to add a case for the string where if amp == codec only add the part name once
Added comment and patched the tplg suffix code
@plbossart @sathya-nujella ping this is a pretty bad break on our end
@plbossart @sathya-nujella ping this is a pretty bad break on our end
A temporal fix has been merged to Chrome-v6.6 on Wednesday: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5691052
@brentlu are you ok with the suggested fix?
@brentlu are you ok with the suggested fix?
LGTM, thanks
Trimmed down the trace, if there are more issues discovered tomorrow please feel free to fix them yourself as I am OOO starting tomorrow for the rest of the week.
8efcd4864652 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization") migrated the pin assignment in the context struct up to soc-acpi-intel-ssp-common.c. This uses a lookup table to see if a device has a amp/codec before assigning the pin. The issue here arises when combination parts that serve both (with 2 ports) are used.
sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:1f.3/adl_rt5682_def/SSP0-Codec' CPU: 1 PID: 2079 Comm: udevd Tainted: G U 6.6.36-03391-g744739e00023 #1 3be1a2880a0970f65545a957db7d08ef4b3e2c0d Hardware name: Google Anraggar/Anraggar, BIOS Google_Anraggar.15217.552.0 05/07/2024 Call Trace:
kobject: kobject_add_internal failed for SSP0-Codec with -EEXIST, don't try to register things with the same name in the same directory.
The issue is that the ALC5650 was only defined in the codec table and not the amp table which left the pin unassigned but the dai link was still created by the machine driver.
This fix has the side effect of changing the target topology for devices from sof-{chipset}-rt5650.tplg to sof-{chipset}-rt5650-rt5650.tplg
Fixes: 8efcd4864652 ("ASoC: Intel: sof_rt5682: use common module for sof_card_private initialization")