Skip to content

Commit 347c8d6

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: avs: Fix PPLCxFMT calculation
HDAudio transfer types utilize SDxFMT for front-end (HOST) and PPLCxFMT for back-end (LINK) side when setting up the stream. BE's substream->runtime duplicates FE runtime so switch to using BE's hw_params to address incorrect format values on the LINK side when FE and BE formats differ. The problem is introduced with commit d070002 ("ASoC: Intel: avs: HDA PCM BE operations") but the code has been shuffled around since then so direct 'Fixes:' tag does not apply. Reviewed-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9ad1f3c commit 347c8d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sound/soc/intel/avs/pcm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,24 +450,26 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn
450450

451451
static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
452452
{
453-
struct snd_pcm_runtime *runtime = substream->runtime;
453+
struct snd_soc_pcm_runtime *be = snd_soc_substream_to_rtd(substream);
454454
const struct snd_soc_pcm_stream *stream_info;
455455
struct hdac_ext_stream *link_stream;
456+
const struct snd_pcm_hw_params *p;
456457
struct avs_dma_data *data;
457458
unsigned int format_val;
458459
unsigned int bits;
459460
int ret;
460461

461462
data = snd_soc_dai_get_dma_data(dai, substream);
462463
link_stream = data->link_stream;
464+
p = &be->dpcm[substream->stream].hw_params;
463465

464466
if (link_stream->link_prepared)
465467
return 0;
466468

467469
stream_info = snd_soc_dai_get_pcm_stream(dai, substream->stream);
468-
bits = snd_hdac_stream_format_bits(runtime->format, runtime->subformat,
470+
bits = snd_hdac_stream_format_bits(params_format(p), params_subformat(p),
469471
stream_info->sig_bits);
470-
format_val = snd_hdac_stream_format(runtime->channels, bits, runtime->rate);
472+
format_val = snd_hdac_stream_format(params_channels(p), bits, params_rate(p));
471473

472474
snd_hdac_ext_stream_decouple(&data->adev->base.core, link_stream, true);
473475
snd_hdac_ext_stream_reset(link_stream);

0 commit comments

Comments
 (0)