forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: topology: fix: handle DAI widget connections properly with multiple CPU DAI's #1863
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 might be the only one who doesn't understand this, but the correct order should be between what and what? I understand that certain two sequences should be defined in a matching order, right? Are both of them in topology files? Are they created automatically by macros from the same code or are these two sequences actually coded by humans? Or is this one sequence in topology and one in a machine driver? If both are created automatically from the same source, then maybe it's ok to rely on this. If not, maybe we need a way to match?
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.
@lyakh The correct order is we set it in the same order between the CPU dais defined in a dai link and the DAI widget defined in topology. e,g,
Where we want to connect ALH0x102 to sdw:1:25d:1308:0 rt1308-aif1 and ALH0x202 to sdw:2:25d:1308:0 rt1308-aif1. So the pipe id (3 and 4) should be in the same order as COMP_CODEC("sdw:1:25d:1308:0", "rt1308-aif1") and COMP_CODEC("sdw:2:25d:1308:0", "rt1308-aif1"). Unfortunately, they are one in machine driver and the other in topology and both of them are created by human.
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.
@bardliao ok, thanks for the explanation. So, as you said, both files are man-made so mistakes would be possible. It would be good to be able to verify matching here, but I don't know how difficult it would be to add nor whether this is actually a usual situation and we have more of them around, in which case this might be considered acceptable.
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.
@lyakh we have debug message here to show the match info, so it is easy to find mismatch. And the algorithm in machine driver is fixed, we only need to design topology based on the machine driver. Now we can only seek some indirect info from the cpu dai name and widget name to match them, but this still depends on how we set name in topology and machine driver.
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 possible solution is to use a new token to identify the index. But it might need ipc structure change. So I would prefer leave it as it is.
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, it's similar to what just recently happened to apl-pcm512x: we replaced the kernel driver with a new one, that changed the order of the HDMIs, then we had to adjust the topology. Now they don't mix - you need either both new or both old, but new + old or old + new doesn't work...