[PATCH 2/8] ALSA: x86: Use snd_pcm_stop_xrun() for connection / disconnection paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: Takashi Iwai <tiwai@xxxxxxx>
---
 sound/x86/intel_hdmi_audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index a30ca03e49ae..a7343f2d2730 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1378,7 +1378,7 @@ static void had_process_hot_plug(struct snd_intelhad *intelhaddata)
 		dev_dbg(intelhaddata->dev,
 			"Force to stop the active stream by disconnection\n");
 		/* Set runtime->state to hw_params done */
-		snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
+		snd_pcm_stop_xrun(substream);
 		had_substream_put(intelhaddata);
 	}
 
@@ -1414,7 +1414,7 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
 
 	/* Report to above ALSA layer */
 	if (substream)
-		snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
+		snd_pcm_stop_xrun(substream);
 
  out:
 	snd_jack_report(intelhaddata->jack, 0);
-- 
2.11.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux