Uh oh!
There was an error while loading. Please reload this page.
ASoC: soc-core: filter use of 'ignore_machine' field - #3236
Conversation
The 'ignore_machine' field is currently used to ignore all FE dailinks statically added by the machine drivers, as well as override the fixups for the BE dailinks. The motivation for this field was primarily to reuse the same machine driver on Intel devices, both with legacy and SOF-based platform drivers. SOF is now used on Mediatek platforms, where the same card uses SOF-based dailinks to deal with DSP-managed streams, as well as 'regular' dailinks. The 'ignore_machine' field set by the core SOF platform driver is too strong, with dailinks not managed by SOF being modified. This patch adds a stricter filtering so that only dailinks managed by a topology-based SOF driver are modified. Reported-by: YC Hung <yc.hung@mediatek.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
plbossart
commented
Oct 26, 2021
completely untested proof-of-concept as an alternative to PR #3217 |
Uh oh!
There was an error while loading. Please reload this page.
yaochunhung
commented
Oct 26, 2021
@plbossart Thanks for providing this PR. I tried this patch. It can skip and won't modify regular dailinks but I found sof-based dailinks, dai_link->platform->of_node will be set then it will show "ASoC : Neither/both platform name/of_node are set for xxx, platform yyy" in the so_dai_link_sanity_check function. Do you have any suggestion to avoid this? Thanks! |
plbossart
commented
Oct 26, 2021
Thanks for testing, that's good, I had no idea if it even worked ;-)
I don't have a clue unfortunately, but this code was written by @dbaluta so that's something to be discussed between DeviceTree users: |
yaochunhung
commented
Oct 27, 2021
@dbaluta@plbossart |
@yaochunhung I got the exact error so for this reason I've added d971400. In your case it means that you have dai_link->platforms->name already set and with d971400 dai_link->plaforms->of_node is also set which upsets SOC core. |
plbossart
commented
Nov 3, 2021
@yaochunhung any comments on @dbaluta's feedback? should we proceed with my change? |
yaochunhung
commented
Nov 4, 2021
@plbossart@dbaluta I check dai_link->platforms->name will be set in sof_link_load function. Not sure if it is ok to add additional condition check as below, |
dbaluta
commented
Nov 9, 2021
@plbossart I think your idea it's good. One existing problem I noticed is when using the same machine driver to create two sound cards. One for a normal sound card and one for a SOF-sound card. Here is pseudocode for So, this function will change card name no matter what! (normal card or SOF card). Here is an update to your patch which avoids this problem: |
plbossart
commented
Nov 9, 2021
@dbaluta I didn't think about the card name at all, but I really wonder what we are supposed to do if there are multiple components used by a card. Clearly it makes no sense to pick the topology prefix from one component or the other. The result would anyway dependent on the order in which components are handled, a complete nightmare. Put differently, I am not sure if the changes you suggested above would work for the 2 component case. |
@plbossart indeed i never thought about two components. I'm not sure the initial code was designed with that in mind. Put differently, the code has the same problem w or w/o my changes but at least it doesn't modify the card name for components not intended to be used by that card. Later edit: I think that when using multiple components they'll need to have some topology prefix. |
yaochunhung
commented
Nov 22, 2021
@plbossart@dbaluta |
dbaluta
commented
Nov 22, 2021
@plbossart i also think we can go with your patch and fix the card name change later. because this problem exists w or w/o your patch. |
plbossart
commented
Nov 22, 2021
ok, then let's record your review approval and merge - standard operating procedure :-) |
marc-hb
commented
Nov 24, 2021
Why was this merged with (old and) mostly failing tests? https://sof-ci.01.org/linuxpr/PR3236/build6619/devicetest/ Revert submitted in #3294 |
dbaluta
commented
Nov 24, 2021
@marc-hb my fault. for some reason i thought that those were normal to fail |
yaochunhung
commented
Dec 2, 2021
@plbossart Do you have any suggestion about how to fix these testing? Thanks. |
plbossart
commented
Dec 2, 2021
Been busy with other things, will try to look into this later this week. |
marc-hb
commented
Dec 2, 2021
BTW https://sof-ci.01.org/linuxpr/PR3236/build6619/devicetest/ had many test failures across many platforms, so it should be easy to reproduce at least some failures and start debugging to help. |
@plbossart Sorry to bother again. Do you have any idea about the testing fails? Thanks. +if (!dai||dai->component!=component)
+continue;Should it be +if (!dai&&dai->component!=component)
+continue; |
cujomalainey
commented
Jan 4, 2022
@yaochunhung i can hopefully take a look later this week |
cujomalainey
commented
Jan 11, 2022
Seems like this is something to do with SDW skus, was able to repro on one of my TGL devices with soundwire |
yaochunhung
commented
Jan 11, 2022
@cujomalainey Please see the comment #3352 (comment) thanks. |
The 'ignore_machine' field is currently used to ignore all FE dailinks
statically added by the machine drivers, as well as override the
fixups for the BE dailinks. The motivation for this field was
primarily to reuse the same machine driver on Intel devices, both with
legacy and SOF-based platform drivers.
SOF is now used on Mediatek platforms, where the same card uses
SOF-based dailinks to deal with DSP-managed streams, as well as
'regular' dailinks. The 'ignore_machine' field set by the core SOF
platform driver is too strong, with dailinks not managed by SOF being
modified.
This patch adds a stricter filtering so that only dailinks managed by
a topology-based SOF driver are modified.
Reported-by: YC Hung yc.hung@mediatek.com
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com