Commit 5def9019 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: x86: Use snd_pcm_stop_xrun() for connection / disconnection paths

This seems more friendly to user-space, as it's notified at least as
an error, instead of forcibly moving the PCM state to SETUP out of
sudden.

Moreover, snd_pcm_stop() needs an extra PCM spinlock I forgot, while
snd_pcm_stop_xrun() takes the spinlock by itself.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b9bacf27
...@@ -1378,7 +1378,7 @@ static void had_process_hot_plug(struct snd_intelhad *intelhaddata) ...@@ -1378,7 +1378,7 @@ static void had_process_hot_plug(struct snd_intelhad *intelhaddata)
dev_dbg(intelhaddata->dev, dev_dbg(intelhaddata->dev,
"Force to stop the active stream by disconnection\n"); "Force to stop the active stream by disconnection\n");
/* Set runtime->state to hw_params done */ /* Set runtime->state to hw_params done */
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); snd_pcm_stop_xrun(substream);
had_substream_put(intelhaddata); had_substream_put(intelhaddata);
} }
...@@ -1414,7 +1414,7 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata) ...@@ -1414,7 +1414,7 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
/* Report to above ALSA layer */ /* Report to above ALSA layer */
if (substream) if (substream)
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); snd_pcm_stop_xrun(substream);
out: out:
snd_jack_report(intelhaddata->jack, 0); snd_jack_report(intelhaddata->jack, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment