Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sound/soc/sof/ipc4-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,12 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
dai_index);
if (dev_type < 0)
return dev_type;

if (params_width(params) != bit_depth) {
format_change = true;
dev_dbg(sdev->dev, "SSP sample width change from %d to %d\n",
params_width(params), bit_depth);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if this safe for the BT offload case where SSP DAI supports multiple formats and we should be not using NHLT info for this. I guess this is. On current devices where we support BT offload, there is no NHLT in BIOS, so I guess this is good, but some potential for confusing bugs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

at this point we did not queried NHLT at all. This is all topology. The topology contains 'hw_config' array of supported configurations on the copier, this corresponds with the copier formats (and if topology have NHLT, then the blobs).

If the copier does not support the sample width of the params, then we need to pick the one which is supported to force a conversion.

Later we will ask the NHLT blob for the configuration that is actually supported by the copier.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@kv2019i, the issue is that if we don't do this then we would have silent incorrect configuration as described by the commit message. copier running in 16 bit mode while the SSP is configured in 32 bit mode or other permutation.
The nice thing is that the NHLT blob and copier format / hw_config all comes from different source and it is a topology bug if they don't match.

break;
default:
return 0;
Expand Down