Skip to content

Commit 8a7d600

Browse files
committed
ALSA: hda - Skip jack and others for non-existing PCM streams
When CONFIG_SND_DYNAMIC_MINORS isn't set, there are only limited number of devices available, and HD-audio, especially with HDMI/DP codec, will fail to create more than two devices. The driver warns about the lack of such devices and skips the PCM device creations, but the HDMI driver still tries to create the corresponding JACK, SPDIF and ELD controls even for the non-existing PCM substreams. This results in confusion on user-space, and even may break the operation. Similarly, Intel HDMI/DP codec builds the ELD notification from i915 graphics driver, and this may be broken if a notification is sent for the non-existing PCM stream. This patch adds the check of the existence of the assigned PCM substream in the both scenarios above, and skips the further operation if the PCM substream is not assigned. Fixes: 9152085 ("ALSA: hda - add DP MST audio support") Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 3a230f7 commit 8a7d600

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,8 @@ static void hdmi_pcm_setup_pin(struct hdmi_spec *spec,
13831383
pcm = get_pcm_rec(spec, per_pin->pcm_idx);
13841384
else
13851385
return;
1386+
if (!pcm->pcm)
1387+
return;
13861388
if (!test_bit(per_pin->pcm_idx, &spec->pcm_in_use))
13871389
return;
13881390

@@ -2151,8 +2153,13 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
21512153
int dev, err;
21522154
int pin_idx, pcm_idx;
21532155

2154-
21552156
for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) {
2157+
if (!get_pcm_rec(spec, pcm_idx)->pcm) {
2158+
/* no PCM: mark this for skipping permanently */
2159+
set_bit(pcm_idx, &spec->pcm_bitmap);
2160+
continue;
2161+
}
2162+
21562163
err = generic_hdmi_build_jack(codec, pcm_idx);
21572164
if (err < 0)
21582165
return err;

0 commit comments

Comments
 (0)