Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
get spcm from FE dai link during BE dai link prepare#834
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -169,19 +169,28 @@ static int hda_link_pcm_prepare(struct snd_pcm_substream *substream, | ||
| struct snd_soc_dai *dai) | ||
| { | ||
| struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
| struct snd_soc_dpcm *dpcm; | ||
| struct snd_sof_dev *sdev = | ||
| snd_soc_component_get_drvdata(dai->component); | ||
| struct snd_sof_pcm *spcm; | ||
| int stream = substream->stream; | ||
| spcm = snd_sof_find_spcm_dai(sdev, rtd); | ||
| if (!spcm) | ||
| return -EINVAL; | ||
| for_each_dpcm_fe(rtd, stream, dpcm) { | ||
| spcm = snd_sof_find_spcm_dai(sdev, dpcm->fe); | ||
| if (!spcm) | ||
| return -EINVAL; | ||
| ||
| /* setup hw_params again only if resuming from system suspend */ | ||
| if (!spcm->hw_params_upon_resume[stream]) | ||
| return 0; | ||
| /* | ||
| * setup hw_params only if resuming from system suspend. | ||
| * The hw_params_upon_resume flag is set for suspended | ||
| * streams during system suspend. | ||
| */ | ||
| if (spcm->hw_params_upon_resume[stream]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please comment when hw_params_upon_resume is be set. It will help us to understand the whole flow. | ||
| goto hw_params; | ||
| } | ||
| return 0; | ||
| hw_params: | ||
| dev_dbg(sdev->dev, "hda: prepare stream %d dir %d\n", | ||
| spcm->pcm.pcm_id, substream->stream); | ||
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.
what if that BE is currently not connected to a FE due to mixer settings?
Uh oh!
There was an error while loading. Please reload this page.
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.
@plbossart i saw your argument in Rander's PR about this too but I cant quite wrap my head around it. Are you talking about hostless pcm's?
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.
No, a front-end and a back-end connected by a switch which is off. Same as on Baytrail with the 'no BE error' without the mixers properly set-up.
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.
Google "Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port"
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.
@plbossart dpcm is certainly not my expertise. But let me take a stab at arguing that this case will be OK:
soc_dpcm_runtime_update() is called by DAPM mixer/mux changes. So when the switch is off, the runtime update will disconnect all BE dai links that were previously connected.
I dont have any proof of this working as we dont have a pipeline with a mux to test it out. So this is purely what I understood from the dpcm flow.
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.
It seems we did not need to handle the dpcm cases here. We will only find some PCM that is connecting to the BE, then get the status from spcm, right?
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.
@xiulipan Yes, the purpose, I think, is to find whether the link dma used by the substream needs restore registers or not. However, spcm is used for fe. I think this is why the dpcm is used.
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.
You could have 2 FEs that are connected to a BE in a mutually exclusive manner, or get mixed. So when a path is established, which FE is used completely depends on the configuration of the switches. If you have a mixer it's also unclear to me which FE you'd select.
We really need to build a topology with 2 BEs and 2 FEs, and a set of switches/mixer components to deal with the 2x2 connection. That's the only way to progress with those DPCM questions.