Skip to content

Commit b1ef30e

Browse files
committed
ALSA: x86: Don't bail out from PCM ops when disconnected
Currently the driver returns -ENODEV when the monitor is disconnected. But PA alsa module doesn't like this and it starts playing Juliet, kills itself as if it were a fatal tragedy. Since we protect the whole read/write at disconnection, just allow the PCM accesses even during disconnection. Signed-off-by: Takashi Iwai <[email protected]>
1 parent 2d42c03 commit b1ef30e

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

sound/x86/intel_hdmi_audio.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,13 +1054,6 @@ static int had_pcm_open(struct snd_pcm_substream *substream)
10541054

10551055
pm_runtime_get_sync(intelhaddata->dev);
10561056

1057-
if (!intelhaddata->connected) {
1058-
dev_dbg(intelhaddata->dev, "%s: HDMI cable plugged-out\n",
1059-
__func__);
1060-
retval = -ENODEV;
1061-
goto error;
1062-
}
1063-
10641057
/* set the runtime hw parameter with local snd_pcm_hardware struct */
10651058
runtime->hw = had_pcm_hardware;
10661059

@@ -1186,14 +1179,6 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
11861179
case SNDRV_PCM_TRIGGER_START:
11871180
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
11881181
case SNDRV_PCM_TRIGGER_RESUME:
1189-
/* Disable local INTRs till register prgmng is done */
1190-
if (!intelhaddata->connected) {
1191-
dev_dbg(intelhaddata->dev,
1192-
"_START: HDMI cable plugged-out\n");
1193-
retval = -ENODEV;
1194-
break;
1195-
}
1196-
11971182
/* Enable Audio */
11981183
had_ack_irqs(intelhaddata); /* FIXME: do we need this? */
11991184
had_enable_audio(intelhaddata, true);
@@ -1227,13 +1212,6 @@ static int had_pcm_prepare(struct snd_pcm_substream *substream)
12271212
intelhaddata = snd_pcm_substream_chip(substream);
12281213
runtime = substream->runtime;
12291214

1230-
if (!intelhaddata->connected) {
1231-
dev_dbg(intelhaddata->dev, "%s: HDMI cable plugged-out\n",
1232-
__func__);
1233-
retval = -ENODEV;
1234-
goto prep_end;
1235-
}
1236-
12371215
dev_dbg(intelhaddata->dev, "period_size=%d\n",
12381216
(int)frames_to_bytes(runtime, runtime->period_size));
12391217
dev_dbg(intelhaddata->dev, "periods=%d\n", runtime->periods);

0 commit comments

Comments
 (0)