Skip to content

Commit 3acb5e1

Browse files
committed
ASoC: SOF: ipc4-topology: Prefer 32-bit DMIC blobs for 8-bit formats as well
With the introduction of 8-bit formats the DMIC blob lookup also needs to be modified to prefer the 32-bit blob when 8-bit format is used on FE. At the same time we also need to make sure that in case 8-bit format is used, but only 16-bit blob is available for DMIC then we will not try to look for 8-bit blob (which is invalid) as fallback, but for a 16-bit one. Fixes: c04c2e8 ("ASoC: SOF: ipc4-topology: Add support for 8-bit formats") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent a575771 commit 3acb5e1

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

sound/soc/sof/ipc4-topology.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,11 +1758,9 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
17581758
channel_count = params_channels(params);
17591759
sample_rate = params_rate(params);
17601760
bit_depth = params_width(params);
1761-
/*
1762-
* Look for 32-bit blob first instead of 16-bit if copier
1763-
* supports multiple formats
1764-
*/
1765-
if (bit_depth == 16 && !single_bitdepth) {
1761+
1762+
/* Prefer 32-bit blob if copier supports multiple formats */
1763+
if (bit_depth <= 16 && !single_bitdepth) {
17661764
dev_dbg(sdev->dev, "Looking for 32-bit blob first for DMIC\n");
17671765
format_change = true;
17681766
bit_depth = 32;
@@ -1805,10 +1803,18 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
18051803
if (format_change) {
18061804
/*
18071805
* The 32-bit blob was not found in NHLT table, try to
1808-
* look for one based on the params
1806+
* look for 16-bit for DMIC or based on the params for
1807+
* SSP
18091808
*/
1810-
bit_depth = params_width(params);
1811-
format_change = false;
1809+
if (linktype == SOF_DAI_INTEL_DMIC) {
1810+
bit_depth = 16;
1811+
if (params_width(params) == 16)
1812+
format_change = false;
1813+
} else {
1814+
bit_depth = params_width(params);
1815+
format_change = false;
1816+
}
1817+
18121818
get_new_blob = true;
18131819
} else if (linktype == SOF_DAI_INTEL_DMIC && !single_bitdepth) {
18141820
/*

0 commit comments

Comments
 (0)