Skip to content

ASoC: Intel: add SDCA Amp feedback fragment topology support#5448

Closed
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:amp-feedback
Closed

ASoC: Intel: add SDCA Amp feedback fragment topology support#5448
bardliao wants to merge 1 commit intothesofproject:topic/sof-devfrom
bardliao:amp-feedback

Conversation

@bardliao
Copy link
Collaborator

@bardliao bardliao commented Jun 9, 2025

Use the topology with feedback PCM if the SDCA smart amp capture dai link is created. The commit makes an assumption that the smart amp playback dai link is always created if the smart amp capture dai link is present. That is a reasonable assumption because it makes no sense that a feedback work without playback.

ujfalusi
ujfalusi previously approved these changes Jun 18, 2025
@stefdb
Copy link

stefdb commented Jun 18, 2025

Hi, I tried testing this. Whilst it works in some instances, in others there are issue. It seems to always create the same number of feedback channels: 4. Testing with 2 amps and 4 amps, it seems to work, but testing with 6 amps breaks it.
The existing topology we use specifies the number of feedback channels in the topology. It seems its able to dynamically allocate the channels, mostly - if our topology says 8 channels, for a 2 amp system, it can split them, same for a 4 amp system, and for an 8 amp system, there is one each. For a 6 amp system, we need to use a 6 channel topology. The current topology allows us to define the right number of feedback channels for the required system, and the match selects the correct topology accordingly. However, the function topology which enables feedback is a one size fits all system. Sometimes it works, sometimes it doesn't.
Thanks,
Stefan

dai_link->num_cpus);
/* Remove the AMP topology, just use the Amp feedback topology */
if (tplg_mask & BIT(TPLG_DEVICE_SDCA_AMP)) {
tplg_mask &= ~BIT(TPLG_DEVICE_SDCA_AMP);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao is this correct? Shouldn't we be replacing the entry in the tplg_files array with the amp feedback topology instead of simply updating the count and mask?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ranj063 You are right. Currently it works by accident. It works just because the amp feedback link is always right after the amp playback link. I will fix it.

@bardliao
Copy link
Collaborator Author

Thanks @stefdb for the feedback. Let me think about how to get the channel number, thanks.

if (!tplg_dev_name)
return -ENOMEM;

/* No need to add tplg file to the tplg_files list */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but dont you need to update the mask ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but dont you need to update the mask ?

Indeed, fixed.

@bardliao bardliao marked this pull request as draft June 23, 2025 09:39
@bardliao
Copy link
Collaborator Author

Convert it to draft as we need to handle the feedback channel number.

Use the topology with feedback PCM if the SDCA smart amp capture dai
link is created. The commit makes an assumption that the smart amp
playback dai link is always created if the smart amp capture dai link is
present. That is a reasonable assumption because it makes no sense that
a feedback work without playback.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao
Copy link
Collaborator Author

@stefdb @rfvirgil @simontrimmer @charleskeepax Do you have any idea that we can get the feedback channel number at this stage? Can I assume that a cs35l56 amp will need 2 channels? Actually, I am thinking if having the feedback PCM device is not common (currently for developing only?), we can just not set .get_function_tplg_files = sof_sdw_get_tplg_files, in the acpi match table and let driver always use the specific topology with correct config. What do you think?

@bardliao bardliao closed this Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants