diff mbox series

ALSA: hda: Properly setup HDMI stream

Message ID 20240112113349.2905328-1-amadeuszx.slawinski@linux.intel.com (mailing list archive)
State Accepted
Commit 454abb80e26ab85323a30e52aa7b0ee9aae1d38a
Headers show
Series ALSA: hda: Properly setup HDMI stream | expand

Commit Message

Amadeusz Sławiński Jan. 12, 2024, 11:33 a.m. UTC
Since commit 4005d1ba0a7e ("ASoC: soc-dai: don't call PCM audio ops if
the stream is not supported") HDMI playback is broken with avs driver.
This happens because for HDMI stream (unlike generic HDA one)
channels_min for stream is not set when creating PCMs. Fix this by
setting the value based on first available converter.

Fixes: 4005d1ba0a7e ("ASoC: soc-dai: don't call PCM audio ops if the stream is not supported")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Takashi Iwai Jan. 12, 2024, 4:48 p.m. UTC | #1
On Fri, 12 Jan 2024 12:33:49 +0100,
Amadeusz Sławiński wrote:
> 
> Since commit 4005d1ba0a7e ("ASoC: soc-dai: don't call PCM audio ops if
> the stream is not supported") HDMI playback is broken with avs driver.
> This happens because for HDMI stream (unlike generic HDA one)
> channels_min for stream is not set when creating PCMs. Fix this by
> setting the value based on first available converter.
> 
> Fixes: 4005d1ba0a7e ("ASoC: soc-dai: don't call PCM audio ops if the stream is not supported")
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

Thanks, applied now.


Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 1cde2a69bdb4b..3903faecbcfce 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2298,6 +2298,7 @@  static int generic_hdmi_build_pcms(struct hda_codec *codec)
 	codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num);
 
 	for (idx = 0; idx < pcm_num; idx++) {
+		struct hdmi_spec_per_cvt *per_cvt;
 		struct hda_pcm *info;
 		struct hda_pcm_stream *pstr;
 
@@ -2313,6 +2314,11 @@  static int generic_hdmi_build_pcms(struct hda_codec *codec)
 		pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK];
 		pstr->substreams = 1;
 		pstr->ops = generic_ops;
+
+		per_cvt = get_cvt(spec, 0);
+		pstr->channels_min = per_cvt->channels_min;
+		pstr->channels_max = per_cvt->channels_max;
+
 		/* pcm number is less than pcm_rec array size */
 		if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec))
 			break;